Add a button to launch FTS to the search bar

This commit is contained in:
Kovid Goyal 2022-06-14 12:36:53 +05:30
parent 2ea40e6cef
commit b51e85e98e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -232,6 +232,10 @@ class SearchBar(QFrame): # {{{
x.setMinimumContentsLength(10)
l.addWidget(x)
parent.full_text_search_action = ac = parent.search.add_action('lt.png', QLineEdit.ActionPosition.LeadingPosition)
ac.setToolTip('<p>' + _('Search the full text of all books in the library, not just their metadata'))
ac.triggered.connect(self.do_fts)
parent.advanced_search_toggle_action = ac = parent.search.add_action('gear.png', QLineEdit.ActionPosition.LeadingPosition)
parent.addAction(ac)
ac.setToolTip(_('Advanced search'))
@ -300,6 +304,10 @@ class SearchBar(QFrame): # {{{
from calibre.gui2.ui import get_gui
get_gui().iactions['Sort By'].update_menu(self.sort_button.menu())
def do_fts(self):
from calibre.gui2.ui import get_gui
get_gui().iactions['Full Text Search'].show_fts()
# }}}