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.actionRedo, SIGNAL("triggered()"), self.onRedo)
|
||||||
self.connect(self.dialog.actionInvertSelection, SIGNAL("triggered()"), self.invertSelection)
|
self.connect(self.dialog.actionInvertSelection, SIGNAL("triggered()"), self.invertSelection)
|
||||||
self.connect(self.dialog.actionReverseOrder, SIGNAL("triggered()"), self.reverseOrder)
|
self.connect(self.dialog.actionReverseOrder, SIGNAL("triggered()"), self.reverseOrder)
|
||||||
|
self.connect(self.dialog.actionSelectFacts, SIGNAL("triggered()"), self.selectFacts)
|
||||||
# jumps
|
# jumps
|
||||||
self.connect(self.dialog.actionFirstCard, SIGNAL("triggered()"), self.onFirstCard)
|
self.connect(self.dialog.actionFirstCard, SIGNAL("triggered()"), self.onFirstCard)
|
||||||
self.connect(self.dialog.actionLastCard, SIGNAL("triggered()"), self.onLastCard)
|
self.connect(self.dialog.actionLastCard, SIGNAL("triggered()"), self.onLastCard)
|
||||||
|
@ -723,6 +724,15 @@ where id in %s""" % ids2str(sf))
|
||||||
# Edit: selection
|
# 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):
|
def invertSelection(self):
|
||||||
sm = self.dialog.tableView.selectionModel()
|
sm = self.dialog.tableView.selectionModel()
|
||||||
items = sm.selection()
|
items = sm.selection()
|
||||||
|
|
|
@ -181,6 +181,7 @@
|
||||||
<addaction name="actionRedo" />
|
<addaction name="actionRedo" />
|
||||||
<addaction name="separator" />
|
<addaction name="separator" />
|
||||||
<addaction name="actionSelectAll" />
|
<addaction name="actionSelectAll" />
|
||||||
|
<addaction name="actionSelectFacts" />
|
||||||
<addaction name="actionInvertSelection" />
|
<addaction name="actionInvertSelection" />
|
||||||
<addaction name="separator" />
|
<addaction name="separator" />
|
||||||
<addaction name="actionReverseOrder" />
|
<addaction name="actionReverseOrder" />
|
||||||
|
@ -258,7 +259,7 @@
|
||||||
<normaloff>:/icons/Anki_Card.png</normaloff>:/icons/Anki_Card.png</iconset>
|
<normaloff>:/icons/Anki_Card.png</normaloff>:/icons/Anki_Card.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>Generate &Cards...</string>
|
<string>&Generate Cards...</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionReschedule" >
|
<action name="actionReschedule" >
|
||||||
|
@ -275,11 +276,6 @@
|
||||||
<string>Select &All</string>
|
<string>Select &All</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionSelectFacts" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Select &Facts</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionUndo" >
|
<action name="actionUndo" >
|
||||||
<property name="icon" >
|
<property name="icon" >
|
||||||
<iconset resource="../icons.qrc" >
|
<iconset resource="../icons.qrc" >
|
||||||
|
@ -401,6 +397,11 @@
|
||||||
<string>Change &Model...</string>
|
<string>Change &Model...</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionSelectFacts" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Select &Facts</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../icons.qrc" />
|
<include location="../icons.qrc" />
|
||||||
|
|
Loading…
Reference in a new issue