mirror of
https://github.com/ankitects/anki.git
synced 2025-11-13 08:07:11 -05:00
add suspend and unsuspend operations to browser
This commit is contained in:
parent
e1d8c31a1e
commit
76a7ea3353
4 changed files with 42 additions and 0 deletions
|
|
@ -605,6 +605,8 @@ class EditDeck(QMainWindow):
|
|||
self.connect(self.dialog.actionCram, SIGNAL("triggered()"), self.cram)
|
||||
self.connect(self.dialog.actionAddCards, SIGNAL("triggered()"), self.addCards)
|
||||
self.connect(self.dialog.actionChangeModel, SIGNAL("triggered()"), self.onChangeModel)
|
||||
self.connect(self.dialog.actionSuspend, SIGNAL("triggered()"), self.onSuspend)
|
||||
self.connect(self.dialog.actionUnsuspend, SIGNAL("triggered()"), self.onUnsuspend)
|
||||
# edit
|
||||
self.connect(self.dialog.actionFont, SIGNAL("triggered()"), self.onFont)
|
||||
self.connect(self.dialog.actionUndo, SIGNAL("triggered()"), self.onUndo)
|
||||
|
|
@ -769,6 +771,24 @@ where id in (%s)""" % ",".join([
|
|||
self.parent.setProgressParent(None)
|
||||
self.updateAfterCardChange()
|
||||
|
||||
def onSuspend(self):
|
||||
n = _("Suspend")
|
||||
self.parent.setProgressParent(self)
|
||||
self.deck.setUndoStart(n)
|
||||
self.deck.addTags(self.selectedFacts(), "Suspended")
|
||||
self.deck.setUndoEnd(n)
|
||||
self.parent.setProgressParent(None)
|
||||
self.updateAfterCardChange()
|
||||
|
||||
def onUnsuspend(self):
|
||||
n = _("Unsuspend")
|
||||
self.parent.setProgressParent(self)
|
||||
self.deck.setUndoStart(n)
|
||||
self.deck.deleteTags(self.selectedFacts(), "Suspended")
|
||||
self.deck.setUndoEnd(n)
|
||||
self.parent.setProgressParent(None)
|
||||
self.updateAfterCardChange()
|
||||
|
||||
def reschedule(self):
|
||||
n = _("Reschedule")
|
||||
d = QDialog(self)
|
||||
|
|
|
|||
|
|
@ -193,6 +193,9 @@
|
|||
<addaction name="actionAddTag" />
|
||||
<addaction name="actionDeleteTag" />
|
||||
<addaction name="separator" />
|
||||
<addaction name="actionSuspend" />
|
||||
<addaction name="actionUnsuspend" />
|
||||
<addaction name="separator" />
|
||||
<addaction name="actionAddCards" />
|
||||
<addaction name="actionChangeModel" />
|
||||
<addaction name="separator" />
|
||||
|
|
@ -422,6 +425,24 @@
|
|||
<string>Font...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSuspend" >
|
||||
<property name="icon" >
|
||||
<iconset resource="../icons.qrc" >
|
||||
<normaloff>:/icons/media-playback-pause.png</normaloff>:/icons/media-playback-pause.png</iconset>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&Suspend</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionUnsuspend" >
|
||||
<property name="icon" >
|
||||
<iconset resource="../icons.qrc" >
|
||||
<normaloff>:/icons/media-playback-start2.png</normaloff>:/icons/media-playback-start2.png</iconset>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&Unsuspend</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../icons.qrc" />
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<RCC>
|
||||
<qresource prefix="/" >
|
||||
<file>icons/media-playback-start2.png</file>
|
||||
<file>icons/anki-logo-thin.png</file>
|
||||
<file>icons/anki-logo.png</file>
|
||||
<file>icons/download.png</file>
|
||||
|
|
|
|||
BIN
icons/media-playback-start2.png
Normal file
BIN
icons/media-playback-start2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Loading…
Reference in a new issue