diff options
author | Ted Gould <ted@canonical.com> | 2009-07-20 11:28:50 -0500 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-07-20 11:28:50 -0500 |
commit | 015f1c1636e6c3b3d84375121ed14a760d76ee8e (patch) | |
tree | 483769cda0c03b8f58634e5a25a1357a35b4f782 | |
parent | ae5eca7787899d8730fcfe91b0e161724e51bdf0 (diff) | |
download | ayatana-indicator-session-015f1c1636e6c3b3d84375121ed14a760d76ee8e.tar.gz ayatana-indicator-session-015f1c1636e6c3b3d84375121ed14a760d76ee8e.tar.bz2 ayatana-indicator-session-015f1c1636e6c3b3d84375121ed14a760d76ee8e.zip |
Switching from dummy users to useful menuitems
-rw-r--r-- | src/users-service.c | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/src/users-service.c b/src/users-service.c index 409a1d0..66dc86e 100644 --- a/src/users-service.c +++ b/src/users-service.c @@ -1,4 +1,6 @@ +#include <glib/gi18n.h> + #include <dbus/dbus-glib.h> #include <dbus/dbus-glib-bindings.h> @@ -10,20 +12,31 @@ static DbusmenuMenuitem * root_menuitem = NULL; static GMainLoop * mainloop = NULL; -gchar * dummies[] = { - "Bob", "Jim", "Alvin", "Mary", NULL -}; +static void +activate_guest_session (DbusmenuMenuitem * mi, gpointer user_data) +{ + +} + +static void +activate_new_session (DbusmenuMenuitem * mi, gpointer user_data) +{ + +} static void -dummy_users (DbusmenuMenuitem * root) { - int count; - for (count = 0; dummies[count] != NULL; count++) { - DbusmenuMenuitem * mi = dbusmenu_menuitem_new(); - g_debug("Creating item: %d %s", dbusmenu_menuitem_get_id(mi), dummies[count]); - g_debug("\tRoot ID: %d", dbusmenu_menuitem_get_id(root)); - dbusmenu_menuitem_property_set(mi, "label", dummies[count]); - dbusmenu_menuitem_child_add_position(root, mi, count); - } +create_items (DbusmenuMenuitem * root) { + DbusmenuMenuitem * mi = NULL; + + mi = dbusmenu_menuitem_new(); + dbusmenu_menuitem_property_set(mi, "label", _("Guest Session")); + dbusmenu_menuitem_child_append(root, mi); + g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_guest_session), NULL); + + mi = dbusmenu_menuitem_new(); + dbusmenu_menuitem_property_set(mi, "label", _("New Session...")); + dbusmenu_menuitem_child_append(root, mi); + g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_new_session), NULL); return; } @@ -51,7 +64,7 @@ main (int argc, char ** argv) root_menuitem = dbusmenu_menuitem_new(); g_debug("Root ID: %d", dbusmenu_menuitem_get_id(root_menuitem)); - dummy_users(root_menuitem); + create_items(root_menuitem); DbusmenuServer * server = dbusmenu_server_new(INDICATOR_USERS_DBUS_OBJECT); dbusmenu_server_set_root(server, root_menuitem); |