diff --git a/AGENTS.md b/AGENTS.md index 5057520..8c19dc6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -168,7 +168,10 @@ documentation page "CustomApp and CustomExt" (`docs/src/developer_folder/custom_ here. - Long-running work (a scan, a sequence, a ramp) goes in an `ExtensionWorker` subclass run in a thread, started and stopped from the extension's workflow actions, as in `sequencer.py` and `ramping.py`. -- `__init__(self, parent: DockArea, dashboard)`: call `super().__init__(parent, dashboard)`, then `self.setup_ui()`. +- `__init__(self, parent: DockArea, dashboard)`: call `super().__init__(parent, dashboard, add_toolbar_break=False)`, + then `self.setup_ui()`. An extension has two toolbars: its own, created by the base class (`CustomApp.__init__`, + `add_toolbar_break` is `True` by default), and the Dashboard one created by `create_dashboard_toolbar(add_break=False)` + in `setup_menus_and_toolbars`. The extensions of PyMoDAQ (scan, sequencer, ramping...) add a break before neither. - **Experiment and state belong to the Dashboard.** The *experiment* is the list of instruments (actuators and detectors) the Dashboard manages and controls; the *state* is the state of that experiment, mostly the values of the instruments' settings and of the Dashboard's actuators. An extension must use the managers it gets through its diff --git a/src/pymodaq_plugins_template/extensions/custom_extension_template.py b/src/pymodaq_plugins_template/extensions/custom_extension_template.py index deb901d..bd16dea 100644 --- a/src/pymodaq_plugins_template/extensions/custom_extension_template.py +++ b/src/pymodaq_plugins_template/extensions/custom_extension_template.py @@ -42,7 +42,9 @@ class CustomExtensionTemplate(CustomExt): params = [] def __init__(self, parent: gutils.DockArea, dashboard): - super().__init__(parent, dashboard) # also creates self.modules_manager for this extension + # also creates self.modules_manager for this extension, and the extension's own toolbar (named after the + # class). Like the PyMoDAQ extensions (scan, sequencer...), no break is added before it + super().__init__(parent, dashboard, add_toolbar_break=False) self.setup_ui() # calls, in this order: setup_docks_and_widgets, setup_menus_and_toolbars, # setup_actions, connect_things and do_things_after_ui_setup @@ -77,7 +79,7 @@ def setup_menus_and_toolbars(self, menubar: QtWidgets.QMenuBar = None): -------- pymodaq.utils.managers.action_manager.ActionManager """ - # adds the toolbar showing/hiding the Dashboard, loading an experiment and a state + # adds a second toolbar, the Dashboard one: show/hide the Dashboard, load an experiment and a state self.create_dashboard_toolbar(add_break=False) def setup_actions(self):