From patchwork Sun Sep 27 14:31:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Programmingkid X-Patchwork-Id: 523153 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E10781401F6 for ; Mon, 28 Sep 2015 00:31:41 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=N5xfXVdZ; dkim-atps=neutral Received: from localhost ([::1]:57668 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgCzL-0001gw-JH for incoming@patchwork.ozlabs.org; Sun, 27 Sep 2015 10:31:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33113) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgCz6-0001PJ-0Q for qemu-devel@nongnu.org; Sun, 27 Sep 2015 10:31:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZgCz2-0000eK-QB for qemu-devel@nongnu.org; Sun, 27 Sep 2015 10:31:23 -0400 Received: from mail-qg0-x22c.google.com ([2607:f8b0:400d:c04::22c]:33104) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgCz2-0000dz-Lq for qemu-devel@nongnu.org; Sun, 27 Sep 2015 10:31:20 -0400 Received: by qgev79 with SMTP id v79so102863566qge.0 for ; Sun, 27 Sep 2015 07:31:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:content-transfer-encoding:subject:date:message-id :cc:to:mime-version; bh=XPG5+wL8kQYfXHjaQKsghb47dPFCYO5T1K7usE84Q0M=; b=N5xfXVdZafZl4eN0mEVUJ6y9viPVMk6n5uljULIY+Q4PIVBuzTTRPyAlQodQPm3CRB 7roAeKOJFnD63Hwt+VkI7YS3ufErZjH4WBtQ0Elol0DYwfIsDecKl0SdFmimZ3MR+3/F RNdQTIprVN4G2l+QmFJf7OT2iqWzJpQu+eEFdCDJun1QHQkAoFys/0C5Z3R6ki64F2XR O8uNh40wov3nKI6an2Yq+VFze8HpeALz3fNXARzifPQM8fnjDmMh7m56ncSXlk+M6oVM jUQcBwrU+2J5Bz0nYhIvu5X/8RsCwJSNkfYXqWWLC26i+B9pLoa5hT5Vz0icTqClJYsK mfCQ== X-Received: by 10.140.133.202 with SMTP id 193mr17769314qhf.52.1443364280399; Sun, 27 Sep 2015 07:31:20 -0700 (PDT) Received: from [192.168.0.3] (d199-74-164-53.col.wideopenwest.com. [74.199.53.164]) by smtp.gmail.com with ESMTPSA id d64sm5285718qgf.34.2015.09.27.07.31.19 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 27 Sep 2015 07:31:19 -0700 (PDT) From: Programmingkid Date: Sun, 27 Sep 2015 10:31:18 -0400 Message-Id: <73E2DCAA-7381-4A5D-870D-27BF4A0D3C3B@gmail.com> To: Peter Maydell Mime-Version: 1.0 (Apple Message framework v1084) X-Mailer: Apple Mail (2.1084) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c04::22c Cc: qemu-devel qemu-devel Subject: [Qemu-devel] [PATCH] ui/cocoa.m: fix help menus 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Make the help menus actually work. Signed-off-by: John Arbuckle --- ui/cocoa.m | 20 ++++++++++++++++---- 1 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 334e6f6..2c81785 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -992,16 +992,28 @@ QemuCocoaView *cocoaView; { COCOA_DEBUG("QemuCocoaAppController: showQEMUDoc\n"); - [[NSWorkspace sharedWorkspace] openFile:[NSString stringWithFormat:@"%@/../doc/qemu/qemu-doc.html", - [[NSBundle mainBundle] resourcePath]] withApplication:@"Help Viewer"]; + NSString *path; + path = [[NSBundle mainBundle] resourcePath]; + path = [path stringByDeletingLastPathComponent]; + path = [NSString stringWithFormat: @"%@/%s", path, "qemu-doc.html"]; + if([[NSWorkspace sharedWorkspace] openFile: path] == NO) { + NSBeep(); + QEMU_Alert(@"Failed to open file qemu-doc.html!"); + } } - (void)showQEMUTec:(id)sender { COCOA_DEBUG("QemuCocoaAppController: showQEMUTec\n"); - [[NSWorkspace sharedWorkspace] openFile:[NSString stringWithFormat:@"%@/../doc/qemu/qemu-tech.html", - [[NSBundle mainBundle] resourcePath]] withApplication:@"Help Viewer"]; + NSString *path; + path = [[NSBundle mainBundle] resourcePath]; + path = [path stringByDeletingLastPathComponent]; + path = [NSString stringWithFormat: @"%@/%s", path, "qemu-tech.html"]; + if([[NSWorkspace sharedWorkspace] openFile: path] == NO) { + NSBeep(); + QEMU_Alert(@"Failed to open file qemu-tech.html!"); + } } /* Stretches video to fit host monitor size */