commit/StationPlaylist: josephsl: Profile switching (7.0-dev): Major issues with instant switch checkbox and rename failure in time-based profiles fixed.

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Sat, 23 Jan 2016 03:29:32 -0000

1 new commit in StationPlaylist:

https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/b62580b62182/
Changeset:   b62580b62182
Branch:      master
User:        josephsl
Date:        2016-01-23 03:29:13+00:00
Summary:     Profile switching (7.0-dev): Major issues with instant switch 
checkbox and rename failure in time-based profiles fixed.

Somehow, when instant switch checkbox event are handled, the selected index is 
fed into profileNames.index function which should have never happened (possibly 
due to master branch not being merged). This caused error tones to be heard, 
now fixed.
Also, when renaming a time-based profile, the profile triggers dictionary 
(dialog version) wasn't informed that a profile rename occurred, causing 
inconsistency between profile list and triggers dictionary to occur. This has 
been fixed (same solution as caching issue earlier).
Next up is handling profile deletion when a time0based profile is active.

Affected #:  1 file

diff --git a/addon/appModules/splstudio/splconfig.py 
b/addon/appModules/splstudio/splconfig.py
index 1905741..e6a96e3 100755
--- a/addon/appModules/splstudio/splconfig.py
+++ b/addon/appModules/splstudio/splconfig.py
@@ -1143,8 +1143,7 @@ class SPLConfigDialog(gui.SettingsDialog):
                applySections(profileIndex)
                SPLActiveProfile = selectedProfile
                SPLSwitchProfile = self.switchProfile
-               # Without nullifying prev profile while switch profile is 
undefined, NVDA will assume it can switch back to that profile when it can't.
-               # It also causes NVDA to display wrong label for switch button.
+               # Make sure to nullify prev profile if instant switch profile 
is gone.
                if self.switchProfile is None:
                        SPLPrevProfile = None
                _configDialogOpened = False
@@ -1158,11 +1157,12 @@ class SPLConfigDialog(gui.SettingsDialog):
                super(SPLConfigDialog,  self).onOk(evt)
 
        def onCancel(self, evt):
-               global _configDialogOpened, SPLActiveProfile, SPLSwitchProfile, 
SPLConfig
+               global _configDialogOpened, SPLActiveProfile, SPLSwitchProfile, 
SPLConfig, profileTriggers
                # 6.1: Discard changes to included columns set.
                self.includedColumns.clear()
                self.includedColumns = None
-               # Remove profile triggers as well.
+               # Apply profile trigger changes if any.
+               profileTriggers = dict(self._profileTriggersConfig)
                self._profileTriggersConfig.clear()
                self._profileTriggersConfig = None
                triggerStart(restart=True)
@@ -1299,6 +1299,10 @@ class SPLConfigDialog(gui.SettingsDialog):
                if self.switchProfile == oldName:
                        self.switchProfile = newName
                        self.switchProfileRenamed = True
+               # Be sure to update profile triggers.
+               if oldName in self._profileTriggersConfig:
+                       self._profileTriggersConfig[newName] = 
self._profileTriggersConfig[oldName]
+                       del self._profileTriggersConfig[oldName]
                if self.activeProfile == oldName:
                        self.activeProfile = newName
                self.profileNames[profilePos] = newName
@@ -1355,7 +1359,7 @@ class SPLConfigDialog(gui.SettingsDialog):
        def onInstantSwitch(self, evt):
                selection = self.profiles.GetSelection()
                # More efficient to pull the name straight from the names pool.
-               selectedName = self.profileNames.index(selection)
+               selectedName = self.profileNames[selection]
                flag = _("instant switch")
                if self.instantSwitchCheckbox.Value:
                        if self.switchProfile is not None and (selectedName != 
self.switchProfile):

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: Profile switching (7.0-dev): Major issues with instant switch checkbox and rename failure in time-based profiles fixed. - commits-noreply