Focus on author in the Category editor window. Fixes #1888053 [[Enhancement] Focus on author in the Category editor window when right clicking on the author in the Book details panel](https://bugs.launchpad.net/calibre/+bug/1888053)

Merge branch 'master' of https://github.com/cbhaley/calibre
This commit is contained in:
Kovid Goyal 2020-07-19 13:22:50 +05:30
commit 26382ef870
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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)