Configure Custom shortcut error fix

This commit is contained in:
John Morris 2019-11-01 11:04:44 +00:00 committed by Tim Bentley
parent 2d0254f45a
commit 2f94f35a42

View File

@ -323,16 +323,23 @@ class ShortcutListForm(QtWidgets.QDialog, Ui_ShortcutListDialog, RegistryPropert
if not toggled: if not toggled:
return return
action = self._current_item_action() action = self._current_item_action()
shortcuts = self._action_shortcuts(action) if action is None:
self.refresh_shortcut_list() QtWidgets.QMessageBox.information(self, translate('OpenLP.ShortcutListForm', 'Select an Action'),
primary_button_text = '' translate('OpenLP.ShortcutListForm', 'Select an action and click one '
alternate_button_text = '' 'of the buttons below to start '
if shortcuts: 'capturing a new primary or alternate shortcut, respectively.'))
primary_button_text = self.get_shortcut_string(shortcuts[0], for_display=True)
if len(shortcuts) == 2: else:
alternate_button_text = self.get_shortcut_string(shortcuts[1], for_display=True) shortcuts = self._action_shortcuts(action)
self.primary_push_button.setText(primary_button_text) self.refresh_shortcut_list()
self.alternate_push_button.setText(alternate_button_text) 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):
""" """