commit/StationPlaylist: josephsl: 6.0: Fix a critical issue related to column inclusion set.

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Tue, 24 Nov 2015 22:31:31 -0000

1 new commit in StationPlaylist:

https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/cf9ee2220ab8/
Changeset: cf9ee2220ab8
Branch: master
User: josephsl
Date: 2015-11-24 22:31:08+00:00
Summary: 6.0: Fix a critical issue related to column inclusion set.

If the profile is reset to defaults, included columns key becomes a list. Thus
manual conversion is required.
Also, when changing included columns set and then clicks cancel button, the new
set is retained. To prevent this, when cancel button is clicked from add-on
settings, clear the current included columns set.

Affected #: 1 file

diff --git a/addon/appModules/splstudio/splconfig.py
b/addon/appModules/splstudio/splconfig.py
index 240ecad..a3bc487 100755
--- a/addon/appModules/splstudio/splconfig.py
+++ b/addon/appModules/splstudio/splconfig.py
@@ -86,7 +86,9 @@ def resetAllConfig():
profile.reset()
profile.filename = profilePath
for setting in _SPLDefaults:
- profile[setting] = _SPLDefaults[setting]
+ # Convert certain settings to a different format.
+ if setting == "IncludedColumns":
profile["IncludedColumns"] = set(_SPLDefaults["IncludedColumns"])
+ else: profile[setting] = _SPLDefaults[setting]
# Translators: A dialog message shown when settings were reset to
defaults.
wx.CallAfter(gui.messageBox, _("Successfully applied default add-on
settings."),
# Translators: Title of the reset config dialog.
@@ -572,7 +574,8 @@ class SPLConfigDialog(gui.SettingsDialog):

self.columnOrderCheckbox=wx.CheckBox(self,wx.NewId(),label=_("Announce columns
in the &order shown on screen"))

self.columnOrderCheckbox.SetValue(SPLConfig["UseScreenColumnOrder"])
self.columnOrder = SPLConfig["ColumnOrder"]
- self.includedColumns = SPLConfig["IncludedColumns"]
+ # Without manual conversion below, it produces a rare bug where
clicking cancel after changing column inclusion causes new set to be retained.
+ self.includedColumns = set(SPLConfig["IncludedColumns"])
settingsSizer.Add(self.columnOrderCheckbox,
border=10,flag=wx.BOTTOM)
# Translators: The label of a button to manage column
announcements.
item = manageColumnsButton = wx.Button(self, label=_("&Manage
track column announcements..."))
@@ -656,6 +659,7 @@ class SPLConfigDialog(gui.SettingsDialog):

def onCancel(self, evt):
global _configDialogOpened, SPLActiveProfile, SPLSwitchProfile,
SPLConfig
+ self.includedColumns.clear()
SPLActiveProfile = self.activeProfile
if self.switchProfileRenamed or self.switchProfileDeleted:
SPLSwitchProfile = self.switchProfile
@@ -1107,7 +1111,10 @@ class ColumnAnnouncementsDialog(wx.Dialog):
parent.includedColumns.add("Title")
for checkbox in self.checkedColumns:
action = parent.includedColumns.add if checkbox.Value
else parent.includedColumns.remove
- action(checkbox.Label)
+ try:
+ action(checkbox.Label)
+ except KeyError:
+ pass
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.

Other related posts:

  • » commit/StationPlaylist: josephsl: 6.0: Fix a critical issue related to column inclusion set. - commits-noreply