mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
update # of selected items in title in real time
This commit is contained in:
parent
658fedc26c
commit
03a6235f35
1 changed files with 9 additions and 3 deletions
|
@ -200,6 +200,9 @@ class EditDeck(QMainWindow):
|
||||||
self.dialog.tableView.setSortingEnabled(False)
|
self.dialog.tableView.setSortingEnabled(False)
|
||||||
self.dialog.tableView.setModel(self.model)
|
self.dialog.tableView.setModel(self.model)
|
||||||
self.dialog.tableView.selectionModel()
|
self.dialog.tableView.selectionModel()
|
||||||
|
self.connect(self.dialog.tableView.selectionModel(),
|
||||||
|
SIGNAL("selectionChanged(QItemSelection,QItemSelection)"),
|
||||||
|
self.updateFilterLabel)
|
||||||
self.dialog.tableView.setFont(QFont(
|
self.dialog.tableView.setFont(QFont(
|
||||||
self.config['editFontFamily'],
|
self.config['editFontFamily'],
|
||||||
self.config['editFontSize']))
|
self.config['editFontSize']))
|
||||||
|
@ -318,9 +321,12 @@ class EditDeck(QMainWindow):
|
||||||
|
|
||||||
def updateFilterLabel(self):
|
def updateFilterLabel(self):
|
||||||
self.setWindowTitle(_("Editor (%(cur)d "
|
self.setWindowTitle(_("Editor (%(cur)d "
|
||||||
"of %(tot)d cards shown)") %
|
"of %(tot)d cards shown; %(sel)d selected)") %
|
||||||
{"cur": len(self.model.cards),
|
{
|
||||||
"tot": self.deck.cardCount})
|
"cur": len(self.model.cards),
|
||||||
|
"tot": self.deck.cardCount,
|
||||||
|
"sel": len(self.dialog.tableView.selectionModel().selectedRows())
|
||||||
|
})
|
||||||
|
|
||||||
def onEvent(self):
|
def onEvent(self):
|
||||||
if self.deck.undoAvailable():
|
if self.deck.undoAvailable():
|
||||||
|
|
Loading…
Reference in a new issue