Update preset.
[bertos.git] / wizard / BProjectPresets.py
index 9afed4f4328ea37ccefb71f2c6a967ba45623f45..40e7cbd8f7aa474de6a0e6dff76b4ff9d3554f96 100644 (file)
@@ -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 <duplo@develer.com>
 #
@@ -45,6 +44,8 @@ from BWizardPage import BWizardPage
 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()