commit/StationPlaylist: josephsl: Project Starfish (6.0-dev): A selector to choose between starfish arms

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Wed, 03 Jun 2015 20:11:33 -0000

1 new commit in StationPlaylist:

https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/1efa235d4e95/
Changeset: 1efa235d4e95
Branch: 6.0/broadcastProfile
User: josephsl
Date: 2015-06-03 20:11:04+00:00
Summary: Project Starfish (6.0-dev): A selector to choose between starfish
arms

Added a new combo box in SPL Settings to select a profile. Also old profiles
are now imported during installation as opposed to when the app module is run
for the first time.

Affected #: 2 files

diff --git a/addon/appModules/splstudio/splconfig.py
b/addon/appModules/splstudio/splconfig.py
index f37f126..4035203 100755
--- a/addon/appModules/splstudio/splconfig.py
+++ b/addon/appModules/splstudio/splconfig.py
@@ -85,19 +85,7 @@ def resetConfig(defaults, activeConfig, intentional=False):
# With the load function below, load the config upon request.
# 6.0: The below init function is really a vehicle that traverses through
config profiles in a loop.
def initConfig():
- # Is this the first time I'm seeing a profile?
- if not os.path.exists(SPLProfiles):
- tempProfiles = os.path.join(globalVars.appArgs.configPath,
"__SPLProfiles")
- if os.path.exists(tempProfiles):
- # Import contents of installation (temp) profiles
directory to the real profiles folder.
- import shutil
- inis = filter(lambda fn: os.path.splitext(fn)[-1] ==
".ini", os.listdir(tempProfiles))
- if len(inis):
- os.mkdir(SPLProfiles)
- for ini in inis:
- shutil.copy2(os.path.join(tempProfiles,
ini), SPLProfiles)
- # Thank you.
- shutil.rmtree(tempProfiles)
+ #if not os.path.exists(SPLProfiles):
# Load the default config from a list of profiles.
global SPLConfig, SPLConfigPool
SPLConfigPool.append(unlockConfig(SPLIni, profileName="Normal profile"))
@@ -161,7 +149,19 @@ class SPLConfigDialog(gui.SettingsDialog):

def makeSettings(self, settingsSizer):

- # Translators: the label for a setting in SPL add-on settings
to set status announcement between words and beeps.
+ sizer = wx.BoxSizer(wx.HORIZONTAL)
+ # Translators: The label for a setting in SPL add-on dialog to
select a broadcast profile.
+ label = wx.StaticText(self, wx.ID_ANY, label=_("Broadcast
&profile:"))
+ self.profiles = wx.Choice(self, wx.ID_ANY,
choices=[profile.name for profile in SPLConfigPool])
+ try:
+
self.profiles.SetSelection(SPLConfigPool.index(SPLConfig))
+ except:
+ pass
+ sizer.Add(label)
+ sizer.Add(self.profiles)
+ settingsSizer.Add(sizer, border=10, flag=wx.BOTTOM)
+
+ # Translators: the label for a setting in SPL add-on settings to set
status announcement between words and beeps.

self.beepAnnounceCheckbox=wx.CheckBox(self,wx.NewId(),label=_("&Beep for status
announcements"))
self.beepAnnounceCheckbox.SetValue(SPLConfig["BeepAnnounce"])
settingsSizer.Add(self.beepAnnounceCheckbox,
border=10,flag=wx.TOP)
@@ -286,6 +286,7 @@ class SPLConfigDialog(gui.SettingsDialog):
_("Error"), wx.OK|wx.ICON_ERROR,self)
self.micAlarm.SetFocus()
return
+ SPLConfig = self.profiles.GetSelection()
SPLConfig["BeepAnnounce"] = self.beepAnnounceCheckbox.Value
SPLConfig["SayEndOfTrack"] = self.outroCheckBox.Value
SPLConfig["EndOfTrackTime"] = self.endOfTrackAlarm.Value

diff --git a/addon/installTasks.py b/addon/installTasks.py
index a4f376b..d13e4af 100755
--- a/addon/installTasks.py
+++ b/addon/installTasks.py
@@ -11,10 +11,10 @@ import globalVars

def onInstall():
profiles = os.path.join(os.path.dirname(__file__), "..",
"stationPlaylist", "profiles")
- # Backup profiles to be picked up by the newly installed app module
when it starts for the first time.
+ # Import old profiles.
if os.path.exists(profiles):
- profileBackups = os.path.join(globalVars.appArgs.configPath,
"__SPLProfiles")
+ newProfiles = os.path.join(os.path.dirname(__file__),
"profiles")
try:
- shutil.copytree(profiles, profileBackups)
+ shutil.copytree(profiles, newProfiles)
except IOError:
pass

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: Project Starfish (6.0-dev): A selector to choose between starfish arms - commits-noreply