[gnome-boxes] Remove a redundant deference to main loop



commit 8142e5bda4e48c6e3da9e5d73efa33073177e499
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed Dec 7 15:04:58 2011 +0200

    Remove a redundant deference to main loop

 src/wizard.vala |   27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)
---
diff --git a/src/wizard.vala b/src/wizard.vala
index 0ce0fa3..f312797 100644
--- a/src/wizard.vala
+++ b/src/wizard.vala
@@ -62,7 +62,8 @@ private class Boxes.Wizard: Boxes.UI {
                     break;
 
                 case WizardPage.SETUP:
-                    setup ();
+                    if (!setup ())
+                        return;
                     break;
 
                 case WizardPage.REVIEW:
@@ -220,9 +221,9 @@ private class Boxes.Wizard: Boxes.UI {
             prepare_for_location (this.wizard_source.uri);
     }
 
-    private void setup () {
+    private bool setup () {
         if (source != null)
-            return;
+            return true;
 
         foreach (var child in setup_vbox.get_children ())
             setup_vbox.remove (child);
@@ -233,19 +234,19 @@ private class Boxes.Wizard: Boxes.UI {
             skip_to = WizardPage.LAST;
         else if (!(install_media is UnattendedInstaller))
             // Nothing to do so just skip to the next page but let the current page change complete first
-            skip_to = page + 1;
+            skip_to = WizardPage.REVIEW;
 
-        if (skip_to != page)
-            Idle.add (() => {
-                page = skip_to;
+        if (skip_to != page) {
+            page = skip_to;
 
-                return false;
-            });
-        else {
-            var installer = install_media as UnattendedInstaller;
-            installer.populate_setup_vbox (setup_vbox);
-            setup_vbox.show_all ();
+            return false;
         }
+
+        var installer = install_media as UnattendedInstaller;
+        installer.populate_setup_vbox (setup_vbox);
+        setup_vbox.show_all ();
+
+        return true;
     }
 
     private void review () {



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