+ """
+ Overload of the BWizardPage reloadData method.
+ """
+ QApplication.instance().setOverrideCursor(Qt.WaitCursor)
+ bertos_utils.loadSourceTree(self.project())
+ self.populateCpuList()
+ cpu_name = self.projectInfo("CPU_NAME")
+ selected_freq = self.projectInfo("SELECTED_FREQ")
+ self.setupUi()
+ if cpu_name:
+ self.selectItem(cpu_name)
+ if selected_freq:
+ self.setFrequency(selected_freq)
+ self.freq_modified = True
+ 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)
+ if not self.freq_modified:
+ # Retrieve the default cpu frequency when the value isn't already modified
+ current_freq = qvariant_converter.getDict(self.pageContent.cpuList.currentItem().data(Qt.UserRole))["CPU_DEFAULT_FREQ"]
+ current_freq = qvariant_converter.getString(current_freq)
+ current_freq = long(current_freq.replace("U", "").replace("L", ""))
+ self.pageContent.frequencySpinBox.setValue(long(current_freq))
+ self.pageContent.descriptionLabel.setText("<br>".join(description))
+ self.pageContent.descriptionLabel.setVisible(True)
+ self.emit(SIGNAL("completeChanged()"))
+
+ def freqChanged(self):
+ """
+ Slot called when the user change the frequency value.
+ """
+ self.freq_modified = True
+ 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())
+ tag_list = bertos_utils.getTagSet(infos)
+ # Create, fill and store the dict with the tags
+ tag_dict = {}
+ for element in tag_list:
+ tag_dict[element] = False
+ self.setProjectInfo("ALL_CPU_TAGS", tag_dict)
+ 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])
+
+ def setFrequency(self, frequency):
+ self.pageContent.frequencySpinBox.setValue(long(frequency))
\ No newline at end of file