commit/StationPlaylist: 2 new changesets

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Sat, 18 Jul 2015 17:14:11 -0000

2 new commits in StationPlaylist:

https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/ee25de359232/
Changeset: ee25de359232
Branch: None
User: josephsl
Date: 2015-07-18 05:10:11+00:00
Summary: Instant profile switching (6.0-dev): Fix a bug where one could get
stuck on stiched profile when one opens add-on settings and press ENTER
immediately.

When clearing the switch flag, be sure to clear the active profile tag as well.
Also the switch button label will now respect if switch flag is set (if it is,
it'll show 'disalbe', otherwise it'll say enable)."
"

Affected #: 1 file

diff --git a/addon/appModules/splstudio/splconfig.py
b/addon/appModules/splstudio/splconfig.py
index 92ff14a..b6569b4 100755
--- a/addon/appModules/splstudio/splconfig.py
+++ b/addon/appModules/splstudio/splconfig.py
@@ -174,19 +174,21 @@ SPLSwitchProfile = 1

# Called from within the app module.
def instantProfileSwitch():
- global SPLPrevProfile, SPLConfig
+ global SPLPrevProfile, SPLConfig, SPLActiveProfile
if SPLSwitchProfile is None:
ui.message("No instant switch profile is defined")
else:
- if SPLActiveProfile == SPLSwitchProfile:
- ui.message("You are already in the active profile")
- elif SPLPrevProfile is None:
+ if SPLPrevProfile is None:
+ if SPLActiveProfile == SPLSwitchProfile:
+ ui.message("You are already in the instant
switch profile")
+ return
# Switch to the given profile.
SPLPrevProfile = SPLConfigPool.index(SPLConfig)
SPLConfig = SPLConfigPool[SPLSwitchProfile]
ui.message("Switching profiles")
else:
SPLConfig = SPLConfigPool[SPLPrevProfile]
+ SPLActiveProfile = SPLPrevProfile
SPLPrevProfile = None
ui.message("Returning to previous profile")

@@ -232,7 +234,9 @@ 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.
- item = self.instantSwitchButton = wx.Button(self,
label=_("Enable instant profile switching"))
+ if SPLPrevProfile 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)
self.switchProfile = SPLSwitchProfile
sizer.Add(item)
@@ -519,7 +523,6 @@ class SPLConfigDialog(gui.SettingsDialog):

def onInstantSwitch(self, evt):
import tones
- ui.message(str(self.switchProfile is not None))
selection = self.profiles.GetSelection()
if self.switchProfile is None or (selection !=
self.switchProfile):
self.instantSwitchButton.Label = "Disable instant
profile switching"


https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/a3e15b023dff/
Changeset: a3e15b023dff
Branch: 6.0/instantProfileSwitching
User: josephsl
Date: 2015-07-18 17:13:29+00:00
Summary: Instant profile switching (6.0-dev): Do not switch profiles if
add-on settings dialog is opened.

Affected #: 1 file

diff --git a/addon/appModules/splstudio/splconfig.py
b/addon/appModules/splstudio/splconfig.py
index b6569b4..7445a9d 100755
--- a/addon/appModules/splstudio/splconfig.py
+++ b/addon/appModules/splstudio/splconfig.py
@@ -175,6 +175,9 @@ SPLSwitchProfile = 1
# Called from within the app module.
def instantProfileSwitch():
global SPLPrevProfile, SPLConfig, SPLActiveProfile
+ if _configDialogOpened:
+ ui.message("Add-on settings dialog is open, cannot switch
profiles")
+ return
if SPLSwitchProfile is None:
ui.message("No instant switch profile is defined")
else:

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: