[gnome-boxes/wip/props-ui-files: 10/12] properties: Asynchronously populate pages



commit bc4e27d836b0d2e8a7d318c8be2fb58917ebb9b5
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]