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



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