diff --git a/openlp/core/utils/actions.py b/openlp/core/utils/actions.py index a1b2bff38..1dc93e0d6 100644 --- a/openlp/core/utils/actions.py +++ b/openlp/core/utils/actions.py @@ -30,11 +30,16 @@ The :mod:`~openlp.core.utils.actions` module provides action list classes used by the shortcuts system. """ +import logging + from PyQt4 import QtCore, QtGui from openlp.core.lib import Settings +log = logging.getLogger(__name__) + + class ActionCategory(object): """ The :class:`~openlp.core.utils.ActionCategory` class encapsulates a category for the @@ -312,6 +317,8 @@ class ActionList(object): actions.append(action) ActionList.shortcut_map[shortcuts[1]] = actions else: + log.warn(u'Shortcut %s is removed from %s because another action already uses this shortcut.' % + (shortcuts[1], action.objectName())) shortcuts.remove(shortcuts[1]) # Check the primary shortcut. existing_actions = ActionList.shortcut_map.get(shortcuts[0], []) @@ -321,7 +328,8 @@ class ActionList(object): actions.append(action) ActionList.shortcut_map[shortcuts[0]] = actions else: - shortcuts.remove(shortcuts[0]) + log.warn(u'Shortcut %s is removed from %s because another action already uses this shortcut.' % + (shortcuts[0], action.objectName())) action.setShortcuts([QtGui.QKeySequence(shortcut) for shortcut in shortcuts]) def remove_action(self, action, category=None):