From: Christian Dywan Date: Thu, 17 Sep 2009 21:51:36 +0000 (+0200) Subject: Add a check box Remember password to authentication dialogs X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0711bdf64e9b373eef550ae0e553232a8b5b0968;p=midori Add a check box Remember password to authentication dialogs --- diff --git a/katze/katze-http-auth.c b/katze/katze-http-auth.c index fb020822..cb2beb40 100644 --- a/katze/katze-http-auth.c +++ b/katze/katze-http-auth.c @@ -144,11 +144,12 @@ authentication_dialog_response_cb (GtkWidget* dialog, { GtkEntry* username = g_object_get_data (G_OBJECT (dialog), "username"); GtkEntry* password = g_object_get_data (G_OBJECT (dialog), "password"); + GtkToggleButton* remember = g_object_get_data (G_OBJECT (dialog), "remember"); soup_auth_authenticate (save->auth, gtk_entry_get_text (username), gtk_entry_get_text (password)); - if (save->http_auth->filename) + if (gtk_toggle_button_get_active (remember) && save->http_auth->filename) { save->username = g_strdup (gtk_entry_get_text (username)); save->password = g_strdup (gtk_entry_get_text (password)); @@ -261,6 +262,11 @@ katze_http_auth_session_authenticate_cb (SoupSession* session, gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE); g_object_set_data (G_OBJECT (dialog), "password", entry); gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox); + hbox = gtk_hbox_new (FALSE, 6); + label = gtk_check_button_new_with_mnemonic (_("_Remember password")); + gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0); + g_object_set_data (G_OBJECT (dialog), "remember", label); + gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); gtk_widget_show_all (GTK_DIALOG (dialog)->vbox);