From ec8c7a72981bd819fba072cf53404bae3d9cee46 Mon Sep 17 00:00:00 2001 From: duplo Date: Thu, 1 Apr 2010 09:51:47 +0000 Subject: [PATCH] Modify the order of the pages. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3370 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/BFolderPage.py | 13 ++++--------- wizard/BVersionPage.py | 8 ++++++++ wizard/bertos.py | 2 +- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/wizard/BFolderPage.py b/wizard/BFolderPage.py index 7caf4382..06191f6b 100644 --- a/wizard/BFolderPage.py +++ b/wizard/BFolderPage.py @@ -39,7 +39,7 @@ from PyQt4.QtGui import * from BWizardPage import * import bertos_utils -from BVersionPage import BVersionPage +from BCpuPage import BCpuPage from BBoardPage import BBoardPage from const import * @@ -65,16 +65,10 @@ class BFolderPage(BWizardPage): if self.pageContent.projectPath.text() != "None": self.setProjectInfo("PROJECT_PATH", unicode(self.pageContent.projectPath.text())) self.setProjectInfo("PROJECT_NAME", os.path.basename(unicode(self.pageContent.projectPath.text()))) + self.setProjectInfo("ROUTE", self.next_page) return True else: return False - - def nextId(self): - """ - Overload of the QWizardPage nextId method. - """ - return self.wizard().pageIndex(self.next_page) - #### @@ -93,6 +87,7 @@ class BFolderPage(BWizardPage): self.connect(self.pageContent.nameEdit, SIGNAL("textChanged(const QString)"), self.nameChanged) self.connect(self.pageContent.directoryEdit, SIGNAL("textChanged(const QString)"), self.directoryChanged) self.connect(self.pageContent.directoryButton, SIGNAL("clicked()"), self.selectDirectory) + self.connect(self.pageContent.customButton, SIGNAL("toggled(bool)"), self.isComplete) #### @@ -138,7 +133,7 @@ class BFolderPage(BWizardPage): Contains the next page class. """ if self.pageContent.customButton.isChecked(): - return BVersionPage + return BCpuPage else: return BBoardPage diff --git a/wizard/BVersionPage.py b/wizard/BVersionPage.py index 8842289d..452e8a94 100644 --- a/wizard/BVersionPage.py +++ b/wizard/BVersionPage.py @@ -69,6 +69,14 @@ class BVersionPage(BWizardPage): return True else: return False + + def nextId(self): + """ + Overload of the QWizard nextId method. + """ + # Pick up the class stored into the project in the 'folder' step + page_class = self.projectInfo("ROUTE") + return self.wizard().pageIndex(page_class) #### diff --git a/wizard/bertos.py b/wizard/bertos.py index 7097ebce..0e3206c2 100755 --- a/wizard/bertos.py +++ b/wizard/bertos.py @@ -66,7 +66,7 @@ from LoadException import VersionException, ToolchainException def newProject(): QApplication.instance().project = BProject() - page_list = [BIntroPage, BFolderPage, BBoardPage, BVersionPage, BCpuPage, BToolchainPage, BModulePage, BOutputPage, BCreationPage, BFinalPage] + page_list = [BIntroPage, BFolderPage, BVersionPage, BBoardPage, BCpuPage, BToolchainPage, BModulePage, BOutputPage, BCreationPage, BFinalPage] wizard = BWizard(page_list) wizard.show() wizard.exec_() -- 2.25.1