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 = QPushButton(_("Deleted Unused"))
|
||||||
b.setAutoDefault(False)
|
b.setAutoDefault(False)
|
||||||
box.addButton(b, QDialogButtonBox.ActionRole)
|
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.connect(box, SIGNAL("rejected()"), diag, SLOT("reject()"))
|
||||||
diag.setMinimumHeight(400)
|
diag.setMinimumHeight(400)
|
||||||
diag.setMinimumWidth(500)
|
diag.setMinimumWidth(500)
|
||||||
diag.exec_()
|
diag.exec_()
|
||||||
|
|
||||||
def deleteUnused(self, unused):
|
def deleteUnused(self, unused, diag):
|
||||||
if not askUser(
|
if not askUser(
|
||||||
_("Delete unused media? This operation can not be undone.")):
|
_("Delete unused media? This operation can not be undone.")):
|
||||||
return
|
return
|
||||||
|
@ -892,6 +893,7 @@ Your edits have left some cards empty. Do you want to delete them?"""))
|
||||||
path = os.path.join(mdir, f)
|
path = os.path.join(mdir, f)
|
||||||
os.unlink(path)
|
os.unlink(path)
|
||||||
tooltip("Deleted.")
|
tooltip("Deleted.")
|
||||||
|
diag.close()
|
||||||
|
|
||||||
# System specific code
|
# System specific code
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
Loading…
Reference in a new issue