Add the cpu in the project infos
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 19 Dec 2008 15:09:01 +0000 (15:09 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 19 Dec 2008 15:09:01 +0000 (15:09 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2111 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BCpuPage.py

index 2c884e231bb5f9cf8a009ec1d1c5294394abacf6..6a544a3a7facb31d63344d3cc8089de279fbc736 100644 (file)
@@ -28,13 +28,21 @@ class BCpuPage(BWizardPage):
     
     def _connectSignals(self):
         self.connect(self.pageContent.cpuList, SIGNAL("itemSelectionChanged()"), self.rowChanged)
+    
+    def _selectItem(self, cpu):
+        elements = self.pageContent.cpuList.findItems(cpu, Qt.MatchCaseSensitive)
+        if len(elements) == 1:
+            self.pageContent.cpuList.setCurrentItem(elements[0])
 
     def reloadData(self):
         self._populateCpuList()
+        cpuName = self._projectInfoRetrieve("CPU_NAME")
+        if not cpuName is None:
+            self._selectItem(cpuName)
     
     def isComplete(self):
         if self.pageContent.cpuList.currentRow() != -1:
-            self._projectInfoStore("CPU_NAME", self.pageContent.cpuList.currentItem())
+            self._projectInfoStore("CPU_NAME", self.pageContent.cpuList.currentItem().text())
             return True
         else:
             return False