mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
add select facts back, change 'generate cards' shortcut
This commit is contained in:
parent
b5358c1264
commit
049f38999b
2 changed files with 17 additions and 6 deletions
|
@ -493,6 +493,7 @@ class EditDeck(QMainWindow):
|
|||
self.connect(self.dialog.actionRedo, SIGNAL("triggered()"), self.onRedo)
|
||||
self.connect(self.dialog.actionInvertSelection, SIGNAL("triggered()"), self.invertSelection)
|
||||
self.connect(self.dialog.actionReverseOrder, SIGNAL("triggered()"), self.reverseOrder)
|
||||
self.connect(self.dialog.actionSelectFacts, SIGNAL("triggered()"), self.selectFacts)
|
||||
# jumps
|
||||
self.connect(self.dialog.actionFirstCard, SIGNAL("triggered()"), self.onFirstCard)
|
||||
self.connect(self.dialog.actionLastCard, SIGNAL("triggered()"), self.onLastCard)
|
||||
|
@ -723,6 +724,15 @@ where id in %s""" % ids2str(sf))
|
|||
# Edit: selection
|
||||
######################################################################
|
||||
|
||||
def selectFacts(self):
|
||||
sm = self.dialog.tableView.selectionModel()
|
||||
cardIds = dict([(x, 1) for x in self.selectedFactsAsCards()])
|
||||
for i, card in enumerate(self.model.cards):
|
||||
if card.id in cardIds:
|
||||
sm.select(self.model.index(i, 0),
|
||||
QItemSelectionModel.Select | QItemSelectionModel.Rows)
|
||||
|
||||
|
||||
def invertSelection(self):
|
||||
sm = self.dialog.tableView.selectionModel()
|
||||
items = sm.selection()
|
||||
|
|
|
@ -181,6 +181,7 @@
|
|||
<addaction name="actionRedo" />
|
||||
<addaction name="separator" />
|
||||
<addaction name="actionSelectAll" />
|
||||
<addaction name="actionSelectFacts" />
|
||||
<addaction name="actionInvertSelection" />
|
||||
<addaction name="separator" />
|
||||
<addaction name="actionReverseOrder" />
|
||||
|
@ -258,7 +259,7 @@
|
|||
<normaloff>:/icons/Anki_Card.png</normaloff>:/icons/Anki_Card.png</iconset>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Generate &Cards...</string>
|
||||
<string>&Generate Cards...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionReschedule" >
|
||||
|
@ -275,11 +276,6 @@
|
|||
<string>Select &All</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSelectFacts" >
|
||||
<property name="text" >
|
||||
<string>Select &Facts</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionUndo" >
|
||||
<property name="icon" >
|
||||
<iconset resource="../icons.qrc" >
|
||||
|
@ -401,6 +397,11 @@
|
|||
<string>Change &Model...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSelectFacts" >
|
||||
<property name="text" >
|
||||
<string>Select &Facts</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../icons.qrc" />
|
||||
|
|
Loading…
Reference in a new issue