Update of /cvsroot/mahogany/M/src/gui
In directory sc8-pr-cvs1:/tmp/cvs-serv26975/src/gui

Modified Files:
        wxMApp.cpp 
Log Message:
use wxCrashReport

Index: wxMApp.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMApp.cpp,v
retrieving revision 1.259
retrieving revision 1.260
diff -b -u -2 -r1.259 -r1.260
--- wxMApp.cpp  30 Mar 2003 21:53:58 -0000      1.259
+++ wxMApp.cpp  13 Jul 2003 21:20:32 -0000      1.260
@@ -96,7 +96,11 @@
 
 #ifdef OS_WIN
-#   include <winnls.h>
+   #include <winnls.h>
 
-#   include "wx/msw/helpbest.h"
+   #include "wx/msw/helpbest.h"
+
+   #ifdef wxHAS_CRASH_REPORT
+      #include "wx/msw/crashrpt.h"
+   #endif
 #endif
 
@@ -523,7 +527,25 @@
 }
 
+static void
+SafeMsgBox(const String& msg)
+{
+   static const char *title = gettext_noop("Fatal application error");
+
+   // using a plain message box is safer in this situation, but under Unix we
+   // have no such choice
+#ifdef __WXMSW__
+   ::MessageBox(NULL, _(msg), _(title), MB_ICONSTOP);
+#else // !MSW
+   wxMessageBox(_(msg), _(title), wxICON_STOP | wxOK);
+#endif // MSW/!MSW
+}
+
 void
 wxMApp::OnAbnormalTermination()
 {
+   // no more background processing
+   gs_mutexBlockBg.Lock();
+
+
    MAppBase::OnAbnormalTermination();
 
@@ -560,5 +582,4 @@
                    "\n"
                    "Thank you!");
-   static const char *title = gettext_noop("Fatal application error");
 
    if ( !msg.empty() )
@@ -569,11 +590,38 @@
    msg += msgCrash;
 
-   // using a plain message box is safer in this situation, but under Unix we
-   // have no such choice
-#ifdef __WXMSW__
-   ::MessageBox(NULL, _(msg), _(title), MB_ICONSTOP);
-#else // !MSW
-   wxMessageBox(_(msg), _(title), wxICON_STOP | wxOK);
-#endif // MSW/!MSW
+#ifdef wxHAS_CRASH_REPORT
+   msg += "\n\n";
+   msg += String::Format
+          (
+            _("P.S. Mahogany will also try to generate bug report in file\n"
+              "\n"
+              "              %s\n"
+              "\n"
+              "after you close this message box. Please download the\n"
+              "PDB file and put it in the same directory as M.exe if\n"
+              "you don't have it already for better results."),
+            wxCrashReport::GetFileName()
+          );
+#endif // wxCrashReport available
+
+   SafeMsgBox(msg);
+
+#ifdef wxHAS_CRASH_REPORT
+   if ( wxCrashReport::Generate() )
+   {
+      msg.Printf
+          (
+            _("Detailed crash report has been generated in file\n"
+              "\n"
+              "           %s\n"
+              "\n"
+              "please look at it for more information and join it\n"
+              "to your bug report."),
+            wxCrashReport::GetFileName()
+          );
+
+      SafeMsgBox(msg);
+   }
+#endif // wxCrashReport available
 }
 
@@ -710,5 +758,5 @@
    // in release build we handle any exceptions we generate (i.e. crashes)
    // ourselves
-#ifndef DEBUG
+#if 1 // ndef DEBUG
    wxHandleFatalExceptions();
 #endif



-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps1
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to