Show in evidence when the module is not totally supported by the selected cpu
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 17 Apr 2009 10:21:40 +0000 (10:21 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 17 Apr 2009 10:21:40 +0000 (10:21 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2532 38d2e660-2303-0410-9eaa-f027e97ec537

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

index f95b8e7a3067e075864e081feaa4d30c13ebba16..2191ce6056b9a7b8fe2d952d5a871bbaa9ee73f0 100644 (file)
@@ -46,6 +46,7 @@ class BModulePage(BWizardPage):
         self.pageContent.propertyTable.setColumnCount(2)
         self.pageContent.propertyTable.setRowCount(0)
         self.pageContent.moduleLabel.setVisible(False)
+        self.pageContent.warningLabel.setVisible(False)
     
     def connectSignals(self):
         """
@@ -77,11 +78,23 @@ class BModulePage(BWizardPage):
         """
         module = self.currentModule()
         if module is not None:
+            try:
+                supported = bertos_utils.isSupported(module, self.project())
+            except SupportedException, e:
+                self.exceptionOccurred(self.tr("Error evaluating \"%1\" for module %2").arg(e.support_string).arg(selectedModule))
+                supported = True
             self._control_group.clear()
             configuration = self.projectInfo("MODULES")[module]["configuration"]
             module_description = self.projectInfo("MODULES")[module]["description"]
             self.pageContent.moduleLabel.setText(module_description)
             self.pageContent.moduleLabel.setVisible(True)
+            if not supported:
+                self.pageContent.warningLabel.setVisible(True)
+                selected_cpu = self.projectInfo("CPU_NAME")
+                self.pageContent.warningLabel.setText(self.tr("<font color='#FF0000'>Warning: the selected module, \
+                    is not completely supported by the %1.</font>").arg(selected_cpu))
+            else:
+                self.pageContent.warningLabel.setVisible(False)
             self.pageContent.propertyTable.clear()
             self.pageContent.propertyTable.setRowCount(0)
             if configuration != "":
@@ -191,6 +204,13 @@ class BModulePage(BWizardPage):
             for module in module_list:
                 enabled = modules[module]["enabled"]
                 module_item = QTreeWidgetItem(item, QStringList([module]))
+                try:
+                    supported = bertos_utils.isSupported(module, self.project())
+                except SupportedException, e:
+                    self.exceptionOccurred(self.tr("Error evaluating \"%1\" for module %2").arg(e.support_string).arg(selectedModule))
+                    supported = True
+                if not supported:
+                    module_item.setForeground(0, QBrush(QColor(Qt.red)))
                 if enabled:
                     module_item.setCheckState(0, Qt.Checked)
                 else:
@@ -322,16 +342,6 @@ class BModulePage(BWizardPage):
         Resolves the selection dependencies.
         """
         modules = self.projectInfo("MODULES")
-        try:
-            supported = bertos_utils.isSupported(selectedModule, self.project())
-        except SupportedException, e:
-            self.exceptionOccurred(self.tr("Error evaluating \"%1\" for module %2").arg(e.support_string).arg(selectedModule))
-            supported = True
-        # Temporary feedback
-        if supported:
-            print "%s is supported" %selectedModule
-        else:
-            print "%s is not supported" %selectedModule
         modules[selectedModule]["enabled"] = True
         self.setProjectInfo("MODULES", modules)
         depends = self.projectInfo("MODULES")[selectedModule]["depends"]
index c8b8e4a3d8ba29f657536be2057721e2fd47e1ad..6efa7741d1ed2944f75b07baaa25cb17f527e270 100644 (file)
@@ -1,7 +1,8 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
  <class>Form</class>
- <widget class="QWidget" name="Form" >
-  <property name="geometry" >
+ <widget class="QWidget" name="Form">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <height>409</height>
    </rect>
   </property>
-  <property name="sizePolicy" >
-   <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
     <horstretch>0</horstretch>
     <verstretch>0</verstretch>
    </sizepolicy>
   </property>
-  <property name="windowTitle" >
+  <property name="windowTitle">
    <string>Form</string>
   </property>
-  <layout class="QHBoxLayout" name="horizontalLayout" >
+  <layout class="QHBoxLayout" name="horizontalLayout">
    <item>
-    <layout class="QVBoxLayout" name="verticalLayout_3" >
+    <layout class="QVBoxLayout" name="verticalLayout_3">
      <item>
-      <widget class="QTreeWidget" name="moduleTree" >
-       <property name="minimumSize" >
+      <widget class="QTreeWidget" name="moduleTree">
+       <property name="minimumSize">
         <size>
          <width>175</width>
          <height>0</height>
         </size>
        </property>
-       <property name="maximumSize" >
+       <property name="maximumSize">
         <size>
          <width>175</width>
          <height>16777215</height>
         </size>
        </property>
        <column>
-        <property name="text" >
+        <property name="text">
          <string>1</string>
         </property>
        </column>
       </widget>
      </item>
      <item>
-      <widget class="QCheckBox" name="automaticFix" >
-       <property name="minimumSize" >
+      <widget class="QCheckBox" name="automaticFix">
+       <property name="minimumSize">
         <size>
          <width>175</width>
          <height>0</height>
         </size>
        </property>
-       <property name="maximumSize" >
+       <property name="maximumSize">
         <size>
          <width>175</width>
          <height>16777215</height>
         </size>
        </property>
-       <property name="text" >
+       <property name="text">
         <string>Automatically fix
 dependecies</string>
        </property>
-       <property name="checked" >
+       <property name="checked">
         <bool>true</bool>
        </property>
       </widget>
@@ -68,10 +69,10 @@ dependecies</string>
     </layout>
    </item>
    <item>
-    <layout class="QVBoxLayout" name="verticalLayout" >
+    <layout class="QVBoxLayout" name="verticalLayout">
      <item>
-      <widget class="Line" name="line" >
-       <property name="orientation" >
+      <widget class="Line" name="line">
+       <property name="orientation">
         <enum>Qt::Vertical</enum>
        </property>
       </widget>
@@ -79,39 +80,49 @@ dependecies</string>
     </layout>
    </item>
    <item>
-    <layout class="QVBoxLayout" name="verticalLayout_2" >
+    <layout class="QVBoxLayout" name="verticalLayout_2">
      <item>
-      <widget class="QLabel" name="moduleLabel" >
-       <property name="text" >
+      <widget class="QLabel" name="moduleLabel">
+       <property name="text">
         <string/>
        </property>
       </widget>
      </item>
      <item>
-      <widget class="QTableWidget" name="propertyTable" >
-       <property name="editTriggers" >
+      <widget class="QTableWidget" name="propertyTable">
+       <property name="editTriggers">
         <set>QAbstractItemView::NoEditTriggers</set>
        </property>
-       <property name="alternatingRowColors" >
+       <property name="alternatingRowColors">
         <bool>true</bool>
        </property>
-       <property name="selectionMode" >
+       <property name="selectionMode">
         <enum>QAbstractItemView::SingleSelection</enum>
        </property>
-       <property name="selectionBehavior" >
+       <property name="selectionBehavior">
         <enum>QAbstractItemView::SelectRows</enum>
        </property>
-       <property name="showGrid" >
+       <property name="showGrid">
         <bool>false</bool>
        </property>
-       <property name="wordWrap" >
+       <property name="wordWrap">
         <bool>true</bool>
        </property>
-       <property name="cornerButtonEnabled" >
+       <property name="cornerButtonEnabled">
         <bool>false</bool>
        </property>
       </widget>
      </item>
+     <item>
+      <widget class="QLabel" name="warningLabel">
+       <property name="text">
+        <string/>
+       </property>
+       <property name="wordWrap">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
     </layout>
    </item>
   </layout>