mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 07:22:23 -04:00
hide unused media dialog after deletion
This commit is contained in:
parent
2796b9eaf8
commit
dd2891b5ba
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
##########################################################################
|
||||
|
|
Loading…
Reference in a new issue