Add the module description in the module page
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 6 Feb 2009 11:37:12 +0000 (11:37 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 6 Feb 2009 11:37:12 +0000 (11:37 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2290 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BModulePage.py
wizard/bertos_utils.py
wizard/ui/module_select.ui

index af1404e9bf476b3ae0b6191ae0d6fb72b8901eea..c44492843fbec92be4eafcacd092fca8ae3102a4 100644 (file)
@@ -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)
index 3854f9f269682ff7c6c02ca0f5f8838b2c9228ff..6065c677cf6241bc4e7869bbad4fbfe9697f4a8e 100644 (file)
@@ -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:
index 8c476c594ff7f6b0d79df740d0f2d353bef1e3ad..370e321263008df0d6c44f644fb0aa852b195aec 100644 (file)
@@ -5,8 +5,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>559</width>
-    <height>412</height>
+    <width>621</width>
+    <height>428</height>
    </rect>
   </property>
   <property name="sizePolicy" >
     </layout>
    </item>
    <item>
-    <widget class="QTableWidget" name="propertyTable" >
-     <property name="editTriggers" >
-      <set>QAbstractItemView::NoEditTriggers</set>
-     </property>
-     <property name="selectionMode" >
-      <enum>QAbstractItemView::SingleSelection</enum>
-     </property>
-     <property name="selectionBehavior" >
-      <enum>QAbstractItemView::SelectRows</enum>
-     </property>
-     <property name="showGrid" >
-      <bool>false</bool>
-     </property>
-    </widget>
+    <layout class="QVBoxLayout" name="verticalLayout_2" >
+     <item>
+      <widget class="QLabel" name="moduleLabel" >
+       <property name="text" >
+        <string/>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QTableWidget" name="propertyTable" >
+       <property name="editTriggers" >
+        <set>QAbstractItemView::NoEditTriggers</set>
+       </property>
+       <property name="selectionMode" >
+        <enum>QAbstractItemView::SingleSelection</enum>
+       </property>
+       <property name="selectionBehavior" >
+        <enum>QAbstractItemView::SelectRows</enum>
+       </property>
+       <property name="showGrid" >
+        <bool>false</bool>
+       </property>
+      </widget>
+     </item>
+    </layout>
    </item>
   </layout>
  </widget>