Add the isComplete overload per the cpu selection page
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 19 Dec 2008 14:23:52 +0000 (14:23 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 19 Dec 2008 14:23:52 +0000 (14:23 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2108 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BCpuPage.py

index 501a5a209d91415df83a4ec524373bc1fbb8e902..2c884e231bb5f9cf8a009ec1d1c5294394abacf6 100644 (file)
@@ -18,12 +18,26 @@ class BCpuPage(BWizardPage):
     def __init__(self):
         BWizardPage.__init__(self, "cpu_select.ui")
         self.setTitle(self.tr("Select the CPU"))
+        self._connectSignals()
     
     def _populateCpuList(self):
+        self.pageContent.cpuList.clear()
         infos = bertos_utils.loadCpuInfos(self._projectInfoRetrieve("SOURCES_PATH"))
         for cpu in infos:
             self.pageContent.cpuList.addItem(QListWidgetItem(cpu["CPU_NAME"]))
     
+    def _connectSignals(self):
+        self.connect(self.pageContent.cpuList, SIGNAL("itemSelectionChanged()"), self.rowChanged)
+
     def reloadData(self):
         self._populateCpuList()
-        
\ No newline at end of file
+    
+    def isComplete(self):
+        if self.pageContent.cpuList.currentRow() != -1:
+            self._projectInfoStore("CPU_NAME", self.pageContent.cpuList.currentItem())
+            return True
+        else:
+            return False
+        
+    def rowChanged(self):
+        self.emit(SIGNAL("completeChanged()"))