diff --git a/laserstudio/widgets/toolbars/laserdrivertoolbar.py b/laserstudio/widgets/toolbars/laserdrivertoolbar.py index 26d36a2..997e5c2 100644 --- a/laserstudio/widgets/toolbars/laserdrivertoolbar.py +++ b/laserstudio/widgets/toolbars/laserdrivertoolbar.py @@ -17,7 +17,7 @@ def __init__(self, laser_studio: "LaserStudio", laser_num: int): assert laser_num < len(laser_studio.instruments.lasers) self.laser = laser_studio.instruments.lasers[laser_num] assert isinstance(self.laser, LaserDriverInstrument) - super().__init__(f"Laser {laser_num} (Donjon Driver)", f"toolbar-laser-donjon-{laser_num}") + super().__init__(f"Laser {laser_num} (Donjon Driver)", "donjon", laser_num) self.setAllowedAreas( Qt.ToolBarArea.LeftToolBarArea | Qt.ToolBarArea.RightToolBarArea ) diff --git a/laserstudio/widgets/toolbars/lasertoolbar.py b/laserstudio/widgets/toolbars/lasertoolbar.py index f1851aa..ec03891 100644 --- a/laserstudio/widgets/toolbars/lasertoolbar.py +++ b/laserstudio/widgets/toolbars/lasertoolbar.py @@ -2,10 +2,10 @@ class LaserToolbar(QToolBar): - def __init__(self, title: str, object_name: str): + def __init__(self, title: str, laser_model: str, laser_num: int): """ - :param title: Toolbar title, as displayed in the context menus. - :param object_name: Unique object name for Qt, used for settings save and restore. + :param laser_model: Equipment model, such as "pdm". Used for settings save and restore. + :param laser_num: Laser equipment index. """ super().__init__(title) - super().setObjectName(object_name) # For settings save and restore + super().setObjectName(f"toolbox-laser-{laser_model}-{laser_num}") # For settings save and restore diff --git a/laserstudio/widgets/toolbars/pdmtoolbar.py b/laserstudio/widgets/toolbars/pdmtoolbar.py index 031a482..605a833 100644 --- a/laserstudio/widgets/toolbars/pdmtoolbar.py +++ b/laserstudio/widgets/toolbars/pdmtoolbar.py @@ -24,7 +24,7 @@ def __init__(self, laser_studio: "LaserStudio", laser_num: int): assert laser_num < len(laser_studio.instruments.lasers) self.laser = laser_studio.instruments.lasers[laser_num] assert isinstance(self.laser, PDMInstrument) - super().__init__(f"Laser {laser_num} (PDM)", f"toolbar-laser-pdm-{laser_num}") + super().__init__(f"Laser {laser_num} (PDM)", "pdm", laser_num) self.setAllowedAreas( Qt.ToolBarArea.LeftToolBarArea | Qt.ToolBarArea.RightToolBarArea )