aboutsummaryrefslogtreecommitdiff
path: root/src/user-menu-mgr.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-08-22 22:29:53 -0500
committerTed Gould <ted@gould.cx>2011-08-22 22:29:53 -0500
commit0bae48ead3c94c9c0f699047da716affea8da60f (patch)
tree9e75f37957a29a26a548e0126c4c8ebfc0550d2c /src/user-menu-mgr.c
parent397ce19ba4e460dbb3bfb4a4b7b06d98918c153b (diff)
parent5012f285c0e332919542cfe5cb92f140c437182f (diff)
downloadayatana-indicator-session-0bae48ead3c94c9c0f699047da716affea8da60f.tar.gz
ayatana-indicator-session-0bae48ead3c94c9c0f699047da716affea8da60f.tar.bz2
ayatana-indicator-session-0bae48ead3c94c9c0f699047da716affea8da60f.zip
Add a user accounts item on the user menu
Diffstat (limited to 'src/user-menu-mgr.c')
-rw-r--r--src/user-menu-mgr.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/user-menu-mgr.c b/src/user-menu-mgr.c
index 30ea0ff..667ebb4 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