From patchwork Fri Sep 25 22:18:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 54184 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by patches.linaro.org (Postfix) with ESMTPS id 8AD80218DB for ; Fri, 25 Sep 2015 22:20:20 +0000 (UTC) Received: by wisv5 with SMTP id v5sf14543869wis.0 for ; Fri, 25 Sep 2015 15:20:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=7Ec2STqObyhmcgBwsbPWCsi/VYOckut9+1Jn7Ra5YcI=; b=ZlMsPNfdmNPBCeNOZNyt7hMWJSw/xmoQfE5q+AKMiHwjX2r079GRaca57BiZfxKoI4 HbMI56CVmmGpaNA4nilEaA55Bcgq/pmhb/HVQvO+P2gSraqusgzPqaw833GW17zXJm1v k3CYhRyB6tiLtKRIJy9FeK+pGMP4kdfij0I3K9WSkBBMecPJITz2hfSuRai4VkBBoABv v2OoLfugS/0Cmo8/NA+60Wyktp2xgCTGQjFY9B7ltPRN8oD4oloChSBnkTre9nlbvDWs VhPVFNTDFxJdr+/tfI49hjqHRotG9dnuCNMchMhmQx8ASW23zBkgO0sfABdXpIDt2mRQ VBXA== X-Gm-Message-State: ALoCoQmuV2ADc71XtTYZ38obueZDf+lIhfhjXIR7HFuV0UGcmusSYld2s36yC4vUUoJSCZlRtGtw X-Received: by 10.152.244.165 with SMTP id xh5mr1316709lac.1.1443219619650; Fri, 25 Sep 2015 15:20:19 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.3.194 with SMTP id e2ls217568lae.49.gmail; Fri, 25 Sep 2015 15:20:19 -0700 (PDT) X-Received: by 10.112.77.197 with SMTP id u5mr1928006lbw.120.1443219619509; Fri, 25 Sep 2015 15:20:19 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id qg5si2601969lbb.18.2015.09.25.15.20.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Sep 2015 15:20:19 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by laclj5 with SMTP id lj5so17396673lac.3 for ; Fri, 25 Sep 2015 15:20:19 -0700 (PDT) X-Received: by 10.152.23.97 with SMTP id l1mr2397344laf.56.1443219619374; Fri, 25 Sep 2015 15:20:19 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp291379lbq; Fri, 25 Sep 2015 15:20:18 -0700 (PDT) X-Received: by 10.50.88.33 with SMTP id bd1mr5118149igb.68.1443219616704; Fri, 25 Sep 2015 15:20:16 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id y42si4262320ioi.100.2015.09.25.15.20.16 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 25 Sep 2015 15:20:16 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:50745 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfbLk-00016C-4e for patch@linaro.org; Fri, 25 Sep 2015 18:20:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfbKY-0008IE-Ux for qemu-devel@nongnu.org; Fri, 25 Sep 2015 18:19:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfbKX-0007S0-TU for qemu-devel@nongnu.org; Fri, 25 Sep 2015 18:19:02 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:35102) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfbKX-0007Mt-MH for qemu-devel@nongnu.org; Fri, 25 Sep 2015 18:19:01 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1ZfbKP-0003za-2S for qemu-devel@nongnu.org; Fri, 25 Sep 2015 23:18:53 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 25 Sep 2015 23:18:52 +0100 Message-Id: <1443219532-15309-4-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1443219532-15309-1-git-send-email-peter.maydell@linaro.org> References: <1443219532-15309-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Subject: [Qemu-devel] [PULL 3/3] ui/cocoa.m: remove open dialog code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: John Arbuckle Removes the open dialog code that runs when no arguments are supplied with QEMU. Not everyone needs a hard drive or cdrom to boot their target. A user might only need to use their target's bios to do work. With that said, this patch removes the unneeded open dialog code. Signed-off-by: John Arbuckle Message-id: 33856864-321C-4367-9170-FB0BF81E789B@gmail.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- ui/cocoa.m | 56 ++------------------------------------------------------ 1 file changed, 2 insertions(+), 54 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index d436780..a91b8bc 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -833,7 +833,6 @@ QemuCocoaView *cocoaView; { } - (void)startEmulationWithArgc:(int)argc argv:(char**)argv; -- (void)openPanelDidEnd:(NSOpenPanel *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo; - (void)doToggleFullScreen:(id)sender; - (void)toggleFullScreen:(id)sender; - (void)showQEMUDoc:(id)sender; @@ -916,29 +915,8 @@ QemuCocoaView *cocoaView; - (void)applicationDidFinishLaunching: (NSNotification *) note { COCOA_DEBUG("QemuCocoaAppController: applicationDidFinishLaunching\n"); - - // Display an open dialog box if no arguments were passed or - // if qemu was launched from the finder ( the Finder passes "-psn" ) - if( gArgc <= 1 || strncmp ((char *)gArgv[1], "-psn", 4) == 0) { - NSOpenPanel *op = [[NSOpenPanel alloc] init]; - [op setPrompt:@"Boot image"]; - [op setMessage:@"Select the disk image you want to boot.\n\nHit the \"Cancel\" button to quit"]; -#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) - [op setAllowedFileTypes:supportedImageFileTypes]; - [op beginSheetModalForWindow:normalWindow - completionHandler:^(NSInteger returnCode) - { [self openPanelDidEnd:op - returnCode:returnCode contextInfo:NULL ]; } ]; -#else - // Compatibility code for pre-10.6, using deprecated method - [op beginSheetForDirectory:nil file:nil types:filetypes - modalForWindow:normalWindow modalDelegate:self - didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:) contextInfo:NULL]; -#endif - } else { - // or launch QEMU, with the global args - [self startEmulationWithArgc:gArgc argv:(char **)gArgv]; - } + // launch QEMU, with the global args + [self startEmulationWithArgc:gArgc argv:(char **)gArgv]; } - (void)applicationWillTerminate:(NSNotification *)aNotification @@ -990,36 +968,6 @@ QemuCocoaView *cocoaView; exit(status); } -- (void)openPanelDidEnd:(NSOpenPanel *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo -{ - COCOA_DEBUG("QemuCocoaAppController: openPanelDidEnd\n"); - - /* The NSFileHandlingPanelOKButton/NSFileHandlingPanelCancelButton values for - * returnCode strictly only apply for the 10.6-and-up beginSheetModalForWindow - * API. For the legacy pre-10.6 beginSheetForDirectory API they are NSOKButton - * and NSCancelButton. However conveniently the values are the same. - * We use the non-legacy names because the others are deprecated in OSX 10.10. - */ - if (returnCode == NSFileHandlingPanelCancelButton) { - exit(0); - } else if (returnCode == NSFileHandlingPanelOKButton) { - char *img = (char*)[ [ [ sheet URL ] path ] cStringUsingEncoding:NSASCIIStringEncoding]; - - char **argv = g_new(char *, 4); - - [sheet close]; - - argv[0] = g_strdup(gArgv[0]); - argv[1] = g_strdup("-hda"); - argv[2] = g_strdup(img); - argv[3] = NULL; - - // printf("Using argc %d argv %s -hda %s\n", 3, gArgv[0], img); - - [self startEmulationWithArgc:3 argv:(char**)argv]; - } -} - /* We abstract the method called by the Enter Fullscreen menu item * because Mac OS 10.7 and higher disables it. This is because of the * menu item's old selector's name toggleFullScreen: