gdm/gdm-2.19.1-move-default-message.patch

148 lines
5.5 KiB
Diff
Raw Normal View History

2007-05-21 18:00:19 +00:00
--- gdm-2.19.1/gui/greeter/greeter_item_pam.c.move-default-message 2007-05-13 22:08:14.000000000 -0400
+++ gdm-2.19.1/gui/greeter/greeter_item_pam.c 2007-05-21 12:05:21.000000000 -0400
@@ -47,6 +47,7 @@ gchar *greeter_current_user = NULL;
2007-02-24 04:01:25 +00:00
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;
2007-05-21 18:00:19 +00:00
@@ -249,13 +250,35 @@ greeter_item_pam_prompt (const char *mes
2007-02-24 04:01:25 +00:00
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);
2007-05-21 18:00:19 +00:00
@@ -320,6 +343,7 @@ greeter_item_pam_message (const char *me
2007-02-24 04:01:25 +00:00
* 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))
{
2007-05-21 18:00:19 +00:00
@@ -339,6 +363,7 @@ greeter_item_pam_message (const char *me
2007-02-24 04:01:25 +00:00
set_text (message_info, message);
}
replace_msg = FALSE;
+ using_fallback_message = FALSE;
}
2007-05-21 18:00:19 +00:00
--- gdm-2.19.1/gui/gdmlogin.c.move-default-message 2007-05-13 22:08:15.000000000 -0400
+++ gdm-2.19.1/gui/gdmlogin.c 2007-05-21 12:05:21.000000000 -0400
@@ -169,6 +169,7 @@ extern gchar *default_session;
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;
@@ -1357,9 +1358,20 @@ process_operation (guchar op_code,
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);
@@ -1447,6 +1459,7 @@ process_operation (guchar op_code,
g_free (tmp);
}
replace_msg = FALSE;
+ using_fallback_message = FALSE;
gtk_widget_show (GTK_WIDGET (msg));
printf ("%c\n", STX);
@@ -1625,9 +1638,7 @@ process_operation (guchar op_code,
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.19.1/daemon/verify-pam.c.move-default-message 2007-05-21 12:05:21.000000000 -0400
+++ gdm-2.19.1/daemon/verify-pam.c 2007-05-21 12:07:50.000000000 -0400
@@ -539,12 +539,6 @@ gdm_verify_pam_conv (int num_msg, struct
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.19.1/daemon/verify-shadow.c.move-default-message 2007-05-13 22:08:24.000000000 -0400
+++ gdm-2.19.1/daemon/verify-shadow.c 2007-05-21 12:11:06.000000000 -0400
@@ -127,7 +127,6 @@ gdm_verify_user (GdmDisplay *d,
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.19.1/daemon/verify-crypt.c.move-default-message 2007-05-13 22:08:24.000000000 -0400
+++ gdm-2.19.1/daemon/verify-crypt.c 2007-05-21 12:10:33.000000000 -0400
@@ -125,7 +125,6 @@ gdm_verify_user (GdmDisplay *d,
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 ()) {