mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32:23 -04:00
unbury cards when returning to deck list
This commit is contained in:
parent
acae66d60e
commit
133d4c2e8e
3 changed files with 4 additions and 3 deletions
|
@ -172,7 +172,7 @@ crt=?, mod=?, scm=?, dty=?, usn=?, ls=?, conf=?""",
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
"Unsuspend any temporarily suspended cards."
|
"Unsuspend any temporarily suspended cards."
|
||||||
if self.dty:
|
if self.dty:
|
||||||
self.sched.onClose()
|
self.sched.unburyCards()
|
||||||
self.dty = False
|
self.dty = False
|
||||||
|
|
||||||
def usn(self):
|
def usn(self):
|
||||||
|
|
|
@ -125,7 +125,7 @@ order by due""" % self._deckLimit(),
|
||||||
else:
|
else:
|
||||||
return 3
|
return 3
|
||||||
|
|
||||||
def onClose(self):
|
def unburyCards(self):
|
||||||
"Unbury cards when closing."
|
"Unbury cards when closing."
|
||||||
self.col.db.execute(
|
self.col.db.execute(
|
||||||
"update cards set queue = type where queue = -2")
|
"update cards set queue = type where queue = -2")
|
||||||
|
@ -189,6 +189,7 @@ order by due""" % self._deckLimit(),
|
||||||
"Returns [deckname, did, rev, lrn, new]"
|
"Returns [deckname, did, rev, lrn, new]"
|
||||||
self._checkDay()
|
self._checkDay()
|
||||||
self.col.decks.recoverOrphans()
|
self.col.decks.recoverOrphans()
|
||||||
|
self.unburyCards()
|
||||||
decks = self.col.decks.all()
|
decks = self.col.decks.all()
|
||||||
decks.sort(key=itemgetter('name'))
|
decks.sort(key=itemgetter('name'))
|
||||||
lims = {}
|
lims = {}
|
||||||
|
|
|
@ -486,7 +486,7 @@ def test_misc():
|
||||||
d.sched.buryNote(c.nid)
|
d.sched.buryNote(c.nid)
|
||||||
d.reset()
|
d.reset()
|
||||||
assert not d.sched.getCard()
|
assert not d.sched.getCard()
|
||||||
d.sched.onClose()
|
d.sched.unburyCards()
|
||||||
d.reset()
|
d.reset()
|
||||||
assert d.sched.getCard()
|
assert d.sched.getCard()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue