From: duplo Date: Fri, 20 Feb 2009 14:28:31 +0000 (+0000) Subject: Divide into categories the selected module in the summary page X-Git-Tag: 2.1.0~314 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=7eea445bdce87ce7acf2c3c22679ce6ce30a8c6e;p=bertos.git Divide into categories the selected module in the summary page git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2368 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/wizard/BCreationPage.py b/wizard/BCreationPage.py index e83f4594..1cc3ab66 100644 --- a/wizard/BCreationPage.py +++ b/wizard/BCreationPage.py @@ -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)