aboutsummaryrefslogtreecommitdiff
path: root/src/status-service.c
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-08-07 21:05:58 +0100
committerTed Gould <ted@canonical.com>2009-08-07 21:05:58 +0100
commitc4dbc5ba3f963a74952c35ef23249694c3593217 (patch)
tree7a9bbd072edfe7ca86c271d7463f4b7e512fb8a4 /src/status-service.c
parent61e75b021a7adc56b685b890ff195a7d03cdb720 (diff)
parentd109578b8a84e07678762906021234404e53a8bf (diff)
downloadayatana-indicator-session-c4dbc5ba3f963a74952c35ef23249694c3593217.tar.gz
ayatana-indicator-session-c4dbc5ba3f963a74952c35ef23249694c3593217.tar.bz2
ayatana-indicator-session-c4dbc5ba3f963a74952c35ef23249694c3593217.zip
Merging in status shuffle branch to package it.
Diffstat (limited to 'src/status-service.c')
-rw-r--r--src/status-service.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/status-service.c b/src/status-service.c
index dbb597c..1bd33e9 100644
--- a/src/status-service.c
+++ b/src/status-service.c
@@ -39,7 +39,10 @@ static const gchar * status_icons[STATUS_PROVIDER_STATUS_LAST] = {
static DbusmenuMenuitem * root_menuitem = NULL;
+static DbusmenuMenuitem * status_menuitem = NULL;
static GMainLoop * mainloop = NULL;
+static gchar * whoami = "ted";
+static StatusServiceDbus * dbus_interface = NULL;
/* A fun little function to actually lock the screen. If,
that's what you want, let's do it! */
@@ -98,6 +101,15 @@ build_menu (gpointer data)
DbusmenuMenuitem * root = DBUSMENU_MENUITEM(data);
g_return_val_if_fail(root != NULL, FALSE);
+ DbusmenuMenuitem * useritem = dbusmenu_menuitem_new();
+ dbusmenu_menuitem_property_set(useritem, "label", whoami);
+ dbusmenu_menuitem_property_set(useritem, "sensitive", "false");
+ dbusmenu_menuitem_child_append(root, useritem);
+
+ status_menuitem = dbusmenu_menuitem_new();
+ dbusmenu_menuitem_property_set(status_menuitem, "label", "Status");
+ dbusmenu_menuitem_child_append(root, status_menuitem);
+
StatusProviderStatus i;
for (i = STATUS_PROVIDER_STATUS_ONLINE; i < STATUS_PROVIDER_STATUS_LAST; i++) {
DbusmenuMenuitem * mi = dbusmenu_menuitem_new();
@@ -106,7 +118,7 @@ build_menu (gpointer data)
dbusmenu_menuitem_property_set(mi, "icon", status_icons[i]);
g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(status_menu_click), GINT_TO_POINTER(i));
- dbusmenu_menuitem_child_append(root, mi);
+ dbusmenu_menuitem_child_append(status_menuitem, mi);
g_debug("Built %s", status_strings[i]);
}
@@ -147,6 +159,8 @@ main (int argc, char ** argv)
g_idle_add(build_menu, root_menuitem);
+ dbus_interface = g_object_new(STATUS_SERVICE_DBUS_TYPE, NULL);
+
mainloop = g_main_loop_new(NULL, FALSE);
g_main_loop_run(mainloop);