mirror of
https://github.com/ankitects/anki.git
synced 2025-11-12 15:47:12 -05:00
add progress bar for deleting cards
This commit is contained in:
parent
4d4e7afcff
commit
d35320364a
1 changed files with 5 additions and 0 deletions
|
|
@ -1052,18 +1052,23 @@ where facts.id not in (select factId from cards)""")
|
||||||
self.s.flush()
|
self.s.flush()
|
||||||
now = time.time()
|
now = time.time()
|
||||||
strids = ids2str(ids)
|
strids = ids2str(ids)
|
||||||
|
self.startProgress(3)
|
||||||
# grab fact ids
|
# grab fact ids
|
||||||
factIds = self.s.column0("select factId from cards where id in %s"
|
factIds = self.s.column0("select factId from cards where id in %s"
|
||||||
% strids)
|
% strids)
|
||||||
# drop from cards
|
# drop from cards
|
||||||
|
self.updateProgress(_("Deleting cards..."))
|
||||||
self.s.statement("delete from cards where id in %s" % strids)
|
self.s.statement("delete from cards where id in %s" % strids)
|
||||||
# note deleted
|
# note deleted
|
||||||
|
self.updateProgress()
|
||||||
data = [{'id': id, 'time': now} for id in ids]
|
data = [{'id': id, 'time': now} for id in ids]
|
||||||
self.s.statements("insert into cardsDeleted values (:id, :time)", data)
|
self.s.statements("insert into cardsDeleted values (:id, :time)", data)
|
||||||
# remove any dangling facts
|
# remove any dangling facts
|
||||||
|
self.updateProgress()
|
||||||
self.deleteDanglingFacts()
|
self.deleteDanglingFacts()
|
||||||
self.rebuildCounts()
|
self.rebuildCounts()
|
||||||
self.flushMod()
|
self.flushMod()
|
||||||
|
self.finishProgress()
|
||||||
|
|
||||||
# Models
|
# Models
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue