gnome-screensaver r1486 - in trunk: . src



Author: mccann
Date: Thu Aug 21 02:05:08 2008
New Revision: 1486
URL: http://svn.gnome.org/viewvc/gnome-screensaver?rev=1486&view=rev

Log:
2008-08-20  William Jon McCann  <jmccann redhat com>

	* src/gs-monitor.c (_gs_monitor_update_from_prefs):
	* src/gs-prefs.c (_gs_prefs_set_user_switch_disabled),
	(gs_prefs_load_from_gconf), (key_changed_cb):
	* src/gs-prefs.h:
	Honor the disable_user_switching lockdown key.



Modified:
   trunk/ChangeLog
   trunk/src/gs-monitor.c
   trunk/src/gs-prefs.c
   trunk/src/gs-prefs.h

Modified: trunk/src/gs-monitor.c
==============================================================================
--- trunk/src/gs-monitor.c	(original)
+++ trunk/src/gs-monitor.c	Thu Aug 21 02:05:08 2008
@@ -322,13 +322,15 @@
         gboolean activate_watch;
         gboolean manager_active;
         gboolean lock_enabled;
+        gboolean user_switch_enabled;
 
         lock_enabled = (monitor->priv->prefs->lock_enabled && !monitor->priv->prefs->lock_disabled);
+        user_switch_enabled = (monitor->priv->prefs->user_switch_enabled && !monitor->priv->prefs->user_switch_disabled);
 
         gs_manager_set_lock_enabled (monitor->priv->manager, lock_enabled);
         gs_manager_set_lock_timeout (monitor->priv->manager, monitor->priv->prefs->lock_timeout);
         gs_manager_set_logout_enabled (monitor->priv->manager, monitor->priv->prefs->logout_enabled);
-        gs_manager_set_user_switch_enabled (monitor->priv->manager, monitor->priv->prefs->user_switch_enabled);
+        gs_manager_set_user_switch_enabled (monitor->priv->manager, user_switch_enabled);
         gs_manager_set_keyboard_enabled (monitor->priv->manager, monitor->priv->prefs->keyboard_enabled);
         gs_manager_set_logout_timeout (monitor->priv->manager, monitor->priv->prefs->logout_timeout);
         gs_manager_set_logout_command (monitor->priv->manager, monitor->priv->prefs->logout_command);

Modified: trunk/src/gs-prefs.c
==============================================================================
--- trunk/src/gs-prefs.c	(original)
+++ trunk/src/gs-prefs.c	Thu Aug 21 02:05:08 2008
@@ -35,7 +35,8 @@
 static void gs_prefs_finalize   (GObject      *object);
 
 #define GNOME_LOCKDOWN_DIR "/desktop/gnome/lockdown"
-#define KEY_LOCK_DISABLE   GNOME_LOCKDOWN_DIR "/disable_lock_screen"
+#define KEY_LOCK_DISABLE          GNOME_LOCKDOWN_DIR "/disable_lock_screen"
+#define KEY_USER_SWITCH_DISABLE   GNOME_LOCKDOWN_DIR "/disable_user_switching"
 
 #define KEY_DIR            "/apps/gnome-screensaver"
 #define KEY_IDLE_ACTIVATION_ENABLED         KEY_DIR "/idle_activation_enabled"
@@ -240,6 +241,13 @@
 }
 
 static void
+_gs_prefs_set_user_switch_disabled (GSPrefs *prefs,
+                                    gboolean value)
+{
+        prefs->user_switch_disabled = value;
+}
+
+static void
 _gs_prefs_set_keyboard_enabled (GSPrefs *prefs,
                                 gboolean value)
 {
@@ -352,6 +360,13 @@
                 key_error_and_free (KEY_LOCK_DISABLE, error);
         }
 
+        bvalue = gconf_client_get_bool (prefs->priv->gconf_client, KEY_USER_SWITCH_DISABLE, &error);
+        if (! error) {
+                _gs_prefs_set_user_switch_disabled (prefs, bvalue);
+        } else {
+                key_error_and_free (KEY_USER_SWITCH_DISABLE, error);
+        }
+
         value = gconf_client_get_int (prefs->priv->gconf_client, KEY_ACTIVATE_DELAY, &error);
         if (! error) {
                 _gs_prefs_set_timeout (prefs, value);
@@ -604,6 +619,19 @@
                         invalid_type_warning (key);
                 }
 
+        } else if (strcmp (key, KEY_USER_SWITCH_DISABLE) == 0) {
+
+                if (value->type == GCONF_VALUE_BOOL) {
+                        gboolean disabled;
+
+                        disabled = gconf_value_get_bool (value);
+                        _gs_prefs_set_user_switch_disabled (prefs, disabled);
+
+                        changed = TRUE;
+                } else {
+                        invalid_type_warning (key);
+                }
+
         } else if (strcmp (key, KEY_CYCLE_DELAY) == 0) {
 
                 if (value->type == GCONF_VALUE_INT) {

Modified: trunk/src/gs-prefs.h
==============================================================================
--- trunk/src/gs-prefs.h	(original)
+++ trunk/src/gs-prefs.h	Thu Aug 21 02:05:08 2008
@@ -47,24 +47,25 @@
         GSPrefsPrivate  *priv;
 
         guint            idle_activation_enabled : 1; /* whether to activate when idle */
-        guint            lock_enabled : 1;		/* whether to lock when active */
-        guint            logout_enabled : 1;	/* Whether to offer the logout option */
+        guint            lock_enabled : 1;              /* whether to lock when active */
+        guint            logout_enabled : 1;    /* Whether to offer the logout option */
         guint            lock_disabled : 1;     /* Whether locking the system is disabled */
-        guint            user_switch_enabled : 1;	/* Whether to offer the user switch option */
-        guint            keyboard_enabled : 1;	/* Whether to try to embed a keyboard */
-
-        guint            power_timeout;	       	/* how much idle time before power management */
-        guint            timeout;	       	/* how much idle time before activation */
-        guint            lock_timeout;		/* how long after activation locking starts */
-        guint            logout_timeout;	/* how long until the logout option appears */
-        guint            cycle;			/* how long each theme should run */
+        guint            user_switch_disabled : 1;      /* Whether user switching is disabled */
+        guint            user_switch_enabled : 1;       /* Whether to offer the user switch option */
+        guint            keyboard_enabled : 1;  /* Whether to try to embed a keyboard */
+
+        guint            power_timeout;         /* how much idle time before power management */
+        guint            timeout;               /* how much idle time before activation */
+        guint            lock_timeout;          /* how long after activation locking starts */
+        guint            logout_timeout;        /* how long until the logout option appears */
+        guint            cycle;                 /* how long each theme should run */
 
         char            *logout_command;        /* command to use to logout */
         char            *keyboard_command;      /* command to use to embed a keyboard */
         char            *away_message;
 
-        GSList          *themes;       		/* the screensaver themes to run */
-        GSSaverMode      mode;			/* theme selection mode */
+        GSList          *themes;                /* the screensaver themes to run */
+        GSSaverMode      mode;                  /* theme selection mode */
 } GSPrefs;
 
 typedef struct



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]