[gnome-boxes] actions-popover: Add "Restart" in display mode
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] actions-popover: Add "Restart" in display mode
- Date: Fri, 22 Apr 2016 13:45:08 +0000 (UTC)
commit 2e6bf4c0a6477241aeb723259100e6f7fb7a0ec0
Author: Visarion Alexandru <viorel visarion gmail com>
Date: Wed Apr 20 16:52:38 2016 +0300
actions-popover: Add "Restart" in display mode
Add a Restart action in the display mode popover-menu.
https://bugzilla.gnome.org/show_bug.cgi?id=745691
src/actions-popover.vala | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/actions-popover.vala b/src/actions-popover.vala
index 446bec1..c8d8f37 100644
--- a/src/actions-popover.vala
+++ b/src/actions-popover.vala
@@ -7,7 +7,8 @@ private class Boxes.ActionsPopover: Gtk.Popover {
{"pause", pause_activated},
{"force_shutdown", force_shutdown_activated},
{"delete", delete_activated},
- {"properties", properties_activated}
+ {"properties", properties_activated},
+ {"restart", restart_activated}
};
private AppWindow window;
@@ -63,6 +64,10 @@ private class Boxes.ActionsPopover: Gtk.Popover {
section.append (_("Delete"), "box.delete");
action = action_group.lookup_action ("delete") as GLib.SimpleAction;
action.set_enabled (machine.can_delete);
+ } else {
+ section.append (_("Restart"), "box.restart");
+ var action = action_group.lookup_action ("restart") as GLib.SimpleAction;
+ action.set_enabled (machine.can_restart);
}
menu.append_section (null, section);
@@ -104,6 +109,10 @@ private class Boxes.ActionsPopover: Gtk.Popover {
machine.force_shutdown ();
}
+ private void restart_activated () {
+ (window.current_item as Machine).restart ();
+ }
+
private void delete_activated () {
window.set_state (UIState.COLLECTION);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]