Remove custom/predefined choice from the folder page and add a new page.
[bertos.git] / wizard / bertos.py
index ce6bd30f2970f54904a220b8ea4982cc9466d4d1..65e578ccdaa4e787a4f5d4731a89b3b44ce464fe 100755 (executable)
@@ -48,6 +48,7 @@ from BWizard import BWizard
 
 from BIntroPage import BIntroPage
 from BFolderPage import BFolderPage
+from BTypePage import BTypePage
 from BBoardPage import BBoardPage
 from BRoutePage import BRoutePage
 from BOpenPage import BOpenPage
@@ -67,7 +68,7 @@ from LoadException import VersionException, ToolchainException
 
 def newProject():
     QApplication.instance().project = BProject()
-    page_list = [BIntroPage, BFolderPage, BVersionPage, BBoardPage, BRoutePage, BCpuPage, BToolchainPage, BModulePage, BOutputPage, BCreationPage, BFinalPage]
+    page_list = [BIntroPage, BFolderPage, BVersionPage, BTypePage, BBoardPage, BRoutePage, BCpuPage, BToolchainPage, BModulePage, BOutputPage, BCreationPage, BFinalPage]
     wizard = BWizard(page_list)
     wizard.show()
     wizard.exec_()
@@ -85,24 +86,26 @@ def newProject():
 def editProject(project_file):
     info_dict = {}
     while(True):
+        # Empty project is the default fallback.
+        QApplication.instance().project = BProject()
         try:
             QApplication.instance().project = BProject(project_file, info_dict)
         except VersionException:
             QMessageBox.critical(
                 None,
                 QObject().tr("BeRTOS version not found!"),
-                QObject().tr("The selected BeRTOS version is not found, please select an existing one...")
+                QObject().tr("The selected BeRTOS version was not found, please select another one...")
             )
             dialog = BVersionDialog()
             if dialog.exec_():
                 version = dialog.version_page.currentVersion()
-                info_dict["SOURCES_PATH"] = version
+                info_dict["BERTOS_PATH"] = version
             continue
         except ToolchainException, exc:
             QMessageBox.critical(
                 None,
                 QObject().tr("Toolchain not found!"),
-                QObject().tr("The selected toolchain is not found, please select an existing one...")
+                QObject().tr("The selected toolchain was not found, please select another one...")
             )
             QApplication.instance().project = exc.partial_project
             dialog = BToolchainDialog()