From: duplo Date: Thu, 22 Jan 2009 11:51:24 +0000 (+0000) Subject: Add the appropriate widget for the parameters X-Git-Tag: 2.1.0~483 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=ad8fb90358803374a7fcf6f065305eb2eda9b4b7;p=bertos.git Add the appropriate widget for the parameters git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2199 38d2e660-2303-0410-9eaa-f027e97ec537 --- 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())