Search
lxdream.org :: lxdream :: r685:fa1589b42be7
lxdream 0.9.1
released Jun 29
Download Now
changeset685:fa1589b42be7
parent684:95f2068235ef
child686:afd1bd3f1acc
authornkeynes
dateTue Jun 03 11:16:51 2008 +0000 (11 years ago)
Add alert dialog for errors
Handle the command line when launched from finder
src/cocoaui/cocoaui.c
1.1 --- a/src/cocoaui/cocoaui.c Sun Jun 01 08:58:46 2008 +0000
1.2 +++ b/src/cocoaui/cocoaui.c Tue Jun 03 11:16:51 2008 +0000
1.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.12
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 like
1.17 + * -psn_0_... - we want to remove this so that lxdream doesn't try to process it
1.18 + * normally
1.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.25
1.26 gboolean gui_init( gboolean withDebug )
1.27 @@ -233,7 +241,13 @@
1.28
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.40
1.41 void gui_update_io_activity( io_activity_type io, gboolean active )
.