further merging: 0.4.67cvs6
[claws.git] / src / prefs_account.c
index f835032f26338a3ad7fd1daf89cb1b7dc148146c..d7435342f3f348c4a4bfeefdd13f4d809dcbaf6f 100644 (file)
@@ -36,6 +36,7 @@
 #include "main.h"
 #include "prefs.h"
 #include "prefs_account.h"
+#include "prefs_customheader.h"
 #include "account.h"
 #include "mainwindow.h"
 #include "manage_window.h"
@@ -314,6 +315,11 @@ static void prefs_account_privacy_create   (void);
 #endif /* USE_GPGME */
 static void prefs_account_advanced_create      (void);
 
+static void prefs_account_edit_custom_header   (void);
+
+static gint prefs_account_deleted              (GtkWidget      *widget,
+                                                GdkEventAny    *event,
+                                                gpointer        data);
 static void prefs_account_key_pressed          (GtkWidget      *widget,
                                                 GdkEventKey    *event,
                                                 gpointer        data);
@@ -321,7 +327,6 @@ static void prefs_account_ok                        (void);
 static gint prefs_account_apply                        (void);
 static void prefs_account_cancel               (void);
 
-static void prefs_account_customhdr_edit       (void);
 
 #define VSPACING               12
 #define VSPACING_NARROW                4
@@ -344,7 +349,7 @@ void prefs_account_read_config(PrefsAccount *ac_prefs, const gchar *label)
        if (id < 0) g_warning("wrong account id: %d\n", id);
        ac_prefs->account_id = id;
 
-       prefs_headers_read_config(ac_prefs);
+       prefs_custom_header_read_config(ac_prefs);
 }
 
 void prefs_account_save_config(PrefsAccount *ac_prefs)
@@ -501,7 +506,7 @@ static void prefs_account_create(void)
        /* create dialog */
        prefs_dialog_create(&dialog);
        gtk_signal_connect(GTK_OBJECT(dialog.window), "delete_event",
-                          GTK_SIGNAL_FUNC(prefs_account_cancel), NULL);
+                          GTK_SIGNAL_FUNC(prefs_account_deleted), NULL);
        gtk_signal_connect(GTK_OBJECT(dialog.window), "key_press_event",
                           GTK_SIGNAL_FUNC(prefs_account_key_pressed), NULL);
        gtk_signal_connect(GTK_OBJECT(dialog.window), "focus_in_event",
@@ -941,8 +946,6 @@ static void prefs_account_send_create(void)
        gtk_widget_show (hbox);
        gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
 
-       /* gtk_widget_set_sensitive(hbox, FALSE); */
-
        PACK_CHECK_BUTTON (hbox, customhdr_chkbtn,
                           _("Add user-defined header"));
 
@@ -950,6 +953,9 @@ static void prefs_account_send_create(void)
        gtk_widget_show (customhdr_edit_btn);
        gtk_box_pack_start (GTK_BOX (hbox), customhdr_edit_btn,
                            FALSE, FALSE, 0);
+       gtk_signal_connect (GTK_OBJECT (customhdr_edit_btn), "clicked",
+                           GTK_SIGNAL_FUNC (prefs_account_edit_custom_header),
+                           NULL);
 
        SET_TOGGLE_SENSITIVITY (customhdr_chkbtn, customhdr_edit_btn);
 
@@ -1014,10 +1020,6 @@ static void prefs_account_send_create(void)
                _("Authenticate with POP3 before sending"));
        gtk_widget_set_sensitive(pop_bfr_smtp_chkbtn, FALSE);
 
-       gtk_signal_connect(GTK_OBJECT(customhdr_edit_btn), "clicked",
-                          GTK_SIGNAL_FUNC(prefs_account_customhdr_edit),
-                          NULL);
-
        send.date_chkbtn      = date_chkbtn;
        send.msgid_chkbtn     = msgid_chkbtn;
        send.customhdr_chkbtn = customhdr_chkbtn;
@@ -1204,6 +1206,13 @@ static void prefs_account_advanced_create(void)
        advanced.domain_entry           = entry_domain;
 }
 
+static gint prefs_account_deleted(GtkWidget *widget, GdkEventAny *event,
+                                 gpointer data)
+{
+       prefs_account_cancel();
+       return TRUE;
+}
+
 static void prefs_account_key_pressed(GtkWidget *widget, GdkEventKey *event,
                                      gpointer data)
 {
@@ -1280,9 +1289,9 @@ static void prefs_account_cancel(void)
        gtk_main_quit();
 }
 
-static void prefs_account_customhdr_edit(void)
+static void prefs_account_edit_custom_header(void)
 {
-       prefs_headers_open(&tmp_ac_prefs);
+       prefs_custom_header_open(&tmp_ac_prefs);
 }
 
 #if USE_GPGME