[gnome-boxes/dont-delete-vms-when-installer-media-is-gone] vm-creator: Keep Live VMs around



commit 578e50b3f4380aba21a82e3400bb9d5bfa77e609
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 4e9b9e42..1f1967de 100644
--- a/src/vm-creator.vala
+++ b/src/vm-creator.vala
@@ -174,27 +174,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]