mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Fix #7787: saved search box is cleared whenever a saved search is selected.
This commit is contained in:
parent
7f6c1712e1
commit
9dd662ac0b
@ -205,7 +205,7 @@ class SearchBox2(QComboBox): # {{{
|
||||
self.blockSignals(yes)
|
||||
self.line_edit.blockSignals(yes)
|
||||
|
||||
def set_search_string(self, txt, store_in_history=False):
|
||||
def set_search_string(self, txt, store_in_history=False, emit_changed=True):
|
||||
self.setFocus(Qt.OtherFocusReason)
|
||||
if not txt:
|
||||
self.clear()
|
||||
@ -213,7 +213,8 @@ class SearchBox2(QComboBox): # {{{
|
||||
self.normalize_state()
|
||||
self.setEditText(txt)
|
||||
self.line_edit.end(False)
|
||||
self.changed.emit()
|
||||
if emit_changed:
|
||||
self.changed.emit()
|
||||
self._do_search(store_in_history=store_in_history)
|
||||
self.focus_to_library.emit()
|
||||
|
||||
@ -293,7 +294,7 @@ class SavedSearchBox(QComboBox): # {{{
|
||||
self.search_box.clear()
|
||||
self.setEditText(qname)
|
||||
return
|
||||
self.search_box.set_search_string(u'search:"%s"' % qname)
|
||||
self.search_box.set_search_string(u'search:"%s"' % qname, emit_changed=False)
|
||||
self.setEditText(qname)
|
||||
self.setToolTip(saved_searches().lookup(qname))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user