Bug with creating or opening a project not closing windows of current opened project fixed
authorlaurent
Thu, 03 Sep 2009 12:09:39 +0200
changeset 388 9d5b3d63563d
parent 387 2cc48e356902
child 389 bde723abfdfc
Bug with creating or opening a project not closing windows of current opened project fixed
Beremiz.py
--- a/Beremiz.py	Thu Sep 03 11:28:46 2009 +0200
+++ b/Beremiz.py	Thu Sep 03 12:09:39 2009 +0200
@@ -1252,6 +1252,9 @@
             dialog.Destroy()
             config.Write("lastopenedfolder", os.path.dirname(projectpath))
             config.Flush()
+            self.PluginInfos = {}
+            if self.PluginRoot is not None:
+                self.PluginRoot.CloseProject()
             self.PluginRoot = PluginsRoot(self, self.Log)
             res = self.PluginRoot.NewProject(projectpath)
             if not res :
@@ -1275,6 +1278,9 @@
             if os.path.isdir(projectpath):
                 config.Write("lastopenedfolder", os.path.dirname(projectpath))
                 config.Flush()
+                self.PluginInfos = {}
+                if self.PluginRoot is not None:
+                    self.PluginRoot.CloseProject()
                 self.PluginRoot = PluginsRoot(self, self.Log)
                 result = self.PluginRoot.LoadProject(projectpath)
                 if not result: