Merge pull request #338 from Aqueminivan/master
Added file counts when deleting media
This commit is contained in:
commit
e2475244d3
16
aqt/main.py
16
aqt/main.py
@ -1104,10 +1104,12 @@ will be lost. Continue?"""))
|
|||||||
if warnings:
|
if warnings:
|
||||||
report += "\n".join(warnings) + "\n"
|
report += "\n".join(warnings) + "\n"
|
||||||
if unused:
|
if unused:
|
||||||
|
numberOfUnusedFilesLabel = len(unused)
|
||||||
if report:
|
if report:
|
||||||
report += "\n\n\n"
|
report += "\n\n\n"
|
||||||
report += _(
|
report += ngettext("%d file found in media folder not used by any cards:",
|
||||||
"In media folder but not used by any cards:")
|
"%d files found in media folder not used by any cards:",
|
||||||
|
numberOfUnusedFilesLabel) % numberOfUnusedFilesLabel
|
||||||
report += "\n" + "\n".join(unused)
|
report += "\n" + "\n".join(unused)
|
||||||
if nohave:
|
if nohave:
|
||||||
if report:
|
if report:
|
||||||
@ -1158,12 +1160,18 @@ will be lost. Continue?"""))
|
|||||||
|
|
||||||
now = time.time()
|
now = time.time()
|
||||||
if now - lastProgress >= 0.3:
|
if now - lastProgress >= 0.3:
|
||||||
|
numberOfRemainingFilesToBeDeleted = len(unused) - c
|
||||||
lastProgress = now
|
lastProgress = now
|
||||||
label = _("Deleted %s files...") % (c+1)
|
label = ngettext("%d file remaining...",
|
||||||
|
"%d files remaining...",
|
||||||
|
numberOfRemainingFilesToBeDeleted) % numberOfRemainingFilesToBeDeleted
|
||||||
self.progress.update(label)
|
self.progress.update(label)
|
||||||
finally:
|
finally:
|
||||||
self.progress.finish()
|
self.progress.finish()
|
||||||
tooltip(_("Deleted."))
|
numberOfFilesDeleted = c + 1
|
||||||
|
tooltip(ngettext("Deleted %d file.",
|
||||||
|
"Deleted %d files.",
|
||||||
|
numberOfFilesDeleted) % numberOfFilesDeleted)
|
||||||
diag.close()
|
diag.close()
|
||||||
|
|
||||||
def onStudyDeck(self):
|
def onStudyDeck(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user