Skip to content

Commit

Permalink
Change labels of check boxes in the add-on prefs panel to make the se…
Browse files Browse the repository at this point in the history
…ttings more clear. Also essentially reverse the check boxes so that existing settings remain compatible. Fixes #5
  • Loading branch information
Bryn committed Apr 4, 2023
1 parent 6fdc0b8 commit 732a091
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions addon/globalPlugins/Unspoken/addonGui.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,33 @@ class SettingsPanel(gui.SettingsPanel):
title = "Unspoken"
def makeSettings(self, settingsSizer):
settingsSizer = guiHelper.BoxSizerHelper(self, sizer=settingsSizer)
self.sayAllCheckBox = settingsSizer.addItem(wx.CheckBox(self, label="&Disable in say all"))
self.sayAllCheckBox.SetValue(config.conf["unspoken"]["sayAll"])
self.sayAllCheckBox = settingsSizer.addItem(wx.CheckBox(self, label="&Play sounds during say all"))
self.sayAllCheckBox.SetValue((True if config.conf["unspoken"]["sayAll"]==False else False))
self.speakRolesCheckBox = settingsSizer.addItem(wx.CheckBox(self, label="&Speak object roles"))
self.speakRolesCheckBox.SetValue(config.conf["unspoken"]["speakRoles"])
self.HRTFCheckBox = settingsSizer.addItem(wx.CheckBox(self, label="Enable &HRTF"))
self.HRTFCheckBox = settingsSizer.addItem(wx.CheckBox(self, label="Use &HRTF (3D Sound)"))
self.HRTFCheckBox.SetValue(config.conf["unspoken"]["HRTF"])
self.ReverbCheckBox = settingsSizer.addItem(wx.CheckBox(self, label="Enable &Reverb (Requires NVDA Restart)"))
self.ReverbCheckBox = settingsSizer.addItem(wx.CheckBox(self, label="Use &Reverb (Requires NVDA Restart)"))
self.ReverbCheckBox.SetValue(config.conf["unspoken"]["Reverb"])
self.ReverbLevelSliderLabel = settingsSizer.addItem(wx.StaticText(self, label="Reverb Level"))
self.ReverbLevelSlider = settingsSizer.addItem(wx.Slider(self))
self.ReverbLevelSlider.SetValue(config.conf["unspoken"]["ReverbLevel"]*100)
self.ReverbTimeSliderLabel = settingsSizer.addItem(wx.StaticText(self, label="Reverb Time"))
self.ReverbTimeSlider = settingsSizer.addItem(wx.Slider(self))
self.ReverbTimeSlider.SetValue(config.conf["unspoken"]["ReverbTime"]*100)
self.noSoundsCheckBox = settingsSizer.addItem(wx.CheckBox(self, label="Don't &play sounds for roles"))
self.noSoundsCheckBox.SetValue(config.conf["unspoken"]["noSounds"])
self.noSoundsCheckBox = settingsSizer.addItem(wx.CheckBox(self, label="&play sounds for roles (Enable Add-On)"))
self.noSoundsCheckBox.SetValue((True if config.conf["unspoken"]["noSounds"]==False else False))
self.volumeCheckBox = settingsSizer.addItem(wx.CheckBox(self, label="Automatically adjust sounds with speech &volume"))
self.volumeCheckBox.SetValue(config.conf["unspoken"]["volumeAdjust"])

def postInit(self):
self.sayAllCheckBox.SetFocus()

def onSave(self):
if self.noSoundsCheckBox.IsChecked() and not self.speakRolesCheckBox.IsChecked():
if not self.noSoundsCheckBox.IsChecked() and not self.speakRolesCheckBox.IsChecked():
gui.messageBox("Disabling both sounds and speaking is not allowed. NVDA will not say roles like button and checkbox, and sounds won't play either. Please change one of these settings", "Error")
return
config.conf["unspoken"]["sayAll"] = self.sayAllCheckBox.IsChecked()
config.conf["unspoken"]["sayAll"] = not self.sayAllCheckBox.IsChecked()
config.conf["unspoken"]["speakRoles"] = self.speakRolesCheckBox.IsChecked()
sound.context.default_panner_strategy.value=synthizer.PannerStrategy.STEREO if not config.conf['unspoken']['HRTF'] else synthizer.PannerStrategy.HRTF
config.conf["unspoken"]["HRTF"] = self.HRTFCheckBox.IsChecked()
Expand All @@ -43,5 +43,5 @@ def onSave(self):
sound.reverb.gain.value=config.conf["unspoken"]["ReverbLevel"]
config.conf["unspoken"]["ReverbTime"] = self.ReverbTimeSlider.GetValue()/100
sound.reverb.t60.value=config.conf["unspoken"]["ReverbTime"]
config.conf["unspoken"]["noSounds"] = self.noSoundsCheckBox.IsChecked()
config.conf["unspoken"]["noSounds"] = not self.noSoundsCheckBox.IsChecked()
config.conf["unspoken"]["volumeAdjust"] = self.volumeCheckBox.IsChecked()
2 changes: 1 addition & 1 deletion buildVars.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# Translators: Long description to be shown for this add-on on add-on information from add-ons manager
"addon_description" : _("""Adds 3D audio for controls and replaces control messages. This updated version uses Synthizer and is compatible with NVDA 2022.1."""),
# version
"addon_version" : "0.9.5",
"addon_version" : "0.9.6",
# Author(s)
"addon_author" : "Camlorn <[email protected]>, Bryan Smart< [email protected]>, Masonasons <[email protected]>",
# URL for the add-on documentation support
Expand Down

0 comments on commit 732a091

Please sign in to comment.