From e36075a13c2e270b9a240032f8fca244614d6367 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Sat, 8 Aug 2009 06:04:11 -0600 Subject: Brining in the concept of global status --- src/status-service.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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! */ -- cgit v1.2.3