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):
|
def randomizeNewCards(self):
|
||||||
"Randomize 'due' on all new cards."
|
"Randomize 'due' on all new cards."
|
||||||
|
self.startProgress()
|
||||||
|
self.updateProgress(_("Randomizing..."))
|
||||||
now = time.time()
|
now = time.time()
|
||||||
fids = self.s.column0("""
|
fids = self.s.column0("""
|
||||||
select distinct factId from cards where type = 2""")
|
select distinct factId from cards where type = 2""")
|
||||||
|
@ -528,14 +530,18 @@ set due = :rand + ordinal,
|
||||||
combinedDue = max(:rand + ordinal, spaceUntil)
|
combinedDue = max(:rand + ordinal, spaceUntil)
|
||||||
where factId = :fid
|
where factId = :fid
|
||||||
and type = 2""", data)
|
and type = 2""", data)
|
||||||
|
self.finishProgress()
|
||||||
|
|
||||||
def orderNewCards(self):
|
def orderNewCards(self):
|
||||||
"Set 'due' to card creation time."
|
"Set 'due' to card creation time."
|
||||||
|
self.startProgress()
|
||||||
|
self.updateProgress(_("Ordering..."))
|
||||||
self.s.statement("""
|
self.s.statement("""
|
||||||
update cards set
|
update cards set
|
||||||
due = created,
|
due = created,
|
||||||
combinedDue = max(spaceUntil, due)
|
combinedDue = max(spaceUntil, due)
|
||||||
where type = 2""")
|
where type = 2""")
|
||||||
|
self.finishProgress()
|
||||||
|
|
||||||
def rescheduleCards(self, ids, min, max):
|
def rescheduleCards(self, ids, min, max):
|
||||||
"Reset cards and schedule with new interval in days (min, max)."
|
"Reset cards and schedule with new interval in days (min, max)."
|
||||||
|
|
Loading…
Reference in a new issue