[gnome-boxes] Add force shutdown button to properties view



commit 91d576399e5d36a34eebe7bf9cb5dc2c72c45e3f
Author: Alexander Larsson <alexl redhat com>
Date:   Thu Oct 25 16:57:08 2012 +0200

    Add force shutdown button to properties view
    
    https://bugzilla.gnome.org/show_bug.cgi?id=686775

 src/properties.vala |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/properties.vala b/src/properties.vala
index 6be1256..14a0a6e 100644
--- a/src/properties.vala
+++ b/src/properties.vala
@@ -20,6 +20,7 @@ private class Boxes.Properties: Boxes.UI {
     private Gtk.Label toolbar_label;
     private Gtk.ListStore listmodel;
     private Gtk.TreeView tree_view;
+    private Gtk.Button shutdown_button;
     private GLib.Binding toolbar_label_bind;
     private MiniGraph cpu;
     private MiniGraph io;
@@ -143,6 +144,8 @@ private class Boxes.Properties: Boxes.UI {
 
         var machine = App.app.current_item as Machine;
 
+        shutdown_button.sensitive = machine != null && machine is LibvirtMachine;
+
         if (machine == null)
             return;
 
@@ -257,6 +260,14 @@ private class Boxes.Properties: Boxes.UI {
         net.hexpand = true;
         grid.attach (net, 5, 1, 1, 1);
 
+        shutdown_button = new Button.with_label (_("Force Shutdown"));
+        shutdown_button.clicked.connect ( () => {
+            var machine = App.app.current_item as LibvirtMachine;
+            if (machine != null)
+                machine.force_shutdown ();
+        });
+        grid.attach (shutdown_button, 0, 2, 6, 1);
+
         vbox.show_all ();
         notebook.show_all ();
     }



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