[gnome-boxes] Add Machine::suspend_at_exit



commit 55c03cbd6b467d63a08195fbc7d68d21a4d532e6
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Fri Sep 14 12:30:29 2012 +0200

    Add Machine::suspend_at_exit
    
    This indicates whether we must try to suspend the box when exiting
    Boxes or not. For now this is only set for libvirt machines using
    the default box connection.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=683473

 src/app.vala     |    3 ++-
 src/machine.vala |    1 +
 2 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/app.vala b/src/app.vala
index 6054115..8d6edae 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -205,6 +205,7 @@ private class Boxes.App: Boxes.UI {
             return machine; // Already added
 
         machine = new LibvirtMachine (source, connection, domain);
+        machine.suspend_at_exit = (connection == default_connection);
         collection.add_item (machine);
         domain.set_data<LibvirtMachine> ("machine", machine);
 
@@ -573,7 +574,7 @@ private class Boxes.App: Boxes.UI {
             if (item is LibvirtMachine) {
                 var machine = item as LibvirtMachine;
 
-                if (machine.connection == default_connection)
+                if (machine.suspend_at_exit)
                     machine.suspend.begin ();
             }
 
diff --git a/src/machine.vala b/src/machine.vala
index 401b253..ebc5739 100644
--- a/src/machine.vala
+++ b/src/machine.vala
@@ -12,6 +12,7 @@ private abstract class Boxes.Machine: Boxes.CollectionItem, Boxes.IPropertiesPro
     public bool stay_on_display;
     public string? info { get; set; }
     public string? status { get; set; }
+    public bool suspend_at_exit;
 
     private ulong show_id;
     private ulong hide_id;



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