4 # Copyright 2008 Develer S.r.l. (http://www.develer.com/)
9 # Author: Lorenzo Berni <duplo@develer.com>
13 from BWizardPage import *
16 class BCpuPage(BWizardPage):
19 BWizardPage.__init__(self, "cpu_select.ui")
20 self.setTitle(self.tr("Select the CPU"))
21 self._connectSignals()
23 def _populateCpuList(self):
24 self.pageContent.cpuList.clear()
25 infos = bertos_utils.loadCpuInfos(self._projectInfoRetrieve("SOURCES_PATH"))
27 self.pageContent.cpuList.addItem(QListWidgetItem(cpu["CPU_NAME"]))
29 def _connectSignals(self):
30 self.connect(self.pageContent.cpuList, SIGNAL("itemSelectionChanged()"), self.rowChanged)
32 def _selectItem(self, cpu):
33 elements = self.pageContent.cpuList.findItems(cpu, Qt.MatchCaseSensitive)
34 if len(elements) == 1:
35 self.pageContent.cpuList.setCurrentItem(elements[0])
38 self._populateCpuList()
39 cpuName = self._projectInfoRetrieve("CPU_NAME")
40 if not cpuName is None:
41 self._selectItem(cpuName)
44 if self.pageContent.cpuList.currentRow() != -1:
45 self._projectInfoStore("CPU_NAME", self.pageContent.cpuList.currentItem().text())
51 self.emit(SIGNAL("completeChanged()"))