commit/StationPlaylist: josephsl: 6.3: When profiles are deleted, focus moves to the active profile (normal profile is active profile is gone).

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Wed, 20 Jan 2016 22:48:22 -0000

1 new commit in StationPlaylist:

https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/f2145f3fd289/
Changeset:   f2145f3fd289
Branch:      6.x
User:        josephsl
Date:        2016-01-20 22:48:02+00:00
Summary:     6.3: When profiles are deleted, focus moves to the active profile 
(normal profile is active profile is gone).

Previously when deleting a profile, normal profile was selected as the default. 
This produced two issues:
1. If there was an active profile that has survived, focus will not go to that 
profile.
2. When cancel button is pressed, normal profile is activated no matter what 
kind of profile was deleted.
This has been fixed by checking to see if the active profile is still alive, 
and if so, the live active profile will be selected, otherwise normal profile 
will be used. This is destined for add-on 6.3 and later (affects 7.0 but 
requires few more tweaks).

Affected #:  1 file

diff --git a/addon/appModules/splstudio/splconfig.py 
b/addon/appModules/splstudio/splconfig.py
index fed050c..514d9b6 100755
--- a/addon/appModules/splstudio/splconfig.py
+++ b/addon/appModules/splstudio/splconfig.py
@@ -704,11 +704,16 @@ class SPLConfigDialog(gui.SettingsDialog):
                # 6.1: Discard changes to included columns set.
                self.includedColumns.clear()
                self.includedColumns = None
-               SPLActiveProfile = self.activeProfile
                if self.switchProfileRenamed or self.switchProfileDeleted:
                        SPLSwitchProfile = self.switchProfile
                if self.switchProfileDeleted:
-                       SPLConfig = SPLConfigPool[0]
+                       # 6.3: Make sure to set active profile to normal 
profile if and only if the previously active profile is gone.
+                       try:
+                               prevActive = 
getProfileIndexByName(self.activeProfile)
+                       except ValueError:
+                               prevActive = 0
+                       SPLActiveProfile = SPLConfigPool[prevActive].name
+                       SPLConfig = SPLConfigPool[prevActive]
                _configDialogOpened = False
                #super(SPLConfigDialog,  self).onCancel(evt)
                self.Destroy()
@@ -839,8 +844,12 @@ class SPLConfigDialog(gui.SettingsDialog):
                        self.switchProfileDeleted = True
                self.profiles.Delete(index)
                self.profiles.SetString(0, SPLConfigPool[0].name)
-               self.activeProfile = SPLConfigPool[0].name
-               self.profiles.Selection = 0
+               # 6.3: Select normal profile if the active profile is gone.
+               try:
+                       self.profiles.Selection = 
self.profiles.Items.index(self.activeProfile)
+               except ValueError:
+                       self.activeProfile = SPLConfigPool[0].name
+                       self.profiles.Selection = 0
                self.onProfileSelection(None)
                self.profiles.SetFocus()

Repository URL: https://bitbucket.org/nvdaaddonteam/stationplaylist/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.

Other related posts:

  • » commit/StationPlaylist: josephsl: 6.3: When profiles are deleted, focus moves to the active profile (normal profile is active profile is gone). - commits-noreply