aboutsummaryrefslogtreecommitdiff
path: root/src/session-service.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-15 15:21:26 -0500
committerTed Gould <ted@gould.cx>2010-03-15 15:21:26 -0500
commit523c02493e72d1e99e23082e9b14af51fd54ae18 (patch)
treeae795afebf5e00e4b30f078f19dcba88c0d2443f /src/session-service.c
parent065984db24fa4e8723d9dd5add9eec0e71d43ace (diff)
downloadayatana-indicator-session-523c02493e72d1e99e23082e9b14af51fd54ae18.tar.gz
ayatana-indicator-session-523c02493e72d1e99e23082e9b14af51fd54ae18.tar.bz2
ayatana-indicator-session-523c02493e72d1e99e23082e9b14af51fd54ae18.zip
Switching from hiding entries to just rebuilding the menus.
Diffstat (limited to 'src/session-service.c')
-rw-r--r--src/session-service.c22
1 files 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;