From patchwork Sun May 17 21:27:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Programmingkid X-Patchwork-Id: 473227 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 B733B1402B5 for ; Mon, 18 May 2015 07:27:55 +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=dXn2i0sy; dkim-atps=neutral Received: from localhost ([::1]:38488 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yu66B-0007Js-Oa for incoming@patchwork.ozlabs.org; Sun, 17 May 2015 17:27:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yu65w-00072G-1A for qemu-devel@nongnu.org; Sun, 17 May 2015 17:27:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yu65q-0005NM-Sn for qemu-devel@nongnu.org; Sun, 17 May 2015 17:27:35 -0400 Received: from mail-qg0-x22d.google.com ([2607:f8b0:400d:c04::22d]:35778) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yu65q-0005NH-MT for qemu-devel@nongnu.org; Sun, 17 May 2015 17:27:30 -0400 Received: by qgew3 with SMTP id w3so33818381qge.2 for ; Sun, 17 May 2015 14:27:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:subject:date:message-id:cc:to:mime-version; bh=fjXXYFYT0uLFPDEusjrsMQUrCxf0huyAUMFGHC6sC48=; b=dXn2i0syS+T8fn6UuN/EWJbRGppDJxDH0CpiyZeZOBbpVBwYUOnbe/bdSr7Bjcbt9F FPg7aLIB4MnaOXoHcmFZTxk4ocbQvzFTv0jiCZx+8XQ535Mng4KEMtktF+nvAjwd+MEb UPXRR+C5sqdwyczk5GMXQqs10a9PJeOor/q23NVSvHK0L8QxLqYA79ldhcRKGMkW6XyY 5dqYaHqglFqTYEJNd2bJ+woKfccMJIsvkerH0p2yfSOhz2T3V8sglt85+adLW8DeQNNu IqlreFaCWc7xwrXmm6wW8aVbugFJzVg/g6DGNDRWWe4Gp0Z1Kl3JU6LrVYGTnbbQmAGd L3Rw== X-Received: by 10.55.43.220 with SMTP id r89mr41302397qkr.27.1431898050252; Sun, 17 May 2015 14:27:30 -0700 (PDT) Received: from [192.168.0.3] (d199-74-164-53.col.wideopenwest.com. [74.199.53.164]) by mx.google.com with ESMTPSA id k71sm5692021qhc.42.2015.05.17.14.27.27 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 17 May 2015 14:27:29 -0700 (PDT) From: Programmingkid Date: Sun, 17 May 2015 17:27:25 -0400 Message-Id: <568DC517-555B-458C-A148-F82C941C0B39@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::22d Cc: qemu-devel qemu-devel Subject: [Qemu-devel] [PATCH v2] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Add "Reset" and "Power Down" menu items to Machine menu. Signed-off-by: John Arbuckle --- Changed text "Qemu" to "QEMU". Moved menu insertion code into main() function. Changed powerDown menu item's name to powerDownQEMU. Replaced qemu_system_reset_request() with qmp_system_reset(NULL). ui/cocoa.m | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 36ca014..c5e24ea 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 @@ -1097,6 +1111,9 @@ int main (int argc, const char * argv[]) { [menu setAutoenablesItems: NO]; [menu addItem: [[[NSMenuItem alloc] initWithTitle: @"Pause" action: @selector(pauseQEMU:) keyEquivalent: @""] autorelease]]; [menu addItem: [[[NSMenuItem alloc] initWithTitle: @"Resume" action: @selector(resumeQEMU:) keyEquivalent: @""] autorelease]]; + [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];