]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/dbgrptg.cpp
Add upwards recursion to UpdateAccel method.
[wxWidgets.git] / src / generic / dbgrptg.cpp
index 734054bfca9577501b54ca6539a769d5b558f5ae..efb75d241b0c6c3d9d73433ad15a999cbab2a68d 100644 (file)
 #include "wx/filedlg.h"
 #include "wx/valtext.h"
 
+#ifdef __WXMSW__
+    #include "wx/evtloop.h"     // for SetCriticalWindow()
+#endif // __WXMSW__
+
 // ----------------------------------------------------------------------------
 // wxDumpPreviewDlg: simple class for showing ASCII preview of dump files
 // ----------------------------------------------------------------------------
@@ -439,13 +443,20 @@ void wxDebugReportDialog::OnOpen(wxCommandEvent& )
 
             // if we don't have place marker for file name in the command...
             wxString cmd = dlg.GetCommand();
-            if ( cmd.find(_T('%')) == wxString::npos )
+            if ( !cmd.empty() )
             {
-                // ...add it
-                cmd += _T(" \"%s\"");
+#if wxUSE_MIMETYPE
+                if ( cmd.find(_T('%')) != wxString::npos )
+                {
+                    command = wxFileType::ExpandCommand(cmd, fn.GetFullPath());
+                }
+                else // no %s nor %1
+#endif // wxUSE_MIMETYPE
+                {
+                    // append the file name to the end
+                    command << cmd << _T(" \"") << fn.GetFullPath() << _T('"');
+                }
             }
-
-            command = wxFileType::ExpandCommand(cmd, fn.GetFullPath());
         }
     }
 
@@ -477,6 +488,12 @@ bool wxDebugReportPreviewStd::Show(wxDebugReport& dbgrpt) const
 
     wxDebugReportDialog dlg(dbgrpt);
 
+#ifdef __WXMSW__
+    // before entering the event loop (from ShowModal()), block the event
+    // handling for all other windows as this could result in more crashes
+    wxEventLoop::SetCriticalWindow(&dlg);
+#endif // __WXMSW__
+
     return dlg.ShowModal() == wxID_OK && dbgrpt.GetFilesCount() != 0;
 }