[gnome-boxes/gnome-3-4] Wait for right state before selecting new machine



commit 7719e693a27cef35acb054c16d382eb2971bd13b
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed Mar 21 18:16:03 2012 +0200

    Wait for right state before selecting new machine
    
    We were trying to select the machine soon after creation without waiting
    for UI state to change to 'collection' and App.select_item() was simply
    failing since UI state was still 'wizard'.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=672567

 src/vm-creator.vala |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/vm-creator.vala b/src/vm-creator.vala
index b7ddab2..c667d41 100644
--- a/src/vm-creator.vala
+++ b/src/vm-creator.vala
@@ -59,8 +59,18 @@ private class Boxes.VMCreator {
         var machine = app.add_domain (app.default_source, app.default_connection, domain);
 
         if (machine != null && fullscreen) {
-            app.select_item (machine);
-            app.fullscreen = true;
+            ulong signal_id = 0;
+
+            signal_id = app.notify["ui-state"].connect (() => {
+                if (app.ui_state != UIState.COLLECTION)
+                    return;
+
+                app.select_item (machine);
+                app.fullscreen = true;
+                app.disconnect (signal_id);
+
+                return;
+            });
         }
     }
 



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