Divide into categories the selected module in the summary page
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 20 Feb 2009 14:28:31 +0000 (14:28 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 20 Feb 2009 14:28:31 +0000 (14:28 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2368 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BCreationPage.py

index e83f45948c1ad70eb22e823767a464bbd4daeb4a..1cc3ab661a31cb1ff6c2fda9c4aebe7da3ad35a2 100644 (file)
@@ -61,12 +61,23 @@ class BCreationPage(BWizardPage):
         topLevel.append(toolchainTitle)
         moduleTitle = QTreeWidgetItem(QStringList([self.tr("Modules")]))
         configurations = self._projectInfoRetrieve("CONFIGURATIONS")
+        moduleCategories = {}
         for module, information in self._projectInfoRetrieve("MODULES").items():
             if information["enabled"]:
-                moduleItem = QTreeWidgetItem(moduleTitle, QStringList([module + " - " + information["description"]]))
+                if information["category"] not in moduleCategories.keys():
+                    moduleCategories[information["category"]] = []
+                moduleItem = QTreeWidgetItem(QStringList([module + " - " + information["description"]]))
+                moduleCategories[information["category"]].append(moduleItem)
                 if len(information["configuration"]) > 0:
                     for property, data in configurations[information["configuration"]].items():
-                        configurationItem = QTreeWidgetItem(moduleItem, QStringList([data["brief"] + " " + data["value"]]))
+                        # If the final char of the brief is a dot (".") removes it.
+                        brief = data["brief"]
+                        if brief[-1] == ".":
+                            brief = brief[:-1]
+                        configurationItem = QTreeWidgetItem(moduleItem, QStringList([brief + ": " + data["value"]]))
+        for key, value in moduleCategories.items():
+            categoryItem = QTreeWidgetItem(moduleTitle, QStringList([key]))
+            categoryItem.addChildren(value)
         topLevel.append(moduleTitle)
         self.pageContent.summaryTree.insertTopLevelItems(0, topLevel)