mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #2807 ("Reset Quick Search" button does not reset the status of the tag toggle switches)
This commit is contained in:
parent
9bc7b7feed
commit
1b39011adf
@ -1128,6 +1128,7 @@ class SearchBox(QLineEdit):
|
||||
self.home(False)
|
||||
self.initial_state = True
|
||||
self.setStyleSheet("background-color: white")
|
||||
self.emit(SIGNAL('cleared()'))
|
||||
|
||||
def clear(self):
|
||||
self.clear_to_help()
|
||||
|
@ -456,6 +456,7 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
|
||||
SIGNAL('count_changed(int)'), self.location_view.count_changed)
|
||||
self.connect(self.library_view.model(), SIGNAL('count_changed(int)'),
|
||||
self.tags_view.recount)
|
||||
self.connect(self.search, SIGNAL('cleared()'), self.tags_view.clear)
|
||||
self.library_view.model().count_changed()
|
||||
########################### Cover Flow ################################
|
||||
self.cover_flow = None
|
||||
|
@ -36,6 +36,9 @@ class TagsView(QTreeView):
|
||||
self.emit(SIGNAL('tags_marked(PyQt_PyObject, PyQt_PyObject)'),
|
||||
self._model.tokens(), self.match_all.isChecked())
|
||||
|
||||
def clear(self):
|
||||
self.model().clear_state()
|
||||
|
||||
def recount(self, *args):
|
||||
ci = self.currentIndex()
|
||||
if not ci.isValid():
|
||||
@ -119,6 +122,11 @@ class TagsModel(QStandardItemModel):
|
||||
self._data[category], self.cmap[r], self.bold_font, self.icon_map))
|
||||
#self.reset()
|
||||
|
||||
def clear_state(self):
|
||||
for category in self._data.values():
|
||||
for tag in category:
|
||||
tag.state = 0
|
||||
self.refresh()
|
||||
|
||||
def reinit(self, *args, **kwargs):
|
||||
if not self.ignore_next_search:
|
||||
|
Loading…
x
Reference in New Issue
Block a user