From c87ae8e4449bac09a7582c0efab0c30abb1e064a Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Sat, 2 Aug 2003 03:07:46 +0000 Subject: [PATCH] Added button to open the crash log --- stepmania/src/archutils/Darwin/Crash.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/stepmania/src/archutils/Darwin/Crash.cpp b/stepmania/src/archutils/Darwin/Crash.cpp index 068c388c74..0539b1dabd 100644 --- a/stepmania/src/archutils/Darwin/Crash.cpp +++ b/stepmania/src/archutils/Darwin/Crash.cpp @@ -40,15 +40,26 @@ void InformUserOfCrash() "\n" " http://sourceforge.net/tracker/?func=add&group_id=37892&atid=421366", kCFStringEncodingASCII); - CFStringRef OK = CFStringCreateWithCString(NULL, "OK", kCFStringEncodingASCII); - struct AlertStdCFStringAlertParamRec params = {kStdCFStringAlertVersionOne, true, false, OK, NULL, NULL, - kAlertStdAlertOKButton, NULL, kWindowAlertPositionParentWindowScreen, NULL}; + CFStringRef OK = CFStringCreateWithCString(NULL, "Open crashinfo", kCFStringEncodingASCII); + CFStringRef Cancel = CFStringCreateWithCString(NULL, "Cancel", kCFStringEncodingASCII); + struct AlertStdCFStringAlertParamRec params = {kStdCFStringAlertVersionOne, true, false, OK, Cancel, NULL, + kAlertStdAlertOKButton, kAlertStdAlertCancelButton, kWindowAlertPositionParentWindowScreen, NULL}; DialogRef dialog; - SInt16 unused; + SInt16 button; CreateStandardAlert(kAlertStopAlert, error, NULL, ¶ms, &dialog); AutoSizeDialog(dialog); - RunStandardAlert(dialog, NULL, &unused); + RunStandardAlert(dialog, NULL, &button); + switch (button) + { + case kAlertStdAlertOKButton: + if (system(NULL)) + system("open /tmp/crashinfo.txt"); + else + SysBeep(30); + break; + } CFRelease(OK); + CFRelease(Cancel); CFRelease(error); }