--- a/E5Gui/E5Action.py Fri Dec 30 15:21:21 2011 +0100 +++ b/E5Gui/E5Action.py Sun Jan 01 17:16:40 2012 +0100 @@ -103,11 +103,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() @@ -117,6 +119,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): """