mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
When showing the FTS dialog pre populate the search box with the contents of the main calibre search box if the main search box contains a simple search. Fixes #2052460 [[Enhancement] Automatically search for what is typed in the main calibre Search field when opening the Full text dialog](https://bugs.launchpad.net/calibre/+bug/2052460)
This commit is contained in:
parent
296e74e7d7
commit
f179b8c9b9
@ -25,6 +25,9 @@ class FullTextSearchAction(InterfaceAction):
|
||||
return self._dialog
|
||||
|
||||
def show_fts(self):
|
||||
text = self.gui.search.text()
|
||||
if text and ':' not in text:
|
||||
self.dialog.set_search_text(text)
|
||||
self.dialog.show()
|
||||
self.dialog.raise_()
|
||||
|
||||
|
@ -118,6 +118,9 @@ class FTSDialog(Dialog):
|
||||
def clear_search_history(self):
|
||||
self.results_panel.clear_history()
|
||||
|
||||
def set_search_text(self, text):
|
||||
self.results_panel.set_search_text(text)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from calibre.gui2 import Application
|
||||
|
@ -519,6 +519,9 @@ class SearchInputPanel(QWidget):
|
||||
def clear_history(self):
|
||||
self.search_box.clear_history()
|
||||
|
||||
def set_search_text(self, text):
|
||||
self.search_box.setText(text)
|
||||
|
||||
def start(self):
|
||||
self.pi.start()
|
||||
|
||||
@ -813,6 +816,9 @@ class ResultsPanel(QWidget):
|
||||
def clear_history(self):
|
||||
self.sip.clear_history()
|
||||
|
||||
def set_search_text(self, text):
|
||||
self.sip.set_search_text(text)
|
||||
|
||||
def remove_book_from_results(self, book_id):
|
||||
self.results_view.m.remove_book(book_id)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user