X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2FBModulePage.py;h=11101c2cdf9851b030fcebfc18404b2ef0889fb1;hb=ad8fb90358803374a7fcf6f065305eb2eda9b4b7;hp=45103e11c8e4fd6a8f6d4cf88312ebd8f8eb5295;hpb=136ec0f3830266422f63ee6ab47ab28530c7f405;p=bertos.git 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())