aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-session.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-18 13:50:42 -0500
committerTed Gould <ted@gould.cx>2010-03-18 13:50:42 -0500
commitefedfa60d052a58f678575052e0ac98bc324612a (patch)
tree23368eb32b9f150b841da96ccf1c3c29a544181c /src/indicator-session.c
parentc4a714f3964fdea272f766f6e040eef664d6d97d (diff)
parent5704cdb0447a2297003da2128f7fb11b2d5bd8db (diff)
downloadayatana-indicator-session-efedfa60d052a58f678575052e0ac98bc324612a.tar.gz
ayatana-indicator-session-efedfa60d052a58f678575052e0ac98bc324612a.tar.bz2
ayatana-indicator-session-efedfa60d052a58f678575052e0ac98bc324612a.zip
Handle updating of sessions and mark the guest account when it has an open session.
Diffstat (limited to 'src/indicator-session.c')
-rw-r--r--src/indicator-session.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/indicator-session.c b/src/indicator-session.c
index e92c36b..b54a5d9 100644
--- a/src/indicator-session.c
+++ b/src/indicator-session.c
@@ -217,6 +217,19 @@ get_icon (IndicatorObject * io)
return INDICATOR_SESSION(io)->status_image;
}
+static void
+user_property_change (DbusmenuMenuitem * item, const gchar * property, const GValue * value, gpointer user_data)
+{
+ if (g_strcmp0(property, USER_ITEM_PROP_LOGGED_IN) == 0) {
+ if (g_value_get_boolean(value)) {
+ gtk_widget_show(GTK_WIDGET(user_data));
+ } else {
+ gtk_widget_hide(GTK_WIDGET(user_data));
+ }
+ }
+ return;
+}
+
/* Builds an item with a hip little logged in icon. */
static gboolean
new_user_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client)
@@ -263,6 +276,8 @@ new_user_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuCl
dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem, gmi, parent);
+ g_signal_connect(G_OBJECT(newitem), DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK(user_property_change), icon);
+
return TRUE;
}