diff options
author | Ted Gould <ted@gould.cx> | 2011-07-13 12:02:21 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-07-13 12:02:21 -0500 |
commit | ca536289f57fdddd161c525159cfdcfc0bfe373e (patch) | |
tree | e6fae4f92cc8a8d70aceb7acd8d597be1d531761 | |
parent | ac5886d4e7c0eb396502ad05a96a8196d065af63 (diff) | |
download | ayatana-indicator-messages-ca536289f57fdddd161c525159cfdcfc0bfe373e.tar.gz ayatana-indicator-messages-ca536289f57fdddd161c525159cfdcfc0bfe373e.tar.bz2 ayatana-indicator-messages-ca536289f57fdddd161c525159cfdcfc0bfe373e.zip |
Putting status items into the menu
-rw-r--r-- | src/messages-service.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/messages-service.c b/src/messages-service.c index 4ccd0f1..fd22555 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -48,6 +48,7 @@ static GList * serverList = NULL; static GList * launcherList = NULL; static DbusmenuMenuitem * root_menuitem = NULL; +static DbusmenuMenuitem * status_separator = NULL; static GMainLoop * mainloop = NULL; static MessageServiceDbus * dbus_interface = NULL; @@ -1468,7 +1469,15 @@ main (int argc, char ** argv) DbusmenuServer * server = dbusmenu_server_new(INDICATOR_MESSAGES_DBUS_OBJECT); dbusmenu_server_set_root(server, root_menuitem); - status_items_build(&status_update_callback); + /* Add status items */ + GList * statusitems = status_items_build(&status_update_callback); + while (statusitems != NULL) { + dbusmenu_menuitem_child_append(root_menuitem, DBUSMENU_MENUITEM(statusitems->data)); + statusitems = g_list_next(statusitems); + } + status_separator = dbusmenu_menuitem_new(); + dbusmenu_menuitem_property_set(status_separator, DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_CLIENT_TYPES_SEPARATOR); + dbusmenu_menuitem_child_append(root_menuitem, status_separator); /* Start up the libindicate listener */ listener = indicate_listener_ref_default(); |