From 10fcd6064c6140714b558fff705f0bd031bb49ce Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Sun, 19 Jul 2020 08:46:50 +0100 Subject: [PATCH] Enhancement #1888053: Focus on author in the Category editor window when right clicking on an author --- src/calibre/gui2/dialogs/edit_authors_dialog.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/calibre/gui2/dialogs/edit_authors_dialog.py b/src/calibre/gui2/dialogs/edit_authors_dialog.py index 33102201f4..b7cb44d52b 100644 --- a/src/calibre/gui2/dialogs/edit_authors_dialog.py +++ b/src/calibre/gui2/dialogs/edit_authors_dialog.py @@ -229,8 +229,8 @@ class EditAuthorsDialog(QDialog, Ui_EditAuthorsDialog): self.do_sort_by_link() # Position on the desired item + select_item = None if id_to_select: - select_item = None use_as = tweaks['categories_use_field_for_author_name'] == 'author_sort' for row in range(0, len(auts_to_show)): if is_first_letter: @@ -248,13 +248,15 @@ class EditAuthorsDialog(QDialog, Ui_EditAuthorsDialog): select_item = (self.table.item(row, 1) if use_as else self.table.item(row, 0)) break - if select_item: - self.table.setCurrentItem(select_item) - if select_sort or select_link: - self.table.editItem(select_item) - self.start_find_pos = select_item.row() * 2 + select_item.column() + if select_item: + self.table.setCurrentItem(select_item) + self.table.setFocus(True) + if select_sort or select_link: + self.table.editItem(select_item) + self.start_find_pos = select_item.row() * 2 + select_item.column() else: self.table.setCurrentCell(0, 0) + self.find_box.setFocus() self.start_find_pos = -1 self.table.blockSignals(False)