[gnome-boxes/backports-3.36: 2/4] vm-creator: Keep Live VMs around



commit 5b595110f3853da60c748f9a7ef0e561180225a7
Author: Felipe Borges <felipeborges gnome org>
Date:   Fri Feb 7 12:34:45 2020 +0100

    vm-creator: Keep Live VMs around
    
    Instead of deleting a Live session when the user decided not to
    install the OS, we now will keep the Live VMs.
    
    Fixes #227

 src/vm-creator.vala | 27 ++++++---------------------
 1 file changed, 6 insertions(+), 21 deletions(-)
---
diff --git a/src/vm-creator.vala b/src/vm-creator.vala
index be52bc3b..a083fa89 100644
--- a/src/vm-creator.vala
+++ b/src/vm-creator.vala
@@ -160,27 +160,12 @@ private void on_machine_state_changed (GLib.Object object, GLib.ParamSpec? pspec
             machine.vm_creator = null;
             machine.schedule_autosave ();
             try_create_snapshot.begin (machine);
-        } else {
-            if (VMConfigurator.is_live_config (machine.domain_config)) {
-                // No installation during live session, so lets delete the VM
-                machine.disconnect (state_changed_id);
-                install_media.clean_up ();
-                var items = new GLib.List<CollectionItem> ();
-                items.append (machine);
-
-                Boxes.App.UndoNotifyCallback undo_notify_callback = () => {
-                    debug ("Live box deletion cancelled. Invoking post installation setup...");
-                    set_post_install_config (machine);
-                };
-
-                var msg = _("Live box ā€œ%sā€ has been deleted automatically.").printf (machine.name);
-                App.app.delete_machines_undoable ((owned) items, msg, (owned) undo_notify_callback);
-            } else
-                try {
-                    domain.start (0);
-                } catch (GLib.Error error) {
-                    warning ("Failed to start domain '%s': %s", domain.get_name (), error.message);
-                }
+        } else if (!VMConfigurator.is_live_config (machine.domain_config)) {
+            try {
+                domain.start (0);
+            } catch (GLib.Error error) {
+                warning ("Failed to start domain '%s': %s", domain.get_name (), error.message);
+            }
         }
     }
 


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