Permit to set CPU frequency from the wizard in project editing mode.
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 8 Sep 2009 12:38:48 +0000 (12:38 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 8 Sep 2009 12:38:48 +0000 (12:38 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2902 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BEditingDialog.py

index 1b297d3879ce84d8015b984abb8f23c58954099b..e98edf861ce4329d2bd21c4d5e3c7ff81ea39848 100644 (file)
@@ -53,11 +53,22 @@ class BEditingDialog(QDialog):
         self.setupUi()
         self.connectSignals()
         self.module_page.reloadData()
+       self.setFrequency()
     
     def setupUi(self):
         layout = QVBoxLayout()
         self.module_page = BModulePage.BModulePage()
         layout.addWidget(self.module_page)
+       frequency_layout = QHBoxLayout()
+       frequency_layout.addWidget(QLabel(self.tr("CPU frequency")))
+       self.cpu_frequency_spinbox = QDoubleSpinBox()
+       self.cpu_frequency_spinbox.setSuffix("Hz")
+       self.cpu_frequency_spinbox.setRange(1, 1000000000)
+       self.cpu_frequency_spinbox.setSingleStep(1000)
+       self.cpu_frequency_spinbox.setDecimals(0)
+       frequency_layout.addWidget(self.cpu_frequency_spinbox)
+       frequency_layout.addStretch()
+       layout.addLayout(frequency_layout)
         button_layout = QHBoxLayout()
         self.advanced_button = QToolButton()
         self.setupMenu()
@@ -86,6 +97,15 @@ class BEditingDialog(QDialog):
         self.connect(self.change_bertos_version, SIGNAL("triggered(bool)"), self.changeBertosVersion)
         self.connect(self.apply_button, SIGNAL("clicked()"), self.apply)
         self.connect(self.cancel_button, SIGNAL("clicked()"), self.reject)
+       self.connect(self.cpu_frequency_spinbox, SIGNAL("valueChanged(double)"), self.frequencyChanged)
+    
+    def setFrequency(self):
+       frequency = long(self.module_page.projectInfo("SELECTED_FREQ"))
+       self.cpu_frequency_spinbox.setValue(frequency)
+
+    def frequencyChanged(self, frequency):
+       frequency = unicode(long(frequency))
+       self.module_page.setProjectInfo("SELECTED_FREQ", frequency)
 
     def changeToolchain(self):
         dialog = QDialog()