@@ -73,9 +73,7 @@ def onSave(self):
73
73
config .conf ['beepKeyboard' ]['beepToggleKeyChanges' ] = self .beepToggleKeyChanges .GetValue ()
74
74
config .conf ['beepKeyboard' ]['announceToggleStatus' ] = self .announceToggleStatus .GetValue ()
75
75
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 ()
79
77
80
78
class AdvancedBeepKeyboardSettingsDialog (gui .SettingsDialog ):
81
79
# Translators: This is the label for the beep keyboard advanced settings dialog
@@ -156,9 +154,7 @@ def onOk(self, evt):
156
154
config .conf ['beepKeyboard' ]['ignoredCharactersForShift' ] = self .ignoredCharactersForShift .GetValue ()
157
155
config .conf ['beepKeyboard' ]['beepForCharacters' ] = self .beepForCharacters .GetValue ()
158
156
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 ()
162
158
super (AdvancedBeepKeyboardSettingsDialog , self ).onOk (evt )
163
159
164
160
@@ -167,10 +163,7 @@ def __init__(self):
167
163
super (globalPluginHandler .GlobalPlugin , self ).__init__ ()
168
164
self .handleConfigProfileSwitch ()
169
165
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 )
174
167
175
168
def event_typedCharacter (self , obj , nextHandler , ch ):
176
169
nextHandler ()
@@ -194,7 +187,4 @@ def terminate(self):
194
187
super (GlobalPlugin , self ).terminate ()
195
188
self .setExternalReportToggleStatus (False )
196
189
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 )
0 commit comments