[gnome-boxes/wip/props-ui-files: 34/37] properties: Asynchronously populate pages



commit 764c5be6f4dd36e449c0c05b89093d992d913ba8
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Thu Jun 2 18:31:58 2016 +0100

    properties: Asynchronously populate pages
    
    In a following patch we will be making PropertiesPageWidget constructor,
    async so the calling method also needs to be async.

 src/properties.vala |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/properties.vala b/src/properties.vala
index 0982884..6e506ff 100644
--- a/src/properties.vala
+++ b/src/properties.vala
@@ -23,7 +23,7 @@ private class Boxes.Properties: Gtk.Notebook, Boxes.UI {
         notify["ui-state"].connect (ui_state_changed);
     }
 
-    private void populate () {
+    private async void populate () {
         foreach (var page in get_children ())
             remove (page);
 
@@ -43,8 +43,10 @@ private class Boxes.Properties: Gtk.Notebook, Boxes.UI {
 
             page.refresh_properties.connect (() => {
                 var current_page = this.page;
-                this.populate ();
-                this.page = current_page;
+                this.populate.begin ((object, result) => {
+                    this.populate.end (result);
+                    this.page = current_page;
+                });
             });
         }
 
@@ -68,7 +70,7 @@ private class Boxes.Properties: Gtk.Notebook, Boxes.UI {
             restore_fullscreen = (previous_ui_state == UIState.DISPLAY && window.fullscreened);
             window.fullscreened = false;
 
-            populate ();
+            populate.begin ();
         } else if (previous_ui_state == UIState.PROPERTIES) {
             var reboot_required = false;
 


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