filename | src/cocoaui/cocoaui.c |
changeset | 685:fa1589b42be7 |
prev | 681:1755a126b109 |
next | 686:afd1bd3f1acc |
author | nkeynes |
date | Tue Jun 03 11:16:51 2008 +0000 (15 years ago) |
permissions | -rw-r--r-- |
last change | Add alert dialog for errors Handle the command line when launched from finder |
file | annotate | diff | log | raw |
1.1 --- a/src/cocoaui/cocoaui.c Sun Jun 01 00:47:45 2008 +00001.2 +++ b/src/cocoaui/cocoaui.c Tue Jun 03 11:16:51 2008 +00001.3 @@ -19,6 +19,7 @@1.4 #include <AppKit/AppKit.h>1.5 #include <stdio.h>1.6 #include <stdlib.h>1.7 +#include <string.h>1.8 #include <sys/time.h>1.9 #include "lxdream.h"1.10 #include "dreamcast.h"1.11 @@ -198,7 +199,14 @@1.13 gboolean gui_parse_cmdline( int *argc, char **argv[] )1.14 {1.15 - /* do nothing */1.16 + /* If started from the finder, the first (and only) arg will look something like1.17 + * -psn_0_... - we want to remove this so that lxdream doesn't try to process it1.18 + * normally1.19 + */1.20 + if( *argc == 2 && strncmp((*argv)[1], "-psn_", 5) == 0 ) {1.21 + *argc = 1;1.22 + }1.23 + return TRUE;1.24 }1.26 gboolean gui_init( gboolean withDebug )1.27 @@ -233,7 +241,13 @@1.29 gboolean gui_error_dialog( const char *msg, ... )1.30 {1.31 -1.32 + NSString *error_string;1.33 +1.34 + va_list args;1.35 + va_start(args, msg);1.36 + error_string = [[NSString alloc] initWithFormat: [NSString stringWithCString: msg] arguments: args];1.37 + NSRunAlertPanel(@"Error in lxdream", error_string, nil, nil, nil);1.38 + va_end(args);1.39 }1.41 void gui_update_io_activity( io_activity_type io, gboolean active )
.