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 <noreply@anthropic.com>
This commit is contained in:
2026-06-16 12:15:19 +02:00
parent c313e1431b
commit b5b8198c29
2 changed files with 11 additions and 6 deletions

View File

@@ -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 not os.path.exists(file):
return
if bins.host_open_path(file):
return
if sys.platform.startswith("win"):
subprocess.Popen(f'explorer "{file}"')
else:
subprocess.Popen(["xdg-open", file])
QDesktopServices.openUrl(QUrl.fromLocalFile(file))

View File

@@ -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,6 +66,7 @@ class QTextLog(QPlainTextEdit):
self._test_dir = os.getcwd()
path = os.path.join(self._test_dir, path)
if os.path.exists(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)