mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-24 23:36:02 +01:00
Allow pressing F2 in the tags field of the edit metadata dialog to launch the tags editor
This commit is contained in:
parent
871a3ec922
commit
4a574c1a0f
2 changed files with 9 additions and 0 deletions
|
|
@ -1360,6 +1360,7 @@ class TagsEdit(EditWithComplete, ToMetadataMixin): # {{{
|
|||
'or phrases, separated by commas.')
|
||||
FIELD_NAME = 'tags'
|
||||
data_changed = pyqtSignal()
|
||||
tag_editor_requested = pyqtSignal()
|
||||
|
||||
def __init__(self, parent):
|
||||
EditWithComplete.__init__(self, parent)
|
||||
|
|
@ -1417,6 +1418,13 @@ def commit(self, db, id_):
|
|||
allow_case_change=True)
|
||||
return True
|
||||
|
||||
def keyPressEvent(self, ev):
|
||||
if ev.key() == Qt.Key_F2:
|
||||
self.tag_editor_requested.emit()
|
||||
ev.accept()
|
||||
return
|
||||
return EditWithComplete.keyPressEvent(self, ev)
|
||||
|
||||
# }}}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -235,6 +235,7 @@ def mouseReleaseEvent(self, ev):
|
|||
self.tags_editor_button.setToolTip(_('Open Tag editor'))
|
||||
self.tags_editor_button.setIcon(QIcon(I('chapters.png')))
|
||||
self.tags_editor_button.clicked.connect(self.tags_editor)
|
||||
self.tags.tag_editor_requested.connect(self.tags_editor)
|
||||
self.clear_tags_button = QToolButton(self)
|
||||
self.clear_tags_button.setToolTip(_('Clear all tags'))
|
||||
self.clear_tags_button.setIcon(QIcon(I('trash.png')))
|
||||
|
|
|
|||
Loading…
Reference in a new issue