Enhancement #1888053: Focus on author in the Category editor window when right clicking on an author

This commit is contained in:
Charles Haley 2020-07-19 08:46:50 +01:00
parent c341ed4172
commit 10fcd6064c

View File

@ -229,8 +229,8 @@ class EditAuthorsDialog(QDialog, Ui_EditAuthorsDialog):
self.do_sort_by_link() self.do_sort_by_link()
# Position on the desired item # Position on the desired item
if id_to_select:
select_item = None select_item = None
if id_to_select:
use_as = tweaks['categories_use_field_for_author_name'] == 'author_sort' use_as = tweaks['categories_use_field_for_author_name'] == 'author_sort'
for row in range(0, len(auts_to_show)): for row in range(0, len(auts_to_show)):
if is_first_letter: if is_first_letter:
@ -250,11 +250,13 @@ class EditAuthorsDialog(QDialog, Ui_EditAuthorsDialog):
break break
if select_item: if select_item:
self.table.setCurrentItem(select_item) self.table.setCurrentItem(select_item)
self.table.setFocus(True)
if select_sort or select_link: if select_sort or select_link:
self.table.editItem(select_item) self.table.editItem(select_item)
self.start_find_pos = select_item.row() * 2 + select_item.column() self.start_find_pos = select_item.row() * 2 + select_item.column()
else: else:
self.table.setCurrentCell(0, 0) self.table.setCurrentCell(0, 0)
self.find_box.setFocus()
self.start_find_pos = -1 self.start_find_pos = -1
self.table.blockSignals(False) self.table.blockSignals(False)