X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2FBProjectPresets.py;h=40e7cbd8f7aa474de6a0e6dff76b4ff9d3554f96;hb=f1fab319eb3fe91c157b3a9564841aef62a03554;hp=ba4d6d7d0314c119054d477f485a2f6b772011af;hpb=3f3f2c46a3cadf8383ae18a5f22a41a5748298e5;p=bertos.git diff --git a/wizard/BProjectPresets.py b/wizard/BProjectPresets.py index ba4d6d7d..40e7cbd8 100644 --- a/wizard/BProjectPresets.py +++ b/wizard/BProjectPresets.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # encoding: utf-8 # -# This file is part of slimqc. +# This file is part of BeRTOS. # # Bertos is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,7 +28,6 @@ # # Copyright 2010 Develer S.r.l. (http://www.develer.com/) # -# $Id$ # # Author: Lorenzo Berni # @@ -42,9 +41,11 @@ from PyQt4.QtGui import * from BWizardPage import BWizardPage -from BOutputPage import BOutputPage +from BCreationPage import BCreationPage from BToolchainPage import BToolchainPage +from DefineException import ModuleDefineException + from bertos_utils import _cmp from toolchain_manager import ToolchainManager @@ -121,7 +122,11 @@ class BProjectPresets(BWizardPage): preset_path = self.selected_path try: QApplication.instance().setOverrideCursor(Qt.WaitCursor) - self.project.loadProjectFromPreset(preset_path) + try: + self.project.loadProjectFromPreset(preset_path) + except ModuleDefineException, e: + self.exceptionOccurred(self.tr("Error parsing line '%2' in file %1").arg(e.path).arg(e.line)) + self.setProjectInfo("PRESET_LOADED", True) finally: QApplication.instance().restoreOverrideCursor() # Return always True, this is a fake validation. @@ -147,7 +152,7 @@ class BProjectPresets(BWizardPage): toolchain_info = tm._validateToolchain(toolchain) toolchain_info["path"] = toolchain self.setProjectInfo("TOOLCHAIN", toolchain_info) - return self.wizard().pageIndex(BOutputPage) + return self.wizard().pageIndex(BCreationPage) else: return self.wizard().pageIndex(BToolchainPage) else: @@ -162,13 +167,14 @@ class BProjectPresets(BWizardPage): ## Overloaded BWizardPage methods ## - def reloadData(self): - preset_path = self.projectInfo("PROJECT_BOARD") - preset_tree = self.projectInfo("PRESET_TREE") - preset_list = preset_tree["children"][preset_path]["children"] - preset_list = sorted(preset_list.values(), _cmp) - self.setTitle(self.tr("Select the project template for %1").arg(preset_tree["children"][preset_path]["info"].get("name", preset_tree["children"][preset_path]["info"]["filename"]))) - self.setupTabs(preset_list) + def reloadData(self, previous_id=None): + if not self.projectInfo("PRESET_LOADED"): + preset_path = self.projectInfo("PROJECT_BOARD") + preset_tree = self.projectInfo("PRESET_TREE") + preset_list = preset_tree["children"][preset_path]["children"] + preset_list = sorted(preset_list.values(), _cmp) + self.setTitle(self.tr("Select the project template for %1").arg(preset_tree["children"][preset_path]["info"].get("name", preset_tree["children"][preset_path]["info"]["filename"]))) + self.setupTabs(preset_list) def connectSignals(self): self.connect(self.pageContent.boardTabWidget, SIGNAL("currentChanged(int)"), self, SIGNAL("completeChanged()"))