Add title for Preset page.
[bertos.git] / wizard / BModulePage.py
index d42cbb61bcec49bf954f0567fbf48495afeea1ba..8e1a80f7e4980352a9d1e3fe7e89dce7ec540b9e 100644 (file)
@@ -219,16 +219,19 @@ class BModulePage(BWizardPage):
         """
         Loads the module data.
         """
-        # Load the module data every time so that if the user changed the cpu
-        # the right configurations are picked up.
-        try:
-            self.project.loadModuleData()
-        except ModuleDefineException, e:
-            self.exceptionOccurred(self.tr("Error parsing line '%2' in file %1").arg(e.path).arg(e.line))
-        except EnumDefineException, e:
-            self.exceptionOccurred(self.tr("Error parsing line '%2' in file %1").arg(e.path).arg(e.line))
-        except ConfigurationDefineException, e:
-            self.exceptionOccurred(self.tr("Error parsing line '%2' in file %1").arg(e.path).arg(e.line))
+        # Do not load the module data again when the Wizard is in editing mode
+        # or when it's working on a preset.
+        if not self.project.edit and not self.project.from_preset:
+            # Load the module data every time so that if the user changed the cpu
+            # the right configurations are picked up.
+            try:
+                self.project.loadModuleData()
+            except ModuleDefineException, e:
+                self.exceptionOccurred(self.tr("Error parsing line '%2' in file %1").arg(e.path).arg(e.line))
+            except EnumDefineException, e:
+                self.exceptionOccurred(self.tr("Error parsing line '%2' in file %1").arg(e.path).arg(e.line))
+            except ConfigurationDefineException, e:
+                self.exceptionOccurred(self.tr("Error parsing line '%2' in file %1").arg(e.path).arg(e.line))
     
     def fillModuleTree(self):
         """