aboutsummaryrefslogtreecommitdiff
path: root/src/krb5-auth-dialog.c
diff options
context:
space:
mode:
authorcaillon <caillon@517b70f8-ed25-0410-8bf6-f5db08f7b76e>2005-10-31 05:55:04 +0000
committercaillon <caillon@517b70f8-ed25-0410-8bf6-f5db08f7b76e>2005-10-31 05:55:04 +0000
commit09d5f6bb176ebfbd4f84b536b5fc32561bd94063 (patch)
tree43404cd410c0a94a1b23ee46fd3433eec8eec384 /src/krb5-auth-dialog.c
parent1717d07cc0ce625f990ef70577dfceaef2acf181 (diff)
2005-10-31 Christopher Aillon <caillon@redhat.com>
* src/krb5-auth-dialog.c: The dialog shouldn't have two labels reading 'Password:' so make the primary one have better text. git-svn-id: http://svn.gnome.org/svn/krb5-auth-dialog/trunk@28 517b70f8-ed25-0410-8bf6-f5db08f7b76e
Diffstat (limited to 'src/krb5-auth-dialog.c')
-rw-r--r--src/krb5-auth-dialog.c35
1 files changed, 24 insertions, 11 deletions
diff --git a/src/krb5-auth-dialog.c b/src/krb5-auth-dialog.c
index 7a84e98..95b6eb9 100644
--- a/src/krb5-auth-dialog.c
+++ b/src/krb5-auth-dialog.c
@@ -49,24 +49,35 @@ static int renew_credentials ();
static void
setup_dialog (GladeXML *xml,
GtkWidget *dialog,
- const gchar *prompt)
+ const gchar *krb5prompt)
{
GtkWidget *entry;
GtkWidget *label;
GtkWidget *wrong_label;
gchar *wrong_text;
gchar *wrong_markup;
+ gchar *prompt;
+ int pw4len;
- if (prompt == NULL)
- prompt = _("Password:");
- /* Kerberos's prompts are a mess, and basically impossible to
- * translate. There's basically no way short of doing a lot of
- * string parsing to translate them. The most common prompt is
- * "Password for $uid:". We special case that one at least. We
- * cannot do any of the fancier strings (like challenges),
- * though. */
- if (strncmp (prompt, "Password for ", strlen ("Password for ")) == 0)
- prompt = _("Password:");
+ if (krb5prompt == NULL)
+ prompt = g_strdup (_("Please enter your Kerberos password."));
+ else
+ {
+ /* Kerberos's prompts are a mess, and basically impossible to
+ * translate. There's basically no way short of doing a lot of
+ * string parsing to translate them. The most common prompt is
+ * "Password for $uid:". We special case that one at least. We
+ * cannot do any of the fancier strings (like challenges),
+ * though. */
+ pw4len = strlen ("Password for ");
+ if (strncmp (krb5prompt, "Password for ", pw4len) == 0)
+ {
+ gchar *uid = (gchar *) (krb5prompt + pw4len);
+ prompt = g_strdup_printf (_("Please enter the Kerberos password for '%s'"), uid);
+ }
+ else
+ prompt = g_strdup (krb5prompt);
+ }
/* Clear the password entry field */
entry = glade_xml_get_widget (xml, "krb5_entry");
@@ -99,6 +110,8 @@ setup_dialog (GladeXML *xml,
}
else
gtk_label_set_text (GTK_LABEL (wrong_label), "");
+
+ g_free (prompt);
}
static krb5_error_code