mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
Add View Files button to Check Media screen (#3006)
* Add View Files button * Remove Close button
This commit is contained in:
parent
492178c107
commit
12681ae2e7
1 changed files with 10 additions and 1 deletions
|
@ -21,6 +21,7 @@ from aqt.qt import *
|
|||
from aqt.utils import (
|
||||
askUser,
|
||||
disable_help_button,
|
||||
openFolder,
|
||||
restoreGeom,
|
||||
saveGeom,
|
||||
showText,
|
||||
|
@ -114,7 +115,7 @@ class MediaChecker:
|
|||
text.setPlainText(report)
|
||||
text.setWordWrapMode(QTextOption.WrapMode.NoWrap)
|
||||
layout.addWidget(text)
|
||||
box = QDialogButtonBox(QDialogButtonBox.StandardButton.Close)
|
||||
box = QDialogButtonBox()
|
||||
layout.addWidget(box)
|
||||
|
||||
if output.unused:
|
||||
|
@ -149,6 +150,11 @@ class MediaChecker:
|
|||
box.addButton(b, QDialogButtonBox.ButtonRole.RejectRole)
|
||||
qconnect(b.clicked, lambda c: self._on_restore_trash())
|
||||
|
||||
b = QPushButton(tr.addons_view_files())
|
||||
b.setAutoDefault(False)
|
||||
box.addButton(b, QDialogButtonBox.ButtonRole.ActionRole)
|
||||
qconnect(b.clicked, lambda c: self._on_view_files())
|
||||
|
||||
qconnect(box.rejected, diag.reject)
|
||||
diag.setMinimumHeight(400)
|
||||
diag.setMinimumWidth(500)
|
||||
|
@ -245,6 +251,9 @@ class MediaChecker:
|
|||
|
||||
self.mw.taskman.run_in_background(restore_trash, on_done)
|
||||
|
||||
def _on_view_files(self) -> None:
|
||||
openFolder(self.mw.col.media.dir())
|
||||
|
||||
|
||||
def add_missing_media_tag(parent: QWidget, missing_media_notes: Sequence[int]) -> None:
|
||||
add_tags_to_notes(
|
||||
|
|
Loading…
Reference in a new issue