[gnome-boxes] libvirt-machine-props: Restart only sensitive for running machine
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] libvirt-machine-props: Restart only sensitive for running machine
- Date: Tue, 28 Apr 2015 17:42:01 +0000 (UTC)
commit 1c0f5cdfe5cfac87c59a61797cb096b285fe22d4
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Tue Apr 28 18:28:59 2015 +0100
libvirt-machine-props: Restart only sensitive for running machine
If machine in question is not running, users shouldn't be clicking on
"Restart" button, just like it's the case for "Force shutdown" button.
Let's make this button's sensitivity be dependent on machine's status.
src/libvirt-machine-properties.vala | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/libvirt-machine-properties.vala b/src/libvirt-machine-properties.vala
index 529e476..f566225 100644
--- a/src/libvirt-machine-properties.vala
+++ b/src/libvirt-machine-properties.vala
@@ -420,6 +420,7 @@ private class Boxes.LibvirtMachineProperties: GLib.Object, Boxes.IPropertiesProv
machine.restart ();
machine.window.props_window.revert_state ();
});
+ restart_button.sensitive = machine.is_running ();
inner_grid.attach (restart_button, 1, 0, 1, 1);
var shutdown_button = new Gtk.Button.with_label (_("Force Shutdown"));
@@ -428,10 +429,11 @@ private class Boxes.LibvirtMachineProperties: GLib.Object, Boxes.IPropertiesProv
machine.force_shutdown ();
machine.window.props_window.revert_state ();
});
+ shutdown_button.sensitive = machine.is_running ();
inner_grid.attach (shutdown_button, 2, 0, 1, 1);
- shutdown_button.sensitive = machine.is_running ();
var state_notify_id = machine.notify["state"].connect (() => {
+ restart_button.sensitive = machine.is_running ();
shutdown_button.sensitive = machine.is_running ();
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]