From dd2891b5bab28f965757d5d9c05c94a84342389e Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 30 Jan 2012 08:03:39 +0900 Subject: [PATCH] hide unused media dialog after deletion --- aqt/main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aqt/main.py b/aqt/main.py index f8d82b196..bc0e5f37a 100755 --- a/aqt/main.py +++ b/aqt/main.py @@ -877,13 +877,14 @@ Your edits have left some cards empty. Do you want to delete them?""")) b = QPushButton(_("Deleted Unused")) b.setAutoDefault(False) box.addButton(b, QDialogButtonBox.ActionRole) - b.connect(b, SIGNAL("clicked()"), lambda u=unused: self.deleteUnused(u)) + b.connect( + b, SIGNAL("clicked()"), lambda u=unused, d=diag: self.deleteUnused(u, d)) diag.connect(box, SIGNAL("rejected()"), diag, SLOT("reject()")) diag.setMinimumHeight(400) diag.setMinimumWidth(500) diag.exec_() - def deleteUnused(self, unused): + def deleteUnused(self, unused, diag): if not askUser( _("Delete unused media? This operation can not be undone.")): return @@ -892,6 +893,7 @@ Your edits have left some cards empty. Do you want to delete them?""")) path = os.path.join(mdir, f) os.unlink(path) tooltip("Deleted.") + diag.close() # System specific code ##########################################################################