# HG changeset patch
# User lbessard
# Date 1214551732 -7200
# Node ID d8cacbf276b52b8a6226b6a4b876b2956b0d9a34
# Parent  b75983a6608b537103e15f067ec0f1a5becc3dd9
Close Project menu item implemented

diff -r b75983a6608b -r d8cacbf276b5 Beremiz.py
--- a/Beremiz.py	Wed Jun 25 17:36:24 2008 +0200
+++ b/Beremiz.py	Fri Jun 27 09:28:52 2008 +0200
@@ -309,8 +309,6 @@
         self.Bind(wx.EVT_MENU, self.OnOpenWidgetInspector, id=ID_BEREMIZINSPECTOR)
         accel = wx.AcceleratorTable([wx.AcceleratorEntry(wx.ACCEL_SHIFT, wx.WXK_HOME, ID_BEREMIZINSPECTOR)])
         self.SetAcceleratorTable(accel)
-
-
         
         if wx.VERSION < (2, 8, 0):
             self.MainSplitter = wx.SplitterWindow(id=ID_BEREMIZMAINSPLITTER,
@@ -335,7 +333,6 @@
         
         if wx.VERSION < (2, 8, 0):
             self.MainSplitter.SplitHorizontally(self.PLCConfig, self.LogConsole, -250)
-            
         else:
             self.AUIManager = wx.aui.AuiManager(self)
             self.AUIManager.SetDockSizeConstraint(0.5, 0.5)
@@ -1137,6 +1134,8 @@
     
     def OnCloseProjectMenu(self, event):
         self.PluginInfos = {}
+        self.PluginRoot.CloseProject()
+        self.Log.flush()
         self.RefreshPLCParams()
         self.RefreshPluginTree()
         self.RefreshMainMenu()
diff -r b75983a6608b -r d8cacbf276b5 plugger.py
--- a/plugger.py	Wed Jun 25 17:36:24 2008 +0200
+++ b/plugger.py	Fri Jun 27 09:28:52 2008 +0200
@@ -797,6 +797,10 @@
             self.PLCEditor.RefreshTitle()
         self.PlugRequestSave()
     
+    def CloseProject(self):
+        self.ProjectPath = None
+        self.PluggedChilds = {}
+    
     # Update PLCOpenEditor Plugin Block types from loaded plugins
     def RefreshPluginsBlockLists(self):
         if getattr(self, "PluggedChilds", None) is not None: