[gnome-boxes] wizard: allow properties access for remote machine



commit 6ba65a967f407354ceb2e48ae1a3c5370d48ca93
Author: Marc-Andrà Lureau <marcandre lureau gmail com>
Date:   Mon Oct 29 12:39:40 2012 +0100

    wizard: allow properties access for remote machine
    
    https://bugzilla.gnome.org/show_bug.cgi?id=684233

 src/wizard.vala |   26 +++++++++++++++-----------
 1 files changed, 15 insertions(+), 11 deletions(-)
---
diff --git a/src/wizard.vala b/src/wizard.vala
index 974be36..c05b99a 100644
--- a/src/wizard.vala
+++ b/src/wizard.vala
@@ -210,14 +210,13 @@ private class Boxes.Wizard: Boxes.UI {
             }
 
             vm_creator = null;
-            machine = null;
             wizard_source.uri = "";
-
-            return true;
+        } else {
+            source.save ();
+            App.app.add_collection_source.begin (source);
         }
 
-        source.save ();
-        App.app.add_collection_source.begin (source);
+        machine = null;
         return true;
     }
 
@@ -350,7 +349,13 @@ private class Boxes.Wizard: Boxes.UI {
         nokvm_label.hide ();
         summary.clear ();
 
-        if (vm_creator != null && libvirt_machine == null) {
+        if (source != null) {
+            try {
+                machine = new RemoteMachine (source);
+            } catch (Boxes.Error error) {
+                warning (error.message);
+            }
+        } else if (vm_creator != null && libvirt_machine == null) {
             try {
                 machine = yield vm_creator.create_vm (review_cancellable);
             } catch (IOError.CANCELLED cancel_error) { // We did this, so ignore!
@@ -435,11 +440,10 @@ private class Boxes.Wizard: Boxes.UI {
             nokvm_label.visible = (libvirt_machine.domain_config.get_virt_type () != GVirConfig.DomainVirtType.KVM);
         }
 
-        if (libvirt_machine != null) // Only allow customization of VMs for now
-            summary.append_customize_button (() => {
-                // Selecting an item in UIState.WIZARD implies changing state to UIState.PROPERTIES
-                App.app.select_item (machine);
-            });
+        summary.append_customize_button (() => {
+            // Selecting an item in UIState.WIZARD implies changing state to UIState.PROPERTIES
+            App.app.select_item (machine);
+        });
 
         return true;
     }



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