Show visual feedback for modules autoenabled in module page
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 8 Sep 2009 13:29:56 +0000 (13:29 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 8 Sep 2009 13:29:56 +0000 (13:29 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2903 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BModulePage.py

index fac4cacd76d53c073dc2e0695a9a1dcf37996255..ca05160361f88e78947c44d8d534ef95e81ea264 100644 (file)
@@ -77,6 +77,7 @@ class BModulePage(BWizardPage):
         Overload of the BWizardPage connectSignals method.
         """
         self.connect(self.pageContent.moduleTree, SIGNAL("itemPressed(QTreeWidgetItem*, int)"), self.fillPropertyTable)
+        self.connect(self.pageContent.moduleTree, SIGNAL("itemPressed(QTreeWidgetItem*, int)"), self.moduleClicked)
         self.connect(self.pageContent.moduleTree, SIGNAL("itemChanged(QTreeWidgetItem*, int)"), self.dependencyCheck)
         self.connect(self.pageContent.propertyTable, SIGNAL("itemSelectionChanged()"), self.showPropertyDescription)
 
@@ -94,6 +95,9 @@ class BModulePage(BWizardPage):
     
     ## Slots ##
 
+    def moduleClicked(self, item, column):
+        self.setBold(item, False)
+
     def fillPropertyTable(self):
         """
         Slot called when the user selects a module from the module tree.
@@ -373,6 +377,13 @@ class BModulePage(BWizardPage):
                 break
             self.pageContent.propertyTable.item(index, 0).setText(self.currentModuleConfigurations()[property_name]['brief'])
     
+    def setBold(self, item, bold):
+        self.pageContent.moduleTree.blockSignals(True)
+        font = item.font(0)
+        font.setBold(bold)
+        item.setFont(0, font)
+        self.pageContent.moduleTree.blockSignals(False)
+
     def moduleSelected(self, selectedModule):
         """
         Resolves the selection dependencies.
@@ -392,6 +403,8 @@ class BModulePage(BWizardPage):
                 item = self.pageContent.moduleTree.topLevelItem(category)
                 for child in range(item.childCount()):
                     if unicode(item.child(child).text(0)) in unsatisfied:
+                        self.setBold(item.child(child), True)
+                        self.setBold(item, True)
                         item.child(child).setCheckState(0, Qt.Checked)
     
     def moduleUnselected(self, unselectedModule):