aboutsummaryrefslogtreecommitdiff
path: root/src/status-service.c
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-08-08 06:04:11 -0600
committerTed Gould <ted@canonical.com>2009-08-08 06:04:11 -0600
commite36075a13c2e270b9a240032f8fca244614d6367 (patch)
tree5df6df773022d97182ecc19b57728554727c732a /src/status-service.c
parentd61f15d257b8d7e27d4cc7955e9b870d0e44d73b (diff)
downloadayatana-indicator-session-e36075a13c2e270b9a240032f8fca244614d6367.tar.gz
ayatana-indicator-session-e36075a13c2e270b9a240032f8fca244614d6367.tar.bz2
ayatana-indicator-session-e36075a13c2e270b9a240032f8fca244614d6367.zip
Brining in the concept of global status
Diffstat (limited to 'src/status-service.c')
-rw-r--r--src/status-service.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/status-service.c b/src/status-service.c
index 4c48c72..3f25c4f 100644
--- a/src/status-service.c
+++ b/src/status-service.c
@@ -67,6 +67,27 @@ static DbusmenuMenuitem * root_menuitem = NULL;
static DbusmenuMenuitem * status_menuitem = NULL;
static GMainLoop * mainloop = NULL;
static StatusServiceDbus * dbus_interface = NULL;
+static StatusProviderStatus global_status = STATUS_PROVIDER_STATUS_OFFLINE;
+
+static void
+status_update (void) {
+ StatusProviderStatus oldglobal = global_status;
+ global_status = STATUS_PROVIDER_STATUS_ONLINE;
+
+ int i;
+ for (i = 0; i < STATUS_PROVIDER_CNT; i++) {
+ StatusProviderStatus localstatus = status_provider_get_status(status_providers[i]);
+ if (localstatus > global_status) {
+ global_status = localstatus;
+ }
+ }
+
+ if (global_status != oldglobal) {
+ g_debug("Global status changed to: %s", _(status_strings[global_status]));
+ }
+
+ return;
+}
/* A fun little function to actually lock the screen. If,
that's what you want, let's do it! */