Update of /cvsroot/mahogany/M/src/gui
In directory usw-pr-cvs1:/tmp/cvs-serv30272/src/gui
Modified Files:
wxMApp.cpp
Log Message:
handle end session notification
Index: wxMApp.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMApp.cpp,v
retrieving revision 1.224
retrieving revision 1.225
diff -b -u -2 -r1.224 -r1.225
--- wxMApp.cpp 13 Mar 2002 22:30:03 -0000 1.224
+++ wxMApp.cpp 18 Mar 2002 22:39:28 -0000 1.225
@@ -66,4 +66,6 @@
#include "Mpers.h"
+#include "Composer.h" // for SaveAll()
+
#include "MFCache.h"
@@ -179,4 +181,6 @@
wxLogTrace(TRACE_TIMER, "Autosaving options and folder status.");
+ Composer::SaveAll();
+
Profile::FlushAll();
@@ -407,4 +411,6 @@
EVT_DIALUP_DISCONNECTED (wxMApp::OnDisconnected)
#endif // USE_DIALUP
+
+ EVT_QUERY_END_SESSION (wxMApp::OnQueryEndSession)
END_EVENT_TABLE()
@@ -583,8 +589,18 @@
// this function being evaluated anyway. The frame itself does not
// do any tests.
- ((MAppBase *)this)->AddToFramesOkToClose(m_topLevelFrame);
+ wxMApp *self = (wxMApp *)this;
+ self->AddToFramesOkToClose(m_topLevelFrame);
+
+ self->m_CanClose = MAppBase::CanClose();
- ((wxMApp *)this)->m_CanClose = MAppBase::CanClose();
return m_CanClose;
+}
+
+void wxMApp::OnQueryEndSession(wxCloseEvent& event)
+{
+ m_CanClose = false;
+
+ if ( !CanClose() )
+ event.Veto();
}
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates