commit/StationPlaylist: 2 new changesets

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Tue, 14 Jul 2015 05:38:29 -0000

2 new commits in StationPlaylist:

https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/0255207aec42/
Changeset: 0255207aec42
Branch: None
User: josephsl
Date: 2015-07-14 05:34:21+00:00
Summary: 5.2: Make sure one of alarm or settings dialogs is opened.

Previously NVDA iddn't care if the add-on settings dialog was opened. As a
result, it was possible to open an alarm dialog, potentially confusing NvDA as
to which setting is which. This bug is now fixed - NvDA will now prompt the
user to close one or the other.

Affected #: 2 files

diff --git a/addon/appModules/splstudio/__init__.py
b/addon/appModules/splstudio/__init__.py
index a6ef4d1..c1b3e24 100755
--- a/addon/appModules/splstudio/__init__.py
+++ b/addon/appModules/splstudio/__init__.py
@@ -578,8 +578,13 @@ class AppModule(appModuleHandler.AppModule):
script_sayCompleteTime.__doc__=_("Announces time including seconds.")

# Set the end of track alarm time between 1 and 59 seconds.
+ # 5.2: Make sure one of either settings or alarm dialogs is open.

def script_setEndOfTrackTime(self, gesture):
+ if splconfig._configDialogOpened:
+ # Translators: Presented when the add-on config dialog
is opened.
+ wx.CallAfter(gui.messageBox, _("The add-on settings
dialog is opened. Please close the settings dialog first."), _("Error"),
wx.OK|wx.ICON_ERROR)
+ return
try:
timeVal = splconfig.SPLConfig["EndOfTrackTime"]
d = splconfig.SPLAlarmDialog(gui.mainFrame,
"EndOfTrackTime", "SayEndOfTrack",
@@ -602,6 +607,9 @@ class AppModule(appModuleHandler.AppModule):
# Set song ramp (introduction) time between 1 and 9 seconds.

def script_setSongRampTime(self, gesture):
+ if splconfig._configDialogOpened:
+ wx.CallAfter(gui.messageBox, _("The add-on settings
dialog is opened. Please close the settings dialog first."), _("Error"),
wx.OK|wx.ICON_ERROR)
+ return
try:
rampVal = long(splconfig.SPLConfig["SongRampTime"])
d = splconfig.SPLAlarmDialog(gui.mainFrame,
"SongRampTime", "SaySongRamp",
@@ -624,7 +632,10 @@ class AppModule(appModuleHandler.AppModule):
# Tell NVDA to play a sound when mic was active for a long time.

def script_setMicAlarm(self, gesture):
- if splconfig._alarmDialogOpened:
+ if splconfig._configDialogOpened:
+ wx.CallAfter(gui.messageBox, _("The add-on settings
dialog is opened. Please close the settings dialog first."), _("Error"),
wx.OK|wx.ICON_ERROR)
+ return
+ elif splconfig._alarmDialogOpened:
wx.CallAfter(splconfig._alarmError)
return
micAlarm = str(splconfig.SPLConfig["MicAlarm"])
@@ -660,7 +671,11 @@ class AppModule(appModuleHandler.AppModule):
# SPL Config management.

def script_openConfigDialog(self, gesture):
- wx.CallAfter(splconfig.onConfigDialog, None)
+ # 5.2: Guard against alarm dialogs.
+ if splconfig._alarmDialogOpened:
+ # Translators: Presented when an alarm dialog is opened.
+ wx.CallAfter(gui.messageBox, _("An alarm dialog is
already opened. Please close the alarm dialog first."), _("Error"),
wx.OK|wx.ICON_ERROR)
+ else: wx.CallAfter(splconfig.onConfigDialog, None)
# Translators: Input help mode message for a command in Station
Playlist Studio.
script_openConfigDialog.__doc__=_("Opens SPL Studio add-on
configuration dialog.")


diff --git a/addon/appModules/splstudio/splconfig.py
b/addon/appModules/splstudio/splconfig.py
index f68f492..a327d8e 100755
--- a/addon/appModules/splstudio/splconfig.py
+++ b/addon/appModules/splstudio/splconfig.py
@@ -99,6 +99,8 @@ def saveConfig():


# Configuration dialog.
+_configDialogOpened = False
+
class SPLConfigDialog(gui.SettingsDialog):
# Translators: This is the label for the StationPlaylist Studio
configuration dialog.
title = _("Studio Add-on Settings")
@@ -220,6 +222,8 @@ class SPLConfigDialog(gui.SettingsDialog):
sizer.Add(self.resetConfigButton)

def postInit(self):
+ global _configDialogOpened
+ _configDialogOpened = True
self.beepAnnounceCheckbox.SetFocus()

def onOk(self, evt):
@@ -243,8 +247,15 @@ class SPLConfigDialog(gui.SettingsDialog):
SPLConfig["SayScheduledFor"] = self.scheduledForCheckbox.Value
SPLConfig["SayListenerCount"] = self.listenerCountCheckbox.Value
SPLConfig["SayPlayingCartName"] = self.cartNameCheckbox.Value
+ global _configDialogOpened
+ _configDialogOpened = False
super(SPLConfigDialog, self).onOk(evt)

+ def onCancel(self, evt):
+ global _configDialogOpened
+ _configDialogOpened = False
+ super(SPLConfigDialog, self).onCancel(evt)
+
# Check events for outro and intro alarms, respectively.
def onOutroCheck(self, evt):
if not self.outroCheckBox.IsChecked():


https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/31d0b4e168d8/
Changeset: 31d0b4e168d8
Branch: master
User: josephsl
Date: 2015-07-14 05:38:15+00:00
Summary: Merged 5.x work with tweaks for 6.0-dev

Affected #: 2 files

diff --git a/addon/appModules/splstudio/__init__.py
b/addon/appModules/splstudio/__init__.py
index 1a61258..d2434f6 100755
--- a/addon/appModules/splstudio/__init__.py
+++ b/addon/appModules/splstudio/__init__.py
@@ -592,8 +592,13 @@ class AppModule(appModuleHandler.AppModule):
script_sayCompleteTime.__doc__=_("Announces time including seconds.")

# Set the end of track alarm time between 1 and 59 seconds.
+ # 5.2: Make sure one of either settings or alarm dialogs is open.

def script_setEndOfTrackTime(self, gesture):
+ if splconfig._configDialogOpened:
+ # Translators: Presented when the add-on config dialog
is opened.
+ wx.CallAfter(gui.messageBox, _("The add-on settings
dialog is opened. Please close the settings dialog first."), _("Error"),
wx.OK|wx.ICON_ERROR)
+ return
try:
timeVal = splconfig.SPLConfig["EndOfTrackTime"]
d = splconfig.SPLAlarmDialog(gui.mainFrame,
"EndOfTrackTime", "SayEndOfTrack",
@@ -616,6 +621,9 @@ class AppModule(appModuleHandler.AppModule):
# Set song ramp (introduction) time between 1 and 9 seconds.

def script_setSongRampTime(self, gesture):
+ if splconfig._configDialogOpened:
+ wx.CallAfter(gui.messageBox, _("The add-on settings
dialog is opened. Please close the settings dialog first."), _("Error"),
wx.OK|wx.ICON_ERROR)
+ return
try:
rampVal = long(splconfig.SPLConfig["SongRampTime"])
d = splconfig.SPLAlarmDialog(gui.mainFrame,
"SongRampTime", "SaySongRamp",
@@ -638,7 +646,10 @@ class AppModule(appModuleHandler.AppModule):
# Tell NVDA to play a sound when mic was active for a long time.

def script_setMicAlarm(self, gesture):
- if splconfig._alarmDialogOpened:
+ if splconfig._configDialogOpened:
+ wx.CallAfter(gui.messageBox, _("The add-on settings
dialog is opened. Please close the settings dialog first."), _("Error"),
wx.OK|wx.ICON_ERROR)
+ return
+ elif splconfig._alarmDialogOpened:
wx.CallAfter(splconfig._alarmError)
return
micAlarm = str(splconfig.SPLConfig["MicAlarm"])
@@ -674,7 +685,11 @@ class AppModule(appModuleHandler.AppModule):
# SPL Config management.

def script_openConfigDialog(self, gesture):
- wx.CallAfter(splconfig.onConfigDialog, None)
+ # 5.2: Guard against alarm dialogs.
+ if splconfig._alarmDialogOpened:
+ # Translators: Presented when an alarm dialog is opened.
+ wx.CallAfter(gui.messageBox, _("An alarm dialog is
already opened. Please close the alarm dialog first."), _("Error"),
wx.OK|wx.ICON_ERROR)
+ else: wx.CallAfter(splconfig.onConfigDialog, None)
# Translators: Input help mode message for a command in Station
Playlist Studio.
script_openConfigDialog.__doc__=_("Opens SPL Studio add-on
configuration dialog.")


diff --git a/addon/appModules/splstudio/splconfig.py
b/addon/appModules/splstudio/splconfig.py
index 17d249c..414f2fa 100755
--- a/addon/appModules/splstudio/splconfig.py
+++ b/addon/appModules/splstudio/splconfig.py
@@ -152,6 +152,8 @@ def saveConfig():


# Configuration dialog.
+_configDialogOpened = False
+
class SPLConfigDialog(gui.SettingsDialog):
# Translators: This is the label for the StationPlaylist Studio
configuration dialog.
title = _("Studio Add-on Settings")
@@ -321,6 +323,8 @@ class SPLConfigDialog(gui.SettingsDialog):
sizer.Add(self.resetConfigButton)

def postInit(self):
+ global _configDialogOpened
+ _configDialogOpened = True
self.profiles.SetFocus()

def onOk(self, evt):
@@ -332,7 +336,7 @@ class SPLConfigDialog(gui.SettingsDialog):
_("Error"), wx.OK|wx.ICON_ERROR,self)
self.micAlarm.SetFocus()
return
- global SPLConfig
+ global SPLConfig, _configDialogOpened
SPLConfig = SPLConfigPool[self.profiles.GetSelection()]
SPLConfig["BeepAnnounce"] = self.beepAnnounceCheckbox.Value
SPLConfig["SayEndOfTrack"] = self.outroCheckBox.Value
@@ -349,8 +353,14 @@ class SPLConfigDialog(gui.SettingsDialog):
SPLConfig["SayScheduledFor"] = self.scheduledForCheckbox.Value
SPLConfig["SayListenerCount"] = self.listenerCountCheckbox.Value
SPLConfig["SayPlayingCartName"] = self.cartNameCheckbox.Value
+ _configDialogOpened = False
super(SPLConfigDialog, self).onOk(evt)

+ def onCancel(self, evt):
+ global _configDialogOpened
+ _configDialogOpened = False
+ super(SPLConfigDialog, self).onCancel(evt)
+
# Check events for outro and intro alarms, respectively.
def onOutroCheck(self, evt):
if not self.outroCheckBox.IsChecked():

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: