aboutsummaryrefslogtreecommitdiff
path: root/src/session-service.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-15 15:33:36 -0500
committerTed Gould <ted@gould.cx>2010-03-15 15:33:36 -0500
commit29bd57b57fe4cf4e964fdecf034cb2ecb8cd04b1 (patch)
treee6670f278b1e41c0962fdcbc8a5900fbe86f3cd5 /src/session-service.c
parent523c02493e72d1e99e23082e9b14af51fd54ae18 (diff)
downloadayatana-indicator-session-29bd57b57fe4cf4e964fdecf034cb2ecb8cd04b1.tar.gz
ayatana-indicator-session-29bd57b57fe4cf4e964fdecf034cb2ecb8cd04b1.tar.bz2
ayatana-indicator-session-29bd57b57fe4cf4e964fdecf034cb2ecb8cd04b1.zip
Changing the lockdown key to do all the switching instead of just the switch user item.
Diffstat (limited to 'src/session-service.c')
-rw-r--r--src/session-service.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/session-service.c b/src/session-service.c
index c0703bb..66d468f 100644
--- a/src/session-service.c
+++ b/src/session-service.c
@@ -434,7 +434,10 @@ rebuild_items (DbusmenuMenuitem *root,
gboolean can_activate;
GList *children;
- can_activate = users_service_dbus_can_activate_session (service);
+ ensure_gconf_client ();
+
+ can_activate = users_service_dbus_can_activate_session (service) &&
+ !gconf_client_get_bool (gconf_client, LOCKDOWN_KEY_USER, NULL);
children = dbusmenu_menuitem_take_children (root);
g_list_foreach (children, (GFunc)g_object_unref, NULL);
@@ -470,22 +473,12 @@ rebuild_items (DbusmenuMenuitem *root,
if (check_new_session ())
{
- ensure_gconf_client ();
switch_menuitem = dbusmenu_menuitem_new ();
dbusmenu_menuitem_property_set (switch_menuitem, DBUSMENU_MENUITEM_PROP_TYPE, MENU_SWITCH_TYPE);
dbusmenu_menuitem_property_set (switch_menuitem, MENU_SWITCH_USER, g_get_user_name());
dbusmenu_menuitem_child_append (root, switch_menuitem);
g_signal_connect (G_OBJECT (switch_menuitem), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK (activate_new_session), NULL);
-
- if (gconf_client_get_bool (gconf_client, LOCKDOWN_KEY_USER, NULL))
- {
- dbusmenu_menuitem_property_set_bool (switch_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE);
- }
- else
- {
- dbusmenu_menuitem_property_set_bool (switch_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE);
- }
}
GList * users = NULL;