Bug on DebugVariablePanel when opening project at start fixed
authorlaurent
Thu, 08 Oct 2009 11:01:19 +0200
changeset 408 6eaa1908507d
parent 407 0bef13d73350
child 409 63249a965feb
Bug on DebugVariablePanel when opening project at start fixed
Beremiz.py
--- a/Beremiz.py	Wed Oct 07 09:03:15 2009 +0200
+++ b/Beremiz.py	Thu Oct 08 11:01:19 2009 +0200
@@ -394,9 +394,14 @@
         if projectOpen is not None and os.path.isdir(projectOpen):
             self.PluginRoot = PluginsRoot(self, self.Log)
             self.Controler = self.PluginRoot
-            self.PluginRoot.LoadProject(projectOpen, buildpath)
-            self._Refresh(TYPESTREE, INSTANCESTREE, LIBRARYTREE)
-            self.RefreshAll()
+            result = self.PluginRoot.LoadProject(projectOpen, buildpath)
+            if not result:
+                self.DebugVariablePanel.SetDataProducer(self.PluginRoot)
+                self._Refresh(TYPESTREE, INSTANCESTREE, LIBRARYTREE)
+                self.RefreshAll()
+            else:
+                self.ResetView()
+                self.ShowErrorMessage(result)
         else:
             self.PluginRoot = None
             self.Controler = None
@@ -1298,6 +1303,7 @@
                 self._Refresh(TYPESTREE, INSTANCESTREE, LIBRARYTREE)
                 self.RefreshAll()
             else:
+                self.ResetView()
                 self.ShowErrorMessage(result)
             self._Refresh(TITLE, TOOLBAR, FILEMENU, EDITMENU)
         event.Skip()
@@ -1323,6 +1329,7 @@
                     self._Refresh(TYPESTREE, INSTANCESTREE, LIBRARYTREE)
                     self.RefreshAll()
                 else:
+                    self.ResetView()
                     self.ShowErrorMessage(result)
             else:
                 self.ShowErrorMessage(_("\"%s\" folder is not a valid Beremiz project\n") % projectpath)