X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=cocoa.m;h=d41517b08737f5b711792abf98c6580f7fdf8283;hb=51a36cb2cb38bee2834de8add532cb66e4e6b884;hp=ade7f61d82685df8423bdd6fb99fe3bedc3af536;hpb=5b0753e0d8dfca5a33edcd3cc1306bb5d0594005;p=qemu diff --git a/cocoa.m b/cocoa.m index ade7f61..d41517b 100644 --- a/cocoa.m +++ b/cocoa.m @@ -34,9 +34,11 @@ x simple graphical prompt to demo - better graphical prompt */ -#include "vl.h" + #import +#include "vl.h" + NSWindow *window = NULL; NSQuickDrawView *qd_view = NULL; @@ -414,8 +416,11 @@ static void QZ_SetPortAlphaOpaque () /* Called when the internal event loop has just started running */ - (void)applicationDidFinishLaunching: (NSNotification *) note { - - /* Do whatever we want here : set up a pc list... */ + + /* Display an open dialog box if no argument were passed or + if qemu was launched from the finder ( the Finder passes "-psn" ) */ + + if( gArgc <= 1 || strncmp (gArgv[1], "-psn", 4) == 0) { NSOpenPanel *op = [[NSOpenPanel alloc] init]; @@ -425,13 +430,15 @@ static void QZ_SetPortAlphaOpaque () [op setMessage:@"Select the disk image you want to boot.\n\nHit the \"Cancel\" button to quit"]; - [op beginSheetForDirectory:nil file:nil types:[NSArray arrayWithObjects:@"img",@"iso",nil] + [op beginSheetForDirectory:nil file:nil types:[NSArray arrayWithObjects:@"img",@"iso",@"dmg",@"qcow",@"cow",@"cloop",@"vmdk",nil] modalForWindow:window modalDelegate:self didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:) contextInfo:NULL]; } - - /* or Launch Qemu, with the global args */ - //[self startEmulationWithArgc:gArgc argv:gArgv]; + else + { + /* or Launch Qemu, with the global args */ + [self startEmulationWithArgc:gArgc argv:gArgv]; + } } - (void)applicationWillTerminate:(NSNotification *)aNotification