summaryrefslogtreecommitdiff
path: root/gui/simple-greeter/gdm-user-chooser-widget.c
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2008-05-08 18:54:07 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2008-05-08 18:54:07 +0000
commit9f756a13ba6f96e7bdd0e38ddab104b072041c64 (patch)
tree5c628cbdf48779fd91eca88ce4ef7586d267aa0a /gui/simple-greeter/gdm-user-chooser-widget.c
parent8f84d7bb79bd3fedf816eb26b36b74957b875e50 (diff)
downloadgdm-9f756a13ba6f96e7bdd0e38ddab104b072041c64.tar.gz
Add a GConf key for not showing normal users in the user list.
svn path=/trunk/; revision=6225
Diffstat (limited to 'gui/simple-greeter/gdm-user-chooser-widget.c')
-rw-r--r--gui/simple-greeter/gdm-user-chooser-widget.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gui/simple-greeter/gdm-user-chooser-widget.c b/gui/simple-greeter/gdm-user-chooser-widget.c
index 9b54a01f..a37b5a48 100644
--- a/gui/simple-greeter/gdm-user-chooser-widget.c
+++ b/gui/simple-greeter/gdm-user-chooser-widget.c
@@ -34,9 +34,14 @@
#include <glib/gstdio.h>
#include <gtk/gtk.h>
+#include <gconf/gconf-client.h>
+
#include "gdm-user-manager.h"
#include "gdm-user-chooser-widget.h"
+
+#define KEY_DISABLE_USER_LIST "/apps/gdm/simple-greeter/disable_user_list"
+
enum {
USER_NO_DISPLAY = 1 << 0,
USER_ACCOUNT_DISABLED = 1 << 1,
@@ -59,6 +64,7 @@ struct GdmUserChooserWidgetPrivate
guint show_other_user : 1;
guint show_guest_user : 1;
guint show_auto_user : 1;
+ guint show_normal_users : 1;
};
enum {
@@ -231,6 +237,25 @@ gdm_user_chooser_widget_get_property (GObject *object,
}
}
+static gboolean
+is_user_list_disabled (GdmUserChooserWidget *widget)
+{
+ GConfClient *client;
+ GError *error;
+ gboolean result;
+
+ client = gconf_client_get_default ();
+ error = NULL;
+ result = gconf_client_get_bool (client, KEY_DISABLE_USER_LIST, &error);
+ if (error != NULL) {
+ g_debug ("GdmUserChooserWidget: unable to get disable-user-list configuration: %s", error->message);
+ g_error_free (error);
+ }
+ g_object_unref (client);
+
+ return result;
+}
+
static GObject *
gdm_user_chooser_widget_constructor (GType type,
guint n_construct_properties,
@@ -247,6 +272,8 @@ gdm_user_chooser_widget_constructor (GType type,
gdm_user_chooser_widget_set_show_auto_user (user_chooser_widget, FALSE);
gdm_user_chooser_widget_set_show_other_user (user_chooser_widget, TRUE);
+ user_chooser_widget->priv->show_normal_users = !is_user_list_disabled (user_chooser_widget);
+
return G_OBJECT (user_chooser_widget);
}
@@ -403,6 +430,9 @@ on_user_added (GdmUserManager *manager,
char *tooltip;
gboolean is_logged_in;
+ if (!widget->priv->show_normal_users)
+ return;
+
pixbuf = gdm_user_render_icon (user, ICON_SIZE);
if (pixbuf == NULL && widget->priv->stock_person_pixbuf != NULL) {
pixbuf = g_object_ref (widget->priv->stock_person_pixbuf);