From 5012f285c0e332919542cfe5cb92f140c437182f Mon Sep 17 00:00:00 2001 From: Jeremy Bicha Date: Sun, 21 Aug 2011 16:43:49 -0400 Subject: Add User Accounts link to bottom of user menu --- src/user-menu-mgr.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/user-menu-mgr.c b/src/user-menu-mgr.c index 44c1960..bbe51a9 100644 --- a/src/user-menu-mgr.c +++ b/src/user-menu-mgr.c @@ -273,7 +273,24 @@ user_menu_mgr_rebuild_items (UserMenuMgr *self, gboolean greeter_mode) G_CALLBACK (activate_online_accounts), NULL); - dbusmenu_menuitem_child_append (self->root_item, online_accounts_item); + dbusmenu_menuitem_child_append (self->root_item, online_accounts_item); + + DbusmenuMenuitem * user_accounts_item = dbusmenu_menuitem_new(); + dbusmenu_menuitem_property_set (user_accounts_item, + DBUSMENU_MENUITEM_PROP_TYPE, + DBUSMENU_CLIENT_TYPES_DEFAULT); + dbusmenu_menuitem_property_set (user_accounts_item, + DBUSMENU_MENUITEM_PROP_LABEL, + _("User Accounts…")); + + g_signal_connect (G_OBJECT (user_accounts_item), + DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, + G_CALLBACK (activate_user_accounts), + NULL); + + dbusmenu_menuitem_child_append (self->root_item, user_accounts_item); + + } /* Checks to see if we can create sessions */ @@ -357,6 +374,19 @@ activate_online_accounts (DbusmenuMenuitem *mi, } } +static void +activate_user_accounts (DbusmenuMenuitem *mi, + guint timestamp, + gpointer user_data) +{ + GError * error = NULL; + if (!g_spawn_command_line_async("gnome-control-center user-accounts", &error)) + { + g_warning("Unable to show control centre: %s", error->message); + g_error_free(error); + } +} + /* Signal called when a user is added. It updates the count and rebuilds the menu */ static void -- cgit v1.2.3