aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-15 13:28:19 -0500
committerTed Gould <ted@gould.cx>2010-03-15 13:28:19 -0500
commitdf71f47685081f5125fb12c7bb170d88538e9523 (patch)
treefc788871cea0fd65a733434e5808c2db16875308 /src
parent8ea0fde8939236cca0d11aa726fe5d98f6de6526 (diff)
downloadayatana-indicator-session-df71f47685081f5125fb12c7bb170d88538e9523.tar.gz
ayatana-indicator-session-df71f47685081f5125fb12c7bb170d88538e9523.tar.bz2
ayatana-indicator-session-df71f47685081f5125fb12c7bb170d88538e9523.zip
Reacting to changes in the screensaver lockdown key.
Diffstat (limited to 'src')
-rw-r--r--src/session-service.c43
1 files changed, 25 insertions, 18 deletions
diff --git a/src/session-service.c b/src/session-service.c
index a64f701..7ebc00a 100644
--- a/src/session-service.c
+++ b/src/session-service.c
@@ -58,6 +58,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#define LOCKDOWN_DIR "/desktop/gnome/lockdown"
#define LOCKDOWN_KEY_USER LOCKDOWN_DIR "/disable_user_switching"
+#define LOCKDOWN_KEY_SCREENSAVER LOCKDOWN_DIR "/disable_lock_screen"
typedef struct _ActivateData ActivateData;
struct _ActivateData
@@ -97,26 +98,32 @@ lockdown_changed (GConfClient *client,
GConfEntry *entry,
gpointer user_data)
{
- GConfValue *value = gconf_entry_get_value (entry);
- const gchar *key = gconf_entry_get_key (entry);
+ GConfValue *value = gconf_entry_get_value (entry);
+ const gchar *key = gconf_entry_get_key (entry);
- if (!value || !key)
- return;
+ if (value == NULL || key == NULL) {
+ return;
+ }
- if (g_strcmp0 (key, LOCKDOWN_KEY_USER) == 0)
- {
- if (switch_menuitem)
- {
- 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);
- }
- }
- }
+ 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);
+ }
+ }
+ } 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);
+ } else {
+ dbusmenu_menuitem_property_set_bool (lock_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE);
+ }
+ }
+ }
+
+ return;
}
static void