From aec1cb305042a5cb2d8fe67150d91a3962d44c36 Mon Sep 17 00:00:00 2001 From: appleb_m Date: Thu, 26 Feb 2026 17:19:27 +0100 Subject: [PATCH] Exceptions: added developed help dialog to main window --- src/aare/gui/main_window.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/aare/gui/main_window.py b/src/aare/gui/main_window.py index afaf2967..6e66371f 100644 --- a/src/aare/gui/main_window.py +++ b/src/aare/gui/main_window.py @@ -19,6 +19,7 @@ from aare.gui.panels.LogPanel import LogDock from aare.gui.panels.beamline_controls import BeamlineControls from aare.gui.panels.data_collection_settings import DataCollectionSettings +from aare.gui.panels.developer_help_dialog import DeveloperHelpDialog from aare.gui.panels.manual_sample_panel import ManualSamplePanel from aare.gui.panels.reference_tools_panel import ReferenceToolsPanel from aare.gui.panels.sample_queue_panel import SampleQueuePanel @@ -59,6 +60,8 @@ class MainWindow(QMainWindow): self.__base_url = base_url self.__token = token self.__mounting = False + self._dev_help_dialog = None + # Tutorial manager (define tutorials after widgets exist) self.tutorial_manager = TutorialManager(self) @@ -460,6 +463,10 @@ class MainWindow(QMainWindow): about_action.triggered.connect(self.show_about_dialog) help_menu.addAction(about_action) + dev_help_action = QAction("Developer / Help", self) + dev_help_action.triggered.connect(self.show_developer_help) + help_menu.addAction(dev_help_action) + help_menu.addSeparator() start_text_tutorial_action = QAction("Start Tutorial (Text)", self) @@ -476,6 +483,17 @@ class MainWindow(QMainWindow): "About", "Aare Macromolecular Crystallography GUI\nVersion: 1.0\nCopyright: Paul Scherrer Institute 2024-2025", ) + def show_developer_help(self) -> None: + if self._dev_help_dialog is None: + self._dev_help_dialog = DeveloperHelpDialog( + daq=self.daq, + is_staff=bool(getattr(self.__decoded_token, "staff", False)), + parent=self, + ) + self._dev_help_dialog.refresh() + self._dev_help_dialog.show() + self._dev_help_dialog.raise_() + self._dev_help_dialog.activateWindow() @Slot(str) def show_sample_missing_dialog(self, msg: str):