X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2FBProjectPresets.py;h=40e7cbd8f7aa474de6a0e6dff76b4ff9d3554f96;hb=e25abecb6a6ff52917d44d1331e5af831aeceb9c;hp=b92eaa3dfb571267f70d5742e947919abd89a123;hpb=8cc308300073d38f6826ea357f4c6221e1f44f03;p=bertos.git diff --git a/wizard/BProjectPresets.py b/wizard/BProjectPresets.py index b92eaa3d..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,10 @@ 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() @@ -148,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: @@ -163,7 +167,7 @@ class BProjectPresets(BWizardPage): ## Overloaded BWizardPage methods ## - def reloadData(self): + def reloadData(self, previous_id=None): if not self.projectInfo("PRESET_LOADED"): preset_path = self.projectInfo("PROJECT_BOARD") preset_tree = self.projectInfo("PRESET_TREE")