[gnome-boxes] vm-importer: Allow subclasses to not start VM after import



commit fa71624d41dcca978f72ca3d33e1c4f43b672d61
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Fri Nov 15 16:31:34 2013 +0000

    vm-importer: Allow subclasses to not start VM after import
    
    https://bugzilla.gnome.org/show_bug.cgi?id=666185

 src/vm-importer.vala |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/vm-importer.vala b/src/vm-importer.vala
index 262451a..a53232c 100644
--- a/src/vm-importer.vala
+++ b/src/vm-importer.vala
@@ -6,6 +6,8 @@ using GVir;
 private class Boxes.VMImporter : Boxes.VMCreator {
     public InstalledMedia source_media { get { return install_media as InstalledMedia; } }
 
+    protected bool start_after_import = true;
+
     public VMImporter (InstalledMedia source_media) {
         base (source_media);
     }
@@ -56,10 +58,12 @@ private class Boxes.VMImporter : Boxes.VMCreator {
         }
 
         set_post_install_config (machine);
-        try {
-            machine.domain.start (0);
-        } catch (GLib.Error error) {
-            warning ("Failed to start domain '%s': %s", machine.domain.get_name (), error.message);
+        if (start_after_import) {
+            try {
+                machine.domain.start (0);
+            } catch (GLib.Error error) {
+                warning ("Failed to start domain '%s': %s", machine.domain.get_name (), error.message);
+            }
         }
         machine.info = null;
         machine.vm_creator = null;


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