X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2FBCpuPage.py;h=2c884e231bb5f9cf8a009ec1d1c5294394abacf6;hb=29094c2d235a65c3edadd2ec3398b8d71c91a998;hp=03ef2cc05242e4ad9437c587a0af7235fd6c1a7b;hpb=d07bfc9a7ed35125525f82b331d8dab25f06fca8;p=bertos.git diff --git a/wizard/BCpuPage.py b/wizard/BCpuPage.py index 03ef2cc0..2c884e23 100644 --- a/wizard/BCpuPage.py +++ b/wizard/BCpuPage.py @@ -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): - cpus = bertos_utils.findDefinitions("cdef", self._projectInfoRetrieve("SOURCES_PATH")) - for cpu in cpus.keys(): - self.pageContent.cpuList.addItem(QListWidgetItem(cpu)) + 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()"))