commit/StationPlaylist: 2 new changesets

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Sun, 17 Jan 2016 04:14:27 -0000

2 new commits in StationPlaylist:

https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/25110b0fcad2/
Changeset:   25110b0fcad2
Branch:      None
User:        josephsl
Date:        2016-01-17 02:53:18+00:00
Summary:     Columns explorer (7.0-dev): Column exploration range will be 
cached at startup in order to prevent looking it up each time SPL Assistant is 
entered.

A new flag has been added to splconfig.SPLConfig dictionary to store column 
exploration range ( 1 through 7 for 5.0x, all ten keys for 5.10 and later). 
Among other purposes, this allows SPL Assistant entry function to assign 
correct commands based on current Studio version in use.

Affected #:  2 files

diff --git a/addon/appModules/splstudio/__init__.py 
b/addon/appModules/splstudio/__init__.py
index 3f226f0..a1fefdc 100755
--- a/addon/appModules/splstudio/__init__.py
+++ b/addon/appModules/splstudio/__init__.py
@@ -395,6 +395,8 @@ class AppModule(appModuleHandler.AppModule):
                        queueHandler.queueFunction(queueHandler.eventQueue, 
splconfig.updateInit)
                # Display startup dialogs if any.
                wx.CallAfter(splconfig.showStartupDialogs)
+               # Cache start and end range for column exploration.
+               splconfig.SPLConfig["ColumnExpRange"] = (1, 7) if 
self.SPLCurVersion < "5.1" else (0, 10)
 
        # Locate the handle for main window for caching purposes.
        def _locateSPLHwnd(self):
@@ -1338,9 +1340,8 @@ class AppModule(appModuleHandler.AppModule):
                        elif 
splconfig.SPLConfig["Advanced"]["CompatibilityLayer"] == "wineyes": 
self.bindGestures(self.__SPLAssistantWEGestures)
                        # 7.0: Certain commands involving number row.
                        # 7.x only: Take care of both Studio 5.0x and 5.1x.
-                       # 8.0: Remove the conditionals below, as only Studio 
5.10 and later will be supported.
-                       start = 1 if self.SPLCurVersion < "5.1" else 0
-                       end = 7 if self.SPLCurVersion < "5.1" else 10
+                       # 8.0: Remove tuple unpack routine below, as all ten 
keys are available.
+                       start, end = splconfig.SPLConfig["ColumnExpRange"]
                        for i in xrange(start, end):
                                self.bindGesture("kb:%s"%(i), "columnExplorer")
                        self.SPLAssistant = True

diff --git a/addon/appModules/splstudio/splconfig.py 
b/addon/appModules/splstudio/splconfig.py
index d1136bc..e623742 100755
--- a/addon/appModules/splstudio/splconfig.py
+++ b/addon/appModules/splstudio/splconfig.py
@@ -583,6 +583,7 @@ def saveConfig():
        # Global flags, be gone.
        if "Reset" in SPLConfigPool[0]:
                del SPLConfigPool[0]["Reset"]
+       del SPLConfig["ColumnExpRange"]
        # Convert keys back to 5.x format.
        for section in SPLConfigPool[0].keys():
                if isinstance(SPLConfigPool[0][section], dict):
@@ -1364,11 +1365,14 @@ class SPLConfigDialog(gui.SettingsDialog):
                _("Warning"),wx.YES_NO|wx.NO_DEFAULT|wx.ICON_WARNING,self
                )==wx.YES:
                        # Reset all profiles.
-                       resetAllConfig()
+                       # Save some flags from death.
                        global SPLConfig, SPLConfigPool, SPLActiveProfile, 
_configDialogOpened, SPLSwitchProfile, SPLPrevProfile
+                       colRange = SPLConfig["ColumnExpRange"]
+                       resetAllConfig()
                        SPLConfig = dict(_SPLDefaults7)
                        SPLConfig["ActiveIndex"] = 0
                        SPLActiveProfile = SPLConfigPool[0].name
+                       SPLConfig["ColumnExpRange"] = colRange
                        # Workaround: store the reset flag in the normal 
profile to prevent config databases from becoming references to old generation.
                        SPLConfigPool[0]["Reset"] = True
                if SPLSwitchProfile is not None:


https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/eac7324163e1/
Changeset:   eac7324163e1
Branch:      7.0/orangeTrackInfoBoard
User:        josephsl
Date:        2016-01-17 04:14:09+00:00
Summary:     Columns explorer (7.0-dev): Configuration UI added.

A new COlumns Explorer dialog has been added to add-on settings. This dialog 
houses six or ten combo boxes (six if using Studio 5.0x) used to configure 
which column should be 'explored' (looked up) when SPL Assistant, nubmer keys 
are pressed. For visual clarity, these combo boxes are laid out on two rows 
(first row are 5.0x, seocnd row is 5.1x).
This is destined for add-on 7.0.

Affected #:  1 file

