X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2FBCpuPage.py;h=f1dbfd66f218ba87eedc04b139aeb8f34e5c61b4;hb=16555988e69afefd1a3cee8eed5202143ce6931a;hp=86a7cadce638a390495be363cabecbb0e193cce9;hpb=a9f26d8d26f31ffe322fa5e1b0c00fbd82710152;p=bertos.git diff --git a/wizard/BCpuPage.py b/wizard/BCpuPage.py index 86a7cadc..f1dbfd66 100644 --- a/wizard/BCpuPage.py +++ b/wizard/BCpuPage.py @@ -24,6 +24,7 @@ class BCpuPage(BWizardPage): def __init__(self): BWizardPage.__init__(self, UI_LOCATION + "/cpu_select.ui") self.setTitle(self.tr("Select the CPU")) + self.freq_modified = False ## Overloaded QWizardPage methods ## @@ -66,7 +67,7 @@ class BCpuPage(BWizardPage): Overload of the BWizardPage connectSignals method. """ self.connect(self.pageContent.cpuList, SIGNAL("itemSelectionChanged()"), self.rowChanged) - self.connect(self.pageContent.frequencySpinBox, SIGNAL("valueChanged(double)"), self.freqChanged) + self.connect(self.pageContent.frequencySpinBox, SIGNAL("editingFinished()"), self.freqChanged) def reloadData(self): """ @@ -79,9 +80,6 @@ class BCpuPage(BWizardPage): self.setupUi() if not cpu_name is None: self.selectItem(cpu_name) - cpu_frequency = self.projectInfo("SELECTED_FREQ") - if not cpu_frequency is None: - self.pageContent.frequencySpinBox.setValue(cpu_frequency) QApplication.instance().restoreOverrideCursor() self.emit(SIGNAL("completeChanged()")) @@ -95,15 +93,21 @@ class BCpuPage(BWizardPage): """ 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", "") + 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("
".join(description)) self.pageContent.descriptionLabel.setVisible(True) - self.pageContent.frequencySpinBox.setValue(long(frequency)) self.emit(SIGNAL("completeChanged()")) def freqChanged(self): + """ + Slot called when the user change the frequency value. + """ + self.freq_modified = True self.emit(SIGNAL("completeChanged()")) ####