mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
853e49d770
commit
610c65e7ab
@ -173,7 +173,9 @@ class InterfaceAction(QObject):
|
||||
return action
|
||||
|
||||
def create_menu_action(self, menu, unique_name, text, icon=None, shortcut=None,
|
||||
description=None, triggered=None):
|
||||
description=None, triggered=None, shortcut_name=None):
|
||||
if shortcut_name is None:
|
||||
shortcut_name = unicode(text)
|
||||
ac = menu.addAction(text)
|
||||
if icon is not None:
|
||||
if not isinstance(icon, QIcon):
|
||||
@ -191,7 +193,7 @@ class InterfaceAction(QObject):
|
||||
|
||||
if shortcut is not False:
|
||||
self.gui.keyboard.register_shortcut(unique_name,
|
||||
unicode(text), default_keys=keys,
|
||||
shortcut_name, default_keys=keys,
|
||||
action=ac, description=description, group=self.action_spec[0])
|
||||
if triggered is not None:
|
||||
ac.triggered.connect(triggered)
|
||||
|
Loading…
x
Reference in New Issue
Block a user