Manage authors dialog: Add an etry to the right click menu to show books by the current author in the main book list. Fixes #1821992 [[enhancement] right click option to go to books when managing authors](https://bugs.launchpad.net/calibre/+bug/1821992)

Merge branch 'master' of https://github.com/cbhaley/calibre
This commit is contained in:
Kovid Goyal 2019-03-28 14:14:06 +05:30
commit b0543d1bb5
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -187,6 +187,9 @@ class EditAuthorsDialog(QDialog, Ui_EditAuthorsDialog):
if self.context_item is not None and self.context_item.column() == 0:
ca = m.addAction(_('Copy to author sort'))
ca.triggered.connect(self.copy_au_to_aus)
m.addSeparator()
ca = m.addAction(_("Show books by author in book list"))
ca.triggered.connect(self.search)
else:
ca = m.addAction(_('Copy to author'))
ca.triggered.connect(self.copy_aus_to_au)
@ -194,6 +197,11 @@ class EditAuthorsDialog(QDialog, Ui_EditAuthorsDialog):
m.addMenu(case_menu)
m.exec_(self.table.mapToGlobal(point))
def search(self):
from calibre.gui2.ui import get_gui
row = self.context_item.row()
get_gui().search.set_search_string(self.table.item(row, 0).text())
def copy_to_clipboard(self):
cb = QApplication.clipboard()
cb.setText(unicode_type(self.context_item.text()))