add progress dialogs

This commit is contained in:
Damien Elmes 2009-04-23 01:33:59 +09:00
parent fbf31d60da
commit ae7047f5af

View file

@ -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)."