commit/StationPlaylist: josephsl: SPL Controller passthrough R2 (6.0-dev): Allow SPL Controller command to invoke SPL Assistant (now official)

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Sat, 08 Aug 2015 00:07:30 -0000

1 new commit in StationPlaylist:

https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/3a19c8bebb2b/
Changeset: 3a19c8bebb2b
Branch: 6.0/splConR2
User: josephsl
Date: 2015-08-08 00:06:59+00:00
Summary: SPL Controller passthrough R2 (6.0-dev): Allow SPL Controller
command to invoke SPL Assistant (now official)

A new dialog to housing advanced options has been created. As of 6.0, it houses
a checkbox to togge whether SPL Controller can invoke SPL Assistnat layer. This
is saved across sessions. This will be exclusive to add-on 6.0.

Affected #: 2 files

diff --git a/addon/appModules/splstudio/__init__.py
b/addon/appModules/splstudio/__init__.py
index af89878..bd2aa15 100755
--- a/addon/appModules/splstudio/__init__.py
+++ b/addon/appModules/splstudio/__init__.py
@@ -283,9 +283,9 @@ class AppModule(appModuleHandler.AppModule):
global _SPLWin
_SPLWin = hwnd

- # 5.0/Experimental: allow SPL Controller layer command to invoke SPL
Assistant.
- # For now, this needs to be enabled from Python Console and may or may
not make it into 5.0.
- SPLConPassthrough = False
+ # Let the global plugin know if SPLController passthrough is allowed.
+ def SPLConPassthrough(self):
+ return splconfig.SPLConfig["SPLConPassthrough"]

def event_NVDAObject_init(self, obj):
# Radio button group names are not recognized as grouping, so
work around this.

diff --git a/addon/appModules/splstudio/splconfig.py
b/addon/appModules/splstudio/splconfig.py
index 40eb12a..7eb558a 100755
--- a/addon/appModules/splstudio/splconfig.py
+++ b/addon/appModules/splstudio/splconfig.py
@@ -36,6 +36,7 @@ IncludedColumns =
string_list(default=list("Artist","Title","Duration","Intro","
SayScheduledFor = boolean(default=true)
SayListenerCount = boolean(default=true)
SayPlayingCartName = boolean(default=true)
+SPLConPassthrough = boolean(default=false)
"""), encoding="UTF-8", list_values=False)
confspec.newlines = "\r\n"
SPLConfig = None
@@ -376,6 +377,12 @@ class SPLConfigDialog(gui.SettingsDialog):
self.cartNameCheckbox.SetValue(SPLConfig["SayPlayingCartName"])
settingsSizer.Add(self.cartNameCheckbox,
border=10,flag=wx.BOTTOM)

+ # Translators: The label of a button to open advanced options
such as using SPL Controller command to invoke Assistant layer.
+ item = advancedOptButton = wx.Button(self, label=_("&Advanced
options..."))
+ item.Bind(wx.EVT_BUTTON, self.onAdvancedOptions)
+ self.splConPassthrough = SPLConfig["SPLConPassthrough"]
+ settingsSizer.Add(item)
+
# Translators: The label for a button in SPL add-on
configuration dialog to reset settings to defaults.
self.resetConfigButton = wx.Button(self, wx.ID_ANY,
label=_("Reset settings"))
self.resetConfigButton.Bind(wx.EVT_BUTTON,self.onResetConfig)
@@ -413,6 +420,7 @@ class SPLConfigDialog(gui.SettingsDialog):
SPLConfig["SayScheduledFor"] = self.scheduledForCheckbox.Value
SPLConfig["SayListenerCount"] = self.listenerCountCheckbox.Value
SPLConfig["SayPlayingCartName"] = self.cartNameCheckbox.Value
+ SPLConfig["SPLConPassthrough"] = self.splConPassthrough
SPLActiveProfile = SPLConfig.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.
@@ -569,6 +577,12 @@ class SPLConfigDialog(gui.SettingsDialog):
self.Disable()
ColumnAnnouncementsDialog(self).Show()

+ # Advanced options.
+ # See advanced options class for more details.
+ def onAdvancedOptions(self, evt):
+ self.Disable()
+ AdvancedOptionsDialog(self).Show()
+
# Reset settings to defaults.
# This affects the currently selected profile.
def onResetConfig(self, evt):
@@ -778,6 +792,43 @@ class ColumnAnnouncementsDialog(wx.Dialog):
self.trackColumns.Select(selIndex+1)
self.onColumnSelection(None)

+# Advanced options
+# This dialog houses advanced options such as using SPL Controller command to
invoke SPL Assistant.
+# More options will be added in Project Rainbow.
+class AdvancedOptionsDialog(wx.Dialog):
+
+ def __init__(self, parent):
+ super(AdvancedOptionsDialog, self).__init__(parent,
title="Advanced options")
+
+ mainSizer = wx.BoxSizer(wx.VERTICAL)
+
+ sizer = wx.BoxSizer(wx.HORIZONTAL)
+ # Translators: A checkbox to toggle if SPL Controller command
can be used to invoke Assistant layer.
+
self.splConPassthroughCheckbox=wx.CheckBox(self,wx.NewId(),label=_("Allow SPL
C&ontroller command to invoke SPL Assistant layer"))
+
self.splConPassthroughCheckbox.SetValue(SPLConfig["SPLConPassthrough"])
+ sizer.Add(self.splConPassthroughCheckbox, border=10,flag=wx.TOP)
+ mainSizer.Add(sizer, border=10, flag=wx.BOTTOM)
+
+ mainSizer.Add(self.CreateButtonSizer(wx.OK | wx.CANCEL))
+ self.Bind(wx.EVT_BUTTON, self.onOk, id=wx.ID_OK)
+ self.Bind(wx.EVT_BUTTON, self.onCancel, id=wx.ID_CANCEL)
+ mainSizer.Fit(self)
+ self.Sizer = mainSizer
+ self.splConPassthroughCheckbox.SetFocus()
+ self.Center(wx.BOTH | wx.CENTER_ON_SCREEN)
+
+ def onOk(self, evt):
+ parent = self.Parent
+ parent.splConPassthrough = self.splConPassthroughCheckbox.Value
+ parent.profiles.SetFocus()
+ parent.Enable()
+ self.Destroy()
+ return
+
+ def onCancel(self, evt):
+ self.Parent.Enable()
+ self.Destroy()
+
# Additional configuration dialogs

# A common alarm dialog

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: SPL Controller passthrough R2 (6.0-dev): Allow SPL Controller command to invoke SPL Assistant (now official) - commits-noreply