Modify the order of the pages.
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 1 Apr 2010 09:51:47 +0000 (09:51 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 1 Apr 2010 09:51:47 +0000 (09:51 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3370 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BFolderPage.py
wizard/BVersionPage.py
wizard/bertos.py

index 7caf4382cfeb31795eb14293028bde91a9c51938..06191f6be8af9be12fd4debfafee6018760181ad 100644 (file)
@@ -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
     
index 8842289d9aec4bb5cb4199f44946a9df02df266b..452e8a947309637d75906199b3ae0674894157e8 100644 (file)
@@ -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)
     
     ####
     
index 7097ebce2a777d1039bfbe8968acc27224457f68..0e3206c2144c6a2a603b35168e9dd60d4410d577 100755 (executable)
@@ -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_()