mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1623 (Filter stats update)
This commit is contained in:
parent
a83de9ce2d
commit
a0e9483e92
@ -340,6 +340,8 @@ class Main(MainWindow, Ui_MainWindow):
|
|||||||
self.connect(self.search, SIGNAL('search(PyQt_PyObject, PyQt_PyObject)'),
|
self.connect(self.search, SIGNAL('search(PyQt_PyObject, PyQt_PyObject)'),
|
||||||
self.tags_view.model().reinit)
|
self.tags_view.model().reinit)
|
||||||
self.connect(self.library_view.model(), SIGNAL('count_changed(int)'), self.location_view.count_changed)
|
self.connect(self.library_view.model(), SIGNAL('count_changed(int)'), self.location_view.count_changed)
|
||||||
|
self.connect(self.library_view.model(), SIGNAL('count_changed(int)'),
|
||||||
|
self.tags_view.recount)
|
||||||
self.library_view.model().count_changed()
|
self.library_view.model().count_changed()
|
||||||
########################### Cover Flow ################################
|
########################### Cover Flow ################################
|
||||||
self.cover_flow = None
|
self.cover_flow = None
|
||||||
@ -1129,6 +1131,7 @@ class Main(MainWindow, Ui_MainWindow):
|
|||||||
os.remove(f.name)
|
os.remove(f.name)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
self.tags_view.recount()
|
||||||
if self.current_view() is self.library_view:
|
if self.current_view() is self.library_view:
|
||||||
current = self.library_view.currentIndex()
|
current = self.library_view.currentIndex()
|
||||||
self.library_view.model().current_changed(current, QModelIndex())
|
self.library_view.model().current_changed(current, QModelIndex())
|
||||||
|
@ -7,7 +7,7 @@ __docformat__ = 'restructuredtext en'
|
|||||||
Browsing book collection by tags.
|
Browsing book collection by tags.
|
||||||
'''
|
'''
|
||||||
from PyQt4.Qt import QAbstractItemModel, Qt, QVariant, QTreeView, QModelIndex, \
|
from PyQt4.Qt import QAbstractItemModel, Qt, QVariant, QTreeView, QModelIndex, \
|
||||||
QFont, SIGNAL, QSize, QColor, QIcon
|
QFont, SIGNAL, QSize, QColor, QIcon, QPoint
|
||||||
from calibre.gui2 import config
|
from calibre.gui2 import config
|
||||||
NONE = QVariant()
|
NONE = QVariant()
|
||||||
|
|
||||||
@ -36,6 +36,14 @@ class TagsView(QTreeView):
|
|||||||
if self._model.toggle(index):
|
if self._model.toggle(index):
|
||||||
self.emit(SIGNAL('tags_marked(PyQt_PyObject, PyQt_PyObject)'),
|
self.emit(SIGNAL('tags_marked(PyQt_PyObject, PyQt_PyObject)'),
|
||||||
self._model.tokens(), self.match_all.isChecked())
|
self._model.tokens(), self.match_all.isChecked())
|
||||||
|
|
||||||
|
def recount(self, *args):
|
||||||
|
ci = self.currentIndex()
|
||||||
|
if not ci.isValid():
|
||||||
|
ci = self.indexAt(QPoint(10, 10))
|
||||||
|
self.model().refresh()
|
||||||
|
if ci.isValid():
|
||||||
|
self.scrollTo(ci, QTreeView.PositionAtTop)
|
||||||
|
|
||||||
class TagsModel(QAbstractItemModel):
|
class TagsModel(QAbstractItemModel):
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user