diff options
Diffstat (limited to 'mail/mail-account-editor.c')
-rw-r--r-- | mail/mail-account-editor.c | 82 |
1 files changed, 1 insertions, 81 deletions
diff --git a/mail/mail-account-editor.c b/mail/mail-account-editor.c index 8a09d2519e..8dc2a4f99a 100644 --- a/mail/mail-account-editor.c +++ b/mail/mail-account-editor.c @@ -105,16 +105,10 @@ apply_changes (MailAccountEditor *editor) if (mail_account_gui_save (editor->gui) == FALSE) return FALSE; - - gtk_dialog_set_response_sensitive (GTK_DIALOG (editor), - GTK_RESPONSE_APPLY, FALSE); - + /* save any changes we may have */ mail_config_write (); - /* FIXME: #1549: if the account was a remote store, delete it from the folder-tree and re-add it */ - /* FIXME: preferably, we'd only do this if there were changes... oh well */ - return TRUE; } @@ -124,9 +118,6 @@ editor_response_cb (GtkWidget *widget, int button, gpointer user_data) MailAccountEditor *editor = user_data; switch (button) { - case GTK_RESPONSE_APPLY: - apply_changes (editor); - return; case GTK_RESPONSE_OK: apply_changes (editor); default: @@ -135,24 +126,6 @@ editor_response_cb (GtkWidget *widget, int button, gpointer user_data) } static void -mail_account_editor_changed (GtkWidget *widget, MailAccountEditor *editor) -{ - gtk_dialog_set_response_sensitive((GtkDialog *)editor, GTK_RESPONSE_APPLY, TRUE); -} - -static void -listen_for_changes (const char *name, GtkWidget *widget, MailAccountEditor *editor) -{ - if (GTK_IS_ENTRY (widget)) { - g_signal_connect (widget, "changed", G_CALLBACK (mail_account_editor_changed), editor); - } else if (GTK_IS_SPIN_BUTTON (widget)) { - g_signal_connect (widget, "value-changed", G_CALLBACK (mail_account_editor_changed), editor); - } else if (GTK_IS_TOGGLE_BUTTON (widget)) { - g_signal_connect (widget, "toggled", G_CALLBACK (mail_account_editor_changed), editor); - } -} - -static void construct (MailAccountEditor *editor, EAccount *account, EMAccountPrefs *dialog) { EAccountService *source = account->source; @@ -168,69 +141,16 @@ construct (MailAccountEditor *editor, EAccount *account, EMAccountPrefs *dialog) gtk_window_set_resizable (GTK_WINDOW (editor), TRUE); gtk_window_set_modal (GTK_WINDOW (editor), FALSE); gtk_dialog_add_buttons (GTK_DIALOG (editor), - GTK_STOCK_APPLY, GTK_RESPONSE_APPLY, GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); g_signal_connect (editor, "response", G_CALLBACK (editor_response_cb), editor); - g_signal_connect (editor->gui->account_name, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->default_account, "toggled", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->full_name, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->email_address, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->reply_to, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->organization, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (gtk_option_menu_get_menu (editor->gui->sig_option_menu), - "selection-done", G_CALLBACK (mail_account_editor_changed), editor); - - g_signal_connect (editor->gui->source.type, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->source.hostname, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->source.username, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->source.path, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->source.use_ssl, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->source.authtype, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->source.remember, "toggled", G_CALLBACK (mail_account_editor_changed), editor); - - g_signal_connect (editor->gui->source_auto_check, "toggled", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->source_auto_check_min, "value-changed", G_CALLBACK (mail_account_editor_changed), editor); - - g_signal_connect (editor->gui->transport.type, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->transport.hostname, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->transport.username, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->transport_needs_auth, "toggled", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->transport.use_ssl, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->transport.authtype, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->transport.remember, "toggled", G_CALLBACK (mail_account_editor_changed), editor); - - g_signal_connect (editor->gui->drafts_folder_button, "clicked", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->sent_folder_button, "clicked", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->always_cc, "toggled", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->cc_addrs, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->always_bcc, "toggled", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->bcc_addrs, "changed", G_CALLBACK (mail_account_editor_changed), editor); - - g_signal_connect (editor->gui->pgp_key, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->pgp_encrypt_to_self, "toggled", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->pgp_always_sign, "toggled", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->pgp_no_imip_sign, "toggled", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->pgp_always_trust, "toggled", G_CALLBACK (mail_account_editor_changed), editor); - - g_signal_connect (editor->gui->smime_sign_default, "toggled", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->smime_sign_key, "changed", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->smime_encrypt_default, "toggled", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->smime_encrypt_to_self, "toggled", G_CALLBACK (mail_account_editor_changed), editor); - g_signal_connect (editor->gui->smime_encrypt_key, "changed", G_CALLBACK (mail_account_editor_changed), editor); - mail_account_gui_setup (editor->gui, GTK_WIDGET (editor)); mail_account_gui_build_extra_conf (editor->gui, source->url); - /* yes, this is kinda gross... but what can we do, eh? */ - g_hash_table_foreach (editor->gui->extra_config, (GHFunc) listen_for_changes, editor); - - gtk_dialog_set_response_sensitive (GTK_DIALOG (editor), GTK_RESPONSE_APPLY, FALSE); - gtk_widget_grab_focus (GTK_WIDGET (editor->gui->account_name)); } |