summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorJohn Arbuckle <programmingkidx@gmail.com>2015-06-19 10:53:27 +0100
committerPeter Maydell <peter.maydell@linaro.org>2015-06-19 11:22:17 +0100
commit270746142c3c96549ecd82c6097a6d85a35f27cf (patch)
tree2c644e80ed3d11300671415e421f316a8a8c7b6e /ui
parent8524f1c79e614552c0165db9cc75a8a6bd8607a5 (diff)
downloadhqemu-270746142c3c96549ecd82c6097a6d85a35f27cf.zip
hqemu-270746142c3c96549ecd82c6097a6d85a35f27cf.tar.gz
ui/cocoa.m: Add Reset and Power Down menu items to Machine menu
Add "Reset" and "Power Down" menu items to Machine menu. Signed-off-by: John Arbuckle <programmingkidx@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'ui')
-rw-r--r--ui/cocoa.m17
1 files changed, 17 insertions, 0 deletions
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];
OpenPOWER on IntegriCloud