Sun, 01 Jan 2012 17:14:12 +0100
Fixed an issue configuring keyboard shortcuts.
--- a/APIs/Python3/eric5.api Sun Jan 01 16:45:41 2012 +0100 +++ b/APIs/Python3/eric5.api Sun Jan 01 17:14:12 2012 +0100 @@ -1138,7 +1138,7 @@ eric5.E5Graphics.E5GraphicsView.E5GraphicsView?1(scene, parent=None) eric5.E5Gui.E5Action.ArgumentsError?1(error) eric5.E5Gui.E5Action.E5Action.alternateShortcut?4() -eric5.E5Gui.E5Action.E5Action.setAlternateShortcut?4(shortcut) +eric5.E5Gui.E5Action.E5Action.setAlternateShortcut?4(shortcut, removeEmpty=False) eric5.E5Gui.E5Action.E5Action.setShortcut?4(shortcut) eric5.E5Gui.E5Action.E5Action.setShortcuts?4(shortcuts) eric5.E5Gui.E5Action.E5Action?1(*args)
--- a/APIs/Python3/eric5.bas Sun Jan 01 16:45:41 2012 +0100 +++ b/APIs/Python3/eric5.bas Sun Jan 01 17:14:12 2012 +0100 @@ -54,7 +54,7 @@ BrowserSysPathItem BrowserItem ChangeBookmarkCommand QUndoCommand ChatWidget QWidget Ui_ChatWidget -Class ClbrBaseClasses.Class VisibilityMixin +Class ClbrBase ClassItem UMLItem ClassScope Scope ClbrBase _ClbrBase
--- a/Documentation/Source/eric5.E5Gui.E5Action.html Sun Jan 01 16:45:41 2012 +0100 +++ b/Documentation/Source/eric5.E5Gui.E5Action.html Sun Jan 01 17:14:12 2012 +0100 @@ -195,13 +195,17 @@ </dd> </dl><a NAME="E5Action.setAlternateShortcut" ID="E5Action.setAlternateShortcut"></a> <h4>E5Action.setAlternateShortcut</h4> -<b>setAlternateShortcut</b>(<i>shortcut</i>) +<b>setAlternateShortcut</b>(<i>shortcut, removeEmpty=False</i>) <p> Public slot to set the alternative keyboard shortcut. </p><dl> <dt><i>shortcut</i></dt> <dd> the alternative accelerator (QKeySequence) +</dd><dt><i>removeEmpty</i></dt> +<dd> +flag indicating to remove the alternate shortcut, + if it is empty (boolean) </dd> </dl><a NAME="E5Action.setShortcut" ID="E5Action.setShortcut"></a> <h4>E5Action.setShortcut</h4>
--- 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): """
--- a/Preferences/ShortcutsDialog.py Sun Jan 01 16:45:41 2012 +0100 +++ b/Preferences/ShortcutsDialog.py Sun Jan 01 17:14:12 2012 +0100 @@ -357,7 +357,7 @@ for act in actions: if txt == act.objectName(): act.setShortcut(QKeySequence(itm.text(1))) - act.setAlternateShortcut(QKeySequence(itm.text(2))) + act.setAlternateShortcut(QKeySequence(itm.text(2)), removeEmpty=True) break def on_buttonBox_accepted(self):