mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 00:36:38 -04:00
make select facts show all cards
This commit is contained in:
parent
d081a3f864
commit
2c0d6b7425
1 changed files with 7 additions and 10 deletions
|
@ -871,16 +871,13 @@ where id in %s""" % ids2str(sf))
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
def selectFacts(self):
|
def selectFacts(self):
|
||||||
self.mw.progress.start()
|
fids = self.selectedFacts()
|
||||||
sm = self.form.tableView.selectionModel()
|
self.form.searchEdit.setText("fid:"+",".join([str(x) for x in fids]))
|
||||||
items = QItemSelection()
|
# clear the selection so we don't waste energy preserving it
|
||||||
cardIds = dict([(x, 1) for x in self.selectedFactsAsCards()])
|
tv = self.form.tableView
|
||||||
for i, card in enumerate(self.model.cards):
|
tv.selectionModel().clear()
|
||||||
if card in cardIds:
|
self.onSearch()
|
||||||
idx = self.model.index(i, 0)
|
tv.selectAll()
|
||||||
items.select(idx, idx)
|
|
||||||
sm.select(items, QItemSelectionModel.SelectCurrent | QItemSelectionModel.Rows)
|
|
||||||
self.mw.progress.finish()
|
|
||||||
|
|
||||||
def invertSelection(self):
|
def invertSelection(self):
|
||||||
sm = self.form.tableView.selectionModel()
|
sm = self.form.tableView.selectionModel()
|
||||||
|
|
Loading…
Reference in a new issue