X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2FBCpuPage.py;h=f38ab35c5069b5ec5b037d219cb991850f6683d6;hb=f3c5a7fbce17712e088c3d9f9719e42d8ba7fff3;hp=f1dbfd66f218ba87eedc04b139aeb8f34e5c61b4;hpb=16555988e69afefd1a3cee8eed5202143ce6931a;p=bertos.git diff --git a/wizard/BCpuPage.py b/wizard/BCpuPage.py index f1dbfd66..f38ab35c 100644 --- a/wizard/BCpuPage.py +++ b/wizard/BCpuPage.py @@ -44,6 +44,13 @@ class BCpuPage(BWizardPage): self.setProjectInfo("CPU_INFOS", infos) self.setProjectInfo("CPU_NAME", unicode(self.pageContent.cpuList.currentItem().text())) self.setProjectInfo("SELECTED_FREQ", unicode(long(self.pageContent.frequencySpinBox.value()))) + tag_dict = self.projectInfo("ALL_CPU_TAGS") + for tag in tag_dict: + if tag in infos["CPU_TAGS"] + [infos["CPU_NAME"], infos["CORE_CPU"], infos["TOOLCHAIN"]]: + tag_dict[tag] = True + else: + tag_dict[tag] = False + self.setProjectInfo("ALL_CPU_TAGS", tag_dict) return True else: return False @@ -77,9 +84,13 @@ class BCpuPage(BWizardPage): bertos_utils.loadSourceTree(self.project()) self.populateCpuList() cpu_name = self.projectInfo("CPU_NAME") + selected_freq = self.projectInfo("SELECTED_FREQ") self.setupUi() - if not cpu_name is None: + 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()")) @@ -119,6 +130,12 @@ class BCpuPage(BWizardPage): 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)) @@ -130,4 +147,7 @@ class BCpuPage(BWizardPage): """ elements = self.pageContent.cpuList.findItems(cpu, Qt.MatchCaseSensitive) if len(elements) == 1: - self.pageContent.cpuList.setCurrentItem(elements[0]) \ No newline at end of file + self.pageContent.cpuList.setCurrentItem(elements[0]) + + def setFrequency(self, frequency): + self.pageContent.frequencySpinBox.setValue(long(frequency)) \ No newline at end of file