1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
3
* Copyright (C) 2007 William Jon McCann <mccann@jhu.edu>
4
* Copyright (C) 2007 Ray Strode <rstrode@redhat.com>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
34
#include <glib/gi18n.h>
35
#include <glib/gstdio.h>
38
#include <gconf/gconf-client.h>
40
#include "gdm-user-manager.h"
41
#include "gdm-user-chooser-widget.h"
42
#include "gdm-settings-keys.h"
43
#include "gdm-settings-client.h"
45
#define KEY_DISABLE_USER_LIST "/apps/gdm/simple-greeter/disable_user_list"
48
USER_NO_DISPLAY = 1 << 0,
49
USER_ACCOUNT_DISABLED = 1 << 1,
52
#define DEFAULT_USER_ICON "avatar-default"
53
#define OLD_DEFAULT_USER_ICON "stock_person"
55
#define GDM_USER_CHOOSER_WIDGET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDM_TYPE_USER_CHOOSER_WIDGET, GdmUserChooserWidgetPrivate))
57
#define MAX_ICON_SIZE 128
58
#define NUM_USERS_TO_ADD_PER_ITERATION 50
60
struct GdmUserChooserWidgetPrivate
62
GdmUserManager *manager;
63
GtkIconTheme *icon_theme;
67
GdkPixbuf *logged_in_pixbuf;
68
GdkPixbuf *stock_person_pixbuf;
71
guint show_user_other : 1;
72
guint show_user_guest : 1;
73
guint show_user_auto : 1;
74
guint show_normal_users : 1;
76
guint has_user_other : 1;
78
guint update_other_visibility_idle_id;
80
guint add_users_idle_id;
90
static void gdm_user_chooser_widget_class_init (GdmUserChooserWidgetClass *klass);
91
static void gdm_user_chooser_widget_init (GdmUserChooserWidget *user_chooser_widget);
92
static void gdm_user_chooser_widget_finalize (GObject *object);
94
G_DEFINE_TYPE (GdmUserChooserWidget, gdm_user_chooser_widget, GDM_TYPE_CHOOSER_WIDGET)
96
static void add_user_other (GdmUserChooserWidget *widget);
97
static void remove_user_other (GdmUserChooserWidget *widget);
100
get_font_height_for_widget (GtkWidget *widget)
102
PangoFontMetrics *metrics;
103
PangoContext *context;
108
gtk_widget_ensure_style (widget);
109
context = gtk_widget_get_pango_context (widget);
110
metrics = pango_context_get_metrics (context,
111
widget->style->font_desc,
112
pango_context_get_language (context));
114
ascent = pango_font_metrics_get_ascent (metrics);
115
descent = pango_font_metrics_get_descent (metrics);
116
height = PANGO_PIXELS (ascent + descent);
117
pango_font_metrics_unref (metrics);
122
get_icon_height_for_widget (GtkWidget *widget)
127
font_height = get_font_height_for_widget (widget);
128
height = 3 * font_height;
129
if (height > MAX_ICON_SIZE) {
130
height = MAX_ICON_SIZE;
133
g_debug ("GdmUserChooserWidget: font height %d; using icon size %d", font_height, height);
139
update_other_user_visibility (GdmUserChooserWidget *widget)
143
g_debug ("GdmUserChooserWidget: updating other user visibility");
145
if (!widget->priv->show_user_other) {
146
if (widget->priv->has_user_other) {
147
remove_user_other (widget);
153
number_of_users = gdm_chooser_widget_get_number_of_items (GDM_CHOOSER_WIDGET (widget));
155
/* we hide the Other user if it's the last one, and we show it
156
* if there's another user */
157
if (number_of_users == 1 && widget->priv->has_user_other) {
158
remove_user_other (widget);
159
} if (number_of_users >= 1 && !widget->priv->has_user_other) {
160
add_user_other (widget);
164
widget->priv->update_other_visibility_idle_id = 0;
169
queue_update_other_user_visibility (GdmUserChooserWidget *widget)
171
if (widget->priv->update_other_visibility_idle_id == 0) {
172
widget->priv->update_other_visibility_idle_id =
173
g_idle_add ((GSourceFunc) update_other_user_visibility, widget);
178
update_item_for_user (GdmUserChooserWidget *widget,
183
gboolean is_logged_in;
187
size = get_icon_height_for_widget (GTK_WIDGET (widget));
188
pixbuf = gdm_user_render_icon (user, size);
190
if (pixbuf == NULL && widget->priv->stock_person_pixbuf != NULL) {
191
pixbuf = g_object_ref (widget->priv->stock_person_pixbuf);
194
tooltip = g_strdup_printf (_("Log in as %s"),
195
gdm_user_get_user_name (user));
197
is_logged_in = gdm_user_is_logged_in (user);
199
g_debug ("GdmUserChooserWidget: User added name:%s logged-in:%d pixbuf:%p",
200
gdm_user_get_user_name (user),
204
gdm_chooser_widget_update_item (GDM_CHOOSER_WIDGET (widget),
205
gdm_user_get_user_name (user),
207
gdm_user_get_real_name (user),
209
gdm_user_get_login_frequency (user),
214
if (pixbuf != NULL) {
215
g_object_unref (pixbuf);
220
on_item_load (GdmChooserWidget *widget,
222
GdmUserChooserWidget *user_chooser)
226
g_debug ("GdmUserChooserWidget: Loading item for id=%s", id);
228
if (user_chooser->priv->manager == NULL) {
232
user = gdm_user_manager_get_user (user_chooser->priv->manager, id);
234
update_item_for_user (user_chooser, user);
239
add_user_other (GdmUserChooserWidget *widget)
241
widget->priv->has_user_other = TRUE;
242
gdm_chooser_widget_add_item (GDM_CHOOSER_WIDGET (widget),
243
GDM_USER_CHOOSER_USER_OTHER,
245
/* translators: This option prompts
246
* the user to type in a username
247
* manually instead of choosing from
250
C_("user", "Other..."),
251
_("Choose a different account"),
255
(GdmChooserWidgetItemLoadFunc) on_item_load,
260
add_user_guest (GdmUserChooserWidget *widget)
262
gdm_chooser_widget_add_item (GDM_CHOOSER_WIDGET (widget),
263
GDM_USER_CHOOSER_USER_GUEST,
264
widget->priv->stock_person_pixbuf,
266
_("Login as a temporary guest"),
270
(GdmChooserWidgetItemLoadFunc) on_item_load,
272
queue_update_other_user_visibility (widget);
276
add_user_auto (GdmUserChooserWidget *widget)
278
gdm_chooser_widget_add_item (GDM_CHOOSER_WIDGET (widget),
279
GDM_USER_CHOOSER_USER_AUTO,
281
_("Automatic Login"),
282
_("Automatically login to the system after selecting options"),
286
(GdmChooserWidgetItemLoadFunc) on_item_load,
288
queue_update_other_user_visibility (widget);
292
remove_user_other (GdmUserChooserWidget *widget)
294
widget->priv->has_user_other = FALSE;
295
gdm_chooser_widget_remove_item (GDM_CHOOSER_WIDGET (widget),
296
GDM_USER_CHOOSER_USER_OTHER);
300
remove_user_guest (GdmUserChooserWidget *widget)
302
gdm_chooser_widget_remove_item (GDM_CHOOSER_WIDGET (widget),
303
GDM_USER_CHOOSER_USER_GUEST);
304
queue_update_other_user_visibility (widget);
308
remove_user_auto (GdmUserChooserWidget *widget)
310
gdm_chooser_widget_remove_item (GDM_CHOOSER_WIDGET (widget),
311
GDM_USER_CHOOSER_USER_AUTO);
312
queue_update_other_user_visibility (widget);
316
gdm_user_chooser_widget_set_show_user_other (GdmUserChooserWidget *widget,
319
g_return_if_fail (GDM_IS_USER_CHOOSER_WIDGET (widget));
321
if (widget->priv->show_user_other != show_user) {
322
widget->priv->show_user_other = show_user;
323
queue_update_other_user_visibility (widget);
328
gdm_user_chooser_widget_set_show_user_guest (GdmUserChooserWidget *widget,
331
g_return_if_fail (GDM_IS_USER_CHOOSER_WIDGET (widget));
333
if (widget->priv->show_user_guest != show_user) {
334
widget->priv->show_user_guest = show_user;
336
add_user_guest (widget);
338
remove_user_guest (widget);
344
gdm_user_chooser_widget_set_show_user_auto (GdmUserChooserWidget *widget,
347
g_return_if_fail (GDM_IS_USER_CHOOSER_WIDGET (widget));
349
if (widget->priv->show_user_auto != show_user) {
350
widget->priv->show_user_auto = show_user;
352
add_user_auto (widget);
354
remove_user_auto (widget);
360
gdm_user_chooser_widget_get_chosen_user_name (GdmUserChooserWidget *widget)
362
g_return_val_if_fail (GDM_IS_USER_CHOOSER_WIDGET (widget), NULL);
364
return gdm_chooser_widget_get_active_item (GDM_CHOOSER_WIDGET (widget));
368
gdm_user_chooser_widget_set_chosen_user_name (GdmUserChooserWidget *widget,
371
g_return_if_fail (GDM_IS_USER_CHOOSER_WIDGET (widget));
373
gdm_chooser_widget_set_active_item (GDM_CHOOSER_WIDGET (widget), name);
377
gdm_user_chooser_widget_set_show_only_chosen (GdmUserChooserWidget *widget,
378
gboolean show_only) {
379
g_return_if_fail (GDM_IS_USER_CHOOSER_WIDGET (widget));
381
gdm_chooser_widget_set_hide_inactive_items (GDM_CHOOSER_WIDGET (widget),
386
gdm_user_chooser_widget_set_property (GObject *object,
391
GdmUserChooserWidget *self;
393
self = GDM_USER_CHOOSER_WIDGET (object);
396
case PROP_SHOW_USER_AUTO:
397
gdm_user_chooser_widget_set_show_user_auto (self, g_value_get_boolean (value));
399
case PROP_SHOW_USER_GUEST:
400
gdm_user_chooser_widget_set_show_user_guest (self, g_value_get_boolean (value));
402
case PROP_SHOW_USER_OTHER:
403
gdm_user_chooser_widget_set_show_user_other (self, g_value_get_boolean (value));
406
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
412
gdm_user_chooser_widget_get_property (GObject *object,
417
GdmUserChooserWidget *self;
419
self = GDM_USER_CHOOSER_WIDGET (object);
422
case PROP_SHOW_USER_AUTO:
423
g_value_set_boolean (value, self->priv->show_user_auto);
425
case PROP_SHOW_USER_GUEST:
426
g_value_set_boolean (value, self->priv->show_user_guest);
428
case PROP_SHOW_USER_OTHER:
429
g_value_set_boolean (value, self->priv->show_user_other);
432
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
438
is_user_list_disabled (GdmUserChooserWidget *widget)
444
client = gconf_client_get_default ();
446
result = gconf_client_get_bool (client, KEY_DISABLE_USER_LIST, &error);
448
g_debug ("GdmUserChooserWidget: unable to get disable-user-list configuration: %s", error->message);
449
g_error_free (error);
451
g_object_unref (client);
457
add_user (GdmUserChooserWidget *widget,
462
gboolean is_logged_in;
463
char *escaped_username;
464
char *escaped_real_name;
466
if (!widget->priv->show_normal_users) {
470
pixbuf = g_object_ref (widget->priv->stock_person_pixbuf);
472
tooltip = g_strdup_printf (_("Log in as %s"),
473
gdm_user_get_user_name (user));
475
is_logged_in = gdm_user_is_logged_in (user);
477
escaped_username = g_markup_escape_text (gdm_user_get_user_name (user), -1);
478
escaped_real_name = g_markup_escape_text (gdm_user_get_real_name (user), -1);
479
gdm_chooser_widget_add_item (GDM_CHOOSER_WIDGET (widget),
484
gdm_user_get_login_frequency (user),
487
(GdmChooserWidgetItemLoadFunc) on_item_load,
489
g_free (escaped_real_name);
490
g_free (escaped_username);
493
if (pixbuf != NULL) {
494
g_object_unref (pixbuf);
497
queue_update_other_user_visibility (widget);
501
on_user_added (GdmUserManager *manager,
503
GdmUserChooserWidget *widget)
505
/* wait for all users to be loaded */
506
if (! widget->priv->loaded) {
509
add_user (widget, user);
513
on_user_removed (GdmUserManager *manager,
515
GdmUserChooserWidget *widget)
517
const char *user_name;
519
g_debug ("GdmUserChooserWidget: User removed: %s", gdm_user_get_user_name (user));
520
/* wait for all users to be loaded */
521
if (! widget->priv->loaded) {
525
user_name = gdm_user_get_user_name (user);
527
gdm_chooser_widget_remove_item (GDM_CHOOSER_WIDGET (widget),
530
queue_update_other_user_visibility (widget);
534
on_user_is_logged_in_changed (GdmUserManager *manager,
536
GdmUserChooserWidget *widget)
538
const char *user_name;
539
gboolean is_logged_in;
541
g_debug ("GdmUserChooserWidget: User logged in changed: %s", gdm_user_get_user_name (user));
543
user_name = gdm_user_get_user_name (user);
544
is_logged_in = gdm_user_is_logged_in (user);
546
gdm_chooser_widget_set_item_in_use (GDM_CHOOSER_WIDGET (widget),
552
on_user_changed (GdmUserManager *manager,
554
GdmUserChooserWidget *widget)
556
/* wait for all users to be loaded */
557
if (! widget->priv->loaded) {
560
if (! widget->priv->show_normal_users) {
564
update_item_for_user (widget, user);
568
add_users (GdmUserChooserWidget *widget)
573
while (widget->priv->users_to_add != NULL && cnt < NUM_USERS_TO_ADD_PER_ITERATION) {
574
add_user (widget, widget->priv->users_to_add->data);
575
g_object_unref (widget->priv->users_to_add->data);
576
widget->priv->users_to_add = g_slist_delete_link (widget->priv->users_to_add, widget->priv->users_to_add);
579
g_debug ("GdmUserChooserWidget: added %u items", cnt);
581
if (! widget->priv->loaded) {
582
widget->priv->loaded = TRUE;
584
gdm_chooser_widget_loaded (GDM_CHOOSER_WIDGET (widget));
587
return (widget->priv->users_to_add != NULL);
591
queue_add_users (GdmUserChooserWidget *widget)
593
if (widget->priv->add_users_idle_id == 0) {
594
widget->priv->add_users_idle_id = g_idle_add ((GSourceFunc) add_users, widget);
599
on_is_loaded_changed (GdmUserManager *manager,
601
GdmUserChooserWidget *widget)
605
/* FIXME: handle is-loaded=FALSE */
607
g_debug ("GdmUserChooserWidget: Users loaded");
609
users = gdm_user_manager_list_users (manager);
610
g_slist_foreach (users, (GFunc) g_object_ref, NULL);
611
widget->priv->users_to_add = g_slist_concat (widget->priv->users_to_add, g_slist_copy (users));
613
queue_add_users (widget);
617
parse_string_list (char *value, GSList **retval)
624
if (value == NULL || *value == '\0') {
625
g_debug ("Not adding NULL user");
630
temp_array = g_strsplit (value, ",", 0);
631
for (i = 0; temp_array[i] != NULL; i++) {
632
g_debug ("Adding value %s", temp_array[i]);
633
g_strstrip (temp_array[i]);
634
*retval = g_slist_prepend (*retval, g_strdup (temp_array[i]));
637
g_strfreev (temp_array);
641
load_users (GdmUserChooserWidget *widget)
644
if (widget->priv->show_normal_users) {
647
gboolean include_all;
651
widget->priv->manager = gdm_user_manager_ref_default ();
653
/* exclude/include */
654
g_debug ("Setting users to include:");
655
res = gdm_settings_client_get_string (GDM_KEY_INCLUDE,
657
parse_string_list (temp, &includes);
659
g_debug ("Setting users to exclude:");
660
res = gdm_settings_client_get_string (GDM_KEY_EXCLUDE,
662
parse_string_list (temp, &excludes);
665
res = gdm_settings_client_get_boolean (GDM_KEY_INCLUDE_ALL,
667
g_object_set (widget->priv->manager,
668
"include-all", include_all,
669
"include-usernames-list", includes,
670
"exclude-usernames-list", excludes,
673
g_slist_foreach (includes, (GFunc) g_free, NULL);
674
g_slist_free (includes);
675
g_slist_foreach (excludes, (GFunc) g_free, NULL);
676
g_slist_free (excludes);
678
g_signal_connect (widget->priv->manager,
680
G_CALLBACK (on_user_added),
682
g_signal_connect (widget->priv->manager,
684
G_CALLBACK (on_user_removed),
686
g_signal_connect (widget->priv->manager,
688
G_CALLBACK (on_is_loaded_changed),
690
g_signal_connect (widget->priv->manager,
691
"user-is-logged-in-changed",
692
G_CALLBACK (on_user_is_logged_in_changed),
694
g_signal_connect (widget->priv->manager,
696
G_CALLBACK (on_user_changed),
698
gdm_user_manager_queue_load (widget->priv->manager);
700
gdm_chooser_widget_loaded (GDM_CHOOSER_WIDGET (widget));
703
widget->priv->load_idle_id = 0;
709
gdm_user_chooser_widget_constructor (GType type,
710
guint n_construct_properties,
711
GObjectConstructParam *construct_properties)
713
GdmUserChooserWidget *widget;
715
widget = GDM_USER_CHOOSER_WIDGET (G_OBJECT_CLASS (gdm_user_chooser_widget_parent_class)->constructor (type,
716
n_construct_properties,
717
construct_properties));
719
widget->priv->show_normal_users = !is_user_list_disabled (widget);
721
widget->priv->load_idle_id = g_idle_add ((GSourceFunc)load_users, widget);
723
return G_OBJECT (widget);
727
gdm_user_chooser_widget_dispose (GObject *object)
729
GdmUserChooserWidget *widget;
731
widget = GDM_USER_CHOOSER_WIDGET (object);
733
G_OBJECT_CLASS (gdm_user_chooser_widget_parent_class)->dispose (object);
735
if (widget->priv->load_idle_id > 0) {
736
g_source_remove (widget->priv->load_idle_id);
737
widget->priv->load_idle_id = 0;
740
if (widget->priv->add_users_idle_id > 0) {
741
g_source_remove (widget->priv->add_users_idle_id);
742
widget->priv->add_users_idle_id = 0;
745
if (widget->priv->update_other_visibility_idle_id > 0) {
746
g_source_remove (widget->priv->update_other_visibility_idle_id);
747
widget->priv->update_other_visibility_idle_id = 0;
750
if (widget->priv->users_to_add != NULL) {
751
g_slist_foreach (widget->priv->users_to_add, (GFunc) g_object_ref, NULL);
752
g_slist_free (widget->priv->users_to_add);
753
widget->priv->users_to_add = NULL;
756
if (widget->priv->logged_in_pixbuf != NULL) {
757
g_object_unref (widget->priv->logged_in_pixbuf);
758
widget->priv->logged_in_pixbuf = NULL;
761
if (widget->priv->stock_person_pixbuf != NULL) {
762
g_object_unref (widget->priv->stock_person_pixbuf);
763
widget->priv->stock_person_pixbuf = NULL;
766
if (widget->priv->manager != NULL) {
767
g_object_unref (widget->priv->manager);
768
widget->priv->manager = NULL;
773
gdm_user_chooser_widget_class_init (GdmUserChooserWidgetClass *klass)
775
GObjectClass *object_class = G_OBJECT_CLASS (klass);
777
object_class->get_property = gdm_user_chooser_widget_get_property;
778
object_class->set_property = gdm_user_chooser_widget_set_property;
779
object_class->constructor = gdm_user_chooser_widget_constructor;
780
object_class->dispose = gdm_user_chooser_widget_dispose;
781
object_class->finalize = gdm_user_chooser_widget_finalize;
784
g_object_class_install_property (object_class,
786
g_param_spec_boolean ("show-user-auto",
790
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
791
g_object_class_install_property (object_class,
792
PROP_SHOW_USER_GUEST,
793
g_param_spec_boolean ("show-user-guest",
797
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
798
g_object_class_install_property (object_class,
799
PROP_SHOW_USER_OTHER,
800
g_param_spec_boolean ("show-user-other",
804
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
806
g_type_class_add_private (klass, sizeof (GdmUserChooserWidgetPrivate));
810
get_pixbuf_from_icon_names (GdmUserChooserWidget *widget,
811
const char *first_name,
815
GtkIconInfo *icon_info;
818
const char *icon_name;
819
va_list argument_list;
821
array = g_ptr_array_new ();
823
g_ptr_array_add (array, (gpointer) first_name);
825
va_start (argument_list, first_name);
826
icon_name = (const char *) va_arg (argument_list, const char *);
827
while (icon_name != NULL) {
828
g_ptr_array_add (array, (gpointer) icon_name);
829
icon_name = (const char *) va_arg (argument_list, const char *);
831
va_end (argument_list);
832
g_ptr_array_add (array, NULL);
834
size = get_icon_height_for_widget (GTK_WIDGET (widget));
836
icon_info = gtk_icon_theme_choose_icon (widget->priv->icon_theme,
837
(const char **) array->pdata,
839
GTK_ICON_LOOKUP_GENERIC_FALLBACK);
840
g_ptr_array_free (array, FALSE);
842
if (icon_info != NULL) {
846
pixbuf = gtk_icon_info_load_icon (icon_info, &error);
847
gtk_icon_info_free (icon_info);
850
g_warning ("Could not load icon '%s': %s",
851
first_name, error->message);
852
g_error_free (error);
855
g_warning ("Could not find icon '%s' or fallbacks", first_name);
863
get_stock_person_pixbuf (GdmUserChooserWidget *widget)
867
pixbuf = get_pixbuf_from_icon_names (widget,
869
OLD_DEFAULT_USER_ICON,
876
get_logged_in_pixbuf (GdmUserChooserWidget *widget)
880
pixbuf = get_pixbuf_from_icon_names (widget,
894
update_icons (GdmChooserWidget *widget,
901
gboolean *is_separate,
902
IconUpdateData *data)
904
if (data->old_icon == *image) {
905
*image = data->new_icon;
913
load_icons (GdmUserChooserWidget *widget)
915
GdkPixbuf *old_pixbuf;
918
if (widget->priv->logged_in_pixbuf != NULL) {
919
g_object_unref (widget->priv->logged_in_pixbuf);
921
widget->priv->logged_in_pixbuf = get_logged_in_pixbuf (widget);
923
old_pixbuf = widget->priv->stock_person_pixbuf;
924
widget->priv->stock_person_pixbuf = get_stock_person_pixbuf (widget);
925
/* update the icons in the model */
926
data.old_icon = old_pixbuf;
927
data.new_icon = widget->priv->stock_person_pixbuf;
928
gdm_chooser_widget_update_foreach_item (GDM_CHOOSER_WIDGET (widget),
929
(GdmChooserUpdateForeachFunc)update_icons,
931
if (old_pixbuf != NULL) {
932
g_object_unref (old_pixbuf);
937
on_icon_theme_changed (GtkIconTheme *icon_theme,
938
GdmUserChooserWidget *widget)
940
g_debug ("GdmUserChooserWidget: icon theme changed");
945
setup_icons (GdmUserChooserWidget *widget)
947
if (gtk_widget_has_screen (GTK_WIDGET (widget))) {
948
widget->priv->icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (widget)));
950
widget->priv->icon_theme = gtk_icon_theme_get_default ();
953
if (widget->priv->icon_theme != NULL) {
954
g_signal_connect (widget->priv->icon_theme,
956
G_CALLBACK (on_icon_theme_changed),
964
on_list_visible_changed (GdmChooserWidget *widget,
970
g_object_get (G_OBJECT (widget), "list-visible", &is_visible, NULL);
972
gtk_widget_grab_focus (GTK_WIDGET (widget));
977
gdm_user_chooser_widget_init (GdmUserChooserWidget *widget)
979
widget->priv = GDM_USER_CHOOSER_WIDGET_GET_PRIVATE (widget);
981
gdm_chooser_widget_set_separator_position (GDM_CHOOSER_WIDGET (widget),
982
GDM_CHOOSER_WIDGET_POSITION_BOTTOM);
983
gdm_chooser_widget_set_in_use_message (GDM_CHOOSER_WIDGET (widget),
984
_("Currently logged in"));
986
g_signal_connect (widget,
987
"notify::list-visible",
988
G_CALLBACK (on_list_visible_changed),
991
setup_icons (widget);
995
gdm_user_chooser_widget_finalize (GObject *object)
997
GdmUserChooserWidget *widget;
999
g_return_if_fail (object != NULL);
1000
g_return_if_fail (GDM_IS_USER_CHOOSER_WIDGET (object));
1002
widget = GDM_USER_CHOOSER_WIDGET (object);
1004
g_return_if_fail (widget->priv != NULL);
1006
G_OBJECT_CLASS (gdm_user_chooser_widget_parent_class)->finalize (object);
1010
gdm_user_chooser_widget_new (void)
1014
object = g_object_new (GDM_TYPE_USER_CHOOSER_WIDGET,
1017
return GTK_WIDGET (object);