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):
|
def library_changed(self, db):
|
||||||
if self._dialog is not None:
|
if self._dialog is not None:
|
||||||
self._dialog.library_changed()
|
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.scan_status.startup()
|
||||||
self.results_panel.on_show()
|
self.results_panel.on_show()
|
||||||
|
|
||||||
|
def clear_search_history(self):
|
||||||
|
self.results_panel.clear_history()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
from calibre.gui2 import Application
|
from calibre.gui2 import Application
|
||||||
|
@ -497,6 +497,9 @@ class SearchInputPanel(QWidget):
|
|||||||
|
|
||||||
self.layout().addLayout(v2)
|
self.layout().addLayout(v2)
|
||||||
|
|
||||||
|
def clear_history(self):
|
||||||
|
self.search_box.clear_history()
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
self.pi.start()
|
self.pi.start()
|
||||||
|
|
||||||
@ -777,6 +780,9 @@ class ResultsPanel(QWidget):
|
|||||||
if st is not None:
|
if st is not None:
|
||||||
s.restoreState(st)
|
s.restoreState(st)
|
||||||
|
|
||||||
|
def clear_history(self):
|
||||||
|
self.sip.clear_history()
|
||||||
|
|
||||||
def remove_book_from_results(self, book_id):
|
def remove_book_from_results(self, book_id):
|
||||||
self.results_view.m.remove_book(book_id)
|
self.results_view.m.remove_book(book_id)
|
||||||
|
|
||||||
|
@ -253,12 +253,16 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
|
|||||||
for key in (
|
for key in (
|
||||||
'bulk_edit_search_for', 'bulk_edit_replace_with',
|
'bulk_edit_search_for', 'bulk_edit_replace_with',
|
||||||
'viewer-highlights-search-panel-expression',
|
'viewer-highlights-search-panel-expression',
|
||||||
'viewer-search-panel-expression',
|
'viewer-search-panel-expression', 'library-fts-search-box',
|
||||||
):
|
):
|
||||||
history.set('lineedit_history_' + key, [])
|
history.set('lineedit_history_' + key, [])
|
||||||
from calibre.gui2.viewer.config import vprefs
|
from calibre.gui2.viewer.config import vprefs
|
||||||
for k in ('search', 'highlights'):
|
for k in ('search', 'highlights'):
|
||||||
vprefs.set(f'saved-{k}-settings', {})
|
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__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user