[gnome-usage] process-list-box: Update list-box when system-monitor notices



commit 0ee4146d9d283ec621acbcd52dbe0f299e0a462c
Author: Petr Štětka <pstetka redhat com>
Date:   Thu May 31 14:05:47 2018 +0200

    process-list-box: Update list-box when system-monitor notices

 src/process-list-box.vala | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/process-list-box.vala b/src/process-list-box.vala
index 6692138..7579406 100644
--- a/src/process-list-box.vala
+++ b/src/process-list-box.vala
@@ -53,13 +53,19 @@ namespace Usage
                 update();
             });
 
+            var system_monitor = SystemMonitor.get_default();
+            system_monitor.notify["process-list-ready"].connect (() => {
+                if(system_monitor.process_list_ready)
+                    update();
+            });
+
             var settings = Settings.get_default();
             Timeout.add(settings.list_update_interval_UI, update);
 
             bind_property ("empty", this, "visible", BindingFlags.INVERT_BOOLEAN);
         }
 
-        public bool update()
+        private bool update()
         {
             model.remove_all();
 


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