fix: update service manager on existing ui
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user