3 new commits in StationPlaylist:
https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/9768f29d8ed3/
Changeset: 9768f29d8ed3
Branch: None
User: josephsl
Date: 2016-01-29 08:20:07+00:00
Summary: Status announcements dialog (7.0-dev): Officially replace status
announcement controls in main add-ons dialog with say status flags.
Affected #: 1 file
diff --git a/addon/appModules/splstudio/splconfig.py
b/addon/appModules/splstudio/splconfig.py
index 4c52286..94f11ef 100755
--- a/addon/appModules/splstudio/splconfig.py
+++ b/addon/appModules/splstudio/splconfig.py
@@ -1022,49 +1022,11 @@ class SPLConfigDialog(gui.SettingsDialog):
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"))
-
self.scheduledForCheckbox.SetValue(SPLConfig["SayStatus"]["SayScheduledFor"])
+ # Say status flags to be picked up by the dialog of this name.
self.scheduledFor = SPLConfig["SayStatus"]["SayScheduledFor"]
- self.scheduledForCheckbox.Hide()
- settingsSizer.Add(self.scheduledForCheckbox,
border=10,flag=wx.BOTTOM)
-
- # Translators: the label for a setting in SPL add-on settings
to announce listener count.
-
self.listenerCountCheckbox=wx.CheckBox(self,wx.NewId(),label=_("Announce
&listener count"))
-
self.listenerCountCheckbox.SetValue(SPLConfig["SayStatus"]["SayListenerCount"])
self.listenerCount = SPLConfig["SayStatus"]["SayListenerCount"]
- self.listenerCountCheckbox.Hide()
- settingsSizer.Add(self.listenerCountCheckbox,
border=10,flag=wx.BOTTOM)
-
- # Translators: the label for a setting in SPL add-on settings
to announce currently playing cart.
-
self.cartNameCheckbox=wx.CheckBox(self,wx.NewId(),label=_("&Announce name of
the currently playing cart"))
-
self.cartNameCheckbox.SetValue(SPLConfig["SayStatus"]["SayPlayingCartName"])
self.cartName = SPLConfig["SayStatus"]["SayPlayingCartName"]
- self.cartNameCheckbox.Hide()
- settingsSizer.Add(self.cartNameCheckbox,
border=10,flag=wx.BOTTOM)
-
- sizer = wx.BoxSizer(wx.HORIZONTAL)
- # Translators: the label for a setting in SPL add-on settings
to announce currently playing track name.
- label = wx.StaticText(self, wx.ID_ANY, label=_("&Track name
announcement:"))
- # Translators: One of the track name announcement options.
- self.trackAnnouncements=[("True",_("automatic")),
- # Translators: One of the track name announcement options.
- ("Background",_("while using other programs")),
- # Translators: One of the track name announcement options.
- ("False",_("off"))]
- self.trackAnnouncementList= wx.Choice(self, wx.ID_ANY,
choices=[x[1] for x in self.trackAnnouncements])
- trackAnnouncement=SPLConfig["SayStatus"]["SayPlayingTrackName"]
self.playingTrackName =
SPLConfig["SayStatus"]["SayPlayingTrackName"]
- selection = (x for x,y in enumerate(self.trackAnnouncements) if
y[0]==trackAnnouncement).next()
- try:
- self.trackAnnouncementList.SetSelection(selection)
- except:
- pass
- label.Hide()
- self.trackAnnouncementList.Hide()
- sizer.Add(label)
- sizer.Add(self.trackAnnouncementList)
- settingsSizer.Add(sizer, 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 = sayStatusButton = wx.Button(self, label=_("&Status
announcements..."))
@@ -1113,10 +1075,10 @@ class SPLConfigDialog(gui.SettingsDialog):
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
- SPLConfig["SayStatus"]["SayPlayingTrackName"] =
self.trackAnnouncements[self.trackAnnouncementList.GetSelection()][0]
+ SPLConfig["SayStatus"]["SayScheduledFor"] = self.scheduledFor
+ SPLConfig["SayStatus"]["SayListenerCount"] = self.listenerCount
+ SPLConfig["SayStatus"]["SayPlayingCartName"] = self.cartName
+ SPLConfig["SayStatus"]["SayPlayingTrackName"] =
self.playingTrackName
SPLConfig["Advanced"]["SPLConPassthrough"] =
self.splConPassthrough
SPLConfig["Advanced"]["CompatibilityLayer"] = self.compLayer
SPLConfig["Update"]["AutoUpdateCheck"] = self.autoUpdateCheck
@@ -1934,24 +1896,34 @@ class SayStatusDialog(wx.Dialog):
# 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"))
-
self.scheduledForCheckbox.SetValue(self.Parent.scheduledForCheckbox.Value)
+ self.scheduledForCheckbox.SetValue(parent.scheduledFor)
mainSizer.Add(self.scheduledForCheckbox,
border=10,flag=wx.BOTTOM)
# Translators: the label for a setting in SPL add-on settings
to announce listener count.
self.listenerCountCheckbox=wx.CheckBox(self,wx.NewId(),label=_("Announce
&listener count"))
-
self.listenerCountCheckbox.SetValue(self.Parent.listenerCountCheckbox.Value)
+ self.listenerCountCheckbox.SetValue(parent.listenerCount)
mainSizer.Add(self.listenerCountCheckbox,
border=10,flag=wx.BOTTOM)
# Translators: the label for a setting in SPL add-on settings
to announce currently playing cart.
self.cartNameCheckbox=wx.CheckBox(self,wx.NewId(),label=_("&Announce name of
the currently playing cart"))
-
self.cartNameCheckbox.SetValue(self.Parent.cartNameCheckbox.Value)
+ self.cartNameCheckbox.SetValue(parent.cartName)
mainSizer.Add(self.cartNameCheckbox, border=10,flag=wx.BOTTOM)
sizer = wx.BoxSizer(wx.HORIZONTAL)
# Translators: the label for a setting in SPL add-on settings
to announce currently playing track name.
label = wx.StaticText(self, wx.ID_ANY, label=_("&Track name
announcement:"))
- self.trackAnnouncementList= wx.Choice(self, wx.ID_ANY,
choices=[x[1] for x in self.Parent.trackAnnouncements])
-
self.trackAnnouncementList.SetSelection(self.Parent.trackAnnouncementList.GetSelection())
+ # Translators: One of the track name announcement options.
+ self.trackAnnouncements=[("True",_("automatic")),
+ # Translators: One of the track name announcement options.
+ ("Background",_("while using other programs")),
+ # Translators: One of the track name announcement options.
+ ("False",_("off"))]
+ self.trackAnnouncementList= wx.Choice(self, wx.ID_ANY,
choices=[x[1] for x in self.trackAnnouncements])
+ selection = (x for x,y in enumerate(self.trackAnnouncements) if
y[0]==parent.playingTrackName).next()
+ try:
+ self.trackAnnouncementList.SetSelection(selection)
+ except:
+ pass
sizer.Add(label)
sizer.Add(self.trackAnnouncementList)
mainSizer.Add(sizer, border=10, flag=wx.BOTTOM)
@@ -1966,10 +1938,10 @@ class SayStatusDialog(wx.Dialog):
def onOk(self, evt):
parent = self.Parent
-
parent.scheduledForCheckbox.SetValue(self.scheduledForCheckbox.Value)
-
parent.listenerCountCheckbox.SetValue(self.listenerCountCheckbox.Value)
- parent.cartNameCheckbox.SetValue(self.cartNameCheckbox.Value)
-
parent.trackAnnouncementList.SetSelection(self.trackAnnouncementList.GetSelection())
+ parent.scheduledFor = self.scheduledForCheckbox.Value
+ parent.listenerCount = self.listenerCountCheckbox.Value
+ parent.cartName = self.cartNameCheckbox.Value
+ parent.playingTrackName =
self.trackAnnouncements[self.trackAnnouncementList.GetSelection()][0]
parent.profiles.SetFocus()
parent.Enable()
self.Destroy()
https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/4ffee53bf1a2/
Changeset: 4ffee53bf1a2
Branch: None
User: josephsl
Date: 2016-01-30 01:53:10+00:00
Summary: Merge branch 'master' into 7.0/azureTriggersUI
Affected #: 1 file
diff --git a/addon/appModules/splstudio/splconfig.py
b/addon/appModules/splstudio/splconfig.py
index 358de2c..685d3ed 100755
--- a/addon/appModules/splstudio/splconfig.py
+++ b/addon/appModules/splstudio/splconfig.py
@@ -1022,49 +1022,11 @@ class SPLConfigDialog(gui.SettingsDialog):
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"))
-
self.scheduledForCheckbox.SetValue(SPLConfig["SayStatus"]["SayScheduledFor"])
+ # Say status flags to be picked up by the dialog of this name.
self.scheduledFor = SPLConfig["SayStatus"]["SayScheduledFor"]
- self.scheduledForCheckbox.Hide()
- settingsSizer.Add(self.scheduledForCheckbox,
border=10,flag=wx.BOTTOM)
-
- # Translators: the label for a setting in SPL add-on settings
to announce listener count.
-
self.listenerCountCheckbox=wx.CheckBox(self,wx.NewId(),label=_("Announce
&listener count"))
-
self.listenerCountCheckbox.SetValue(SPLConfig["SayStatus"]["SayListenerCount"])
self.listenerCount = SPLConfig["SayStatus"]["SayListenerCount"]
- self.listenerCountCheckbox.Hide()
- settingsSizer.Add(self.listenerCountCheckbox,
border=10,flag=wx.BOTTOM)
-
- # Translators: the label for a setting in SPL add-on settings
to announce currently playing cart.
-
self.cartNameCheckbox=wx.CheckBox(self,wx.NewId(),label=_("&Announce name of
the currently playing cart"))
-
self.cartNameCheckbox.SetValue(SPLConfig["SayStatus"]["SayPlayingCartName"])
self.cartName = SPLConfig["SayStatus"]["SayPlayingCartName"]
- self.cartNameCheckbox.Hide()
- settingsSizer.Add(self.cartNameCheckbox,
border=10,flag=wx.BOTTOM)
-
- sizer = wx.BoxSizer(wx.HORIZONTAL)
- # Translators: the label for a setting in SPL add-on settings
to announce currently playing track name.
- label = wx.StaticText(self, wx.ID_ANY, label=_("&Track name
announcement:"))
- # Translators: One of the track name announcement options.
- self.trackAnnouncements=[("True",_("automatic")),
- # Translators: One of the track name announcement options.
- ("Background",_("while using other programs")),
- # Translators: One of the track name announcement options.
- ("False",_("off"))]
- self.trackAnnouncementList= wx.Choice(self, wx.ID_ANY,
choices=[x[1] for x in self.trackAnnouncements])
- trackAnnouncement=SPLConfig["SayStatus"]["SayPlayingTrackName"]
self.playingTrackName =
SPLConfig["SayStatus"]["SayPlayingTrackName"]
- selection = (x for x,y in enumerate(self.trackAnnouncements) if
y[0]==trackAnnouncement).next()
- try:
- self.trackAnnouncementList.SetSelection(selection)
- except:
- pass
- label.Hide()
- self.trackAnnouncementList.Hide()
- sizer.Add(label)
- sizer.Add(self.trackAnnouncementList)
- settingsSizer.Add(sizer, 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 = sayStatusButton = wx.Button(self, label=_("&Status
announcements..."))
@@ -1113,10 +1075,10 @@ class SPLConfigDialog(gui.SettingsDialog):
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
- SPLConfig["SayStatus"]["SayPlayingTrackName"] =
self.trackAnnouncements[self.trackAnnouncementList.GetSelection()][0]
+ SPLConfig["SayStatus"]["SayScheduledFor"] = self.scheduledFor
+ SPLConfig["SayStatus"]["SayListenerCount"] = self.listenerCount
+ SPLConfig["SayStatus"]["SayPlayingCartName"] = self.cartName
+ SPLConfig["SayStatus"]["SayPlayingTrackName"] =
self.playingTrackName
SPLConfig["Advanced"]["SPLConPassthrough"] =
self.splConPassthrough
SPLConfig["Advanced"]["CompatibilityLayer"] = self.compLayer
SPLConfig["Update"]["AutoUpdateCheck"] = self.autoUpdateCheck
@@ -1965,24 +1927,34 @@ class SayStatusDialog(wx.Dialog):
# 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"))
-
self.scheduledForCheckbox.SetValue(self.Parent.scheduledForCheckbox.Value)
+ self.scheduledForCheckbox.SetValue(parent.scheduledFor)
mainSizer.Add(self.scheduledForCheckbox,
border=10,flag=wx.BOTTOM)
# Translators: the label for a setting in SPL add-on settings
to announce listener count.
self.listenerCountCheckbox=wx.CheckBox(self,wx.NewId(),label=_("Announce
&listener count"))
-
self.listenerCountCheckbox.SetValue(self.Parent.listenerCountCheckbox.Value)
+ self.listenerCountCheckbox.SetValue(parent.listenerCount)
mainSizer.Add(self.listenerCountCheckbox,
border=10,flag=wx.BOTTOM)
# Translators: the label for a setting in SPL add-on settings
to announce currently playing cart.
self.cartNameCheckbox=wx.CheckBox(self,wx.NewId(),label=_("&Announce name of
the currently playing cart"))
-
self.cartNameCheckbox.SetValue(self.Parent.cartNameCheckbox.Value)
+ self.cartNameCheckbox.SetValue(parent.cartName)
mainSizer.Add(self.cartNameCheckbox, border=10,flag=wx.BOTTOM)
sizer = wx.BoxSizer(wx.HORIZONTAL)
# Translators: the label for a setting in SPL add-on settings
to announce currently playing track name.
label = wx.StaticText(self, wx.ID_ANY, label=_("&Track name
announcement:"))
- self.trackAnnouncementList= wx.Choice(self, wx.ID_ANY,
choices=[x[1] for x in self.Parent.trackAnnouncements])
-
self.trackAnnouncementList.SetSelection(self.Parent.trackAnnouncementList.GetSelection())
+ # Translators: One of the track name announcement options.
+ self.trackAnnouncements=[("True",_("automatic")),
+ # Translators: One of the track name announcement options.
+ ("Background",_("while using other programs")),
+ # Translators: One of the track name announcement options.
+ ("False",_("off"))]
+ self.trackAnnouncementList= wx.Choice(self, wx.ID_ANY,
choices=[x[1] for x in self.trackAnnouncements])
+ selection = (x for x,y in enumerate(self.trackAnnouncements) if
y[0]==parent.playingTrackName).next()
+ try:
+ self.trackAnnouncementList.SetSelection(selection)
+ except:
+ pass
sizer.Add(label)
sizer.Add(self.trackAnnouncementList)
mainSizer.Add(sizer, border=10, flag=wx.BOTTOM)
@@ -1997,10 +1969,10 @@ class SayStatusDialog(wx.Dialog):
def onOk(self, evt):
parent = self.Parent
-
parent.scheduledForCheckbox.SetValue(self.scheduledForCheckbox.Value)
-
parent.listenerCountCheckbox.SetValue(self.listenerCountCheckbox.Value)
- parent.cartNameCheckbox.SetValue(self.cartNameCheckbox.Value)
-
parent.trackAnnouncementList.SetSelection(self.trackAnnouncementList.GetSelection())
+ parent.scheduledFor = self.scheduledForCheckbox.Value
+ parent.listenerCount = self.listenerCountCheckbox.Value
+ parent.cartName = self.cartNameCheckbox.Value
+ parent.playingTrackName =
self.trackAnnouncements[self.trackAnnouncementList.GetSelection()][0]
parent.profiles.SetFocus()
parent.Enable()
self.Destroy()
https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/42cdee8678e2/
Changeset: 42cdee8678e2
Branch: 7.0/azureTriggersUI
User: josephsl
Date: 2016-01-30 02:27:06+00:00
Summary: Triggers UI (7.0-dev): Checkbox values are now honored.
The checkboxes in triggers dialog are now honored. Specifically:
* Instant switch: copied instant switch checkbox handler from add-on settings
with silght modifications.
* Time-based: Check a case where the checkbox is checked yet no switch date(s)
are specified. Also, time-switch flag will be modified based on the value of
the checkbox as opposed to switch date bits.
Affected #: 1 file
diff --git a/addon/appModules/splstudio/splconfig.py
b/addon/appModules/splstudio/splconfig.py
index 685d3ed..955498d 100755
--- a/addon/appModules/splstudio/splconfig.py
+++ b/addon/appModules/splstudio/splconfig.py
@@ -1579,27 +1579,44 @@ class TriggersDialog(wx.Dialog):
def onOk(self, evt):
global SPLTriggerProfile, triggerTimer
parent = self.Parent
- bit = 0
- for day in self.triggerDays:
- if day.Value: bit+=64 >> self.triggerDays.index(day)
- if bit:
- hour, min = self.hourEntry.GetValue(),
self.minEntry.GetValue()
- duration = self.durationEntry.GetValue()
- if duplicateExists(parent._profileTriggersConfig,
self.profile, bit, hour, min, duration):
- gui.messageBox(_("A profile trigger already
exists for the entered time slot. Please choose a different date or time."),
+ # Handle instant switch checkbox.
+ if self.instantSwitchCheckbox.Value:
+ if parent.switchProfile is not None and (self.profile
!= parent.switchProfile):
+ # Instant switch flag is set on another
profile, so remove the flag first.
+
parent.setProfileFlags(parent.profileNames.index(parent.switchProfile),
"discard", _("instant switch"))
+ parent.setProfileFlags(self.selection, "add",
_("instant switch"))
+ parent.switchProfile = self.profile
+ else:
+ parent.switchProfile = None
+ parent.setProfileFlags(self.selection, "discard",
_("instant switch"))
+ # Now time-based profile checkbox.
+ if self.timeSwitchCheckbox.Value:
+ bit = 0
+ for day in self.triggerDays:
+ if day.Value: bit+=64 >>
self.triggerDays.index(day)
+ if bit:
+ hour, min = self.hourEntry.GetValue(),
self.minEntry.GetValue()
+ duration = self.durationEntry.GetValue()
+ if
duplicateExists(parent._profileTriggersConfig, self.profile, bit, hour, min,
duration):
+ gui.messageBox(_("A profile trigger
already exists for the entered time slot. Please choose a different date or
time."),
+ _("Error"), wx.OK |
wx.ICON_ERROR, self)
+ return
+ # Change display name if there is no profile of
this name registered.
+ # This helps in preventing unnecessary calls to
profile flags retriever, a huge time and memory savings.
+ # Otherwise trigger flag will be added each
time this is called (either this handler or the add-on settings' flags
retriever must retrieve the flags set).
+ if not self.profile in
parent._profileTriggersConfig:
+ parent.setProfileFlags(self.selection,
"add", _("time-based"))
+ parent._profileTriggersConfig[self.profile] =
setNextTimedProfile(self.profile, bit, datetime.time(hour, min))
+ parent._profileTriggersConfig[self.profile][6]
= duration
+ else:
+ # Er, did you specify a date?
+ gui.messageBox(_("The time-based profile
checkbox is checked but no switch dates are given. Please either specify switch
date(s) or uncheck time-based profile checkbox."),
_("Error"), wx.OK | wx.ICON_ERROR, self)
return
- # Change display name if there is no profile of this
name registered.
- # This helps in preventing unnecessary calls to profile
flags retriever, a huge time and memory savings.
- # Otherwise trigger flag will be added each time this
is called (either this handler or the add-on settings' flags retriever must
retrieve the flags set).
- if not self.profile in parent._profileTriggersConfig:
- parent.setProfileFlags(self.selection, "add",
"time-based")
- parent._profileTriggersConfig[self.profile] =
setNextTimedProfile(self.profile, bit, datetime.time(hour, min))
- parent._profileTriggersConfig[self.profile][6] =
duration
- elif bit == 0 and self.profile in
self.Parent._profileTriggersConfig:
+ elif not self.timeSwitchCheckbox.Value and self.profile in
self.Parent._profileTriggersConfig:
del parent._profileTriggersConfig[self.profile]
# Calling set profile flags with discard argument is
always safe here.
- parent.setProfileFlags(self.selection, "discard",
"time-based")
+ parent.setProfileFlags(self.selection, "discard",
_("time-based"))
parent.profiles.SetFocus()
parent.Enable()
self.Destroy()
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.