add bury fact option

This commit is contained in:
Damien Elmes 2009-04-29 12:14:36 +09:00
parent 0ddc1d7d72
commit b6305085e8
2 changed files with 32 additions and 0 deletions

View file

@ -1411,6 +1411,16 @@ session (black)</dd>
self.deck.setUndoEnd(undo) self.deck.setUndoEnd(undo)
runHook("currentCardDeleted") runHook("currentCardDeleted")
def onBuryFact(self):
undo = _("Bury")
self.deck.setUndoStart(undo)
for card in self.currentCard.fact.cards:
card.priority = -2
card.isDue = 0
self.deck.flushMod()
self.reset()
self.deck.setUndoEnd(undo)
def onUndo(self): def onUndo(self):
self.deck.undo() self.deck.undo()
self.reset(count=False) self.reset(count=False)
@ -1902,6 +1912,7 @@ Couldn't contact Anki Online. Please check your internet connection."""))
self.connect(m.actionStudyOptions, s, self.onStudyOptions) self.connect(m.actionStudyOptions, s, self.onStudyOptions)
self.connect(m.actionDonate, s, self.onDonate) self.connect(m.actionDonate, s, self.onDonate)
self.connect(m.actionRecordNoiseProfile, s, self.onRecordNoiseProfile) self.connect(m.actionRecordNoiseProfile, s, self.onRecordNoiseProfile)
self.connect(m.actionBuryFact, s, self.onBuryFact)
def enableDeckMenuItems(self, enabled=True): def enableDeckMenuItems(self, enabled=True):
"setEnabled deck-related items." "setEnabled deck-related items."
@ -1957,6 +1968,7 @@ Couldn't contact Anki Online. Please check your internet connection."""))
self.mainWin.actionMarkCard.setEnabled(False) self.mainWin.actionMarkCard.setEnabled(False)
self.mainWin.actionSuspendCard.setEnabled(False) self.mainWin.actionSuspendCard.setEnabled(False)
self.mainWin.actionDelete.setEnabled(False) self.mainWin.actionDelete.setEnabled(False)
self.mainWin.actionBuryFact.setEnabled(False)
self.mainWin.actionRepeatAudio.setEnabled(False) self.mainWin.actionRepeatAudio.setEnabled(False)
def enableCardMenuItems(self): def enableCardMenuItems(self):
@ -1970,6 +1982,7 @@ Couldn't contact Anki Online. Please check your internet connection."""))
self.mainWin.actionMarkCard.setEnabled(True) self.mainWin.actionMarkCard.setEnabled(True)
self.mainWin.actionSuspendCard.setEnabled(True) self.mainWin.actionSuspendCard.setEnabled(True)
self.mainWin.actionDelete.setEnabled(True) self.mainWin.actionDelete.setEnabled(True)
self.mainWin.actionBuryFact.setEnabled(True)
enableEdits = (not self.config['preventEditUntilAnswer'] or enableEdits = (not self.config['preventEditUntilAnswer'] or
self.state != "getQuestion") self.state != "getQuestion")
self.mainWin.actionEditCurrent.setEnabled(enableEdits) self.mainWin.actionEditCurrent.setEnabled(enableEdits)

View file

@ -1132,6 +1132,7 @@
<addaction name="actionEditdeck" /> <addaction name="actionEditdeck" />
<addaction name="separator" /> <addaction name="separator" />
<addaction name="actionMarkCard" /> <addaction name="actionMarkCard" />
<addaction name="actionBuryFact" />
<addaction name="actionSuspendCard" /> <addaction name="actionSuspendCard" />
<addaction name="actionDelete" /> <addaction name="actionDelete" />
</widget> </widget>
@ -1633,6 +1634,9 @@
<property name="statusTip" > <property name="statusTip" >
<string>Stop reviewing this card until it's unsuspended in the browser</string> <string>Stop reviewing this card until it's unsuspended in the browser</string>
</property> </property>
<property name="shortcut" >
<string>Ctrl+Shift+S</string>
</property>
</action> </action>
<action name="actionModelProperties" > <action name="actionModelProperties" >
<property name="icon" > <property name="icon" >
@ -1934,6 +1938,21 @@
<string>Download a plugin to add new features or change Anki's behaviour</string> <string>Download a plugin to add new features or change Anki's behaviour</string>
</property> </property>
</action> </action>
<action name="actionBuryFact" >
<property name="icon" >
<iconset resource="../icons.qrc" >
<normaloff>:/icons/khtml_kget.png</normaloff>:/icons/khtml_kget.png</iconset>
</property>
<property name="text" >
<string>&amp;Bury Fact</string>
</property>
<property name="statusTip" >
<string>Suspend the current fact until the deck is closed and opened again</string>
</property>
<property name="shortcut" >
<string>Ctrl+Shift+B</string>
</property>
</action>
</widget> </widget>
<tabstops> <tabstops>
<tabstop>newPerDay</tabstop> <tabstop>newPerDay</tabstop>