From b5b8198c29387b9a0d0eee9a5922152e326b55da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Tue, 16 Jun 2026 12:15:19 +0200 Subject: [PATCH] fix(gui): host-open clicked log paths in Flatpak (text_log) fix(gui): host-open the sequence file location in Flatpak; drop double-open Co-Authored-By: Claude Opus 4.8 --- src/testium/main_win/f1_win/d_f1_win.py | 13 ++++++++----- src/testium/main_win/text_log.py | 4 +++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/testium/main_win/f1_win/d_f1_win.py b/src/testium/main_win/f1_win/d_f1_win.py index 7d18187..9c02da6 100644 --- a/src/testium/main_win/f1_win/d_f1_win.py +++ b/src/testium/main_win/f1_win/d_f1_win.py @@ -13,6 +13,7 @@ from PySide6.QtGui import QSyntaxHighlighter, QTextCharFormat, QColor, QFont, QD from PySide6.QtCore import Qt, QUrl, Slot from main_win.f1_win.f1_win_core import Ui_F1Dialog +from interpreter.utils import bins class YamlHighlighter(QSyntaxHighlighter): @@ -304,9 +305,11 @@ class DialogF1(QDialog): def on_butlocopen_click(self): file = self.ui.sequenceFileNameLineEdit.text() - if os.path.exists(file): - if sys.platform.startswith("win"): - subprocess.Popen(f'explorer "{file}"') - else: - subprocess.Popen(["xdg-open", file]) + if not os.path.exists(file): + return + if bins.host_open_path(file): + return + if sys.platform.startswith("win"): + subprocess.Popen(f'explorer "{file}"') + else: QDesktopServices.openUrl(QUrl.fromLocalFile(file)) diff --git a/src/testium/main_win/text_log.py b/src/testium/main_win/text_log.py index aaeadfc..e410a75 100644 --- a/src/testium/main_win/text_log.py +++ b/src/testium/main_win/text_log.py @@ -7,6 +7,7 @@ from PySide6.QtGui import QCursor, QDesktopServices, QFont from main_win.text_log_highlighter import TextLogHighlighter import api.testium as tm +from interpreter.utils import bins class QTextLog(QPlainTextEdit): def __init__(self, parent): @@ -65,7 +66,8 @@ class QTextLog(QPlainTextEdit): self._test_dir = os.getcwd() path = os.path.join(self._test_dir, path) if os.path.exists(path): - QDesktopServices.openUrl(QUrl.fromLocalFile(path)) + if not bins.host_open_path(path): + QDesktopServices.openUrl(QUrl.fromLocalFile(path)) return # évite d'insérer du texte si clic super().mousePressEvent(event)