Fix a weird issue with the 'clear alternate shortcut' button clearing both

This commit is contained in:
Raoul Snyman 2016-02-02 23:56:03 +02:00
parent f6c2a5b410
commit 5928fde62e

View File

@ -320,9 +320,17 @@ class ShortcutListForm(QtWidgets.QDialog, Ui_ShortcutListDialog, RegistryPropert
""" """
if not toggled: if not toggled:
return return
self.on_primary_push_button_clicked(False) action = self._current_item_action()
self.on_alternate_push_button_clicked(False) shortcuts = self._action_shortcuts(action)
self.refresh_shortcut_list() self.refresh_shortcut_list()
primary_button_text = ''
alternate_button_text = ''
if shortcuts:
primary_button_text = self.get_shortcut_string(shortcuts[0], for_display=True)
if len(shortcuts) == 2:
alternate_button_text = self.get_shortcut_string(shortcuts[1], for_display=True)
self.primary_push_button.setText(primary_button_text)
self.alternate_push_button.setText(alternate_button_text)
def save(self): def save(self):
""" """
@ -371,6 +379,7 @@ class ShortcutListForm(QtWidgets.QDialog, Ui_ShortcutListDialog, RegistryPropert
""" """
Restore the defaults of this action. Restore the defaults of this action.
""" """
print('Alternate button clicked')
self.alternate_push_button.setChecked(False) self.alternate_push_button.setChecked(False)
action = self._current_item_action() action = self._current_item_action()
if action is None: if action is None: