From f927de07cfdce30eaab26ee4ba7b1fac3c1ee7c5 Mon Sep 17 00:00:00 2001 From: duplo Date: Fri, 20 Mar 2009 17:32:57 +0000 Subject: [PATCH] Add autoenabled configuration parameters git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2401 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/BModulePage.py | 30 ++++++++++++++++++------------ wizard/bertos_utils.py | 2 ++ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/wizard/BModulePage.py b/wizard/BModulePage.py index a2f13a54..7241c80e 100644 --- a/wizard/BModulePage.py +++ b/wizard/BModulePage.py @@ -75,19 +75,25 @@ class BModulePage(BWizardPage): if len(configuration) > 0: configurations = self._projectInfoRetrieve("CONFIGURATIONS")[configuration] self.pageContent.propertyTable.setRowCount(len(configurations)) - for index, property in enumerate(configurations): - item = QTableWidgetItem(configurations[property]["brief"]) - item.setData(Qt.UserRole, qvariant_converter.convertString(property)) - self.pageContent.propertyTable.setItem(index, 0, item) - if "type" in configurations[property]["informations"].keys() and configurations[property]["informations"]["type"] == "boolean": - self._insertCheckBox(index, configurations[property]["value"]) - elif "type" in configurations[property]["informations"].keys() and configurations[property]["informations"]["type"] == "enum": - self._insertComboBox(index, configurations[property]["value"], configurations[property]["informations"]["value_list"]) - elif "type" in configurations[property]["informations"] and configurations[property]["informations"]["type"] == "int": - self._insertSpinBox(index, configurations[property]["value"], configurations[property]["informations"]) + index = 0 + for property in configurations: + if "type" in configurations[property]["informations"] and configurations[property]["informations"]["type"] == "autoenabled": + ## Doesn't show the hidden fields + pass else: - # Not defined type, rendered as a text field - self.pageContent.propertyTable.setItem(index, 1, QTableWidgetItem(property)) + item = QTableWidgetItem(configurations[property]["brief"]) + item.setData(Qt.UserRole, qvariant_converter.convertString(property)) + self.pageContent.propertyTable.setItem(index, 0, item) + if "type" in configurations[property]["informations"].keys() and configurations[property]["informations"]["type"] == "boolean": + self._insertCheckBox(index, configurations[property]["value"]) + elif "type" in configurations[property]["informations"].keys() and configurations[property]["informations"]["type"] == "enum": + self._insertComboBox(index, configurations[property]["value"], configurations[property]["informations"]["value_list"]) + elif "type" in configurations[property]["informations"] and configurations[property]["informations"]["type"] == "int": + self._insertSpinBox(index, configurations[property]["value"], configurations[property]["informations"]) + else: + # Not defined type, rendered as a text field + self.pageContent.propertyTable.setItem(index, 1, QTableWidgetItem(configurations[property]["value"])) + index += 1 else: self.pageContent.propertyTable.setRowCount(0) diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index b872cf15..47fa4b6b 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -56,6 +56,8 @@ def createBertosProject(projectInfo): string = open(sourcesDir + "/" + key, "r").read() for parameter, infos in value.items(): value = infos["value"] + if "type" in infos["informations"] and infos["informations"]["type"] == "autoenabled": + value = "1" if "unsigned" in infos["informations"].keys() and infos["informations"]["unsigned"]: value += "U" if "long" in infos["informations"].keys() and infos["informations"]["long"]: -- 2.25.1