Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D6qGB-00055i-4W for qemu-devel@nongnu.org; Thu, 03 Mar 2005 08:20:59 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D6qG6-00053x-HZ for qemu-devel@nongnu.org; Thu, 03 Mar 2005 08:20:55 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D6qG5-000500-Qk for qemu-devel@nongnu.org; Thu, 03 Mar 2005 08:20:53 -0500 Received: from [213.228.0.44] (helo=postfix3-1.free.fr) by monty-python.gnu.org with esmtp (Exim 4.34) id 1D6prY-0003wH-3h for qemu-devel@nongnu.org; Thu, 03 Mar 2005 07:55:32 -0500 Received: from [192.168.1.101] (unknown [82.227.67.30]) by postfix3-1.free.fr (Postfix) with ESMTP id 7D70217351F for ; Thu, 3 Mar 2005 13:55:31 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v619.2) In-Reply-To: References: Content-Type: multipart/mixed; boundary=Apple-Mail-4-550832533 Message-Id: <66100c34a592f5317e856df81aa866bd@free.fr> From: Pierre d'Herbemont Subject: Re: [Qemu-devel] [Patch] Fix for ppc-softmmu and cocoa video driver Date: Thu, 3 Mar 2005 13:55:34 +0100 Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --Apple-Mail-4-550832533 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed On 3 mars 05, at 03:56, David Still wrote: > As it is currently written, qemu in cocoa mode will always ask you to > select the disk image via the cocoa open file dialog, even if you > specified an image from the command-line. Would it be possible to > have qemu only open the dialog box if an image was not selected from > command-line? > Here is a fix. Pierre. --Apple-Mail-4-550832533 Content-Transfer-Encoding: 7bit Content-Type: text/plain; x-unix-mode=0644; name="dialogwhennoargs.diff.txt" Content-Disposition: attachment; filename=dialogwhennoargs.diff.txt Index: cocoa.m =================================================================== RCS file: /cvsroot/qemu/qemu/cocoa.m,v retrieving revision 1.2 diff -u -r1.2 cocoa.m --- cocoa.m 2 Mar 2005 22:22:43 -0000 1.2 +++ cocoa.m 3 Mar 2005 12:51:44 -0000 @@ -416,8 +416,11 @@ /* 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]; @@ -431,9 +434,11 @@ 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 --Apple-Mail-4-550832533--