mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-11 09:13:57 -04:00
Tags editor: restore the focus to the last box typed in.
This commit is contained in:
parent
3c68d52fae
commit
b2333c1773
@ -73,7 +73,11 @@ class TagEditor(QDialog, Ui_TagEditor):
|
|||||||
self.available_filter_input.textChanged.connect(self.filter_tags)
|
self.available_filter_input.textChanged.connect(self.filter_tags)
|
||||||
self.applied_filter_input.textChanged.connect(partial(self.filter_tags, which='applied_tags'))
|
self.applied_filter_input.textChanged.connect(partial(self.filter_tags, which='applied_tags'))
|
||||||
|
|
||||||
self.available_filter_input.setFocus()
|
# Restore the focus to the last input box used (typed into)
|
||||||
|
self.add_tag_input.textChanged.connect(partial(self.edit_box_changed, which="add_tag_input"))
|
||||||
|
self.available_filter_input.textChanged.connect(partial(self.edit_box_changed, which="available_filter_input"))
|
||||||
|
self.applied_filter_input.textChanged.connect(partial(self.edit_box_changed, which="applied_filter_input"))
|
||||||
|
getattr(self, gprefs.get('tag_editor_last_filter', 'add_tag_input')).setFocus()
|
||||||
|
|
||||||
if islinux:
|
if islinux:
|
||||||
self.available_tags.itemDoubleClicked.connect(self.apply_tags)
|
self.available_tags.itemDoubleClicked.connect(self.apply_tags)
|
||||||
@ -85,6 +89,10 @@ class TagEditor(QDialog, Ui_TagEditor):
|
|||||||
if geom is not None:
|
if geom is not None:
|
||||||
self.restoreGeometry(geom)
|
self.restoreGeometry(geom)
|
||||||
|
|
||||||
|
def edit_box_changed(self, which):
|
||||||
|
gprefs['tag_editor_last_filter'] = which
|
||||||
|
|
||||||
|
|
||||||
def delete_tags(self, item=None):
|
def delete_tags(self, item=None):
|
||||||
confirms, deletes = [], []
|
confirms, deletes = [], []
|
||||||
items = self.available_tags.selectedItems() if item is None else [item]
|
items = self.available_tags.selectedItems() if item is None else [item]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user