+ """
+ Overload of the BWizardPage reloadData method.
+ """
+ QApplication.instance().setOverrideCursor(Qt.WaitCursor)
+ bertos_utils.loadSourceTree(self.project())
+ self.populateCpuList()
+ cpu_name = self.projectInfo("CPU_NAME")
+ self.setupUi()
+ if not cpu_name is None:
+ self.selectItem(cpu_name)
+ QApplication.instance().restoreOverrideCursor()
+ self.emit(SIGNAL("completeChanged()"))
+
+ ####
+
+ ## Slots ##
+
+ def rowChanged(self):
+ """
+ Slot called when the user select an entry from the cpu list.
+ """
+ description = qvariant_converter.getDict(self.pageContent.cpuList.currentItem().data(Qt.UserRole))["CPU_DESC"]
+ description = qvariant_converter.getStringList(description)
+ frequency = qvariant_converter.getDict(self.pageContent.cpuList.currentItem().data(Qt.UserRole))["CPU_DEFAULT_FREQ"]
+ frequency = qvariant_converter.getString(frequency)
+ frequency = frequency.replace("U", "").replace("L", "")
+ self.pageContent.descriptionLabel.setText("<br>".join(description))
+ self.pageContent.descriptionLabel.setVisible(True)
+ self.pageContent.frequencySpinBox.setValue(long(frequency))
+ self.emit(SIGNAL("completeChanged()"))
+
+ def freqChanged(self):
+ self.emit(SIGNAL("completeChanged()"))
+
+ ####
+
+ def populateCpuList(self):
+ """
+ Fills the cpu list.
+ """
+ self.pageContent.cpuList.clear()
+ self.pageContent.cpuList.setCurrentItem(None)
+ infos = bertos_utils.loadCpuInfos(self.project())
+ for cpu in infos:
+ item = QListWidgetItem(cpu["CPU_NAME"])
+ item.setData(Qt.UserRole, qvariant_converter.convertDict(cpu))
+ self.pageContent.cpuList.addItem(item)
+
+ def selectItem(self, cpu):
+ """
+ Selects the given cpu from the list.
+ """
+ elements = self.pageContent.cpuList.findItems(cpu, Qt.MatchCaseSensitive)
+ if len(elements) == 1:
+ self.pageContent.cpuList.setCurrentItem(elements[0])
\ No newline at end of file