Commit 810ea920 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[widgets][parameterwidget] Code / test cleanup

parent dd384ac8
This diff is collapsed.
......@@ -248,7 +248,7 @@ class StringSetupWidget(QWidget):
layout.addLayout(radio_buttons_layout)
# single items
self.single_default_ledit = QLineEdit()
self.single_default_lineedit = QLineEdit()
# choices items
self.choices_default_combobox = QComboBox()
......@@ -283,7 +283,7 @@ class StringSetupWidget(QWidget):
self.single_button.toggled.connect(self.dataChanged)
self.choices_button.toggled.connect(self.dataChanged)
self.single_default_ledit.textChanged.connect(self.dataChanged)
self.single_default_lineedit.textChanged.connect(self.dataChanged)
self.choices_default_combobox.currentIndexChanged.connect(self.dataChanged)
choices_model = self.choices_listwidget.model()
choices_model.rowsInserted.connect(self.dataChanged)
......@@ -318,7 +318,7 @@ class StringSetupWidget(QWidget):
raise RuntimeError("Invalid default value")
else:
self.single_button.setChecked(True)
self.single_default_ledit.setText(default)
self.single_default_lineedit.setText(default)
def dump(self):
"""Returns the json representation of the editor"""
......@@ -326,7 +326,7 @@ class StringSetupWidget(QWidget):
data = {}
if self.single_button.isChecked():
data["default"] = self.single_default_ledit.text()
data["default"] = self.single_default_lineedit.text()
else:
data["default"] = self.choices_default_combobox.currentText()
data["choice"] = [
......@@ -340,14 +340,14 @@ class StringSetupWidget(QWidget):
"""Reset the editor to its default state"""
self.single_button.setChecked(True)
self.single_default_ledit.clear()
self.single_default_lineedit.clear()
self.choices_listwidget.clear()
self.choices_default_combobox.clear()
def __setup_single_ui(self):
layout = QFormLayout()
layout.addRow(self.tr("Default:"), self.single_default_ledit)
layout.addRow(self.tr("Default:"), self.single_default_lineedit)
self.single_conf_widget.setLayout(layout)
def __setup_choices_ui(self):
......
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