Add a check box Remember password to authentication dialogs

This commit is contained in:
Christian Dywan 2009-09-17 23:51:36 +02:00
parent 822eff4f6d
commit 0711bdf64e

View file

@ -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);