mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Clear search histories in preferences should clear the fts dialog's search history as well
This commit is contained in:
parent
6c79a163ba
commit
75bbecc534
@ -31,3 +31,7 @@ class FullTextSearchAction(InterfaceAction):
|
||||
def library_changed(self, db):
|
||||
if self._dialog is not None:
|
||||
self._dialog.library_changed()
|
||||
|
||||
def clear_search_history(self):
|
||||
if self._dialog is not None:
|
||||
self._dialog.clear_search_history()
|
||||
|
@ -96,6 +96,9 @@ class FTSDialog(Dialog):
|
||||
self.scan_status.startup()
|
||||
self.results_panel.on_show()
|
||||
|
||||
def clear_search_history(self):
|
||||
self.results_panel.clear_history()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from calibre.gui2 import Application
|
||||
|
@ -497,6 +497,9 @@ class SearchInputPanel(QWidget):
|
||||
|
||||
self.layout().addLayout(v2)
|
||||
|
||||
def clear_history(self):
|
||||
self.search_box.clear_history()
|
||||
|
||||
def start(self):
|
||||
self.pi.start()
|
||||
|
||||
@ -777,6 +780,9 @@ class ResultsPanel(QWidget):
|
||||
if st is not None:
|
||||
s.restoreState(st)
|
||||
|
||||
def clear_history(self):
|
||||
self.sip.clear_history()
|
||||
|
||||
def remove_book_from_results(self, book_id):
|
||||
self.results_view.m.remove_book(book_id)
|
||||
|
||||
|
@ -253,12 +253,16 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
|
||||
for key in (
|
||||
'bulk_edit_search_for', 'bulk_edit_replace_with',
|
||||
'viewer-highlights-search-panel-expression',
|
||||
'viewer-search-panel-expression',
|
||||
'viewer-search-panel-expression', 'library-fts-search-box',
|
||||
):
|
||||
history.set('lineedit_history_' + key, [])
|
||||
from calibre.gui2.viewer.config import vprefs
|
||||
for k in ('search', 'highlights'):
|
||||
vprefs.set(f'saved-{k}-settings', {})
|
||||
from calibre.gui2.ui import get_gui
|
||||
gui = get_gui()
|
||||
if gui is not None:
|
||||
gui.iactions['Full Text Search'].clear_search_history()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Loading…
x
Reference in New Issue
Block a user