mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
add bury fact option
This commit is contained in:
parent
0ddc1d7d72
commit
b6305085e8
2 changed files with 32 additions and 0 deletions
|
@ -1411,6 +1411,16 @@ session (black)</dd>
|
|||
self.deck.setUndoEnd(undo)
|
||||
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):
|
||||
self.deck.undo()
|
||||
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.actionDonate, s, self.onDonate)
|
||||
self.connect(m.actionRecordNoiseProfile, s, self.onRecordNoiseProfile)
|
||||
self.connect(m.actionBuryFact, s, self.onBuryFact)
|
||||
|
||||
def enableDeckMenuItems(self, enabled=True):
|
||||
"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.actionSuspendCard.setEnabled(False)
|
||||
self.mainWin.actionDelete.setEnabled(False)
|
||||
self.mainWin.actionBuryFact.setEnabled(False)
|
||||
self.mainWin.actionRepeatAudio.setEnabled(False)
|
||||
|
||||
def enableCardMenuItems(self):
|
||||
|
@ -1970,6 +1982,7 @@ Couldn't contact Anki Online. Please check your internet connection."""))
|
|||
self.mainWin.actionMarkCard.setEnabled(True)
|
||||
self.mainWin.actionSuspendCard.setEnabled(True)
|
||||
self.mainWin.actionDelete.setEnabled(True)
|
||||
self.mainWin.actionBuryFact.setEnabled(True)
|
||||
enableEdits = (not self.config['preventEditUntilAnswer'] or
|
||||
self.state != "getQuestion")
|
||||
self.mainWin.actionEditCurrent.setEnabled(enableEdits)
|
||||
|
|
|
@ -1132,6 +1132,7 @@
|
|||
<addaction name="actionEditdeck" />
|
||||
<addaction name="separator" />
|
||||
<addaction name="actionMarkCard" />
|
||||
<addaction name="actionBuryFact" />
|
||||
<addaction name="actionSuspendCard" />
|
||||
<addaction name="actionDelete" />
|
||||
</widget>
|
||||
|
@ -1633,6 +1634,9 @@
|
|||
<property name="statusTip" >
|
||||
<string>Stop reviewing this card until it's unsuspended in the browser</string>
|
||||
</property>
|
||||
<property name="shortcut" >
|
||||
<string>Ctrl+Shift+S</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionModelProperties" >
|
||||
<property name="icon" >
|
||||
|
@ -1934,6 +1938,21 @@
|
|||
<string>Download a plugin to add new features or change Anki's behaviour</string>
|
||||
</property>
|
||||
</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>&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>
|
||||
<tabstops>
|
||||
<tabstop>newPerDay</tabstop>
|
||||
|
|
Loading…
Reference in a new issue