diff --git a/addon/appModules/splstudio/splconfig.py 
b/addon/appModules/splstudio/splconfig.py
index e623742..4d46b52 100755
--- a/addon/appModules/splstudio/splconfig.py
+++ b/addon/appModules/splstudio/splconfig.py
@@ -1004,6 +1004,11 @@ class SPLConfigDialog(gui.SettingsDialog):
                item = manageColumnsButton = wx.Button(self, label=_("&Manage 
track column announcements..."))
                item.Bind(wx.EVT_BUTTON, self.onManageColumns)
                settingsSizer.Add(item)
+               # Translators: The label of a button to configure columns 
explorer slots (SPL Assistant, number row keys to announce specific columns).
+               item = columnsExplorerButton = wx.Button(self, label=_("Columns 
E&xplorer..."))
+               item.Bind(wx.EVT_BUTTON, self.onColumnsExplorer)
+               self.exploreColumns = SPLConfig["General"]["ExploreColumns"]
+               settingsSizer.Add(item)
 
                # Translators: the label for a setting in SPL add-on settings 
to announce scheduled time.
                
self.scheduledForCheckbox=wx.CheckBox(self,wx.NewId(),label=_("Announce 
&scheduled time for the selected track"))
@@ -1094,6 +1099,7 @@ class SPLConfigDialog(gui.SettingsDialog):
                SPLConfig["ColumnAnnouncement"]["UseScreenColumnOrder"] = 
self.columnOrderCheckbox.Value
                SPLConfig["ColumnAnnouncement"]["ColumnOrder"] = 
self.columnOrder
                SPLConfig["ColumnAnnouncement"]["IncludedColumns"] = 
self.includedColumns
+               SPLConfig["General"]["ExploreColumns"] = self.exploreColumns
                SPLConfig["SayStatus"]["SayScheduledFor"] = 
self.scheduledForCheckbox.Value
                SPLConfig["SayStatus"]["SayListenerCount"] = 
self.listenerCountCheckbox.Value
                SPLConfig["SayStatus"]["SayPlayingCartName"] = 
self.cartNameCheckbox.Value
@@ -1344,6 +1350,11 @@ class SPLConfigDialog(gui.SettingsDialog):
                self.Disable()
                ColumnAnnouncementsDialog(self).Show()
 
+       # Columns Explorer configuration.
+       def onColumnsExplorer(self, evt):
+               self.Disable()
+               ColumnsExplorerDialog(self).Show()
+
        # Status announcement dialog.
        def onStatusAnnouncement(self, evt):
                self.Disable()
@@ -1805,6 +1816,72 @@ class ColumnAnnouncementsDialog(wx.Dialog):
                        if self.FindFocus().GetId() == wx.ID_OK:
                                self.upButton.SetFocus()
 
+# Columns Explorer.
+# Configure which column will be announced when SPL Assistnat, number keys are 
pressed.
+class ColumnsExplorerDialog(wx.Dialog):
+
+       def __init__(self, parent):
+               super(ColumnsExplorerDialog, self).__init__(parent, 
title=_("Columns Explorer"))
+
+               # Gather column slots.
+               # 7.0: First six slots are reserved for Studio 5.0x columns.
+               self.columnSlots = []
+
+               mainSizer = wx.BoxSizer(wx.VERTICAL)
+
+               # 7.0: Studio 5.0x columns.
+               # 8.0: Remove the below code.
+               oldStudioColumns = ["Artist", "Title", "Duration", "Intro", 
"Category", "Filename"]
+               sizer = wx.BoxSizer(wx.HORIZONTAL)
+               for slot in xrange(6):
+                       # Translators: The label for a setting in SPL add-on 
dialog to select column for this column slot.
+                       label = wx.StaticText(self, wx.ID_ANY, label=_("Slot 
{position}").format(position = slot+1))
+                       columns = wx.Choice(self, wx.ID_ANY, 
choices=oldStudioColumns)
+                       try:
+                               
columns.SetSelection(oldStudioColumns.index(parent.exploreColumns[slot]))
+                       except:
+                               pass
+                       sizer.Add(label)
+                       sizer.Add(columns)
+                       self.columnSlots.append(columns)
+               mainSizer.Add(sizer, border=10, flag=wx.BOTTOM)
+
+               # For Studio 5.10 and later.
+               if SPLConfig["ColumnExpRange"] == (0, 10):
+                       sizer = wx.BoxSizer(wx.HORIZONTAL)
+                       for slot in xrange(6, 10):
+                               label = wx.StaticText(self, wx.ID_ANY, 
label=_("Slot {position}").format(position = slot+1))
+                               columns = wx.Choice(self, wx.ID_ANY, 
choices=_SPLDefaults7["ColumnAnnouncement"]["ColumnOrder"])
+                               try:
+                                       
columns.SetSelection(_SPLDefaults7["ColumnAnnouncement"]["ColumnOrder"].index(parent.exploreColumns[slot]))
+                               except:
+                                       pass
+                               sizer.Add(label)
+                               sizer.Add(columns)
+                               self.columnSlots.append(columns)
+                       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.columnSlots[0].SetFocus()
+               self.Center(wx.BOTH | wx.CENTER_ON_SCREEN)
+
+       def onOk(self, evt):
+               parent = self.Parent
+               for slot in xrange(len(self.columnSlots)):
+                       parent.exploreColumns[slot] = 
self.columnSlots[slot].GetStringSelection()
+               parent.profiles.SetFocus()
+               parent.Enable()
+               self.Destroy()
+               return
+
+       def onCancel(self, evt):
+               self.Parent.Enable()
+               self.Destroy()
+
 # Say status dialog.
 # Houses options such as announcing cart names.
 class SayStatusDialog(wx.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: