mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 09:16:38 -04:00
add progress dialogs
This commit is contained in:
parent
fbf31d60da
commit
ae7047f5af
1 changed files with 6 additions and 0 deletions
|
@ -518,6 +518,8 @@ where id in %s""" % ids2str(ids), now=time.time(), new=0)
|
|||
|
||||
def randomizeNewCards(self):
|
||||
"Randomize 'due' on all new cards."
|
||||
self.startProgress()
|
||||
self.updateProgress(_("Randomizing..."))
|
||||
now = time.time()
|
||||
fids = self.s.column0("""
|
||||
select distinct factId from cards where type = 2""")
|
||||
|
@ -528,14 +530,18 @@ set due = :rand + ordinal,
|
|||
combinedDue = max(:rand + ordinal, spaceUntil)
|
||||
where factId = :fid
|
||||
and type = 2""", data)
|
||||
self.finishProgress()
|
||||
|
||||
def orderNewCards(self):
|
||||
"Set 'due' to card creation time."
|
||||
self.startProgress()
|
||||
self.updateProgress(_("Ordering..."))
|
||||
self.s.statement("""
|
||||
update cards set
|
||||
due = created,
|
||||
combinedDue = max(spaceUntil, due)
|
||||
where type = 2""")
|
||||
self.finishProgress()
|
||||
|
||||
def rescheduleCards(self, ids, min, max):
|
||||
"Reset cards and schedule with new interval in days (min, max)."
|
||||
|
|
Loading…
Reference in a new issue