From ad8fb90358803374a7fcf6f065305eb2eda9b4b7 Mon Sep 17 00:00:00 2001 From: duplo Date: Thu, 22 Jan 2009 11:51:24 +0000 Subject: [PATCH] Add the appropriate widget for the parameters git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2199 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/BModulePage.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/wizard/BModulePage.py b/wizard/BModulePage.py index 45103e11..11101c2c 100644 --- a/wizard/BModulePage.py +++ b/wizard/BModulePage.py @@ -49,7 +49,24 @@ class BModulePage(BWizardPage): self.pageContent.propertyTable.setRowCount(len(parameters)) for index, key in enumerate(parameters): self.pageContent.propertyTable.setItem(index, 0, QTableWidgetItem(key)) - self.pageContent.propertyTable.setItem(index, 1, QTableWidgetItem(parameters[key]["value"])) + if "type" in parameters[key]["informations"].keys(): + if parameters[key]["informations"]["type"] == "boolean": + checkBox = QCheckBox() + self.pageContent.propertyTable.setCellWidget(index, 1, checkBox) + checkBox.setChecked(parameters[key]["value"] == "1") + if parameters[key]["informations"]["type"] == "int": + spinBox = QSpinBox() + if "max" in parameters[key]["informations"].keys(): + spinBox.setMaximum(int(parameters[key]["informations"]["max"])) + if "min" in parameters[key]["informations"].keys(): + spinBox.setMinimum(int(parameters[key]["informations"]["min"])) + if "long" in parameters[key]["informations"].keys(): + if bool(parameters[key]["informations"]["long"]): + spinBox.setSuffix("L") + self.pageContent.propertyTable.setCellWidget(index, 1, spinBox) + spinBox.setValue(int(parameters[key]["value"])) + else: + self.pageContent.propertyTable.setItem(index, 1, QTableWidgetItem(parameters[key]["value"])) def moduleItemClicked(self): module = unicode(self.pageContent.moduleList.currentItem().text()) -- 2.25.1