From: duplo Date: Fri, 6 Feb 2009 11:37:12 +0000 (+0000) Subject: Add the module description in the module page X-Git-Tag: 2.1.0~392 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=179b0cb7522fc025ec5c86ca228f109de6282401;p=bertos.git Add the module description in the module page git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2290 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/wizard/BModulePage.py b/wizard/BModulePage.py index af1404e9..c4449284 100644 --- a/wizard/BModulePage.py +++ b/wizard/BModulePage.py @@ -73,10 +73,13 @@ class BModulePage(BWizardPage): module = self._currentModule() self._controlGroup.clear() configuration = self._projectInfoRetrieve("MODULES")[module]["configuration"] + moduleDescription = self._projectInfoRetrieve("MODULES")[module]["description"] + self.pageContent.moduleLabel.setText(moduleDescription) + self.pageContent.moduleLabel.setVisible(True) self.pageContent.propertyTable.clear() if len(configuration) > 0: configurations = self._projectInfoRetrieve("CONFIGURATIONS")[configuration] - self.pageContent.propertyTable.setRowCount(len(configurations)) + self.pageContent.propertyTable.setRowCount(len(configurations) + 1) for index, property in enumerate(configurations): item = QTableWidgetItem(property) item.setData(Qt.UserRole, qvariant_converter.convertString(property)) @@ -181,6 +184,7 @@ class BModulePage(BWizardPage): self.pageContent.propertyTable.verticalHeader().setVisible(False) self.pageContent.propertyTable.setColumnCount(2) self.pageContent.propertyTable.setRowCount(0) + self.pageContent.moduleLabel.setVisible(False) def _connectSignals(self): self.connect(self.pageContent.moduleTable, SIGNAL("itemSelectionChanged()"), self._fillPropertyTable) diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index 3854f9f2..6065c677 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -247,6 +247,11 @@ def loadModuleInfos(path): "configuration": WIZARD_MODULE["configuration"], "description": "", "enabled": False} + index = comment.find("\\brief") + if index != -1: + description = comment[index + 7:] + description = description[:description.find(" * ")] + moduleInfos[WIZARD_MODULE["name"]]["description"] = description return moduleInfos return {} except SyntaxError: diff --git a/wizard/ui/module_select.ui b/wizard/ui/module_select.ui index 8c476c59..370e3212 100644 --- a/wizard/ui/module_select.ui +++ b/wizard/ui/module_select.ui @@ -5,8 +5,8 @@ 0 0 - 559 - 412 + 621 + 428 @@ -53,20 +53,31 @@ - - - QAbstractItemView::NoEditTriggers - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - false - - + + + + + + + + + + + + QAbstractItemView::NoEditTriggers + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + false + + + +