From 7eea445bdce87ce7acf2c3c22679ce6ce30a8c6e Mon Sep 17 00:00:00 2001 From: duplo Date: Fri, 20 Feb 2009 14:28:31 +0000 Subject: [PATCH] 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 --- wizard/BCreationPage.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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) -- 2.25.1