commit/StationPlaylist: josephsl: When clicking cancel from main add-on settings, appropriate profiles are now merged into the runtime dictionary.

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Thu, 21 Jan 2016 00:19:48 -0000

1 new commit in StationPlaylist:

https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/cd129b0d957e/
Changeset:   cd129b0d957e
Branch:      master
User:        josephsl
Date:        2016-01-21 00:13:39+00:00
Summary:     When clicking cancel from main add-on settings, appropriate 
profiles are now merged into the runtime dictionary.

Force profile merge no matter what happens (profile rename, deletion, etc.). 
This also allows active profile flag to be updated correctly.
This is unique to add-on 7.0 due to sectoinized config.

Affected #:  1 file

diff --git a/addon/appModules/splstudio/splconfig.py 
b/addon/appModules/splstudio/splconfig.py
index 84274e8..b19bf08 100755
--- a/addon/appModules/splstudio/splconfig.py
+++ b/addon/appModules/splstudio/splconfig.py
@@ -1158,17 +1158,16 @@ class SPLConfigDialog(gui.SettingsDialog):
                self._profileTriggersConfig.clear()
                self._profileTriggersConfig = None
                triggerStart(restart=True)
+               # 7.0: No matter what happens, merge appropriate profile.
+               try:
+                       prevActive = self.profileNames.index(self.activeProfile)
+               except ValueError:
+                       prevActive = 0
+               mergeSections(prevActive)
                if self.switchProfileRenamed or self.switchProfileDeleted:
                        SPLSwitchProfile = self.switchProfile
                if self.switchProfileDeleted:
-                       # 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
-                       # 7.0: Merge just obtained profile index.
-                       mergeSections(prevActive)
                _configDialogOpened = False
                super(SPLConfigDialog,  self).onCancel(evt)
 
@@ -1332,8 +1331,9 @@ class SPLConfigDialog(gui.SettingsDialog):
                del self.profileNames[profilePos]
                del _SPLCache[name]
                # 6.3: Select normal profile if the active profile is gone.
+               # 7.0: Consult profile names instead.
                try:
-                       self.profiles.Selection = 
self.profiles.Items.index(self.activeProfile)
+                       self.profiles.Selection = 
self.profileNames.index(self.activeProfile)
                except ValueError:
                        self.activeProfile = SPLConfigPool[0].name
                        self.profiles.Selection = 0

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: When clicking cancel from main add-on settings, appropriate profiles are now merged into the runtime dictionary. - commits-noreply