23
23
static GtkWidget *window, *vbox, *login_vbox, *message_label, *user_view;
24
24
static GdkPixmap *background_pixmap;
25
25
static GtkWidget *username_entry, *password_entry;
26
static gchar *session = NULL, *language = NULL, *theme_name;
26
static gchar *theme_name;
27
static GSList *session_radio_list = NULL, *language_radio_list = NULL, *layout_radio_list = NULL;
34
for (iter = language_radio_list; iter; iter = iter->next)
36
GtkCheckMenuItem *item = iter->data;
37
if (gtk_check_menu_item_get_active (item))
38
return g_object_get_data (G_OBJECT (item), "language");
45
set_language (const gchar *language)
49
for (iter = language_radio_list; iter; iter = iter->next)
51
GtkCheckMenuItem *item = iter->data;
52
if (strcmp (language, g_object_get_data (G_OBJECT (item), "language")) == 0)
53
gtk_check_menu_item_set_active (item, TRUE);
62
for (iter = layout_radio_list; iter; iter = iter->next)
64
GtkCheckMenuItem *item = iter->data;
65
if (gtk_check_menu_item_get_active (item))
66
return g_object_get_data (G_OBJECT (item), "layout");
73
set_layout (const gchar *layout)
77
for (iter = layout_radio_list; iter; iter = iter->next)
79
GtkCheckMenuItem *item = iter->data;
80
if (strcmp (layout, g_object_get_data (G_OBJECT (item), "layout")) == 0)
81
gtk_check_menu_item_set_active (item, TRUE);
90
for (iter = session_radio_list; iter; iter = iter->next)
92
GtkCheckMenuItem *item = iter->data;
93
if (gtk_check_menu_item_get_active (item))
94
return g_object_get_data (G_OBJECT (item), "key");
101
set_session (const gchar *session)
105
for (iter = session_radio_list; iter; iter = iter->next)
107
GtkCheckMenuItem *item = iter->data;
108
if (strcmp (session, g_object_get_data (G_OBJECT (item), "key")) == 0)
109
gtk_check_menu_item_set_active (item, TRUE);
29
114
start_authentication (const gchar *username)
117
gchar *language, *layout, *session;
119
if (ldm_greeter_get_user_defaults (greeter, username, &language, &layout, &session))
121
set_language (language);
122
set_session (session);
33
129
if (user_model && gtk_tree_model_get_iter_first (GTK_TREE_MODEL (user_model), &iter))
260
session_changed_cb (GtkWidget *widget)
262
if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (widget)))
265
session = g_strdup (g_object_get_data (G_OBJECT (widget), "key"));
270
language_changed_cb (GtkWidget *widget)
272
if (!gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (widget)))
276
language = g_strdup (g_object_get_data (G_OBJECT (widget), "language"));
280
356
a11y_font_cb (GtkWidget *widget)
282
358
if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (widget)))
412
487
g_signal_connect (G_OBJECT (greeter), "quit", G_CALLBACK (quit_cb), NULL);
414
489
ldm_greeter_connect (greeter);
415
session = g_strdup (ldm_greeter_get_default_session (greeter));
417
491
theme_dir = g_path_get_dirname (ldm_greeter_get_theme (greeter));
418
492
rc_file = ldm_greeter_get_string_property (greeter, "gtkrc");
548
622
menu = gtk_menu_new ();
549
623
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_item), menu);
551
menu_item = gtk_radio_menu_item_new_with_label (language_radio_list, _("Previous language"));
552
language_radio_list = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_item));
553
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
554
g_signal_connect (menu_item, "toggled", G_CALLBACK (language_changed_cb), NULL);
556
625
items = ldm_greeter_get_languages (greeter);
557
626
for (item = items; item; item = item->next)
572
641
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item), TRUE);
574
643
g_object_set_data (G_OBJECT (menu_item), "language", g_strdup (ldm_language_get_code (language)));
575
g_signal_connect (menu_item, "toggled", G_CALLBACK (language_changed_cb), NULL);
578
646
menu_item = gtk_menu_item_new_with_label (_("Keyboard Layout"));
588
656
layout_radio_list = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_item));
589
657
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
591
if (g_str_equal (ldm_layout_get_name (layout), ldm_greeter_get_layout (greeter)))
659
if (g_str_equal (ldm_layout_get_name (layout), ldm_greeter_get_default_layout (greeter)))
592
660
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item), TRUE);
594
662
g_object_set_data (G_OBJECT (menu_item), "layout", g_strdup (ldm_layout_get_name (layout)));
612
680
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item), TRUE);
614
682
g_object_set_data (G_OBJECT (menu_item), "key", g_strdup (ldm_session_get_key (session)));
615
g_signal_connect (menu_item, "toggled", G_CALLBACK (session_changed_cb), NULL);
618
685
power_menu = gtk_menu_new ();