Linux: Fix regression on Unity that prevented some keyboard shortcuts from working because of the global menu bar. Fixes #1390901 [Book Merge via Keyboard Shortcut Not Working](https://bugs.launchpad.net/calibre/+bug/1390901)

This commit is contained in:
Kovid Goyal 2014-11-09 18:50:42 +05:30
parent 07858d843a
commit feb269da46

View File

@ -258,10 +258,10 @@ class InterfaceAction(QObject):
self.gui.keyboard.register_shortcut(unique_name,
shortcut_name, default_keys=keys,
action=ac, description=description, group=self.action_spec[0])
if isosx:
# In Qt 5 keyboard shortcuts dont work unless the
# action is explicitly added to the main window
self.gui.addAction(ac)
# In Qt 5 keyboard shortcuts dont work unless the
# action is explicitly added to the main window and on OSX and
# Unity since the menu might be exported, the shortcuts wont work
self.gui.addAction(ac)
if triggered is not None:
ac.triggered.connect(triggered)
return ac