[gnome-usage] memory-sub-view: Update showing list-box acording to backend state
- From: Petr Štětka <pstetka src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-usage] memory-sub-view: Update showing list-box acording to backend state
- Date: Wed, 19 Dec 2018 12:50:00 +0000 (UTC)
commit 769dadb8b2de23a76d6001f7fe5af2bd29637f57
Author: Petr Štětka <pstetka redhat com>
Date: Thu May 31 14:16:54 2018 +0200
memory-sub-view: Update showing list-box acording to backend state
src/memory-sub-view.vala | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/src/memory-sub-view.vala b/src/memory-sub-view.vala
index 2336df8..0a6ef14 100644
--- a/src/memory-sub-view.vala
+++ b/src/memory-sub-view.vala
@@ -36,7 +36,7 @@ namespace Usage
var spinner = new Gtk.Spinner();
spinner.active = true;
spinner.margin_top = 30;
- spinner.margin_bottom = 20;
+ spinner.height_request = 250;
no_process_view = new NoResultsFoundView();
@@ -55,15 +55,19 @@ namespace Usage
memory_box.pack_start(spinner, true, true, 0);
memory_box.add(no_process_view);
- SystemMonitor.get_default().cpu_processes_ready.connect(() =>
- {
- memory_box.pack_start(process_list_box, false, false, 0);
- process_list_box.update();
- memory_box.remove(spinner);
+ var system_monitor = SystemMonitor.get_default();
+ system_monitor.notify["process-list-ready"].connect ((sender, property) => {
+ if(system_monitor.process_list_ready) {
+ memory_box.pack_start(process_list_box, false, false, 0);
+ memory_box.remove(spinner);
+ }
+ else {
+ memory_box.pack_start(spinner, true, true, 0);
+ memory_box.remove(process_list_box);
+ }
});
process_list_box.bind_property ("empty", no_process_view, "visible", BindingFlags.BIDIRECTIONAL);
-
add(memory_box);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]