gdm/gdm-2.17.7-move-default-message.patch
2007-02-24 04:01:25 +00:00

148 lines
5.1 KiB
Diff

--- gdm-2.17.7/gui/gdmlogin.c.move-default-message 2007-02-12 00:40:13.000000000 -0500
+++ gdm-2.17.7/gui/gdmlogin.c 2007-02-23 22:53:47.000000000 -0500
@@ -160,6 +160,7 @@
extern const gchar *current_session;
extern gboolean session_dir_whacked_out;
extern gint gdm_timed_delay;
+static gboolean using_fallback_message = FALSE;
static gboolean first_prompt = TRUE;
@@ -1558,9 +1559,20 @@
gdm_config_get_string (GDM_KEY_SOUND_ON_LOGIN_FILE),
gdm_config_get_bool (GDM_KEY_SOUND_ON_LOGIN));
gtk_label_set_text_with_mnemonic (GTK_LABEL (label), _("_Username:"));
+ if (ve_string_empty (gtk_label_get_text (GTK_LABEL (msg)))) {
+ gtk_label_set_text (GTK_LABEL (msg),
+ _("Please enter your username"));
+ using_fallback_message = TRUE;
+ }
+
} else {
if (tmp != NULL)
gtk_label_set_text (GTK_LABEL (label), tmp);
+ if (using_fallback_message) {
+ gtk_label_set_text (GTK_LABEL (msg), "");
+ using_fallback_message = FALSE;
+ }
+
}
g_free (tmp);
@@ -1648,6 +1660,7 @@
g_free (tmp);
}
replace_msg = FALSE;
+ using_fallback_message = FALSE;
gtk_widget_show (GTK_WIDGET (msg));
printf ("%c\n", STX);
@@ -1828,9 +1841,7 @@
if (browser_ok && gdm_config_get_bool (GDM_KEY_BROWSER))
gtk_widget_set_sensitive (GTK_WIDGET (browser), TRUE);
- tmp = ve_locale_to_utf8 (args);
- gtk_label_set_text (GTK_LABEL (msg), tmp);
- g_free (tmp);
+ gtk_label_set_text (GTK_LABEL (msg), "");
gtk_widget_show (GTK_WIDGET (msg));
printf ("%c\n", STX);
--- gdm-2.17.7/gui/greeter/greeter_item_pam.c.move-default-message 2007-02-12 00:40:12.000000000 -0500
+++ gdm-2.17.7/gui/greeter/greeter_item_pam.c 2007-02-23 22:50:22.000000000 -0500
@@ -46,6 +46,7 @@
gboolean require_quarter = FALSE;
extern gboolean greeter_probably_login_prompt;
+static gboolean using_fallback_message = FALSE;
extern GtkButton *gtk_ok_button;
extern GtkButton *gtk_start_again_button;
@@ -250,13 +251,35 @@
int entry_len,
gboolean entry_visible)
{
+ GreeterItemInfo *message_info;
GreeterItemInfo *conversation_info;
GreeterItemInfo *entry_info;
GtkWidget *entry;
+ message_info = greeter_lookup_id ("pam-message");
conversation_info = greeter_lookup_id ("pam-prompt");
entry_info = greeter_lookup_id ("user-pw-entry");
+ if (strcmp (message, _("Username:")) == 0 && message_info)
+ {
+ gchar *text;
+ text = NULL;
+ g_object_get (G_OBJECT (message_info->item),
+ "text", &text,
+ NULL);
+ if (ve_string_empty (text))
+ {
+ set_text (message_info, _("Please enter your username"));
+ using_fallback_message = TRUE;
+ }
+ g_free (text);
+ }
+ else if (using_fallback_message)
+ {
+ set_text (message_info, "");
+ using_fallback_message = FALSE;
+ }
+
if (conversation_info)
{
set_text (conversation_info, message);
@@ -296,6 +319,7 @@
* we try to collect them until the next prompt or reset or
* whatnot */
if ( ! replace_msg &&
+ ! using_fallback_message &&
/* empty message is for clearing */
! ve_string_empty (message))
{
@@ -315,6 +339,7 @@
set_text (message_info, message);
}
replace_msg = FALSE;
+ using_fallback_message = FALSE;
}
--- gdm-2.17.7/daemon/verify-pam.c.move-default-message 2007-02-23 22:50:22.000000000 -0500
+++ gdm-2.17.7/daemon/verify-pam.c 2007-02-23 22:50:22.000000000 -0500
@@ -534,12 +534,6 @@
case PAM_PROMPT_ECHO_ON:
if (strcmp (m, _("Username:")) == 0) {
if ( ve_string_empty (selected_user)) {
- /* this is an evil hack, but really there is no way we'll
- know this is a username prompt. However we SHOULD NOT
- rely on this working. The pam modules can set their
- prompt to whatever they wish to */
- gdm_slave_greeter_ctl_no_ret
- (GDM_MSG, _("Please enter your username"));
s = gdm_slave_greeter_ctl (GDM_PROMPT, m);
/* this will clear the message */
gdm_slave_greeter_ctl_no_ret (GDM_MSG, "");
--- gdm-2.17.7/daemon/verify-crypt.c.move-default-message 2007-02-12 00:40:19.000000000 -0500
+++ gdm-2.17.7/daemon/verify-crypt.c 2007-02-23 22:50:22.000000000 -0500
@@ -115,7 +115,6 @@
authenticate_again:
/* Ask for the user's login */
gdm_verify_select_user (NULL);
- gdm_slave_greeter_ctl_no_ret (GDM_MSG, _("Please enter your username"));
login = gdm_slave_greeter_ctl (GDM_PROMPT, _("Username:"));
if (login == NULL ||
gdm_slave_greeter_check_interruption ()) {
--- gdm-2.17.7/daemon/verify-shadow.c.move-default-message 2007-02-12 00:40:19.000000000 -0500
+++ gdm-2.17.7/daemon/verify-shadow.c 2007-02-23 22:50:22.000000000 -0500
@@ -114,7 +114,6 @@
authenticate_again:
/* Ask for the user's login */
gdm_verify_select_user (NULL);
- gdm_slave_greeter_ctl_no_ret (GDM_MSG, _("Please enter your username"));
login = gdm_slave_greeter_ctl (GDM_PROMPT, _("Username:"));
if (login == NULL ||
gdm_slave_greeter_check_interruption ()) {