Update preset.
[bertos.git] / wizard / BProjectPresets.py
index 5b5fa7a1d5524c0da049f5fd9114583748f3f9fb..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()
@@ -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")