From 752340d7f7ca597637fb42a19c5190a61a7db3c4 Mon Sep 17 00:00:00 2001 From: jupfi Date: Sun, 14 Apr 2024 20:13:32 +0200 Subject: [PATCH] Updated menubar entry for spectrometer selection. --- src/nqrduck_spectrometer/view.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/nqrduck_spectrometer/view.py b/src/nqrduck_spectrometer/view.py index 8354eb0..980feeb 100644 --- a/src/nqrduck_spectrometer/view.py +++ b/src/nqrduck_spectrometer/view.py @@ -112,6 +112,14 @@ class SpectrometerView(ModuleView): self._module.model._available_spectrometers, ) + # Create an header action called 'Spectrometer" + self._actions["Spectrometer"] = QAction("Spectrometer:", menu_item) + font = self._actions["Spectrometer"].font() + font.setBold(True) + self._actions["Spectrometer"].setFont(font) + self._actions["Spectrometer"].setEnabled(False) + menu_item.addSeparator() + for ( spectrometer_name, spectrometer_module, @@ -130,7 +138,7 @@ class SpectrometerView(ModuleView): last_added_action = self._actions[list(self._actions.keys())[-1]] last_added_action.setChecked(True) - self.add_menubar_item.emit("Hardware", list(self._actions.values())) + self.add_menubar_item.emit("Hardware", list(self._actions.values()), True) @pyqtSlot(str) def on_menu_button_clicked(self, spectrometer_name):