summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorWilliam Jon McCann <jmccann@redhat.com>2008-09-02 20:06:22 +0000
committerWilliam Jon McCann <mccann@src.gnome.org>2008-09-02 20:06:22 +0000
commit8d70ef4edafdcd035f0f5b60a319914ceb543aef (patch)
treee57c26b836eeae8cf0a8cd74dac8a90375626d7b /gui
parenta097442f51acff4d2b28906deaec4f7dbdd66796 (diff)
downloadgdm-8d70ef4edafdcd035f0f5b60a319914ceb543aef.tar.gz
Make set-show-user* into construct properties.
2008-09-02 William Jon McCann <jmccann@redhat.com> * gui/simple-greeter/gdm-greeter-login-window.c (gdm_greeter_login_window_request_timed_login): * gui/simple-greeter/gdm-user-chooser-dialog.c (gdm_user_chooser_dialog_set_show_user_other), (gdm_user_chooser_dialog_set_show_user_guest), (gdm_user_chooser_dialog_set_show_user_auto): * gui/simple-greeter/gdm-user-chooser-dialog.h: * gui/simple-greeter/gdm-user-chooser-widget.c (gdm_user_chooser_widget_set_show_user_other), (gdm_user_chooser_widget_set_show_user_guest), (gdm_user_chooser_widget_set_show_user_auto), (gdm_user_chooser_widget_set_property), (gdm_user_chooser_widget_get_property), (load_users), (gdm_user_chooser_widget_class_init): * gui/simple-greeter/gdm-user-chooser-widget.h: * gui/simple-greeter/test-user-chooser.c (main): Make set-show-user* into construct properties. svn path=/trunk/; revision=6457
Diffstat (limited to 'gui')
-rw-r--r--gui/simple-greeter/gdm-greeter-login-window.c2
-rw-r--r--gui/simple-greeter/gdm-user-chooser-dialog.c12
-rw-r--r--gui/simple-greeter/gdm-user-chooser-dialog.h4
-rw-r--r--gui/simple-greeter/gdm-user-chooser-widget.c81
-rw-r--r--gui/simple-greeter/gdm-user-chooser-widget.h6
-rw-r--r--gui/simple-greeter/test-user-chooser.c4
6 files changed, 78 insertions, 31 deletions
diff --git a/gui/simple-greeter/gdm-greeter-login-window.c b/gui/simple-greeter/gdm-greeter-login-window.c
index 7c1937fa..e88740e4 100644
--- a/gui/simple-greeter/gdm-greeter-login-window.c
+++ b/gui/simple-greeter/gdm-greeter-login-window.c
@@ -837,7 +837,7 @@ gdm_greeter_login_window_request_timed_login (GdmGreeterLoginWindow *login_windo
if (login_window->priv->dialog_mode != MODE_SELECTION) {
reset_dialog (login_window);
}
- gdm_user_chooser_widget_set_show_auto_user (GDM_USER_CHOOSER_WIDGET (login_window->priv->user_chooser), TRUE);
+ gdm_user_chooser_widget_set_show_user_auto (GDM_USER_CHOOSER_WIDGET (login_window->priv->user_chooser), TRUE);
if (!timed_login_already_enabled) {
gdm_user_chooser_widget_set_chosen_user_name (GDM_USER_CHOOSER_WIDGET (login_window->priv->user_chooser),
diff --git a/gui/simple-greeter/gdm-user-chooser-dialog.c b/gui/simple-greeter/gdm-user-chooser-dialog.c
index 11459c2b..4667a683 100644
--- a/gui/simple-greeter/gdm-user-chooser-dialog.c
+++ b/gui/simple-greeter/gdm-user-chooser-dialog.c
@@ -63,30 +63,30 @@ gdm_user_chooser_dialog_get_chosen_user_name (GdmUserChooserDialog *dialog)
}
void
-gdm_user_chooser_dialog_set_show_other_user (GdmUserChooserDialog *dialog,
+gdm_user_chooser_dialog_set_show_user_other (GdmUserChooserDialog *dialog,
gboolean show_user)
{
g_return_if_fail (GDM_IS_USER_CHOOSER_DIALOG (dialog));
- gdm_user_chooser_widget_set_show_other_user (GDM_USER_CHOOSER_WIDGET (dialog->priv->chooser_widget), show_user);
+ gdm_user_chooser_widget_set_show_user_other (GDM_USER_CHOOSER_WIDGET (dialog->priv->chooser_widget), show_user);
}
void
-gdm_user_chooser_dialog_set_show_guest_user (GdmUserChooserDialog *dialog,
+gdm_user_chooser_dialog_set_show_user_guest (GdmUserChooserDialog *dialog,
gboolean show_user)
{
g_return_if_fail (GDM_IS_USER_CHOOSER_DIALOG (dialog));
- gdm_user_chooser_widget_set_show_guest_user (GDM_USER_CHOOSER_WIDGET (dialog->priv->chooser_widget), show_user);
+ gdm_user_chooser_widget_set_show_user_guest (GDM_USER_CHOOSER_WIDGET (dialog->priv->chooser_widget), show_user);
}
void
-gdm_user_chooser_dialog_set_show_auto_user (GdmUserChooserDialog *dialog,
+gdm_user_chooser_dialog_set_show_user_auto (GdmUserChooserDialog *dialog,
gboolean show_user)
{
g_return_if_fail (GDM_IS_USER_CHOOSER_DIALOG (dialog));
- gdm_user_chooser_widget_set_show_auto_user (GDM_USER_CHOOSER_WIDGET (dialog->priv->chooser_widget), show_user);
+ gdm_user_chooser_widget_set_show_user_auto (GDM_USER_CHOOSER_WIDGET (dialog->priv->chooser_widget), show_user);
}
static void
diff --git a/gui/simple-greeter/gdm-user-chooser-dialog.h b/gui/simple-greeter/gdm-user-chooser-dialog.h
index a70e1023..214c190b 100644
--- a/gui/simple-greeter/gdm-user-chooser-dialog.h
+++ b/gui/simple-greeter/gdm-user-chooser-dialog.h
@@ -53,9 +53,9 @@ GtkWidget * gdm_user_chooser_dialog_new (void)
char * gdm_user_chooser_dialog_get_chosen_user_name (GdmUserChooserDialog *dialog);
void gdm_user_chooser_dialog_set_show_other_user (GdmUserChooserDialog *dialog,
gboolean show);
-void gdm_user_chooser_dialog_set_show_guest_user (GdmUserChooserDialog *dialog,
+void gdm_user_chooser_dialog_set_show_user_guest (GdmUserChooserDialog *dialog,
gboolean show);
-void gdm_user_chooser_dialog_set_show_auto_user (GdmUserChooserDialog *dialog,
+void gdm_user_chooser_dialog_set_show_user_auto (GdmUserChooserDialog *dialog,
gboolean show);
G_END_DECLS
diff --git a/gui/simple-greeter/gdm-user-chooser-widget.c b/gui/simple-greeter/gdm-user-chooser-widget.c
index 4212ff04..067468da 100644
--- a/gui/simple-greeter/gdm-user-chooser-widget.c
+++ b/gui/simple-greeter/gdm-user-chooser-widget.c
@@ -62,9 +62,9 @@ struct GdmUserChooserWidgetPrivate
GdkPixbuf *stock_person_pixbuf;
guint loaded : 1;
- guint show_other_user : 1;
- guint show_guest_user : 1;
- guint show_auto_user : 1;
+ guint show_user_other : 1;
+ guint show_user_guest : 1;
+ guint show_user_auto : 1;
guint show_normal_users : 1;
guint load_idle_id;
@@ -72,6 +72,9 @@ struct GdmUserChooserWidgetPrivate
enum {
PROP_0,
+ PROP_SHOW_USER_GUEST,
+ PROP_SHOW_USER_AUTO,
+ PROP_SHOW_USER_OTHER,
};
static void gdm_user_chooser_widget_class_init (GdmUserChooserWidgetClass *klass);
@@ -141,13 +144,13 @@ remove_user_auto (GdmUserChooserWidget *widget)
}
void
-gdm_user_chooser_widget_set_show_other_user (GdmUserChooserWidget *widget,
+gdm_user_chooser_widget_set_show_user_other (GdmUserChooserWidget *widget,
gboolean show_user)
{
g_return_if_fail (GDM_IS_USER_CHOOSER_WIDGET (widget));
- if (widget->priv->show_other_user != show_user) {
- widget->priv->show_other_user = show_user;
+ if (widget->priv->show_user_other != show_user) {
+ widget->priv->show_user_other = show_user;
if (show_user) {
add_user_other (widget);
} else {
@@ -157,13 +160,13 @@ gdm_user_chooser_widget_set_show_other_user (GdmUserChooserWidget *widget,
}
void
-gdm_user_chooser_widget_set_show_guest_user (GdmUserChooserWidget *widget,
+gdm_user_chooser_widget_set_show_user_guest (GdmUserChooserWidget *widget,
gboolean show_user)
{
g_return_if_fail (GDM_IS_USER_CHOOSER_WIDGET (widget));
- if (widget->priv->show_guest_user != show_user) {
- widget->priv->show_guest_user = show_user;
+ if (widget->priv->show_user_guest != show_user) {
+ widget->priv->show_user_guest = show_user;
if (show_user) {
add_user_guest (widget);
} else {
@@ -173,13 +176,13 @@ gdm_user_chooser_widget_set_show_guest_user (GdmUserChooserWidget *widget,
}
void
-gdm_user_chooser_widget_set_show_auto_user (GdmUserChooserWidget *widget,
+gdm_user_chooser_widget_set_show_user_auto (GdmUserChooserWidget *widget,
gboolean show_user)
{
g_return_if_fail (GDM_IS_USER_CHOOSER_WIDGET (widget));
- if (widget->priv->show_auto_user != show_user) {
- widget->priv->show_auto_user = show_user;
+ if (widget->priv->show_user_auto != show_user) {
+ widget->priv->show_user_auto = show_user;
if (show_user) {
add_user_auto (widget);
} else {
@@ -220,7 +223,20 @@ gdm_user_chooser_widget_set_property (GObject *object,
const GValue *value,
GParamSpec *pspec)
{
+ GdmUserChooserWidget *self;
+
+ self = GDM_USER_CHOOSER_WIDGET (object);
+
switch (prop_id) {
+ case PROP_SHOW_USER_AUTO:
+ gdm_user_chooser_widget_set_show_user_auto (self, g_value_get_boolean (value));
+ break;
+ case PROP_SHOW_USER_GUEST:
+ gdm_user_chooser_widget_set_show_user_guest (self, g_value_get_boolean (value));
+ break;
+ case PROP_SHOW_USER_OTHER:
+ gdm_user_chooser_widget_set_show_user_other (self, g_value_get_boolean (value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -233,7 +249,20 @@ gdm_user_chooser_widget_get_property (GObject *object,
GValue *value,
GParamSpec *pspec)
{
+ GdmUserChooserWidget *self;
+
+ self = GDM_USER_CHOOSER_WIDGET (object);
+
switch (prop_id) {
+ case PROP_SHOW_USER_AUTO:
+ g_value_set_boolean (value, self->priv->show_user_auto);
+ break;
+ case PROP_SHOW_USER_GUEST:
+ g_value_set_boolean (value, self->priv->show_user_guest);
+ break;
+ case PROP_SHOW_USER_OTHER:
+ g_value_set_boolean (value, self->priv->show_user_other);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -393,11 +422,6 @@ static gboolean
load_users (GdmUserChooserWidget *widget)
{
- /* FIXME: make these construct properties */
- gdm_user_chooser_widget_set_show_guest_user (widget, FALSE);
- gdm_user_chooser_widget_set_show_auto_user (widget, FALSE);
- gdm_user_chooser_widget_set_show_other_user (widget, TRUE);
-
if (widget->priv->show_normal_users) {
widget->priv->manager = gdm_user_manager_ref_default ();
g_signal_connect (widget->priv->manager,
@@ -483,6 +507,29 @@ gdm_user_chooser_widget_class_init (GdmUserChooserWidgetClass *klass)
object_class->dispose = gdm_user_chooser_widget_dispose;
object_class->finalize = gdm_user_chooser_widget_finalize;
+
+ g_object_class_install_property (object_class,
+ PROP_SHOW_USER_AUTO,
+ g_param_spec_boolean ("show-user-auto",
+ "show user auto",
+ "show user auto",
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+ g_object_class_install_property (object_class,
+ PROP_SHOW_USER_GUEST,
+ g_param_spec_boolean ("show-user-guest",
+ "show user guest",
+ "show user guest",
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+ g_object_class_install_property (object_class,
+ PROP_SHOW_USER_OTHER,
+ g_param_spec_boolean ("show-user-other",
+ "show user other",
+ "show user other",
+ TRUE,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+
g_type_class_add_private (klass, sizeof (GdmUserChooserWidgetPrivate));
}
diff --git a/gui/simple-greeter/gdm-user-chooser-widget.h b/gui/simple-greeter/gdm-user-chooser-widget.h
index 0795eb1f..8ef89a12 100644
--- a/gui/simple-greeter/gdm-user-chooser-widget.h
+++ b/gui/simple-greeter/gdm-user-chooser-widget.h
@@ -59,11 +59,11 @@ void gdm_user_chooser_widget_set_chosen_user_name (GdmUs
const char *user_name);
void gdm_user_chooser_widget_set_show_only_chosen (GdmUserChooserWidget *widget,
gboolean show_only);
-void gdm_user_chooser_widget_set_show_other_user (GdmUserChooserWidget *widget,
+void gdm_user_chooser_widget_set_show_user_other (GdmUserChooserWidget *widget,
gboolean show);
-void gdm_user_chooser_widget_set_show_guest_user (GdmUserChooserWidget *widget,
+void gdm_user_chooser_widget_set_show_user_guest (GdmUserChooserWidget *widget,
gboolean show);
-void gdm_user_chooser_widget_set_show_auto_user (GdmUserChooserWidget *widget,
+void gdm_user_chooser_widget_set_show_user_auto (GdmUserChooserWidget *widget,
gboolean show);
G_END_DECLS
diff --git a/gui/simple-greeter/test-user-chooser.c b/gui/simple-greeter/test-user-chooser.c
index 360cd244..8a9e603a 100644
--- a/gui/simple-greeter/test-user-chooser.c
+++ b/gui/simple-greeter/test-user-chooser.c
@@ -47,8 +47,8 @@ main (int argc, char *argv[])
dialog = gdm_user_chooser_dialog_new ();
/*gtk_widget_set_size_request (dialog, 480, 128);*/
- gdm_user_chooser_dialog_set_show_guest_user (GDM_USER_CHOOSER_DIALOG (dialog), TRUE);
- gdm_user_chooser_dialog_set_show_auto_user (GDM_USER_CHOOSER_DIALOG (dialog), TRUE);
+ gdm_user_chooser_dialog_set_show_user_guest (GDM_USER_CHOOSER_DIALOG (dialog), TRUE);
+ gdm_user_chooser_dialog_set_show_user_auto (GDM_USER_CHOOSER_DIALOG (dialog), TRUE);
if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) {
char *name;