commit/StationPlaylist: josephsl: Instant profile switching (6.0-dev): Fix a showstopper bug where switch button shoed wrong label when switch profile is undefined.

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Mon, 20 Jul 2015 07:19:35 -0000

1 new commit in StationPlaylist:

https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/ca984d2d541c/
Changeset: ca984d2d541c
Branch: 6.0/instantProfileSwitching
User: josephsl
Date: 2015-07-20 07:18:48+00:00
Summary: Instant profile switching (6.0-dev): Fix a showstopper bug where
switch button shoed wrong label when switch profile is undefined.

When displaying the label for the switch button, just check switch profile.
Also, when switch profile is off, be sure to nullify prev profile, otherwise
NVDA will assume one can switch back to the predefined prev profile when it
can't.
With this, switch profile is ready for testing. The ability to save this across
sessions will not come to life for a while.

Affected #: 1 file

diff --git a/addon/appModules/splstudio/splconfig.py
b/addon/appModules/splstudio/splconfig.py
index ad957a8..b7a22a5 100755
--- a/addon/appModules/splstudio/splconfig.py
+++ b/addon/appModules/splstudio/splconfig.py
@@ -238,7 +238,7 @@ class SPLConfigDialog(gui.SettingsDialog):
item.Bind(wx.EVT_BUTTON, self.onDelete)
sizer.Add(item)
# Translators: The label of a button to toggle instant profile
switching on and off.
- if SPLPrevProfile is None and SPLSwitchProfile is None:
switchLabel = "Enable instant profile switching"
+ if SPLSwitchProfile is None: switchLabel = "Enable instant
profile switching"
else: switchLabel = "Disable instant profile switching"
item = self.instantSwitchButton = wx.Button(self,
label=switchLabel)
item.Bind(wx.EVT_BUTTON, self.onInstantSwitch)
@@ -389,7 +389,7 @@ class SPLConfigDialog(gui.SettingsDialog):
_("Error"), wx.OK|wx.ICON_ERROR,self)
self.micAlarm.SetFocus()
return
- global SPLConfig, SPLActiveProfile, _configDialogOpened,
SPLSwitchProfile
+ global SPLConfig, SPLActiveProfile, _configDialogOpened,
SPLSwitchProfile, SPLPrevProfile
selectedProfile = self.profiles.GetSelection()
SPLConfig = SPLConfigPool[selectedProfile]
SPLConfig["BeepAnnounce"] = self.beepAnnounceCheckbox.Value
@@ -409,6 +409,10 @@ class SPLConfigDialog(gui.SettingsDialog):
SPLConfig["SayPlayingCartName"] = self.cartNameCheckbox.Value
SPLActiveProfile = SPLConfigPool[selectedProfile].name
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.
+ if self.switchProfile is None:
+ SPLPrevProfile = None
_configDialogOpened = False
super(SPLConfigDialog, self).onOk(evt)

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: Instant profile switching (6.0-dev): Fix a showstopper bug where switch button shoed wrong label when switch profile is undefined. - commits-noreply