Reload the module data every time the user enter into the module configuration page...
[bertos.git] / wizard / BModulePage.py
index 9c13a2cc01402688b69ba71b70faef78d1d1f27e..d42cbb61bcec49bf954f0567fbf48495afeea1ba 100644 (file)
@@ -219,18 +219,16 @@ class BModulePage(BWizardPage):
         """
         Loads the module data.
         """
-        # Load the module data only if it isn't already loaded
-        if not self.projectInfo("MODULES") \
-                and not self.projectInfo("LISTS") \
-                and not self.projectInfo("CONFIGURATIONS"):
-            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))
+        # 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):
         """
@@ -376,7 +374,12 @@ class BModulePage(BWizardPage):
         """
         Returns the configuration for the selected module.
         """
-        configuration = self.projectInfo("MODULES")[module]["configuration"]
+        configuration = []
+        if module:
+            # On linux platform it seems that the behaviour of the focus
+            # changing is a bit different from the mac one. So if module is
+            # None then no configurations should be returned.
+            configuration = self.projectInfo("MODULES")[module]["configuration"]
         if len(configuration) > 0:
             return self.projectInfo("CONFIGURATIONS")[configuration]
         else: