CHANGE right-click in the editor to show option to open folder in linux

This commit is contained in:
GithubAnon0000 2025-06-25 18:33:37 +02:00
parent b250a2f724
commit d39fbf01f1
2 changed files with 7 additions and 7 deletions

View file

@ -1735,10 +1735,9 @@ class EditorWebView(AnkiWebView):
assert a is not None
qconnect(a.triggered, lambda: openFolder(path))
if is_win or is_mac:
a = menu.addAction(tr.editing_show_in_folder())
assert a is not None
qconnect(a.triggered, lambda: show_in_folder(path))
a = menu.addAction(tr.editing_show_in_folder())
assert a is not None
qconnect(a.triggered, lambda: show_in_folder(path))
def _clipboard(self) -> QClipboard:
clipboard = self.editor.mw.app.clipboard()

View file

@ -936,9 +936,10 @@ def show_in_folder(path: str) -> None:
"""
call(osascript_to_args(script))
else:
# Just open the file in any other platform
with no_bundled_libs():
QDesktopServices.openUrl(QUrl.fromLocalFile(path))
# Open the file using the default file handler. This might still open
# the file in an image viewer or the browser (instead of in a file
# manager) if the user has configured the system that way.
subprocess.run(["xdg-open", path])
def _show_in_folder_win32(path: str) -> None: