--- a/E5Gui/E5Action.py Sun Jan 01 16:45:41 2012 +0100 +++ b/E5Gui/E5Action.py Sun Jan 01 17:14:12 2012 +0100 @@ -105,11 +105,13 @@ self.__ammendToolTip() - def setAlternateShortcut(self, shortcut): + def setAlternateShortcut(self, shortcut, removeEmpty=False): """ Public slot to set the alternative keyboard shortcut. @param shortcut the alternative accelerator (QKeySequence) + @param removeEmpty flag indicating to remove the alternate shortcut, + if it is empty (boolean) """ if not shortcut.isEmpty(): shortcuts = self.shortcuts() @@ -119,6 +121,11 @@ else: shortcuts[1] = shortcut self.setShortcuts(shortcuts) + elif removeEmpty: + shortcuts = self.shortcuts() + if len(shortcuts) == 2: + del shortcuts[1] + self.setShortcuts(shortcuts) def alternateShortcut(self): """