[gnome-boxes] InstallerMedia tells if setup is needed



commit a902f815a94233970422351f19ebed32c10c52d2
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed Jul 11 10:53:00 2012 +0300

    InstallerMedia tells if setup is needed
    
    No need to use 'is UnattendedInstaller' check for this now.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=679706

 src/installer-media.vala      |    5 +++++
 src/unattended-installer.vala |    6 ++++++
 src/wizard.vala               |   11 ++++-------
 3 files changed, 15 insertions(+), 7 deletions(-)
---
diff --git a/src/installer-media.vala b/src/installer-media.vala
index 06738cf..4bebb61 100644
--- a/src/installer-media.vala
+++ b/src/installer-media.vala
@@ -13,6 +13,11 @@ private class Boxes.InstallerMedia : GLib.Object {
     public string mount_point;
     public bool from_image;
 
+    public virtual bool need_user_input_for_vm_creation {
+        get {
+            return false;
+        }
+    }
     public bool live { get { return os_media == null || os_media.live; } }
 
     public InstallerMedia.from_iso_info (string           path,
diff --git a/src/unattended-installer.vala b/src/unattended-installer.vala
index e018263..6d9003e 100644
--- a/src/unattended-installer.vala
+++ b/src/unattended-installer.vala
@@ -7,6 +7,12 @@ public errordomain UnattendedInstallerError {
 }
 
 private abstract class Boxes.UnattendedInstaller: InstallerMedia {
+    public override bool need_user_input_for_vm_creation {
+        get {
+            return !live; // No setup required by live media (and unknown medias are not UnattendedInstaller instances)
+        }
+    }
+
     public bool express_install {
         get { return express_toggle.active; }
     }
diff --git a/src/wizard.vala b/src/wizard.vala
index ec2fb99..122ab37 100644
--- a/src/wizard.vala
+++ b/src/wizard.vala
@@ -391,18 +391,15 @@ private class Boxes.Wizard: Boxes.UI {
             page == Boxes.WizardPage.PREPARATION)
             skip_to = page - 1;
 
-        if (vm_creator != null && page == Boxes.WizardPage.SETUP) {
-            var live = vm_creator.install_media.live;
-
-            // No setup required by live media and unattended installers
-            if (live || !(vm_creator.install_media is UnattendedInstaller)) {
+        if (vm_creator != null && page == Boxes.WizardPage.SETUP)
+            // Skip SETUP page if installer media doesn't need it
+            if (!vm_creator.install_media.need_user_input_for_vm_creation) {
                 skip_to = forwards ? page + 1 : page - 1;
 
                 // Also skip review for live media if told to do so
-                if (live && forwards && skip_review_for_live)
+                if (vm_creator.install_media.live && forwards && skip_review_for_live)
                     skip_to += 1;
             }
-        }
 
         if (skip_to != page) {
             this.page = skip_to;



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