Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
2010-02-23 José Millán Soto <jmillan@igalia.com>
        Reviewed by Xan Lopez.

        [Gtk] Server message not shown on http authentication
        https://bugs.webkit.org/show_bug.cgi?id=34219

        * webkit/webkitsoupauthdialog.c:
        (show_auth_dialog):
        Server message is displayed, messageLabel and message variables were
        renamed to avoid confusion.

Canonical link: https://commits.webkit.org/46441@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@55139 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
eseidel committed Feb 23, 2010
1 parent 3b9df11 commit 0b4870e
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 11 deletions.
12 changes: 12 additions & 0 deletions WebKit/gtk/ChangeLog
@@ -1,3 +1,15 @@
2010-02-23 José Millán Soto <jmillan@igalia.com>

Reviewed by Xan Lopez.

[Gtk] Server message not shown on http authentication
https://bugs.webkit.org/show_bug.cgi?id=34219

* webkit/webkitsoupauthdialog.c:
(show_auth_dialog):
Server message is displayed, messageLabel and message variables were
renamed to avoid confusion.

2010-02-23 Steve Block <steveblock@google.com>

Reviewed by Darin Adler.
Expand Down
44 changes: 33 additions & 11 deletions WebKit/gtk/webkit/webkitsoupauthdialog.c
Expand Up @@ -190,8 +190,12 @@ static void show_auth_dialog(WebKitAuthData* authData, const char* login, const
GtkWidget* vbox;
GtkWidget* icon;
GtkWidget* table;
GtkWidget* messageLabel;
char* message;
GtkWidget* serverMessageDescriptionLabel;
GtkWidget* serverMessageLabel;
GtkWidget* descriptionLabel;
char* description;
const char* realm;
gboolean hasRealm;
SoupURI* uri;
GtkWidget* rememberBox;
GtkWidget* checkButton;
Expand Down Expand Up @@ -241,12 +245,12 @@ static void show_auth_dialog(WebKitAuthData* authData, const char* login, const
gtk_box_pack_start(GTK_BOX(hbox), mainVBox, TRUE, TRUE, 0);

uri = soup_message_get_uri(authData->msg);
message = g_strdup_printf(_("A username and password are being requested by the site %s"), uri->host);
messageLabel = gtk_label_new(message);
g_free(message);
gtk_misc_set_alignment(GTK_MISC(messageLabel), 0.0, 0.5);
gtk_label_set_line_wrap(GTK_LABEL(messageLabel), TRUE);
gtk_box_pack_start(GTK_BOX(mainVBox), GTK_WIDGET(messageLabel),
description = g_strdup_printf(_("A username and password are being requested by the site %s"), uri->host);
descriptionLabel = gtk_label_new(description);
g_free(description);
gtk_misc_set_alignment(GTK_MISC(descriptionLabel), 0.0, 0.5);
gtk_label_set_line_wrap(GTK_LABEL(descriptionLabel), TRUE);
gtk_box_pack_start(GTK_BOX(mainVBox), GTK_WIDGET(descriptionLabel),
FALSE, FALSE, 0);

vbox = gtk_vbox_new(FALSE, 6);
Expand All @@ -261,14 +265,32 @@ static void show_auth_dialog(WebKitAuthData* authData, const char* login, const
gtk_box_pack_start(GTK_BOX(vbox), entryContainer,
FALSE, FALSE, 0);

table = gtk_table_new(2, 2, FALSE);
realm = soup_auth_get_realm(authData->auth);
// Checking that realm is not an empty string
hasRealm = (realm && (strlen(realm) > 0));

table = gtk_table_new(hasRealm ? 3 : 2, 2, FALSE);
gtk_table_set_col_spacings(GTK_TABLE(table), 12);
gtk_table_set_row_spacings(GTK_TABLE(table), 6);
gtk_container_add(GTK_CONTAINER(entryContainer), table);

authData->loginEntry = table_add_entry(table, 0, _("Username:"),
if (hasRealm) {
serverMessageDescriptionLabel = gtk_label_new(_("Server message:"));
serverMessageLabel = gtk_label_new(realm);
gtk_misc_set_alignment(GTK_MISC(serverMessageDescriptionLabel), 0.0, 0.5);
gtk_label_set_line_wrap(GTK_LABEL(serverMessageDescriptionLabel), TRUE);
gtk_misc_set_alignment(GTK_MISC(serverMessageLabel), 0.0, 0.5);
gtk_label_set_line_wrap(GTK_LABEL(serverMessageLabel), TRUE);

gtk_table_attach_defaults(GTK_TABLE(table), serverMessageDescriptionLabel,
0, 1, 0, 1);
gtk_table_attach_defaults(GTK_TABLE(table), serverMessageLabel,
1, 2, 0, 1);
}

authData->loginEntry = table_add_entry(table, hasRealm ? 1 : 0, _("Username:"),
login, NULL);
authData->passwordEntry = table_add_entry(table, 1, _("Password:"),
authData->passwordEntry = table_add_entry(table, hasRealm ? 2 : 1, _("Password:"),
password, NULL);

gtk_entry_set_visibility(GTK_ENTRY(authData->passwordEntry), FALSE);
Expand Down

0 comments on commit 0b4870e

Please sign in to comment.