commit/StationPlaylist: josephsl: Merge branches 'master' and '7.0/orangeTrackInfoBoard' into staging

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Thu, 14 Jan 2016 21:08:10 -0000

1 new commit in StationPlaylist:

https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/c0628407fa87/
Changeset:   c0628407fa87
Branch:      staging
User:        josephsl
Date:        2016-01-14 21:05:39+00:00
Summary:     Merge branches 'master' and '7.0/orangeTrackInfoBoard' into staging

Affected #:  2 files

diff --git a/addon/appModules/splstudio/__init__.py 
b/addon/appModules/splstudio/__init__.py
index cb35a78..99bc7b8 100755
--- a/addon/appModules/splstudio/__init__.py
+++ b/addon/appModules/splstudio/__init__.py
@@ -1344,6 +1344,13 @@ class AppModule(appModuleHandler.AppModule):
                        if 
splconfig.SPLConfig["Advanced"]["CompatibilityLayer"] == "off": 
self.bindGestures(self.__SPLAssistantGestures)
                        elif 
splconfig.SPLConfig["Advanced"]["CompatibilityLayer"] == "jfw": 
self.bindGestures(self.__SPLAssistantJFWGestures)
                        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
+                       for i in xrange(start, end):
+                               self.bindGesture("kb:%s"%(i), "columnExplorer")
                        self.SPLAssistant = True
                        tones.beep(512, 50)
                        if 
splconfig.SPLConfig["Advanced"]["CompatibilityLayer"] == "jfw": 
ui.message("JAWS")
@@ -1637,6 +1644,15 @@ class AppModule(appModuleHandler.AppModule):
                                status = _("Metadata streaming on DSP encoder 
disabled")
                ui.message(status)
 
+       def script_columnExplorer(self, gesture):
+               if gesture.displayName.isdigit():
+                       focus = api.getFocusObject()
+                       if not isinstance(focus, SPLTrackItem):
+                               ui.message("Not a track")
+                       else:
+                               columns = ("Artist", "Title", "Duration", 
"Intro", "Category", "Filename", "Year", "Album", "Genre", "Time Scheduled")
+                               
focus.announceColumnContent(focus._indexOf(columns[int(gesture.displayName)-1]))
+
        def script_layerHelp(self, gesture):
                compatibility = 
splconfig.SPLConfig["Advanced"]["CompatibilityLayer"]
                # Translators: The title for SPL Assistant help dialog.

diff --git a/addon/appModules/splstudio/splconfig.py 
b/addon/appModules/splstudio/splconfig.py
index 4246b83..7d3a23a 100755
--- a/addon/appModules/splstudio/splconfig.py
+++ b/addon/appModules/splstudio/splconfig.py
@@ -332,7 +332,7 @@ def initProfileTriggers():
        except IOError:
                pass
        # Cache profile triggers, used to compare the runtime dictionary 
against the cache.
-       profileTriggers2 = profileTriggers
+       profileTriggers2 = dict(profileTriggers)
        triggerStart()
 
 # Locate time-based profiles if any.
@@ -553,6 +553,8 @@ def _preSave(conf):
 # For the most part, no setting will be modified.
 def shouldSave(profile):
        tree = None if profile.filename == SPLIni else profile.name
+       # One downside of caching: new profiles are not recognized as such.
+       if "___new___" in _SPLCache[tree]: return True
        for section in profile.keys():
                if isinstance(profile[section], dict):
                        for key in profile[section]:
@@ -1440,7 +1442,7 @@ class NewProfileDialog(wx.Dialog):
                self.Center(wx.BOTH | wx.CENTER_ON_SCREEN)
 
        def onOk(self, evt):
-               global SPLConfigPool
+               global SPLConfigPool, _SPLCache
                profileNames = [profile.name for profile in SPLConfigPool]
                name = api.filterFileName(self.profileName.Value)
                if not name:
@@ -1455,12 +1457,14 @@ class NewProfileDialog(wx.Dialog):
                        os.mkdir(SPLProfiles)
                newProfilePath = os.path.join(SPLProfiles, namePath)
                SPLConfigPool.append(unlockConfig(newProfilePath, 
profileName=name))
+               # Make the cache know this is a new profile.
+               # If nothing happens to this profile, the newly created profile 
will be saved to disk.
+               _SPLCache[name]["___new___"] = True
                if self.copy:
                        newProfile = SPLConfigPool[-1]
                        baseProfile = 
getProfileByName(self.baseProfiles.GetStringSelection())
-                       for setting in baseProfile:
+                       for setting in newProfile.keys():
                                try:
-                                       # Go through all settings (including 
profile-specific ones for now).
                                        # 6.1/7.0: Only iterate through 
mutatable keys.
                                        if baseProfile[setting] != 
newProfile[setting]:
                                                newProfile[setting] = 
baseProfile[setting]

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: Merge branches 'master' and '7.0/orangeTrackInfoBoard' into staging - commits-noreply