diff options
author | Jeremy Bicha <jbicha@ubuntu.com> | 2011-08-21 16:43:49 -0400 |
---|---|---|
committer | Jeremy Bicha <jbicha@ubuntu.com> | 2011-08-21 16:43:49 -0400 |
commit | 5012f285c0e332919542cfe5cb92f140c437182f (patch) | |
tree | 024e1660f219805457c38804e6b0b80ec2687853 | |
parent | dea3599b2e7061a1ece931ac5afae57c8c28f125 (diff) | |
download | ayatana-indicator-session-5012f285c0e332919542cfe5cb92f140c437182f.tar.gz ayatana-indicator-session-5012f285c0e332919542cfe5cb92f140c437182f.tar.bz2 ayatana-indicator-session-5012f285c0e332919542cfe5cb92f140c437182f.zip |
Add User Accounts link to bottom of user menu
-rw-r--r-- | src/user-menu-mgr.c | 32 |
1 files changed, 31 insertions, 1 deletions
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 |