Adding warning message on LPCBeremiz when closing frame and program not saved
authorlaurent
Tue, 19 Apr 2011 11:52:49 +0200
changeset 596 b36422acae13
parent 595 6348c0110e0f
child 597 6fbfd3bf2927
Adding warning message on LPCBeremiz when closing frame and program not saved
LPCBeremiz.py
--- a/LPCBeremiz.py	Mon Apr 04 11:07:53 2011 +0200
+++ b/LPCBeremiz.py	Tue Apr 19 11:52:49 2011 +0200
@@ -898,17 +898,19 @@
     def OnCloseFrame(self, event):
         global frame
         
-        frame.Hide()
-        
-        self.PluginRoot.ResetAppFrame(lpcberemiz_cmd.Log)
-        if self.PluginRoot.OnlineMode == 0:
-            self.PluginRoot._connector = None
-        
-        self.PluginRoot.KillDebugThread()
-        self.KillLocalRuntime()
-        
-        lpcberemiz_cmd.Log.write("Closed\n")
-        
+        if self.CheckSaveBeforeClosing(_("Close Application")):
+            
+            frame.Hide()
+            
+            self.PluginRoot.ResetAppFrame(lpcberemiz_cmd.Log)
+            if self.PluginRoot.OnlineMode == 0:
+                self.PluginRoot._connector = None
+            
+            self.PluginRoot.KillDebugThread()
+            self.KillLocalRuntime()
+            
+            lpcberemiz_cmd.Log.write("Closed\n")
+            
         event.Veto()
 
     def ShowProperties(self):