Add autoenabled configuration parameters
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 20 Mar 2009 17:32:57 +0000 (17:32 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 20 Mar 2009 17:32:57 +0000 (17:32 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2401 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BModulePage.py
wizard/bertos_utils.py

index a2f13a5474dcd33fc0102b15b1d61b5f26bd3d02..7241c80e0a2a28ba93dbe5a0c977898b40c96978 100644 (file)
@@ -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)
     
index b872cf1501986baacbdd101199241a1b712d2cfc..47fa4b6b8572315b8c11e3bb53888bd7029bb82a 100644 (file)
@@ -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"]: