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

[widgets][parameterwidget] Code / test cleanup

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