Commit a1ea43b0 authored by Samuel GAIST's avatar Samuel GAIST Committed by Samuel GAIST
Browse files

[widgets][algorithmeditor] Fixed handling of result and parameters for analyzers

parent 7ef794eb
......@@ -256,6 +256,7 @@ class PropertyEditor(QWidget):
self.autonomous_radiobutton,
]:
self.sequential_radiobutton.setChecked(True)
self.splittable_checkbox.setDisabled(checked)
def isAnalyzer(self):
return self.analyzer_checkbox.isChecked()
......@@ -628,17 +629,18 @@ class AlgorithmEditor(AbstractAssetEditor):
groups_layout.addWidget(self.add_group_button)
# Parameters
parameters_groupbox = QGroupBox(self.tr("Parameters"))
parameters_layout = QVBoxLayout(parameters_groupbox)
self.parameters_groupbox = QGroupBox(self.tr("Parameters"))
parameters_layout = QVBoxLayout(self.parameters_groupbox)
parameters_layout.addWidget(self.parameter_list_widget)
parameters_layout.addWidget(self.add_parameter_button)
self.parameters_groupbox.setVisible(not self.property_editor.isAnalyzer())
# Results
results_groupbox = QGroupBox(self.tr("Results"))
results_layout = QVBoxLayout(results_groupbox)
self.results_groupbox = QGroupBox(self.tr("Results"))
results_layout = QVBoxLayout(self.results_groupbox)
results_layout.addWidget(self.result_list_widget)
results_layout.addWidget(self.add_result_button)
results_groupbox.setVisible(self.property_editor.isAnalyzer())
self.results_groupbox.setVisible(self.property_editor.isAnalyzer())
# Libraries
libraries_groupbox = QGroupBox(self.tr("Libraries"))
......@@ -647,15 +649,15 @@ class AlgorithmEditor(AbstractAssetEditor):
editors_scrollwidget = ScrollWidget()
editors_scrollwidget.addWidget(groups_groupbox)
editors_scrollwidget.addWidget(parameters_groupbox)
editors_scrollwidget.addWidget(results_groupbox)
editors_scrollwidget.addWidget(self.parameters_groupbox)
editors_scrollwidget.addWidget(self.results_groupbox)
editors_scrollwidget.addWidget(libraries_groupbox)
self.layout().addWidget(self.property_editor)
self.layout().addWidget(editors_scrollwidget)
self.property_editor.dataChanged.connect(self.__updateUI)
self.property_editor.analyzerStateChanged.connect(results_groupbox.setVisible)
self.property_editor.analyzerStateChanged.connect(self.__updateUI)
self.group_list_widget.dataChanged.connect(self.dataChanged)
self.parameter_list_widget.dataChanged.connect(self.dataChanged)
self.result_list_widget.dataChanged.connect(self.dataChanged)
......@@ -694,6 +696,9 @@ 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())
self.dataChanged.emit()
@pyqtSlot()
......@@ -790,7 +795,10 @@ class AlgorithmEditor(AbstractAssetEditor):
widget.dump() for widget in self.group_list_widget.widget_list
]
if self.parameter_list_widget.widget_list:
if (
not self.property_editor.isAnalyzer()
and self.parameter_list_widget.widget_list
):
data["parameters"] = {}
for widget in self.parameter_list_widget.widget_list:
data["parameters"][widget.name()] = widget.dump()
......
Supports Markdown
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