From 140077731584c4fd0123b5aec1f5105002c68763 Mon Sep 17 00:00:00 2001 From: Benjamin Labrecque Date: Tue, 28 Jul 2026 16:13:34 +0200 Subject: [PATCH] fix: update service manager on existing ui --- cli/src/core/service_creator.py | 4 ++-- cli/src/models/gui_config.py | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cli/src/core/service_creator.py b/cli/src/core/service_creator.py index ad14a53..8bd8024 100644 --- a/cli/src/core/service_creator.py +++ b/cli/src/core/service_creator.py @@ -45,7 +45,7 @@ class ServiceCreator: self.ctx.master_hla_names.add_hla_name(service.name_upper) self.ctx.iocs_overview.add_ioc(service, description=ioc_description) self.ctx.master_ioc_subs.update_content(service_name=service.name_upper) - if gui_config.should_create_ui(): + if gui_config.should_create_new_ui() or gui_config.should_use_existing_ui(): self.ctx.service_manager_ui.update_xml( service=service, service_name_camel=service.name_camel, @@ -99,7 +99,7 @@ class ServiceCreator: "ioc_owner": ioc_owner, }, ) - if gui_config.should_create_ui(): + if gui_config.should_create_new_ui(): copier.run_copy( src_path=str(QT_TEMPLATES_DIR), dst_path=str(self.ctx.write_paths.qt_dir), diff --git a/cli/src/models/gui_config.py b/cli/src/models/gui_config.py index 5b9d472..2804839 100644 --- a/cli/src/models/gui_config.py +++ b/cli/src/models/gui_config.py @@ -11,9 +11,12 @@ class GuiConfig(BaseModel): gui_option: GuiOption raw_ui_filename: Optional[str] = None - def should_create_ui(self): + def should_create_new_ui(self): return self.gui_option == GuiOption.NEW + def should_use_existing_ui(self): + return self.gui_option == GuiOption.EXISTING + @property def ui_filename(self) -> str: if self.raw_ui_filename is None: @@ -33,6 +36,7 @@ class GuiConfig(BaseModel): raise InvalidCliOptions( f"Could not find service with name {self.ui_filename} in service_registry." ) from e + if self.gui_option == GuiOption.NONE and self.raw_ui_filename: raise InvalidCliOptions( f"Cannot specify --ui-filename when --gui-option is {GuiOption.NONE}"