aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2012-04-14 03:14:47 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2012-04-16 12:47:00 +0200
commit29d7ae0000e5e87258a84323791aaabcace91af1 (patch)
tree04d78a1b0fd2c4514b4dfc0b552b4a7b6077820d
parent42c652d123ea133d0a0930b96e8e39dbd0c597b5 (diff)
downloadconnman-gnome-29d7ae0000e5e87258a84323791aaabcace91af1.tar.gz
Monitor the Manager's State property
Monitor the Manager's State property and update global_ready appropriately when it changes. Without this change using the applet with connman 0.79 and starting the applet after the daemon no status icon is shown. With this change this icon displays an appropriate state when the applet launches.
-rw-r--r--applet/main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/applet/main.c b/applet/main.c
index 224e2fd..0cf82bf 100644
--- a/applet/main.c
+++ b/applet/main.c
@@ -111,6 +111,16 @@ static void manager_property_changed(DBusGProxy *proxy, const char *property,
iterate_list, &path);
update_service(proxy, path);
g_free(path);
+ } else if (g_str_equal(property, "State") == TRUE) {
+ const gchar *state = g_value_get_string(value);
+
+ if (g_strcmp0(state, "ready") == 0 || g_strcmp0(state, "online") == 0) {
+ global_ready = TRUE;
+ status_ready(global_strength);
+ } else {
+ global_ready = FALSE;
+ status_offline();
+ }
}
}