fix(gui): keep the file-name preview in the plain theme color
CI / lint (push) Skipped
CI / test (3.12) (push) Skipped
CI / test (3.13) (push) Skipped
CI / test-with-beamline-plugins (pxi_bec) (push) Skipped
CI / test-with-beamline-plugins (pxii_bec) (push) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (push) Skipped
CI / lint (pull_request) Successful in 1m9s
CI / test (3.12) (pull_request) Successful in 1m2s
CI / test (3.13) (pull_request) Successful in 1m11s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Successful in 1m11s
CI / test-with-coverage (pull_request) Successful in 1m49s
CI / coverage-analysis (pull_request) Successful in 4s
CI / test (3.14) (pull_request) Canceled after 9s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Canceled after 7s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Canceled after 4s

Dawn: the red "file exists" tint on the path label reads as an error
across the whole panel. The Run guard's popup already reports a clash,
so the label stays in the standard text color. The popup now also asks
the user to run the data collection again after the run number bump.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
duan_jandClaude Fable 5.1 authored and duan_j committed 2026-09-17 14:27:19 +02:00
1 parent bd2b25e156
commit 07c561128d
2 files changed
+7 -13

No files matched your search

+4 -7
View File
@@ -7,7 +7,6 @@ from aarecommon.models.models import DAQStatusModel, SampleShortInfo
from PySide6.QtCore import Qt, Signal, Slot
from PySide6.QtWidgets import QGridLayout, QLabel, QLineEdit, QMessageBox, QSpinBox, QWidget
from aare.gui.styles import PATH_WARN_TEXT
from aare.gui.widgets.title_label import TitleLabel
## Logic for filenames:
@@ -165,13 +164,11 @@ class FilePathPanel(QWidget):
# Store the GUI’s base (without applying scan-kind transforms) for wiring into requests later
self._filename = self._expand_macros(base, run_number)
# Preview label shows the effective path (what will be written)
# Preview label shows the effective path (what will be written), in the
# plain theme color: a clash is reported by the Run guard's popup, not
# by a red label.
effective = self._effective_dataset_base(self._filename)
exists = self._exists_for_run(self._filename)
self.file_name_label.setText(effective + "_master.h5")
# Empty stylesheet = reset to the THEME text color (a hardcoded
# "default" black would be invisible on the dark theme).
self.file_name_label.setStyleSheet(f"color: {PATH_WARN_TEXT};" if exists else "")
self.path_updated.emit(self._filename)
@Slot()
@@ -257,6 +254,6 @@ class FilePathPanel(QWidget):
self,
"File exists",
f"File already exists:\n{path}\n\n"
f"Run number increased to {self.run_number_edit.value()}.",
f"Run number increased to {self.run_number_edit.value()}. Please run data collection again.",
)
return False