[gnome-boxes/wip/image-import: 14/18] vm-creator: Set thyself on LibvirtMachine soon after creation



commit 4809271159ecd2c68c08c85cdc3b750f1f1d6ea1
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Thu Jun 6 02:57:33 2013 +0300

    vm-creator: Set thyself on LibvirtMachine soon after creation
    
    Set 'vm_creator' property of LibvirtMachine soon after creating it
    because otherwise its not clear if machine is under construction during
    the wizard/before launch.

 src/vm-creator.vala |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/vm-creator.vala b/src/vm-creator.vala
index d4eaaa0..a657b60 100644
--- a/src/vm-creator.vala
+++ b/src/vm-creator.vala
@@ -57,7 +57,12 @@ private class Boxes.VMCreator {
 
         var domain = connection.create_domain (config);
 
-        return LibvirtBroker.get_default ().add_domain (App.app.default_source, App.app.default_connection, 
domain);
+        var machine = LibvirtBroker.get_default ().add_domain (App.app.default_source,
+                                                               App.app.default_connection,
+                                                               domain);
+        machine.vm_creator = this;
+
+        return machine;
     }
 
     public virtual void launch_vm (LibvirtMachine machine) throws GLib.Error {
@@ -77,7 +82,6 @@ private class Boxes.VMCreator {
             machine.domain.start (0);
 
         state_changed_id = machine.notify["state"].connect (on_machine_state_changed);
-        machine.vm_creator = this;
         machine.config.access_last_time = get_real_time ();
         update_machine_info (machine);
     }


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