aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-07-11 17:14:57 +0100
committerConor Curran <conor.curran@canonical.com>2011-07-11 17:14:57 +0100
commit0e39b3235ecebf14936ef64d77f4e376d3f852ba (patch)
tree8639655ed493ce8dac5c039bf41dd2feb86fe3eb /src
parent2d5bc28e81e87cb9a75644fd863ebc7ecb84c76c (diff)
downloadayatana-indicator-session-0e39b3235ecebf14936ef64d77f4e376d3f852ba.tar.gz
ayatana-indicator-session-0e39b3235ecebf14936ef64d77f4e376d3f852ba.tar.bz2
ayatana-indicator-session-0e39b3235ecebf14936ef64d77f4e376d3f852ba.zip
online accounts item added@
Diffstat (limited to 'src')
-rw-r--r--src/session-service.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/session-service.c b/src/session-service.c
index 590778c..001d0e6 100644
--- a/src/session-service.c
+++ b/src/session-service.c
@@ -102,6 +102,7 @@ static GConfClient * gconf_client = NULL;
static void rebuild_session_items (DbusmenuMenuitem *root, UsersServiceDbus *service);
static void rebuild_user_items (DbusmenuMenuitem *root, UsersServiceDbus *service);
+static void activate_online_accounts (DbusmenuMenuitem *mi, guint timestamp, gpointer user_data);
static void
lockdown_changed (GConfClient *client,
@@ -541,6 +542,42 @@ rebuild_user_items (DbusmenuMenuitem *root,
}
g_list_free(users);
}
+ // Add the online accounts and separator
+ DbusmenuMenuitem * separator1 = dbusmenu_menuitem_new();
+ dbusmenu_menuitem_property_set (separator1,
+ DBUSMENU_MENUITEM_PROP_TYPE,
+ DBUSMENU_CLIENT_TYPES_SEPARATOR);
+ dbusmenu_menuitem_child_append (root, separator1);
+ DbusmenuMenuitem * online_accounts_item = dbusmenu_menuitem_new();
+ dbusmenu_menuitem_property_set (online_accounts_item,
+ DBUSMENU_MENUITEM_PROP_TYPE,
+ DBUSMENU_CLIENT_TYPES_DEFAULT);
+ dbusmenu_menuitem_property_set (online_accounts_item,
+ DBUSMENU_MENUITEM_PROP_LABEL,
+ _("Online Accounts..."));
+
+ g_signal_connect (G_OBJECT (online_accounts_item),
+ DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
+ G_CALLBACK (activate_online_accounts),
+ NULL);
+
+ dbusmenu_menuitem_child_append (root, online_accounts_item);
+}
+
+// TODO
+// Wait until dialog is complete to find out name to pass
+// to the control centre.
+static void
+activate_online_accounts (DbusmenuMenuitem *mi,
+ guint timestamp,
+ gpointer user_data)
+{
+ GError * error = NULL;
+ if (!g_spawn_command_line_async("gnome-control-center", &error))
+ {
+ g_warning("Unable to show control centre: %s", error->message);
+ g_error_free(error);
+ }
}
static void