Commit fad71d8d authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[widgets][algorithmeditor] Ensure a result exists when switching analyzer on

Fixes #270
parent ed1d8680
......@@ -719,8 +719,13 @@ class AlgorithmEditor(AbstractAssetEditor):
last_widget = self.group_list_widget.widget_list[-1]
last_widget.setUnsynchronizedEnabled(True)
self.results_groupbox.setVisible(self.property_editor.isAnalyzer())
self.parameters_groupbox.setVisible(not self.property_editor.isAnalyzer())
is_analyzer = self.property_editor.isAnalyzer()
self.results_groupbox.setVisible(is_analyzer)
self.parameters_groupbox.setVisible(not is_analyzer)
if is_analyzer:
if not self.result_list_widget.widget_list:
self.__onAddResult()
self.dataChanged.emit()
......@@ -798,6 +803,10 @@ class AlgorithmEditor(AbstractAssetEditor):
]:
widget.clear()
results = json_object.get("results", {})
for name, configuration in results.items():
self.__addResult(name, configuration)
groups = json_object.get("groups", [])
for group in groups:
self.__addGroup(group)
......@@ -806,10 +815,6 @@ class AlgorithmEditor(AbstractAssetEditor):
for name, configuration in parameters.items():
self.__addParameter(name, configuration)
results = json_object.get("results", {})
for name, configuration in results.items():
self.__addResult(name, configuration)
self.libraries_widget.set_available_libraries(self.library_model.stringList())
self.libraries_widget.set_used_libraries(json_object.get("uses", {}))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment