mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Edit metadata dialog: Add a keyboard shortcut to swap title and author [Alt+Down]. Fixes #1397701 [[Enhancement]](https://bugs.launchpad.net/calibre/+bug/1397701)
This commit is contained in:
parent
45656eb50c
commit
cfff3734da
@ -63,6 +63,8 @@ class MetadataSingleDialogBase(ResizableDialog):
|
|||||||
sc = p.keyboard.keys_map.get(kname, None)
|
sc = p.keyboard.keys_map.get(kname, None)
|
||||||
if sc:
|
if sc:
|
||||||
self.download_shortcut.setKey(sc[0])
|
self.download_shortcut.setKey(sc[0])
|
||||||
|
self.swap_title_author_shortcut = s = QShortcut(self)
|
||||||
|
s.setKey(QKeySequence('Alt+Down', QKeySequence.PortableText))
|
||||||
|
|
||||||
self.button_box = bb = QDialogButtonBox(self)
|
self.button_box = bb = QDialogButtonBox(self)
|
||||||
self.button_box.accepted.connect(self.accept)
|
self.button_box.accepted.connect(self.accept)
|
||||||
@ -164,8 +166,9 @@ class MetadataSingleDialogBase(ResizableDialog):
|
|||||||
self.swap_title_author_button = QToolButton(self)
|
self.swap_title_author_button = QToolButton(self)
|
||||||
self.swap_title_author_button.setIcon(QIcon(I('swap.png')))
|
self.swap_title_author_button.setIcon(QIcon(I('swap.png')))
|
||||||
self.swap_title_author_button.setToolTip(_(
|
self.swap_title_author_button.setToolTip(_(
|
||||||
'Swap the author and title'))
|
'Swap the author and title') + ' [%s]' % self.swap_title_author_shortcut.key().toString(QKeySequence.NativeText))
|
||||||
self.swap_title_author_button.clicked.connect(self.swap_title_author)
|
self.swap_title_author_button.clicked.connect(self.swap_title_author)
|
||||||
|
self.swap_title_author_shortcut.activated.connect(self.swap_title_author_button.click)
|
||||||
|
|
||||||
self.manage_authors_button = QToolButton(self)
|
self.manage_authors_button = QToolButton(self)
|
||||||
self.manage_authors_button.setIcon(QIcon(I('user_profile.png')))
|
self.manage_authors_button.setIcon(QIcon(I('user_profile.png')))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user