[gnome-panel/wip/user-menu: 10/11] panel: Make PanelLockdown track disable-user-switching too
- From: Vincent Untz <vuntz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel/wip/user-menu: 10/11] panel: Make PanelLockdown track disable-user-switching too
- Date: Thu, 31 Mar 2011 13:10:46 +0000 (UTC)
commit 547f799f01dd61d737775cabd4fb17cceb8860c5
Author: Vincent Untz <vuntz gnome org>
Date: Thu Mar 31 17:49:42 2011 +0530
panel: Make PanelLockdown track disable-user-switching too
gnome-panel/panel-lockdown.c | 41 +++++++++++++++++++++++++++++++++++++++++
gnome-panel/panel-lockdown.h | 2 ++
gnome-panel/panel-schemas.h | 1 +
3 files changed, 44 insertions(+), 0 deletions(-)
---
diff --git a/gnome-panel/panel-lockdown.c b/gnome-panel/panel-lockdown.c
index 38c0b69..794843d 100644
--- a/gnome-panel/panel-lockdown.c
+++ b/gnome-panel/panel-lockdown.c
@@ -37,6 +37,7 @@ struct _PanelLockdownPrivate {
gboolean disable_command_line;
gboolean disable_lock_screen;
gboolean disable_log_out;
+ gboolean disable_switch_user;
/* panel-specific */
gboolean panels_locked_down;
@@ -49,6 +50,7 @@ enum {
PROP_DISABLE_COMMAND_LINE,
PROP_DISABLE_LOCK_SCREEN,
PROP_DISABLE_LOG_OUT,
+ PROP_DISABLE_SWITCH_USER,
PROP_PANELS_LOCKED_DOWN,
PROP_DISABLE_FORCE_QUIT
};
@@ -101,6 +103,12 @@ panel_lockdown_constructor (GType type,
"disable-log-out",
G_SETTINGS_BIND_GET);
+ g_settings_bind (lockdown->priv->desktop_settings,
+ PANEL_DESKTOP_DISABLE_SWITCH_USER_KEY,
+ lockdown,
+ "disable-switch-user",
+ G_SETTINGS_BIND_GET);
+
g_settings_bind (lockdown->priv->panel_settings,
PANEL_LOCKDOWN_COMPLETE_LOCKDOWN_KEY,
lockdown,
@@ -172,6 +180,12 @@ panel_lockdown_set_property (GObject *object,
value,
"disable-log-out");
break;
+ case PROP_DISABLE_SWITCH_USER:
+ _panel_lockdown_set_property_helper (lockdown,
+ &lockdown->priv->disable_switch_user,
+ value,
+ "disable-switch-user");
+ break;
case PROP_PANELS_LOCKED_DOWN:
_panel_lockdown_set_property_helper (lockdown,
&lockdown->priv->panels_locked_down,
@@ -212,6 +226,9 @@ panel_lockdown_get_property (GObject *object,
case PROP_DISABLE_LOG_OUT:
g_value_set_boolean (value, lockdown->priv->disable_log_out);
break;
+ case PROP_DISABLE_SWITCH_USER:
+ g_value_set_boolean (value, lockdown->priv->disable_switch_user);
+ break;
case PROP_PANELS_LOCKED_DOWN:
g_value_set_boolean (value, lockdown->priv->panels_locked_down);
break;
@@ -298,6 +315,16 @@ panel_lockdown_class_init (PanelLockdownClass *lockdown_class)
g_object_class_install_property (
gobject_class,
+ PROP_DISABLE_SWITCH_USER,
+ g_param_spec_boolean (
+ "disable-switch-user",
+ "Disable user switching",
+ "Whether user switching is disabled or not",
+ TRUE,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_property (
+ gobject_class,
PROP_PANELS_LOCKED_DOWN,
g_param_spec_boolean (
"panels-locked-down",
@@ -360,6 +387,14 @@ panel_lockdown_get_disable_log_out (PanelLockdown *lockdown)
}
gboolean
+panel_lockdown_get_disable_switch_user (PanelLockdown *lockdown)
+{
+ g_return_val_if_fail (PANEL_IS_LOCKDOWN (lockdown), TRUE);
+
+ return lockdown->priv->disable_switch_user;
+}
+
+gboolean
panel_lockdown_get_panels_locked_down (PanelLockdown *lockdown)
{
g_return_val_if_fail (PANEL_IS_LOCKDOWN (lockdown), TRUE);
@@ -483,6 +518,12 @@ panel_lockdown_get_disable_log_out_s (void)
}
gboolean
+panel_lockdown_get_disable_switch_user_s (void)
+{
+ return panel_lockdown_get_disable_switch_user (panel_lockdown_get ());
+}
+
+gboolean
panel_lockdown_get_panels_locked_down_s (void)
{
return panel_lockdown_get_panels_locked_down (panel_lockdown_get ());
diff --git a/gnome-panel/panel-lockdown.h b/gnome-panel/panel-lockdown.h
index 67cd922..528c612 100644
--- a/gnome-panel/panel-lockdown.h
+++ b/gnome-panel/panel-lockdown.h
@@ -58,6 +58,7 @@ gboolean panel_lockdown_get_panels_locked_down (PanelLockdown *lockdown);
gboolean panel_lockdown_get_disable_command_line (PanelLockdown *lockdown);
gboolean panel_lockdown_get_disable_lock_screen (PanelLockdown *lockdown);
gboolean panel_lockdown_get_disable_log_out (PanelLockdown *lockdown);
+gboolean panel_lockdown_get_disable_switch_user (PanelLockdown *lockdown);
gboolean panel_lockdown_get_disable_force_quit (PanelLockdown *lockdown);
gboolean panel_lockdown_is_applet_disabled (PanelLockdown *lockdown,
@@ -79,6 +80,7 @@ gboolean panel_lockdown_get_not_panels_locked_down_s (void);
gboolean panel_lockdown_get_disable_command_line_s (void);
gboolean panel_lockdown_get_disable_lock_screen_s (void);
gboolean panel_lockdown_get_disable_log_out_s (void);
+gboolean panel_lockdown_get_disable_switch_user_s (void);
gboolean panel_lockdown_get_disable_force_quit_s (void);
G_END_DECLS
diff --git a/gnome-panel/panel-schemas.h b/gnome-panel/panel-schemas.h
index 728e8b2..59b01b8 100644
--- a/gnome-panel/panel-schemas.h
+++ b/gnome-panel/panel-schemas.h
@@ -14,6 +14,7 @@
#define PANEL_DESKTOP_DISABLE_COMMAND_LINE_KEY "disable-command-line"
#define PANEL_DESKTOP_DISABLE_LOCK_SCREEN_KEY "disable-lock-screen"
#define PANEL_DESKTOP_DISABLE_LOG_OUT_KEY "disable-log-out"
+#define PANEL_DESKTOP_DISABLE_SWITCH_USER_KEY "disable-user-switching"
#define PANEL_RUN_SCHEMA "org.gnome.gnome-panel.run-dialog"
#define PANEL_RUN_HISTORY_KEY "history"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]