From patchwork Fri Jun 19 10:30:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 50072 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5C884218C9 for ; Fri, 19 Jun 2015 10:31:51 +0000 (UTC) Received: by lbbqq2 with SMTP id qq2sf27261895lbb.0 for ; Fri, 19 Jun 2015 03:31:50 -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=dmVg8jh9tpTAG6I9zxVqYkMRHy4ygt4L9GIu8VxWwzE=; b=I5TcRhk0Q9ERDYjoijmXjH1kyQScwuvMro421GHFSlwWGTwa1+xtz+fVNx8KGmiPEn HpK77p8EjyhAvta2e2KU0y76/U2Aq2SGbeIvsS55PC+LcXgU4YfJ1CYTK/1bZtmRnak4 jtK5Pq5+Tmqm/hWaeGkgkG8yAtiRGv/uj0hd7Imj/uKonQdf134cjHEQ81h9epTFV1XT pRz3MJa2q8ZYYIilckzw/S4vvf4F7r3otIMjpvBXcK4C+dhmr5w23AJZaTcjyzmfg9bE I5K6e018MnrY8QqGEbShfyMUlJh/dMPCWdKgF4rHy3tDJQ9YUNfw7cm67nxu4lPdITUG ZizA== X-Gm-Message-State: ALoCoQmA05tRkqLdJznL1r7sRo55uIBkYq4oSpJdXAwgwK0PFSqcryKn/lS5acBHk1C8SHfgoU4c X-Received: by 10.194.142.205 with SMTP id ry13mr11959475wjb.2.1434709910261; Fri, 19 Jun 2015 03:31:50 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.7.67 with SMTP id da3ls658129lad.49.gmail; Fri, 19 Jun 2015 03:31:50 -0700 (PDT) X-Received: by 10.112.222.133 with SMTP id qm5mr17246155lbc.86.1434709910095; Fri, 19 Jun 2015 03:31:50 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id re5si8804572lbb.150.2015.06.19.03.31.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Jun 2015 03:31:49 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbbvz5 with SMTP id vz5so21359190lbb.0 for ; Fri, 19 Jun 2015 03:31:49 -0700 (PDT) X-Received: by 10.112.234.200 with SMTP id ug8mr16887410lbc.117.1434709909783; Fri, 19 Jun 2015 03:31:49 -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.108.230 with SMTP id hn6csp479561lbb; Fri, 19 Jun 2015 03:31:48 -0700 (PDT) X-Received: by 10.140.132.17 with SMTP id 17mr21651156qhe.36.1434709908377; Fri, 19 Jun 2015 03:31:48 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id l67si10430351qgd.96.2015.06.19.03.31.47 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 19 Jun 2015 03:31:48 -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]:57346 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5taN-000267-Fl for patch@linaro.org; Fri, 19 Jun 2015 06:31:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5tZP-00011a-Lm for qemu-devel@nongnu.org; Fri, 19 Jun 2015 06:30:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5tZO-0007NT-M3 for qemu-devel@nongnu.org; Fri, 19 Jun 2015 06:30:47 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:34488) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5tZO-00074r-4p for qemu-devel@nongnu.org; Fri, 19 Jun 2015 06:30:46 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1Z5tZG-0006QQ-0h for qemu-devel@nongnu.org; Fri, 19 Jun 2015 11:30:38 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 19 Jun 2015 11:30:36 +0100 Message-Id: <1434709837-24665-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1434709837-24665-1-git-send-email-peter.maydell@linaro.org> References: <1434709837-24665-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 2/3] ui/cocoa.m: Add Reset and Power Down menu items to Machine menu 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.217.170 as permitted sender) smtp.mail=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 Add "Reset" and "Power Down" menu items to Machine menu. Signed-off-by: John Arbuckle Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- ui/cocoa.m | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ui/cocoa.m b/ui/cocoa.m index d28140b..559058b 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -806,6 +806,8 @@ QemuCocoaView *cocoaView; - (void)resumeQEMU:(id)sender; - (void)displayPause; - (void)removePause; +- (void)restartQEMU:(id)sender; +- (void)powerDownQEMU:(id)sender; @end @implementation QemuCocoaAppController @@ -1033,6 +1035,18 @@ QemuCocoaView *cocoaView; [pauseLabel removeFromSuperview]; } +/* Restarts QEMU */ +- (void)restartQEMU:(id)sender +{ + qmp_system_reset(NULL); +} + +/* Powers down QEMU */ +- (void)powerDownQEMU:(id)sender +{ + qmp_system_powerdown(NULL); +} + @end @@ -1099,6 +1113,9 @@ int main (int argc, const char * argv[]) { menuItem = [[[NSMenuItem alloc] initWithTitle: @"Resume" action: @selector(resumeQEMU:) keyEquivalent: @""] autorelease]; [menu addItem: menuItem]; [menuItem setEnabled: NO]; + [menu addItem: [NSMenuItem separatorItem]]; + [menu addItem: [[[NSMenuItem alloc] initWithTitle: @"Reset" action: @selector(restartQEMU:) keyEquivalent: @""] autorelease]]; + [menu addItem: [[[NSMenuItem alloc] initWithTitle: @"Power Down" action: @selector(powerDownQEMU:) keyEquivalent: @""] autorelease]]; menuItem = [[[NSMenuItem alloc] initWithTitle: @"Machine" action:nil keyEquivalent:@""] autorelease]; [menuItem setSubmenu:menu]; [[NSApp mainMenu] addItem:menuItem];