From 523c02493e72d1e99e23082e9b14af51fd54ae18 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 15 Mar 2010 15:21:26 -0500 Subject: Switching from hiding entries to just rebuilding the menus. --- src/session-service.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/src/session-service.c b/src/session-service.c index 72a93eb..c0703bb 100644 --- a/src/session-service.c +++ b/src/session-service.c @@ -92,6 +92,8 @@ static DbusmenuMenuitem * shutdown_mi = NULL; static GConfClient * gconf_client = NULL; +static void rebuild_items (DbusmenuMenuitem *root, UsersServiceDbus *service); + static void lockdown_changed (GConfClient *client, guint cnxd_id, @@ -105,24 +107,8 @@ lockdown_changed (GConfClient *client, return; } - if (g_strcmp0 (key, LOCKDOWN_KEY_USER) == 0) { - if (switch_menuitem != NULL) { - if (gconf_value_get_bool (value)) { - 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); - } - } - } else if (g_strcmp0 (key, LOCKDOWN_KEY_SCREENSAVER) == 0) { - if (lock_menuitem != NULL) { - if (gconf_value_get_bool (value)) { - dbusmenu_menuitem_property_set_bool (lock_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); - dbusmenu_menuitem_property_set_bool (lock_separator, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); - } else { - dbusmenu_menuitem_property_set_bool (lock_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); - dbusmenu_menuitem_property_set_bool (lock_separator, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); - } - } + if (g_strcmp0 (key, LOCKDOWN_KEY_USER) == 0 || g_strcmp0 (key, LOCKDOWN_KEY_SCREENSAVER) == 0) { + rebuild_items(root_menuitem, dbus_interface); } return; -- cgit v1.2.3