From bfab81f21ec1f468ae3f96fbee651636789c15ed Mon Sep 17 00:00:00 2001 From: duplo Date: Thu, 1 Apr 2010 13:44:37 +0000 Subject: [PATCH] Add stub for nextId logic of the board preset page. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3373 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/BBoardPage.py | 27 ++++++++++++++++++++++++++- wizard/BCpuPage.py | 3 +++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/wizard/BBoardPage.py b/wizard/BBoardPage.py index 80631b59..54cc94cc 100644 --- a/wizard/BBoardPage.py +++ b/wizard/BBoardPage.py @@ -38,6 +38,9 @@ from PyQt4.QtGui import * from BWizardPage import BWizardPage +from BCpuPage import BCpuPage +from BOutputPage import BOutputPage + import const import qvariant_converter from bertos_utils import presetList @@ -59,7 +62,24 @@ class BBoardPage(BWizardPage): """ Overload of the QWizardPage isComplete method. """ - return False + return self.pageContent.boardList.currentItem() is not None + + def nextId(self): + """ + Overload of the QWizardPage nextId method. + """ + # Stub of nextId logic + if self.advanced: + self.setProjectInfo("PRESET_ADVANCED_CONFIG", True) + return self.wizard().pageIndex(BCpuPage) + # Search for suitable toolchains. If there isn't one return + # BToolchainPage id (BToolchainPage should then route to BOutputPage + # instead of BModulePage). + + # If a suitable toolchain is found the user has to be prompted + # directly to the BOutputPage + else: + return self.wizard().pageIndex(BOutputPage) #### @@ -106,5 +126,10 @@ class BBoardPage(BWizardPage): selected_preset = presets[preset_path] self.pageContent.descriptionLabel.setText(selected_preset['description']) self._last_selected = preset_path + self.emit(SIGNAL("completeChanged()")) #### + + @property + def advanced(self): + return self.pageContent.advancedCheckBox.isChecked() \ No newline at end of file diff --git a/wizard/BCpuPage.py b/wizard/BCpuPage.py index 842200b5..49daf8c9 100644 --- a/wizard/BCpuPage.py +++ b/wizard/BCpuPage.py @@ -95,6 +95,9 @@ class BCpuPage(BWizardPage): self.pageContent.cpuList.setSortingEnabled(True) self.pageContent.frequencyLabel.setVisible(False) self.pageContent.frequencySpinBox.setVisible(False) + preset_advanced = self.projectInfo("PRESET_ADVANCED_CONFIG") + if preset_advanced: + self.pageContent.cpuList.setEnabled(False) def connectSignals(self): """ -- 2.25.1