mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04: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
@ -1360,6 +1360,7 @@ class TagsEdit(EditWithComplete, ToMetadataMixin): # {{{
|
|||||||
'or phrases, separated by commas.')
|
'or phrases, separated by commas.')
|
||||||
FIELD_NAME = 'tags'
|
FIELD_NAME = 'tags'
|
||||||
data_changed = pyqtSignal()
|
data_changed = pyqtSignal()
|
||||||
|
tag_editor_requested = pyqtSignal()
|
||||||
|
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
EditWithComplete.__init__(self, parent)
|
EditWithComplete.__init__(self, parent)
|
||||||
@ -1417,6 +1418,13 @@ class TagsEdit(EditWithComplete, ToMetadataMixin): # {{{
|
|||||||
allow_case_change=True)
|
allow_case_change=True)
|
||||||
return 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 @@ class MetadataSingleDialogBase(QDialog):
|
|||||||
self.tags_editor_button.setToolTip(_('Open Tag editor'))
|
self.tags_editor_button.setToolTip(_('Open Tag editor'))
|
||||||
self.tags_editor_button.setIcon(QIcon(I('chapters.png')))
|
self.tags_editor_button.setIcon(QIcon(I('chapters.png')))
|
||||||
self.tags_editor_button.clicked.connect(self.tags_editor)
|
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 = QToolButton(self)
|
||||||
self.clear_tags_button.setToolTip(_('Clear all tags'))
|
self.clear_tags_button.setToolTip(_('Clear all tags'))
|
||||||
self.clear_tags_button.setIcon(QIcon(I('trash.png')))
|
self.clear_tags_button.setIcon(QIcon(I('trash.png')))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user