mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Cleanup previous PR
This commit is contained in:
parent
88f75bb6e4
commit
1a20d1e005
@ -79,8 +79,8 @@ class InterfaceAction(QObject):
|
||||
#: with no default key binding.
|
||||
action_spec = ('text', 'icon', None, None)
|
||||
|
||||
#: If not none, used for the name displayed to the user when customizing
|
||||
#: the keyboard shortcuts for the above action spec (self.qaction)
|
||||
#: If not None, used for the name displayed to the user when customizing
|
||||
#: the keyboard shortcuts for the above action spec instead of action_spec[0]
|
||||
action_shortcut_name = None
|
||||
|
||||
#: If True, a menu is automatically created and added to self.qaction
|
||||
@ -185,11 +185,11 @@ class InterfaceAction(QObject):
|
||||
if shortcut is not None:
|
||||
keys = ((shortcut,) if isinstance(shortcut, string_or_bytes) else
|
||||
tuple(shortcut))
|
||||
if shortcut_name is None and self.action_shortcut_name is not None:
|
||||
if shortcut_name is None:
|
||||
if self.action_shortcut_name is not None:
|
||||
shortcut_name = self.action_shortcut_name
|
||||
if not shortcut_name and spec[0]:
|
||||
elif spec[0]:
|
||||
shortcut_name = str(spec[0])
|
||||
|
||||
if shortcut_name and self.action_spec[0] and not (
|
||||
attr == 'qaction' and self.popup_type == QToolButton.ToolButtonPopupMode.InstantPopup):
|
||||
try:
|
||||
|
Loading…
x
Reference in New Issue
Block a user