Commit 5a246934eb737c242e28995641c9ebf80477b0b7
1 parent
b7e2c11d
open the dialog box if an image was not selected from command-line (Pierre d'Herbemont)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1358 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
10 additions
and
5 deletions
cocoa.m
| @@ -416,8 +416,11 @@ static void QZ_SetPortAlphaOpaque () | @@ -416,8 +416,11 @@ static void QZ_SetPortAlphaOpaque () | ||
| 416 | /* Called when the internal event loop has just started running */ | 416 | /* Called when the internal event loop has just started running */ |
| 417 | - (void)applicationDidFinishLaunching: (NSNotification *) note | 417 | - (void)applicationDidFinishLaunching: (NSNotification *) note |
| 418 | { | 418 | { |
| 419 | - | ||
| 420 | - /* Do whatever we want here : set up a pc list... */ | 419 | + |
| 420 | + /* Display an open dialog box if no argument were passed or | ||
| 421 | + if qemu was launched from the finder ( the Finder passes "-psn" ) */ | ||
| 422 | + | ||
| 423 | + if( gArgc <= 1 || strncmp (gArgv[1], "-psn", 4) == 0) | ||
| 421 | { | 424 | { |
| 422 | NSOpenPanel *op = [[NSOpenPanel alloc] init]; | 425 | NSOpenPanel *op = [[NSOpenPanel alloc] init]; |
| 423 | 426 | ||
| @@ -431,9 +434,11 @@ static void QZ_SetPortAlphaOpaque () | @@ -431,9 +434,11 @@ static void QZ_SetPortAlphaOpaque () | ||
| 431 | modalForWindow:window modalDelegate:self | 434 | modalForWindow:window modalDelegate:self |
| 432 | didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:) contextInfo:NULL]; | 435 | didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:) contextInfo:NULL]; |
| 433 | } | 436 | } |
| 434 | - | ||
| 435 | - /* or Launch Qemu, with the global args */ | ||
| 436 | - //[self startEmulationWithArgc:gArgc argv:gArgv]; | 437 | + else |
| 438 | + { | ||
| 439 | + /* or Launch Qemu, with the global args */ | ||
| 440 | + [self startEmulationWithArgc:gArgc argv:gArgv]; | ||
| 441 | + } | ||
| 437 | } | 442 | } |
| 438 | 443 | ||
| 439 | - (void)applicationWillTerminate:(NSNotification *)aNotification | 444 | - (void)applicationWillTerminate:(NSNotification *)aNotification |