aboutsummaryrefslogtreecommitdiff
path: root/src/user-menu-mgr.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-08-25 11:04:58 +0100
committerConor Curran <conor.curran@canonical.com>2011-08-25 11:04:58 +0100
commitf0031ebfeb68b1dcb805416d5f110d476a094452 (patch)
tree48c9c1197366fb30b1ac2e02bf38cb00f539d70f /src/user-menu-mgr.c
parente708841644c5be2997a4ff92cad8383a9260e7ed (diff)
parentcbae3e05ba000358ad819566cfb46a847e424400 (diff)
downloadayatana-indicator-session-f0031ebfeb68b1dcb805416d5f110d476a094452.tar.gz
ayatana-indicator-session-f0031ebfeb68b1dcb805416d5f110d476a094452.tar.bz2
ayatana-indicator-session-f0031ebfeb68b1dcb805416d5f110d476a094452.zip
branded attached devices menuitem labels
Diffstat (limited to 'src/user-menu-mgr.c')
-rw-r--r--src/user-menu-mgr.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/user-menu-mgr.c b/src/user-menu-mgr.c
index f3b1b64..64b29c5 100644
--- a/src/user-menu-mgr.c
+++ b/src/user-menu-mgr.c
@@ -54,7 +54,8 @@ static void activate_online_accounts (DbusmenuMenuitem *mi,
gpointer user_data);
static void activate_user_accounts (DbusmenuMenuitem *mi,
guint timestamp,
- gpointer user_data);
+ gpointer user_data);
+
static void user_menu_mgr_rebuild_items (UserMenuMgr *self,
gboolean greeter_mode);
static gboolean check_new_session ();
@@ -175,7 +176,7 @@ user_menu_mgr_rebuild_items (UserMenuMgr *self, gboolean greeter_mode)
gboolean user_menu_is_visible = FALSE;
if (!greeter_mode){
- user_menu_is_visible = self->user_count > 1;
+ user_menu_is_visible = self->user_count > 1 || check_guest_session();
}
session_dbus_set_user_menu_visibility (self->session_dbus_interface,
@@ -238,13 +239,25 @@ user_menu_mgr_rebuild_items (UserMenuMgr *self, gboolean greeter_mode)
}
gboolean logged_in = g_strcmp0 (user->user_name, g_get_user_name()) == 0;
+
+ g_debug ("user name = %s and g user name = %s",
+ user->user_name,
+ g_get_user_name());
+
dbusmenu_menuitem_property_set_bool (mi,
USER_ITEM_PROP_IS_CURRENT_USER,
logged_in);
if (logged_in == TRUE){
- g_debug ("about to set the users real name to %s for user %s",
- user->real_name, user->user_name);
- session_dbus_set_users_real_name (self->session_dbus_interface, user->real_name);
+ if (check_guest_session()){
+ g_debug ("about to set the users real name to %s for user %s",
+ user->real_name, user->user_name);
+ session_dbus_set_users_real_name (self->session_dbus_interface, user->real_name);
+ }
+ else{
+ g_debug ("about to set the users real name to GUEST");
+ session_dbus_set_users_real_name (self->session_dbus_interface,
+ _("Guest"));
+ }
}
dbusmenu_menuitem_child_append (self->root_item, mi);
@@ -425,7 +438,7 @@ static gboolean
check_guest_session (void)
{
if (geteuid() < 500) {
- /* System users shouldn't have guest account shown. Mosly
+ /* System users shouldn't have guest account shown. Mostly
this would be the case of the guest user itself. */
return FALSE;
}