diff --git a/aqt/main.py b/aqt/main.py index ab1eb23d0..ce89258ff 100644 --- a/aqt/main.py +++ b/aqt/main.py @@ -1148,10 +1148,21 @@ will be lost. Continue?""")) _("Delete unused media?")): return mdir = self.col.media.dir() - for f in unused: - path = os.path.join(mdir, f) - if os.path.exists(path): - send2trash(path) + self.progress.start(immediate=True) + try: + lastProgress = 0 + for c, f in enumerate(unused): + path = os.path.join(mdir, f) + if os.path.exists(path): + send2trash(path) + + now = time.time() + if now - lastProgress >= 0.3: + lastProgress = now + label = _("Deleted %s files...") % (c+1) + self.progress.update(label) + finally: + self.progress.finish() tooltip(_("Deleted.")) diag.close()