Skip to content

Commit 1d78bfd

Browse files
committed
version 1.3
update code improvements
1 parent 81603f8 commit 1d78bfd

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

addon/globalPlugins/beepKeyboard.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,7 @@ def onSave(self):
7373
config.conf['beepKeyboard']['beepToggleKeyChanges'] = self.beepToggleKeyChanges.GetValue()
7474
config.conf['beepKeyboard']['announceToggleStatus'] = self.announceToggleStatus.GetValue()
7575
config.conf['beepKeyboard']['disableBeepingOnPasswordFields'] = self.disableBeepingOnPasswordFields.GetValue()
76-
if hasattr(config, "post_configProfileSwitch"):
77-
config.post_configProfileSwitch.notify()
78-
else: config.configProfileSwitched.notify()
76+
config.post_configProfileSwitch.notify()
7977

8078
class AdvancedBeepKeyboardSettingsDialog(gui.SettingsDialog):
8179
# Translators: This is the label for the beep keyboard advanced settings dialog
@@ -156,9 +154,7 @@ def onOk(self, evt):
156154
config.conf['beepKeyboard']['ignoredCharactersForShift'] = self.ignoredCharactersForShift.GetValue()
157155
config.conf['beepKeyboard']['beepForCharacters'] = self.beepForCharacters.GetValue()
158156
config.conf['beepKeyboard']['shiftedCharactersTone'], config.conf['beepKeyboard']['customCharactersTone'], config.conf['beepKeyboard']['capsLockUpperTone'], config.conf['beepKeyboard']['toggleOffTone'], config.conf['beepKeyboard']['toggleOnTone'] = self.tonesParameters
159-
if hasattr(config, "post_configProfileSwitch"):
160-
config.post_configProfileSwitch.notify()
161-
else: config.configProfileSwitched.notify()
157+
config.post_configProfileSwitch.notify()
162158
super(AdvancedBeepKeyboardSettingsDialog, self).onOk(evt)
163159

164160

@@ -167,10 +163,7 @@ def __init__(self):
167163
super(globalPluginHandler.GlobalPlugin, self).__init__()
168164
self.handleConfigProfileSwitch()
169165
gui.settingsDialogs.NVDASettingsDialog.categoryClasses.append(BeepKeyboardSettingsPanel)
170-
if hasattr(config, "post_configProfileSwitch"):
171-
config.post_configProfileSwitch.register(self.handleConfigProfileSwitch)
172-
else:
173-
config.configProfileSwitched.register(self.handleConfigProfileSwitch)
166+
config.post_configProfileSwitch.register(self.handleConfigProfileSwitch)
174167

175168
def event_typedCharacter(self, obj, nextHandler, ch):
176169
nextHandler()
@@ -194,7 +187,4 @@ def terminate(self):
194187
super(GlobalPlugin, self).terminate()
195188
self.setExternalReportToggleStatus(False)
196189
gui.settingsDialogs.NVDASettingsDialog.categoryClasses.remove(BeepKeyboardSettingsPanel)
197-
if hasattr(config, "post_configProfileSwitch"):
198-
config.post_configProfileSwitch.unregister(self.handleConfigProfileSwitch)
199-
else:
200-
config.configProfileSwitched.unregister(self.handleConfigProfileSwitch)
190+
config.post_configProfileSwitch.unregister(self.handleConfigProfileSwitch)

buildVars.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# Translators: Long description to be shown for this add-on on add-on information from add-ons manager
2020
"addon_description" : _("""This add-on beeps with some keyboard events."""),
2121
# version
22-
"addon_version" : "1.2",
22+
"addon_version" : "1.3",
2323
# Author(s)
2424
"addon_author" : u"David CM <dhf360@gmail.com>",
2525
# URL for the add-on documentation support

0 commit comments

Comments
 (0)