mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32:23 -04:00
add invert selection, add cards->generate cards
This commit is contained in:
parent
06d72e5b0f
commit
bb5ff4eb7c
2 changed files with 14 additions and 1 deletions
|
@ -402,6 +402,7 @@ class EditDeck(QMainWindow):
|
||||||
self.connect(self.dialog.actionAddCards, SIGNAL("triggered()"), self.addCards)
|
self.connect(self.dialog.actionAddCards, SIGNAL("triggered()"), self.addCards)
|
||||||
self.connect(self.dialog.actionResetProgress, SIGNAL("triggered()"), self.resetProgress)
|
self.connect(self.dialog.actionResetProgress, SIGNAL("triggered()"), self.resetProgress)
|
||||||
self.connect(self.dialog.actionSelectFacts, SIGNAL("triggered()"), self.selectFacts)
|
self.connect(self.dialog.actionSelectFacts, SIGNAL("triggered()"), self.selectFacts)
|
||||||
|
self.connect(self.dialog.actionInvertSelection, SIGNAL("triggered()"), self.invertSelection)
|
||||||
self.connect(self.dialog.actionUndo, SIGNAL("triggered()"), self.onUndo)
|
self.connect(self.dialog.actionUndo, SIGNAL("triggered()"), self.onUndo)
|
||||||
self.connect(self.dialog.actionRedo, SIGNAL("triggered()"), self.onRedo)
|
self.connect(self.dialog.actionRedo, SIGNAL("triggered()"), self.onRedo)
|
||||||
runHook('editor.setupMenus', self)
|
runHook('editor.setupMenus', self)
|
||||||
|
@ -580,6 +581,12 @@ where id in (%s)""" % ",".join([
|
||||||
sm.select(self.model.index(i, 0),
|
sm.select(self.model.index(i, 0),
|
||||||
QItemSelectionModel.Select | QItemSelectionModel.Rows)
|
QItemSelectionModel.Select | QItemSelectionModel.Rows)
|
||||||
|
|
||||||
|
def invertSelection(self):
|
||||||
|
sm = self.dialog.tableView.selectionModel()
|
||||||
|
items = sm.selection()
|
||||||
|
self.dialog.tableView.selectAll()
|
||||||
|
sm.select(items, QItemSelectionModel.Deselect | QItemSelectionModel.Rows)
|
||||||
|
|
||||||
# Undo/Redo
|
# Undo/Redo
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
|
|
|
@ -182,6 +182,7 @@
|
||||||
<addaction name="separator" />
|
<addaction name="separator" />
|
||||||
<addaction name="actionSelectAll" />
|
<addaction name="actionSelectAll" />
|
||||||
<addaction name="actionSelectFacts" />
|
<addaction name="actionSelectFacts" />
|
||||||
|
<addaction name="actionInvertSelection" />
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menuActions" >
|
<widget class="QMenu" name="menuActions" >
|
||||||
<property name="title" >
|
<property name="title" >
|
||||||
|
@ -234,7 +235,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>Add &Cards...</string>
|
<string>Generate &Cards...</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionResetProgress" >
|
<action name="actionResetProgress" >
|
||||||
|
@ -274,6 +275,11 @@
|
||||||
<string>&Redo</string>
|
<string>&Redo</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionInvertSelection" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>&Invert Selection</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../icons.qrc" />
|
<include location="../icons.qrc" />
|
||||||
|
|
Loading…
Reference in a new issue