[gnome-boxes] actions-popover: Add "Force shutdown" option



commit 6eb6ee941b7fb854ddad69c25b5a69da1ba673ee
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Mon Apr 27 19:02:55 2015 +0100

    actions-popover: Add "Force shutdown" option

 src/actions-popover.vala |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/actions-popover.vala b/src/actions-popover.vala
index fdcf4be..39adc0e 100644
--- a/src/actions-popover.vala
+++ b/src/actions-popover.vala
@@ -5,6 +5,7 @@ private class Boxes.ActionsPopover: Gtk.Popover {
         {"open-in-new-win", open_in_new_win_activated},
         {"favorite",        favorite_activated},
         {"pause",           pause_activated},
+        {"force_shutdown",  force_shutdown_activated},
         {"delete",          delete_activated},
         {"properties",      properties_activated}
     };
@@ -42,6 +43,12 @@ private class Boxes.ActionsPopover: Gtk.Popover {
         else
             section.append (_("Add to Favorites"), "box.favorite");
 
+        if (machine is LibvirtMachine) {
+            section.append (_("Force Shutdown"), "box.force_shutdown");
+            var action = action_group.lookup_action ("force_shutdown") as GLib.SimpleAction;
+            action.set_enabled (machine.is_running ());
+        }
+
         // Pause
         section.append (_("Pause"), "box.pause");
         var action = action_group.lookup_action ("pause") as GLib.SimpleAction;
@@ -87,6 +94,12 @@ private class Boxes.ActionsPopover: Gtk.Popover {
         });
     }
 
+    private void force_shutdown_activated () {
+        var machine = window.current_item as LibvirtMachine;
+
+        machine.force_shutdown ();
+    }
+
     private void delete_activated () {
         window.set_state (UIState.COLLECTION);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]