From c2b5c65756630312d42b2d1281ee189b4a7ce2ec Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Tue, 19 Feb 2013 19:36:43 +0100 Subject: [PATCH] fixed up _is_shortcut_available method --- openlp/core/utils/actions.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/openlp/core/utils/actions.py b/openlp/core/utils/actions.py index 950d654dc..c131fbc88 100644 --- a/openlp/core/utils/actions.py +++ b/openlp/core/utils/actions.py @@ -322,7 +322,6 @@ class ActionList(object): ActionList.shortcut_map[shortcuts[0]] = actions else: shortcuts.remove(shortcuts[0]) - action.setShortcuts([QtGui.QKeySequence(shortcut) for shortcut in shortcuts]) def remove_action(self, action, category=None): @@ -404,15 +403,15 @@ class ActionList(object): ``action`` The action which wants to use a particular shortcut. """ - local_context = action.shortcutContext() not in [QtCore.Qt.WindowShortcut, QtCore.Qt.ApplicationShortcut] + global_context = action.shortcutContext() in [QtCore.Qt.WindowShortcut, QtCore.Qt.ApplicationShortcut] affected_actions = [] - if local_context: + if global_context: affected_actions = filter( lambda a: isinstance(a, QtGui.QAction), self.get_all_child_objects(action.parent())) for existing_action in existing_actions: if action is existing_action: continue - if not local_context or existing_action in affected_actions: + if global_context or existing_action in affected_actions: return False if existing_action.shortcutContext() in [QtCore.Qt.WindowShortcut, QtCore.Qt.ApplicationShortcut]: return False