mirror of
https://github.com/nqrduck/nqrduck-spectrometer.git
synced 2024-11-09 12:30:01 +00:00
Merge pull request #19 from nqrduck/15-menubar-ui-problems
Updated menubar entry for spectrometer selection.
This commit is contained in:
commit
fbac6c8a69
1 changed files with 9 additions and 1 deletions
|
@ -112,6 +112,14 @@ class SpectrometerView(ModuleView):
|
||||||
self._module.model._available_spectrometers,
|
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 (
|
for (
|
||||||
spectrometer_name,
|
spectrometer_name,
|
||||||
spectrometer_module,
|
spectrometer_module,
|
||||||
|
@ -130,7 +138,7 @@ class SpectrometerView(ModuleView):
|
||||||
last_added_action = self._actions[list(self._actions.keys())[-1]]
|
last_added_action = self._actions[list(self._actions.keys())[-1]]
|
||||||
last_added_action.setChecked(True)
|
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)
|
@pyqtSlot(str)
|
||||||
def on_menu_button_clicked(self, spectrometer_name):
|
def on_menu_button_clicked(self, spectrometer_name):
|
||||||
|
|
Loading…
Reference in a new issue