make select facts show all cards

This commit is contained in:
Damien Elmes 2011-04-17 07:13:10 +09:00
parent d081a3f864
commit 2c0d6b7425

View file

@ -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()