Fixed log clipping bug #616795
[claws.git] / src / prefs_common.c
index d823904ff5fc1acce6f3288d2b8de9e9221494ef..fb47a04d5def58ec3277ecc525909ef93b30151b 100644 (file)
@@ -56,8 +56,8 @@
 #include "stock_pixmap.h"
 #include "quote_fmt.h"
 
-#if USE_PSPELL
-#include "gtkspell.h"
+#if USE_ASPELL
+#include "gtkaspell.h"
 #endif
 
 PrefsCommon prefs_common;
@@ -78,7 +78,6 @@ static struct Receive {
        GtkObject *spinbtn_autochk_adj;
 
        GtkWidget *checkbtn_chkonstartup;
-       GtkWidget *checkbtn_noerrorpanel;
        GtkWidget *checkbtn_scan_after_inc;
 
 
@@ -100,9 +99,7 @@ static struct Send {
        GtkWidget *checkbtn_queuemsg;
 
        GtkWidget *optmenu_charset;
-       
-       GtkWidget *checkbtn_returnreceipt;
-} send;
+} p_send;
 
 static struct Compose {
        GtkWidget *checkbtn_autosig;
@@ -114,28 +111,33 @@ static struct Compose {
        GtkWidget *checkbtn_autoextedit;
        GtkWidget *spinbtn_undolevel;
        GtkObject *spinbtn_undolevel_adj;
-       GtkWidget *checkbtn_reply_account_autosel;
-       GtkWidget *checkbtn_forward_account_autosel;
-       GtkWidget *checkbtn_reedit_account_autosel;
-
        GtkWidget *spinbtn_linewrap;
        GtkObject *spinbtn_linewrap_adj;
        GtkWidget *checkbtn_wrapquote;
+       GtkWidget *checkbtn_autowrap;
        GtkWidget *checkbtn_wrapatsend;
 
+       GtkWidget *checkbtn_reply_account_autosel;
+       GtkWidget *checkbtn_forward_account_autosel;
+       GtkWidget *checkbtn_reedit_account_autosel;
        GtkWidget *checkbtn_quote;
+       GtkWidget *checkbtn_default_reply_list;
        GtkWidget *checkbtn_forward_as_attachment;
+       GtkWidget *checkbtn_redirect_keep_from;
        GtkWidget *checkbtn_smart_wrapping;
        GtkWidget *checkbtn_block_cursor;
        GtkWidget *checkbtn_reply_with_quote;
+       
+       GtkWidget *checkbtn_autosave;
+       GtkWidget *entry_autosave_length;
 } compose;
 
        /* spelling */
-#if USE_PSPELL
+#if USE_ASPELL
 static struct Spelling {
-       GtkWidget *checkbtn_enable_pspell;
-       GtkWidget *entry_pspell_path;
-       GtkWidget *btn_pspell_path;
+       GtkWidget *checkbtn_enable_aspell;
+       GtkWidget *entry_aspell_path;
+       GtkWidget *btn_aspell_path;
        GtkWidget *optmenu_dictionary;
        GtkWidget *optmenu_sugmode;
        GtkWidget *misspelled_btn;
@@ -150,6 +152,8 @@ static struct Quote {
 
        GtkWidget *entry_fw_quotemark;
        GtkWidget *text_fw_quotefmt;
+       
+       GtkWidget *entry_quote_chars;
 } quote;
 
 static struct Display {
@@ -161,6 +165,10 @@ static struct Display {
        GtkWidget *entry_boldfont;
 
        GtkWidget *chkbtn_folder_unread;
+       GtkWidget *chkbtn_display_img;
+       GtkWidget *entry_ng_abbrev_len;
+       GtkWidget *spinbtn_ng_abbrev_len;
+       GtkObject *spinbtn_ng_abbrev_len_adj;
 
        GtkWidget *chkbtn_transhdr;
 
@@ -169,7 +177,6 @@ static struct Display {
        GtkWidget *chkbtn_useaddrbook;
        GtkWidget *chkbtn_expand_thread;
        GtkWidget *chkbtn_bold_unread;
-
        GtkWidget *entry_datefmt;
 } display;
 
@@ -193,19 +200,26 @@ static struct Message {
 static struct Privacy {
        GtkWidget *checkbtn_auto_check_signatures;
        GtkWidget *checkbtn_gpg_signature_popup;
+       GtkWidget *checkbtn_store_passphrase;
+       GtkWidget *spinbtn_store_passphrase;
+       GtkObject *spinbtn_store_passphrase_adj;
        GtkWidget *checkbtn_passphrase_grab;
        GtkWidget *checkbtn_gpg_warning;
-       GtkWidget *optmenu_default_signkey;
 } privacy;
 #endif
 
 static struct Interface {
        /* GtkWidget *checkbtn_emacs; */
+       GtkWidget *checkbtn_show_msg_with_cursor;
        GtkWidget *checkbtn_openunread;
+       GtkWidget *checkbtn_mark_as_read_on_newwin;
        GtkWidget *checkbtn_openinbox;
        GtkWidget *checkbtn_immedexec;
        GtkWidget *checkbtn_addaddrbyclick;
        GtkWidget *optmenu_recvdialog;
+       GtkWidget *optmenu_senddialog;
+       GtkWidget *checkbtn_no_recv_err_panel;
+       GtkWidget *checkbtn_close_recv_dialog;
        GtkWidget *optmenu_nextunreadmsgdialog;
        GtkWidget *entry_pixmap_theme;
        GtkWidget *combo_pixmap_theme;
@@ -221,6 +235,9 @@ static struct Other {
        GtkWidget *checkbtn_cleanonexit;
        GtkWidget *checkbtn_askonclean;
        GtkWidget *checkbtn_warnqueued;
+        GtkWidget *checkbtn_cliplog;
+        GtkWidget *loglength_entry;
+
 } other;
 
 static struct MessageColorButtons {
@@ -229,6 +246,7 @@ static struct MessageColorButtons {
        GtkWidget *quote_level3_btn;
        GtkWidget *uri_btn;
        GtkWidget *tgt_folder_btn;
+       GtkWidget *signature_btn;
 } color_buttons;
 
 static struct KeybindDialog {
@@ -243,19 +261,16 @@ static GtkWidget *color_dialog;
 
 static void prefs_common_charset_set_data_from_optmenu(PrefParam *pparam);
 static void prefs_common_charset_set_optmenu         (PrefParam *pparam);
-#if USE_GPGME
-static void prefs_common_default_signkey_set_data_from_optmenu
-                                                       (PrefParam *pparam);
-static void prefs_common_default_signkey_set_optmenu   (PrefParam *pparam);
-#endif
 static void prefs_common_recv_dialog_newmail_notify_toggle_cb  (GtkWidget *w,
                                                                 gpointer data);
 static void prefs_common_recv_dialog_set_data_from_optmenu(PrefParam *pparam);
 static void prefs_common_recv_dialog_set_optmenu(PrefParam *pparam);
+static void prefs_common_send_dialog_set_data_from_optmenu(PrefParam *pparam);
+static void prefs_common_send_dialog_set_optmenu(PrefParam *pparam);
 static void prefs_nextunreadmsgdialog_set_data_from_optmenu(PrefParam *pparam);
 static void prefs_nextunreadmsgdialog_set_optmenu(PrefParam *pparam);
 
-#if USE_PSPELL
+#if USE_ASPELL
 static void prefs_dictionary_set_data_from_optmenu     (PrefParam *param);
 static void prefs_dictionary_set_optmenu               (PrefParam *pparam);
 static void prefs_speller_sugmode_set_data_from_optmenu        (PrefParam *pparam);
@@ -298,9 +313,6 @@ static PrefParam param[] = {
        {"check_on_startup", "FALSE", &prefs_common.chk_on_startup, P_BOOL,
         &receive.checkbtn_chkonstartup,
         prefs_set_data_from_toggle, prefs_set_toggle},
-       {"noerrorpanel", "FALSE", &prefs_common.noerrorpanel, P_BOOL,
-        &receive.checkbtn_noerrorpanel,
-        prefs_set_data_from_toggle, prefs_set_toggle},
        {"scan_all_after_inc", "FALSE", &prefs_common.scan_all_after_inc,
         P_BOOL, &receive.checkbtn_scan_after_inc,
         prefs_set_data_from_toggle, prefs_set_toggle},
@@ -320,20 +332,20 @@ static PrefParam param[] = {
 
        /* Send */
        {"use_ext_sendmail", "FALSE", &prefs_common.use_extsend, P_BOOL,
-        &send.checkbtn_extsend,
+        &p_send.checkbtn_extsend,
         prefs_set_data_from_toggle, prefs_set_toggle},
        {"ext_sendmail_cmd", DEFAULT_SENDMAIL_CMD,
         &prefs_common.extsend_cmd, P_STRING,
-        &send.entry_extsend, prefs_set_data_from_entry, prefs_set_entry},
+        &p_send.entry_extsend, prefs_set_data_from_entry, prefs_set_entry},
        {"save_message", "TRUE", &prefs_common.savemsg, P_BOOL,
-        &send.checkbtn_savemsg,
+        &p_send.checkbtn_savemsg,
         prefs_set_data_from_toggle, prefs_set_toggle},
        {"queue_message", "FALSE", &prefs_common.queue_msg, P_BOOL,
-        &send.checkbtn_queuemsg,
+        &p_send.checkbtn_queuemsg,
         prefs_set_data_from_toggle, prefs_set_toggle},
 
        {"outgoing_charset", CS_AUTO, &prefs_common.outgoing_charset, P_STRING,
-        &send.optmenu_charset,
+        &p_send.optmenu_charset,
         prefs_common_charset_set_data_from_optmenu,
         prefs_common_charset_set_optmenu},
 
@@ -347,10 +359,19 @@ static PrefParam param[] = {
        {"auto_ext_editor", "FALSE", &prefs_common.auto_exteditor, P_BOOL,
         &compose.checkbtn_autoextedit,
         prefs_set_data_from_toggle, prefs_set_toggle},
-
+       {"forward_as_attachment", "FALSE", &prefs_common.forward_as_attachment,
+        P_BOOL, &compose.checkbtn_forward_as_attachment,
+        prefs_set_data_from_toggle, prefs_set_toggle},
+       {"redirect_keep_from", "FALSE",
+        &prefs_common.redirect_keep_from, P_BOOL,
+        &compose.checkbtn_redirect_keep_from,
+        prefs_set_data_from_toggle, prefs_set_toggle},
        {"undo_level", "50", &prefs_common.undolevels, P_INT,
         &compose.spinbtn_undolevel,
         prefs_set_data_from_spinbtn, prefs_set_spinbtn},
+       {"block_cursor", "FALSE", &prefs_common.block_cursor,
+        P_BOOL, &compose.checkbtn_block_cursor,
+        prefs_set_data_from_toggle, prefs_set_toggle},
 
        {"linewrap_length", "72", &prefs_common.linewrap_len, P_INT,
         &compose.spinbtn_linewrap,
@@ -358,30 +379,33 @@ static PrefParam param[] = {
        {"linewrap_quotation", "FALSE", &prefs_common.linewrap_quote, P_BOOL,
         &compose.checkbtn_wrapquote,
         prefs_set_data_from_toggle, prefs_set_toggle},
+       {"linewrap_auto", "FALSE", &prefs_common.autowrap, P_BOOL,
+        &compose.checkbtn_autowrap,
+        prefs_set_data_from_toggle, prefs_set_toggle},
        {"linewrap_before_sending", "FALSE",
         &prefs_common.linewrap_at_send, P_BOOL,
         &compose.checkbtn_wrapatsend,
         prefs_set_data_from_toggle, prefs_set_toggle},
-       {"forward_as_attachment", "FALSE", &prefs_common.forward_as_attachment,
-        P_BOOL, &compose.checkbtn_forward_as_attachment,
-        prefs_set_data_from_toggle, prefs_set_toggle},
         {"smart_wrapping", "TRUE", &prefs_common.smart_wrapping,
         P_BOOL, &compose.checkbtn_smart_wrapping,
         prefs_set_data_from_toggle, prefs_set_toggle},
-       {"block_cursor", "FALSE", &prefs_common.block_cursor,
-        P_BOOL, &compose.checkbtn_block_cursor,
+        {"autosave", "FALSE", &prefs_common.autosave,
+        P_BOOL, &compose.checkbtn_autosave,
         prefs_set_data_from_toggle, prefs_set_toggle},
-#if USE_PSPELL
-       {"enable_pspell", "TRUE", &prefs_common.enable_pspell,
-        P_BOOL, &spelling.checkbtn_enable_pspell,
+        {"autosave_length", "50", &prefs_common.autosave_length,
+        P_INT, &compose.entry_autosave_length,
+        prefs_set_data_from_entry, prefs_set_entry},
+#if USE_ASPELL
+       {"enable_aspell", "TRUE", &prefs_common.enable_aspell,
+        P_BOOL, &spelling.checkbtn_enable_aspell,
         prefs_set_data_from_toggle, prefs_set_toggle},
-       {"pspell_path", PSPELL_PATH, &prefs_common.pspell_path, 
-        P_STRING, &spelling.entry_pspell_path, 
+       {"aspell_path", ASPELL_PATH, &prefs_common.aspell_path, 
+        P_STRING, &spelling.entry_aspell_path, 
         prefs_set_data_from_entry, prefs_set_entry},
        {"dictionary",  "", &prefs_common.dictionary,
         P_STRING, &spelling.optmenu_dictionary, 
         prefs_dictionary_set_data_from_optmenu, prefs_dictionary_set_optmenu },
-       {"pspell_sugmode",  "1", &prefs_common.pspell_sugmode,
+       {"aspell_sugmode",  "1", &prefs_common.aspell_sugmode,
         P_INT, &spelling.optmenu_sugmode, 
         prefs_speller_sugmode_set_data_from_optmenu, prefs_speller_sugmode_set_optmenu },
        {"use_alternate_dict", "FALSE", &prefs_common.use_alternate,
@@ -410,6 +434,10 @@ static PrefParam param[] = {
         &compose.checkbtn_reedit_account_autosel,
         prefs_set_data_from_toggle, prefs_set_toggle},
 
+       {"default_reply_list", "TRUE", &prefs_common.default_reply_list, P_BOOL,
+        &compose.checkbtn_default_reply_list,
+        prefs_set_data_from_toggle, prefs_set_toggle},
+
        {"show_ruler", "TRUE", &prefs_common.show_ruler, P_BOOL,
         NULL, NULL, NULL},
 
@@ -429,6 +457,8 @@ static PrefParam param[] = {
         "?n{Newsgroups: %n\\n}?s{Subject: %s\\n}\\n\\n%M",
         &prefs_common.fw_quotefmt, P_STRING, &quote.text_fw_quotefmt,
         prefs_set_data_from_text, prefs_set_text},
+       {"quote_chars", ">", &prefs_common.quote_chars, P_STRING,
+        &quote.entry_quote_chars, prefs_set_data_from_entry, prefs_set_entry},
 
        /* Display */
        {"widget_font", NULL, &prefs_common.widgetfont, P_STRING,
@@ -456,12 +486,21 @@ static PrefParam param[] = {
         &display.chkbtn_folder_unread,
         prefs_set_data_from_toggle, prefs_set_toggle},
 
+       {"display_img", "TRUE",
+        &prefs_common.display_img, P_BOOL,
+        &display.chkbtn_display_img,
+        prefs_set_data_from_toggle, prefs_set_toggle},
+       {"newsgroup_abbrev_len", "16",
+        &prefs_common.ng_abbrev_len, P_INT,
+        &display.spinbtn_ng_abbrev_len,
+        prefs_set_data_from_spinbtn, prefs_set_spinbtn},
+
        {"translate_header", "TRUE", &prefs_common.trans_hdr, P_BOOL,
         &display.chkbtn_transhdr,
         prefs_set_data_from_toggle, prefs_set_toggle},
 
        /* Display: Summary View */
-       {"enable_swap_from", "TRUE", &prefs_common.swap_from, P_BOOL,
+       {"enable_swap_from", "FALSE", &prefs_common.swap_from, P_BOOL,
         &display.chkbtn_swapfrom,
         prefs_set_data_from_toggle, prefs_set_toggle},
        {"enable_hscrollbar", "TRUE", &prefs_common.enable_hscrollbar, P_BOOL,
@@ -482,11 +521,16 @@ static PrefParam param[] = {
 
        {"enable_thread", "TRUE", &prefs_common.enable_thread, P_BOOL,
         NULL, NULL, NULL},
-       
        {"toolbar_style", "3", &prefs_common.toolbar_style, P_ENUM,
         NULL, NULL, NULL},
        {"show_statusbar", "TRUE", &prefs_common.show_statusbar, P_BOOL,
         NULL, NULL, NULL},
+       {"show_searchbar", "TRUE", &prefs_common.show_searchbar, P_BOOL,
+        NULL, NULL, NULL},
+
+       {"folderview_vscrollbar_policy", "0",
+        &prefs_common.folderview_vscrollbar_policy, P_ENUM,
+        NULL, NULL, NULL},
 
        {"summary_col_show_mark", "TRUE",
         &prefs_common.summary_col_visible[S_COL_MARK], P_BOOL, NULL, NULL, NULL},
@@ -610,7 +654,7 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"target_folder_color", "14294218", &prefs_common.tgt_folder_col, P_INT,
         NULL, NULL, NULL},
-       {"signature_color", "0", &prefs_common.sig_col, P_USHORT,
+       {"signature_color", "7960953", &prefs_common.signature_col, P_INT,
         NULL, NULL, NULL},
        {"recycle_quote_colors", "FALSE", &prefs_common.recycle_quote_colors,
         P_BOOL, NULL, NULL, NULL},
@@ -663,6 +707,13 @@ static PrefParam param[] = {
         &prefs_common.gpg_signature_popup, P_BOOL,
         &privacy.checkbtn_gpg_signature_popup,
         prefs_set_data_from_toggle, prefs_set_toggle},
+       {"store_passphrase", "FALSE", &prefs_common.store_passphrase, P_BOOL,
+        &privacy.checkbtn_store_passphrase,
+        prefs_set_data_from_toggle, prefs_set_toggle},
+       {"store_passphrase_timeout", "0",
+        &prefs_common.store_passphrase_timeout, P_INT,
+        &privacy.spinbtn_store_passphrase,
+        prefs_set_data_from_spinbtn, prefs_set_spinbtn},
 #ifndef __MINGW32__
        {"passphrase_grab", "FALSE", &prefs_common.passphrase_grab, P_BOOL,
         &privacy.checkbtn_passphrase_grab,
@@ -671,10 +722,6 @@ static PrefParam param[] = {
        {"gpg_warning", "TRUE", &prefs_common.gpg_warning, P_BOOL,
         &privacy.checkbtn_gpg_warning,
         prefs_set_data_from_toggle, prefs_set_toggle},
-       {"default_signkey", CS_AUTO, &prefs_common.default_signkey, P_STRING,
-        &privacy.optmenu_default_signkey,
-        prefs_common_default_signkey_set_data_from_optmenu,
-        prefs_common_default_signkey_set_optmenu},
 #endif /* USE_GPGME */
 
        /* Interface */
@@ -685,10 +732,17 @@ static PrefParam param[] = {
 
        /* {"emulate_emacs", "FALSE", &prefs_common.emulate_emacs, P_BOOL,
         NULL, NULL, NULL}, */
-
+       {"show_message_with_cursor_key", "FALSE",
+        &prefs_common.show_msg_with_cursor_key,
+        P_BOOL, &interface.checkbtn_show_msg_with_cursor,
+        prefs_set_data_from_toggle, prefs_set_toggle},
        {"open_unread_on_enter", "FALSE", &prefs_common.open_unread_on_enter,
         P_BOOL, &interface.checkbtn_openunread,
         prefs_set_data_from_toggle, prefs_set_toggle},
+       {"mark_as_read_on_new_window", "FALSE",
+        &prefs_common.mark_as_read_on_new_window,
+        P_BOOL, &interface.checkbtn_mark_as_read_on_newwin,
+        prefs_set_data_from_toggle, prefs_set_toggle},
        {"open_inbox_on_inc", "FALSE", &prefs_common.open_inbox_on_inc,
         P_BOOL, &interface.checkbtn_openinbox,
         prefs_set_data_from_toggle, prefs_set_toggle},
@@ -699,6 +753,16 @@ static PrefParam param[] = {
         &interface.optmenu_recvdialog,
         prefs_common_recv_dialog_set_data_from_optmenu,
         prefs_common_recv_dialog_set_optmenu},
+       {"send_dialog_mode", "0", &prefs_common.send_dialog_mode, P_ENUM,
+        &interface.optmenu_senddialog,
+        prefs_common_send_dialog_set_data_from_optmenu,
+        prefs_common_send_dialog_set_optmenu},
+       {"no_receive_error_panel", "FALSE", &prefs_common.no_recv_err_panel,
+        P_BOOL, &interface.checkbtn_no_recv_err_panel,
+        prefs_set_data_from_toggle, prefs_set_toggle},
+       {"close_receive_dialog", "TRUE", &prefs_common.close_recv_dialog,
+        P_BOOL, &interface.checkbtn_close_recv_dialog,
+        prefs_set_data_from_toggle, prefs_set_toggle},
        {"nextunreadmsg_dialog", NULL, &prefs_common.next_unread_msg_dialog, P_ENUM,
         &interface.optmenu_nextunreadmsgdialog,
         prefs_nextunreadmsgdialog_set_data_from_optmenu,
@@ -724,9 +788,6 @@ static PrefParam param[] = {
        {"confirm_on_exit", "TRUE", &prefs_common.confirm_on_exit, P_BOOL,
         &other.checkbtn_confonexit,
         prefs_set_data_from_toggle, prefs_set_toggle},
-       {"send_return_receipt", "TRUE", &prefs_common.return_receipt, P_BOOL,
-        &send.checkbtn_returnreceipt,
-        prefs_set_data_from_toggle, prefs_set_toggle},
        {"clean_trash_on_exit", "FALSE", &prefs_common.clean_on_exit, P_BOOL,
         &other.checkbtn_cleanonexit,
         prefs_set_data_from_toggle, prefs_set_toggle},
@@ -736,11 +797,24 @@ static PrefParam param[] = {
        {"warn_queued_on_exit", "TRUE", &prefs_common.warn_queued_on_exit,
         P_BOOL, &other.checkbtn_warnqueued,
         prefs_set_data_from_toggle, prefs_set_toggle},
+       {"work_offline", "FALSE", &prefs_common.work_offline, P_BOOL,
+        NULL, NULL, NULL},
 
-       {"kill_score", "-9999", &prefs_common.kill_score, P_INT,
+       {"hide_score", "-9999", &prefs_common.kill_score, P_INT,
         NULL, NULL, NULL},
        {"important_score", "1", &prefs_common.important_score, P_INT,
         NULL, NULL, NULL},
+        {"clip_log", "FALSE", &prefs_common.cliplog, P_BOOL,
+        &other.checkbtn_cliplog,
+        prefs_set_data_from_toggle, prefs_set_toggle},
+       {"log_length", "1000", &prefs_common.loglength, P_INT,
+        &other.loglength_entry,
+        prefs_set_data_from_entry, prefs_set_entry},
+
+       {"cache_max_mem_usage", "4096", &prefs_common.cache_max_mem_usage, P_INT,
+        NULL, NULL, NULL},
+       {"cache_min_keep_time", "15", &prefs_common.cache_min_keep_time, P_INT,
+        NULL, NULL, NULL},
 
        {NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
 };
@@ -749,8 +823,10 @@ static PrefParam param[] = {
 static void prefs_common_create                (void);
 static void prefs_receive_create       (void);
 static void prefs_send_create          (void);
-static void prefs_compose_create       (void);
+#ifdef USE_ASPELL
 static void prefs_spelling_create      (void);
+#endif
+static void prefs_compose_create       (void);
 static void prefs_quote_create         (void);
 static void prefs_display_create       (void);
 static void prefs_message_create       (void);
@@ -827,7 +903,6 @@ static void prefs_common_apply              (void);
 static void prefs_common_cancel                (void);
 
 void prefs_common_init() {
-       prefs_common.fltlist = NULL;
        prefs_common.disphdr_list = NULL;
 }
 
@@ -841,7 +916,7 @@ void prefs_common_read_config(void)
 
        path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMAND_HISTORY,
                           NULL);
-       if ((fp = fopen(path, "r")) == NULL) {
+       if ((fp = fopen(path, "rb")) == NULL) {
                if (ENOENT != errno) FILE_OP_ERROR(path, "fopen");
                g_free(path);
                return;
@@ -869,7 +944,7 @@ void prefs_common_save_config(void)
 
        path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMAND_HISTORY,
                           NULL);
-       if ((fp = fopen(path, "w")) == NULL) {
+       if ((fp = fopen(path, "wb")) == NULL) {
                FILE_OP_ERROR(path, "fopen");
                g_free(path);
                return;
@@ -909,7 +984,7 @@ static void prefs_common_create(void)
 {
        gint page = 0;
 
-       debug_print(_("Creating common preferences window...\n"));
+       debug_print("Creating common preferences window...\n");
 
        prefs_dialog_create(&dialog);
        gtk_window_set_title (GTK_WINDOW(dialog.window),
@@ -935,7 +1010,7 @@ static void prefs_common_create(void)
        SET_NOTEBOOK_LABEL(dialog.notebook, _("Send"),      page++);
        prefs_compose_create();
        SET_NOTEBOOK_LABEL(dialog.notebook, _("Compose"),   page++);
-#if USE_PSPELL
+#if USE_ASPELL
        prefs_spelling_create();
        SET_NOTEBOOK_LABEL(dialog.notebook, _("Spell Checker"),   page++);
 #endif 
@@ -981,7 +1056,6 @@ static void prefs_receive_create(void)
        GtkWidget *spinbtn_autochk;
        GtkWidget *label_autochk2;
        GtkWidget *checkbtn_chkonstartup;
-       GtkWidget *checkbtn_noerrorpanel;
        GtkWidget *checkbtn_scan_after_inc;
 
 
@@ -1095,9 +1169,6 @@ static void prefs_receive_create(void)
 
        PACK_CHECK_BUTTON (vbox2, checkbtn_chkonstartup,
                           _("Check new mail on startup"));
-
-       PACK_CHECK_BUTTON (vbox2, checkbtn_noerrorpanel,
-                          _("No error popup on receive error"));
        PACK_CHECK_BUTTON (vbox2, checkbtn_scan_after_inc,
                           _("Update all local folders after incorporation"));
 
@@ -1128,7 +1199,7 @@ static void prefs_receive_create(void)
        gtk_box_pack_start (GTK_BOX (vbox2), hbox_newmail_notify, FALSE, 
                            FALSE, 0);
 
-       label_newmail_notify_cmd = gtk_label_new (_("Command  to execute:\n"
+       label_newmail_notify_cmd = gtk_label_new (_("Command to execute:\n"
                                                    "(use %d as number of new "
                                                    "mails)"));
        gtk_label_set_justify(GTK_LABEL(label_newmail_notify_cmd), 
@@ -1184,7 +1255,6 @@ static void prefs_receive_create(void)
        receive.spinbtn_autochk_adj = spinbtn_autochk_adj;
 
        receive.checkbtn_chkonstartup = checkbtn_chkonstartup;
-       receive.checkbtn_noerrorpanel = checkbtn_noerrorpanel;
        receive.checkbtn_scan_after_inc = checkbtn_scan_after_inc;
 
 
@@ -1214,7 +1284,6 @@ static void prefs_send_create(void)
        GtkWidget *optmenu;
        GtkWidget *optmenu_menu;
        GtkWidget *menuitem;
-       GtkWidget *checkbtn_returnreceipt;
        GtkWidget *label_charset_desc;
 
        vbox1 = gtk_vbox_new (FALSE, VSPACING);
@@ -1256,11 +1325,9 @@ static void prefs_send_create(void)
        gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
 
        PACK_CHECK_BUTTON (vbox2, checkbtn_savemsg,
-                          _("Save sent messages to outbox"));
+                          _("Save sent messages to Sent"));
        PACK_CHECK_BUTTON (vbox2, checkbtn_queuemsg,
                           _("Queue messages that fail to send"));
-       PACK_CHECK_BUTTON (vbox2, checkbtn_returnreceipt,
-                          _("Send return receipt on request"));
 
        hbox1 = gtk_hbox_new (FALSE, 8);
        gtk_widget_show (hbox1);
@@ -1298,7 +1365,7 @@ static void prefs_send_create(void)
 #endif
        SET_MENUITEM(_("Cyrillic (KOI8-R)"),             CS_KOI8_R);
 #if HAVE_LIBJCONV
-       SET_MENUITEM(_("Cyrillic (Windows-1251)"),       CS_CP1251);
+       SET_MENUITEM(_("Cyrillic (Windows-1251)"),       CS_WINDOWS_1251);
        SET_MENUITEM(_("Cyrillic (KOI8-U)"),             CS_KOI8_U);
 #endif
        SET_MENUITEM(_("Japanese (ISO-2022-JP)"),        CS_ISO_2022_JP);
@@ -1330,15 +1397,14 @@ static void prefs_send_create(void)
                            FALSE, FALSE, 0);
        gtk_label_set_justify(GTK_LABEL (label_charset_desc), GTK_JUSTIFY_LEFT);
 
-       send.checkbtn_extsend = checkbtn_extsend;
-       send.entry_extsend    = entry_extsend;
-       /* send.button_extsend   = button_extsend; */
+       p_send.checkbtn_extsend = checkbtn_extsend;
+       p_send.entry_extsend    = entry_extsend;
+       /* p_send.button_extsend   = button_extsend; */
 
-       send.checkbtn_savemsg  = checkbtn_savemsg;
-       send.checkbtn_queuemsg = checkbtn_queuemsg;
-       send.checkbtn_returnreceipt = checkbtn_returnreceipt;
+       p_send.checkbtn_savemsg  = checkbtn_savemsg;
+       p_send.checkbtn_queuemsg = checkbtn_queuemsg;
 
-       send.optmenu_charset = optmenu;
+       p_send.optmenu_charset = optmenu;
 }
 
 static void prefs_common_recv_dialog_newmail_notify_toggle_cb(GtkWidget *w, gpointer data)
@@ -1352,7 +1418,7 @@ static void prefs_common_recv_dialog_newmail_notify_toggle_cb(GtkWidget *w, gpoi
        gtk_widget_set_sensitive(receive.hbox_newmail_notify, toggled);
 }
 
-#if USE_PSPELL
+#if USE_ASPELL
 static void prefs_dictionary_set_data_from_optmenu(PrefParam *param)
 {
        gchar *str;
@@ -1363,7 +1429,7 @@ static void prefs_dictionary_set_data_from_optmenu(PrefParam *param)
        g_return_if_fail(param->widget);
        g_return_if_fail(*(param->widget));
 
-       dict_fullname = gtkpspell_get_dictionary_menu_active_item
+       dict_fullname = gtkaspell_get_dictionary_menu_active_item
                (gtk_option_menu_get_menu(GTK_OPTION_MENU(*(param->widget))));
        str = *((gchar **) param->data);
        if (str)
@@ -1410,7 +1476,7 @@ static void prefs_speller_sugmode_set_data_from_optmenu(PrefParam *param)
        g_return_if_fail(param->widget);
        g_return_if_fail(*(param->widget));
 
-       sugmode = gtkpspell_get_sugmode_from_option_menu
+       sugmode = gtkaspell_get_sugmode_from_option_menu
                (GTK_OPTION_MENU(*(param->widget)));
        *((gint *) param->data) = sugmode;
 }
@@ -1424,11 +1490,11 @@ static void prefs_speller_sugmode_set_optmenu(PrefParam *pparam)
        g_return_if_fail(pparam->data != NULL);
 
        sugmode = *(gint *) pparam->data;
-       gtkpspell_sugmode_option_menu_set(optmenu, sugmode);
+       gtkaspell_sugmode_option_menu_set(optmenu, sugmode);
 }
        
        
-static void prefs_spelling_checkbtn_enable_pspell_toggle_cb
+static void prefs_spelling_checkbtn_enable_aspell_toggle_cb
        (GtkWidget *widget,
         gpointer data)
 {
@@ -1436,40 +1502,40 @@ static void prefs_spelling_checkbtn_enable_pspell_toggle_cb
 
        toggled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
 
-       gtk_widget_set_sensitive(spelling.entry_pspell_path,   toggled);
+       gtk_widget_set_sensitive(spelling.entry_aspell_path,   toggled);
        gtk_widget_set_sensitive(spelling.optmenu_dictionary,  toggled);
        gtk_widget_set_sensitive(spelling.optmenu_sugmode,     toggled);
-       gtk_widget_set_sensitive(spelling.btn_pspell_path,     toggled);
+       gtk_widget_set_sensitive(spelling.btn_aspell_path,     toggled);
        gtk_widget_set_sensitive(spelling.misspelled_btn,      toggled);
        gtk_widget_set_sensitive(spelling.checkbtn_use_alternate,      toggled);
        gtk_widget_set_sensitive(spelling.checkbtn_check_while_typing, toggled);
 }
 
-static void prefs_spelling_btn_pspell_path_clicked_cb(GtkWidget *widget,
+static void prefs_spelling_btn_aspell_path_clicked_cb(GtkWidget *widget,
                                                     gpointer data)
 {
        gchar *file_path, *tmp;
        GtkWidget *new_menu;
 
        file_path = filesel_select_file(_("Select dictionaries location"),
-                                       prefs_common.pspell_path);
+                                       prefs_common.aspell_path);
        if (file_path == NULL) {
                /* don't change */      
        }
        else {
          tmp=g_dirname(file_path);
          
-               if (prefs_common.pspell_path)
-                       g_free(prefs_common.pspell_path);
-               prefs_common.pspell_path = g_strdup_printf("%s%s",tmp,
+               if (prefs_common.aspell_path)
+                       g_free(prefs_common.aspell_path);
+               prefs_common.aspell_path = g_strdup_printf("%s%s",tmp,
                                                           G_DIR_SEPARATOR_S);
 
-               new_menu = gtkpspell_dictionary_option_menu_new(prefs_common.pspell_path);
+               new_menu = gtkaspell_dictionary_option_menu_new(prefs_common.aspell_path);
                gtk_option_menu_set_menu(GTK_OPTION_MENU(spelling.optmenu_dictionary),
                                         new_menu);
 
-               gtk_entry_set_text(GTK_ENTRY(spelling.entry_pspell_path), 
-                                  prefs_common.pspell_path);                                    
+               gtk_entry_set_text(GTK_ENTRY(spelling.entry_aspell_path), 
+                                  prefs_common.aspell_path);                                    
                /* select first one */
                gtk_option_menu_set_history(GTK_OPTION_MENU(
                                        spelling.optmenu_dictionary), 0);
@@ -1478,7 +1544,7 @@ static void prefs_spelling_btn_pspell_path_clicked_cb(GtkWidget *widget,
                        g_free(prefs_common.dictionary);
 
                prefs_common.dictionary = 
-                       gtkpspell_get_dictionary_menu_active_item(
+                       gtkaspell_get_dictionary_menu_active_item(
                                gtk_option_menu_get_menu(
                                        GTK_OPTION_MENU(
                                                spelling.optmenu_dictionary)));
@@ -1492,11 +1558,11 @@ static void prefs_spelling_create()
        GtkWidget *vbox1;
        GtkWidget *frame_spell;
        GtkWidget *vbox_spell;
-       GtkWidget *hbox_pspell_path;
-       GtkWidget *checkbtn_enable_pspell;
-       GtkWidget *label_pspell_path;
-       GtkWidget *entry_pspell_path;
-       GtkWidget *btn_pspell_path;
+       GtkWidget *hbox_aspell_path;
+       GtkWidget *checkbtn_enable_aspell;
+       GtkWidget *label_aspell_path;
+       GtkWidget *entry_aspell_path;
+       GtkWidget *btn_aspell_path;
        GtkWidget *spell_table;
        GtkWidget *label_dictionary;
        GtkWidget *optmenu_dictionary;
@@ -1520,11 +1586,11 @@ static void prefs_spelling_create()
        gtk_container_add(GTK_CONTAINER(frame_spell), vbox_spell);
        gtk_container_set_border_width(GTK_CONTAINER(vbox_spell), 8);
 
-       PACK_CHECK_BUTTON(vbox_spell, checkbtn_enable_pspell, 
-                         _("Enable spell checker (EXPERIMENTAL)"));
+       PACK_CHECK_BUTTON(vbox_spell, checkbtn_enable_aspell, 
+                         _("Enable spell checker"));
 
-       gtk_signal_connect(GTK_OBJECT(checkbtn_enable_pspell), "toggled",
-                          GTK_SIGNAL_FUNC(prefs_spelling_checkbtn_enable_pspell_toggle_cb),
+       gtk_signal_connect(GTK_OBJECT(checkbtn_enable_aspell), "toggled",
+                          GTK_SIGNAL_FUNC(prefs_spelling_checkbtn_enable_aspell_toggle_cb),
                           NULL);
 
        /* Check while typing */
@@ -1545,31 +1611,31 @@ static void prefs_spelling_create()
 
        gtk_box_pack_start(GTK_BOX(vbox_spell), spell_table, TRUE, TRUE, 0);
 
-       label_pspell_path = gtk_label_new (_("Dictionaries path:"));
-       gtk_misc_set_alignment(GTK_MISC(label_pspell_path), 1.0, 0.5);
-       gtk_widget_show(label_pspell_path);
-       gtk_table_attach (GTK_TABLE (spell_table), label_pspell_path, 0, 1, 0,
+       label_aspell_path = gtk_label_new (_("Dictionaries path:"));
+       gtk_misc_set_alignment(GTK_MISC(label_aspell_path), 1.0, 0.5);
+       gtk_widget_show(label_aspell_path);
+       gtk_table_attach (GTK_TABLE (spell_table), label_aspell_path, 0, 1, 0,
                          1, GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
        
-       hbox_pspell_path = gtk_hbox_new (FALSE, 8);
-       gtk_table_attach (GTK_TABLE (spell_table), hbox_pspell_path, 1, 2, 0,
+       hbox_aspell_path = gtk_hbox_new (FALSE, 8);
+       gtk_table_attach (GTK_TABLE (spell_table), hbox_aspell_path, 1, 2, 0,
                          1, GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
-       gtk_widget_show(hbox_pspell_path);
+       gtk_widget_show(hbox_aspell_path);
 
-       entry_pspell_path = gtk_entry_new();
-       gtk_widget_show(entry_pspell_path);
-       gtk_box_pack_start(GTK_BOX(hbox_pspell_path), entry_pspell_path, TRUE,
+       entry_aspell_path = gtk_entry_new();
+       gtk_widget_show(entry_aspell_path);
+       gtk_box_pack_start(GTK_BOX(hbox_aspell_path), entry_aspell_path, TRUE,
                           TRUE, 0);    
        
-       gtk_widget_set_sensitive(entry_pspell_path, prefs_common.enable_pspell);
+       gtk_widget_set_sensitive(entry_aspell_path, prefs_common.enable_aspell);
 
-       btn_pspell_path = gtk_button_new_with_label(" ... ");
-       gtk_widget_show(btn_pspell_path);
-       gtk_box_pack_start(GTK_BOX(hbox_pspell_path), btn_pspell_path, FALSE, FALSE, 0);
-       gtk_widget_set_sensitive(btn_pspell_path, prefs_common.enable_pspell);
+       btn_aspell_path = gtk_button_new_with_label(" ... ");
+       gtk_widget_show(btn_aspell_path);
+       gtk_box_pack_start(GTK_BOX(hbox_aspell_path), btn_aspell_path, FALSE, FALSE, 0);
+       gtk_widget_set_sensitive(btn_aspell_path, prefs_common.enable_aspell);
 
-       gtk_signal_connect(GTK_OBJECT(btn_pspell_path), "clicked", 
-                          GTK_SIGNAL_FUNC(prefs_spelling_btn_pspell_path_clicked_cb),
+       gtk_signal_connect(GTK_OBJECT(btn_aspell_path), "clicked", 
+                          GTK_SIGNAL_FUNC(prefs_spelling_btn_aspell_path_clicked_cb),
                           NULL);
 
        label_dictionary = gtk_label_new(_("Default dictionary:"));
@@ -1581,11 +1647,11 @@ static void prefs_spelling_create()
        optmenu_dictionary = gtk_option_menu_new();
        gtk_widget_show(optmenu_dictionary);
        gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu_dictionary), 
-                                gtkpspell_dictionary_option_menu_new(
-                                        prefs_common.pspell_path));
+                                gtkaspell_dictionary_option_menu_new(
+                                        prefs_common.aspell_path));
        gtk_table_attach (GTK_TABLE (spell_table), optmenu_dictionary, 1, 2, 1,
                          2, GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
-       gtk_widget_set_sensitive(optmenu_dictionary, prefs_common.enable_pspell);
+       gtk_widget_set_sensitive(optmenu_dictionary, prefs_common.enable_aspell);
 
        /* Suggestion mode */
        sugmode_label = gtk_label_new(_("Default suggestion mode"));
@@ -1597,10 +1663,10 @@ static void prefs_spelling_create()
        sugmode_optmenu = gtk_option_menu_new();
        gtk_widget_show(sugmode_optmenu);
        gtk_option_menu_set_menu(GTK_OPTION_MENU(sugmode_optmenu),
-                           gtkpspell_sugmode_option_menu_new(prefs_common.pspell_sugmode));
+                           gtkaspell_sugmode_option_menu_new(prefs_common.aspell_sugmode));
        gtk_table_attach(GTK_TABLE(spell_table), sugmode_optmenu, 1, 2, 2, 3,
                         GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
-       gtk_widget_set_sensitive(sugmode_optmenu, prefs_common.enable_pspell);
+       gtk_widget_set_sensitive(sugmode_optmenu, prefs_common.enable_aspell);
 
        /* Color */
        color_label = gtk_label_new(_("Misspelled word color:"));
@@ -1618,15 +1684,15 @@ static void prefs_spelling_create()
        set_button_bg_color(spelling.misspelled_btn,
                            prefs_common.misspelled_col);
        gtk_widget_set_usize (spelling.misspelled_btn, 30, 20);
-       gtk_widget_set_sensitive(spelling.misspelled_btn, prefs_common.enable_pspell);
+       gtk_widget_set_sensitive(spelling.misspelled_btn, prefs_common.enable_aspell);
        gtk_signal_connect (GTK_OBJECT (spelling.misspelled_btn), "clicked",
                            GTK_SIGNAL_FUNC(quote_color_set_dialog), "Misspelled word");
        gtk_container_add(GTK_CONTAINER(col_align), spelling.misspelled_btn);
 
 
-       spelling.checkbtn_enable_pspell = checkbtn_enable_pspell;
-       spelling.entry_pspell_path      = entry_pspell_path;
-       spelling.btn_pspell_path        = btn_pspell_path;
+       spelling.checkbtn_enable_aspell = checkbtn_enable_aspell;
+       spelling.entry_aspell_path      = entry_aspell_path;
+       spelling.btn_aspell_path        = btn_aspell_path;
        spelling.optmenu_dictionary     = optmenu_dictionary;
        spelling.optmenu_sugmode        = sugmode_optmenu;
        spelling.checkbtn_use_alternate = checkbtn_use_alternate;
@@ -1640,10 +1706,7 @@ static void prefs_compose_create(void)
 {
        GtkWidget *vbox1;
        GtkWidget *vbox2;
-       GtkWidget *vbox3;
        GtkWidget *hbox1;
-       GtkWidget *hbox2;
-       GtkWidget *btn_quotefmt;
 
        GtkWidget *frame_sig;
        GtkWidget *vbox_sig;
@@ -1651,13 +1714,10 @@ static void prefs_compose_create(void)
        GtkWidget *label_sigsep;
        GtkWidget *entry_sigsep;
 
-       GtkWidget *frame_editor;
-       GtkWidget *hbox_editor;
        GtkWidget *checkbtn_autoextedit;
 
        GtkWidget *frame_autosel;
        GtkWidget *hbox_autosel;
-       GtkWidget *vbox_autosel;
        GtkWidget *checkbtn_reply_account_autosel;
        GtkWidget *checkbtn_forward_account_autosel;
        GtkWidget *checkbtn_reedit_account_autosel;
@@ -1676,33 +1736,27 @@ static void prefs_compose_create(void)
        GtkObject *spinbtn_linewrap_adj;
        GtkWidget *spinbtn_linewrap;
        GtkWidget *checkbtn_wrapquote;
+       GtkWidget *checkbtn_autowrap;
        GtkWidget *checkbtn_wrapatsend;
 
-       GtkWidget *frame_reply;
-       GtkWidget *checkbtn_quote;
+       GtkWidget *checkbtn_default_reply_list;
+
        GtkWidget *checkbtn_forward_as_attachment;
+       GtkWidget *checkbtn_redirect_keep_from;
        GtkWidget *checkbtn_smart_wrapping;
        GtkWidget *checkbtn_block_cursor;
+       GtkWidget *frame_msgwrap;
 
+       GtkWidget *hbox_autosave;
+       GtkWidget *checkbtn_autosave;
+       GtkWidget *entry_autosave_length;
+       GtkWidget *label_autosave_length;
+       
        vbox1 = gtk_vbox_new (FALSE, VSPACING);
        gtk_widget_show (vbox1);
        gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
        gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
 
-
-
-       hbox1 = gtk_hbox_new (FALSE, 32);
-       gtk_widget_show (hbox1);
-
-       hbox2 = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox2);
-       gtk_box_pack_start (GTK_BOX (hbox1), hbox2, FALSE, FALSE, 0);
-
-
-       hbox1 = gtk_hbox_new (FALSE, 32);
-       gtk_widget_show (hbox1);
-       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
-
        PACK_FRAME(vbox1, frame_sig, _("Signature"));
 
        vbox_sig = gtk_vbox_new (FALSE, VSPACING_NARROW);
@@ -1727,7 +1781,7 @@ static void prefs_compose_create(void)
        gtk_widget_set_usize (entry_sigsep, 64, -1);
 
         /* Account autoselection */
-       PACK_FRAME(vbox1, frame_autosel, _("Automatic Account Selection"));
+       PACK_FRAME(vbox1, frame_autosel, _("Automatic account selection"));
 
        hbox_autosel = gtk_hbox_new (FALSE, VSPACING_NARROW);
        gtk_widget_show (hbox_autosel);
@@ -1745,15 +1799,65 @@ static void prefs_compose_create(void)
        gtk_widget_show (vbox2);
        gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
 
+       PACK_CHECK_BUTTON (vbox2, checkbtn_default_reply_list,
+                          _("Reply button invokes mailing list reply"));
+
        PACK_CHECK_BUTTON (vbox2, checkbtn_autoextedit,
                           _("Automatically launch the external editor"));
 
-       PACK_VSPACER (vbox2, vbox3, VSPACING_NARROW_2);
+       hbox5 = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox5);
+       gtk_box_pack_start (GTK_BOX (vbox2), hbox5, FALSE, FALSE, 0);
+
+       PACK_CHECK_BUTTON (hbox5, checkbtn_forward_as_attachment,
+                          _("Forward as attachment"));
+
+       PACK_CHECK_BUTTON (hbox5, checkbtn_block_cursor,
+                         _("Block cursor"));
+
+       PACK_CHECK_BUTTON (vbox2, checkbtn_redirect_keep_from,
+                          _("Keep the original 'From' header when redirecting"));
+
+       
+       hbox_autosave = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox_autosave);
+       gtk_box_pack_start (GTK_BOX (vbox1), hbox_autosave, FALSE, FALSE, 0);
+       
+       PACK_CHECK_BUTTON (hbox_autosave, checkbtn_autosave,
+                          _("Autosave to drafts every "));
+
+       entry_autosave_length = gtk_entry_new();
+       gtk_widget_set_usize (entry_autosave_length, 64, -1);   
+       gtk_widget_show (entry_autosave_length);
+       gtk_box_pack_start (GTK_BOX (hbox_autosave), entry_autosave_length, FALSE, FALSE, 0);
+       
+       label_autosave_length = gtk_label_new(_("characters"));
+       gtk_widget_show (label_autosave_length);
+       gtk_box_pack_start (GTK_BOX (hbox_autosave), label_autosave_length, FALSE, FALSE, 0);
+       
+       hbox_undolevel = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox_undolevel);
+       gtk_box_pack_start (GTK_BOX (vbox1), hbox_undolevel, FALSE, FALSE, 0);
+
+       label_undolevel = gtk_label_new (_("Undo level"));
+       gtk_widget_show (label_undolevel);
+       gtk_box_pack_start (GTK_BOX (hbox_undolevel), label_undolevel, FALSE, FALSE, 0);
+
+       spinbtn_undolevel_adj = gtk_adjustment_new (50, 0, 100, 1, 10, 10);
+       spinbtn_undolevel = gtk_spin_button_new
+               (GTK_ADJUSTMENT (spinbtn_undolevel_adj), 1, 0);
+       gtk_widget_show (spinbtn_undolevel);
+       gtk_box_pack_start (GTK_BOX (hbox_undolevel), spinbtn_undolevel, FALSE, FALSE, 0);
+       gtk_widget_set_usize (spinbtn_undolevel, 64, -1);
+       gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_undolevel), TRUE);
 
         /* line-wrapping */
+       PACK_FRAME(vbox1, frame_msgwrap, _("Message wrapping"));
+
        vbox_linewrap = gtk_vbox_new (FALSE, VSPACING_NARROW);
        gtk_widget_show (vbox_linewrap);
-       gtk_box_pack_start (GTK_BOX (vbox1), vbox_linewrap, FALSE, FALSE, 0);
+       gtk_container_add (GTK_CONTAINER (frame_msgwrap), vbox_linewrap);
+       gtk_container_set_border_width (GTK_CONTAINER (vbox_linewrap), 8);
 
        hbox3 = gtk_hbox_new (FALSE, 8);
        gtk_widget_show (hbox3);
@@ -1776,43 +1880,20 @@ static void prefs_compose_create(void)
        gtk_widget_show (label_linewrap);
        gtk_box_pack_start (GTK_BOX (hbox3), label_linewrap, FALSE, FALSE, 0);
 
-       PACK_VSPACER (vbox2, vbox3, VSPACING_NARROW_2);
-
-       hbox4 = gtk_hbox_new (FALSE, 32);
+       hbox4 = gtk_hbox_new (FALSE, VSPACING);
        gtk_widget_show (hbox4);
        gtk_box_pack_start (GTK_BOX (vbox_linewrap), hbox4, FALSE, FALSE, 0);
 
        PACK_CHECK_BUTTON (hbox4, checkbtn_wrapquote, _("Wrap quotation"));
+
+       PACK_CHECK_BUTTON (hbox4, checkbtn_autowrap, _("Wrap on input"));
+
        PACK_CHECK_BUTTON
                (hbox4, checkbtn_wrapatsend, _("Wrap before sending"));
 
-       PACK_CHECK_BUTTON (vbox1, checkbtn_forward_as_attachment,
-                          _("Forward as attachment"));
-
-       PACK_CHECK_BUTTON (vbox1, checkbtn_smart_wrapping,
+       PACK_CHECK_BUTTON (vbox_linewrap, checkbtn_smart_wrapping,
                           _("Smart wrapping (EXPERIMENTAL)"));
        
-       PACK_CHECK_BUTTON (vbox1, checkbtn_block_cursor,
-                         _("Block cursor"));
-
-       PACK_VSPACER (vbox2, vbox3, VSPACING_NARROW_2);
-
-       hbox_undolevel = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox3);
-       gtk_box_pack_start (GTK_BOX (vbox1), hbox_undolevel, FALSE, FALSE, 0);
-
-       label_undolevel = gtk_label_new (_("Undo level"));
-       gtk_widget_show (label_undolevel);
-       gtk_box_pack_start (GTK_BOX (hbox_undolevel), label_undolevel, FALSE, FALSE, 0);
-
-       spinbtn_undolevel_adj = gtk_adjustment_new (50, 0, 100, 1, 10, 10);
-       spinbtn_undolevel = gtk_spin_button_new
-               (GTK_ADJUSTMENT (spinbtn_undolevel_adj), 1, 0);
-       gtk_widget_show (spinbtn_undolevel);
-       gtk_box_pack_start (GTK_BOX (hbox_undolevel), spinbtn_undolevel, FALSE, FALSE, 0);
-       gtk_widget_set_usize (spinbtn_undolevel, 64, -1);
-       gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_undolevel), TRUE);
-
        /*
        compose.checkbtn_quote   = checkbtn_quote;
        compose.entry_quotemark  = entry_quotemark;
@@ -1830,18 +1911,24 @@ static void prefs_compose_create(void)
        compose.spinbtn_undolevel     = spinbtn_undolevel;
        compose.spinbtn_undolevel_adj = spinbtn_undolevel_adj;
 
-       compose.spinbtn_linewrap     = spinbtn_linewrap;
-       compose.spinbtn_linewrap_adj = spinbtn_linewrap_adj;
-       compose.checkbtn_wrapquote   = checkbtn_wrapquote;
-       compose.checkbtn_wrapatsend  = checkbtn_wrapatsend;
+       compose.spinbtn_linewrap      = spinbtn_linewrap;
+       compose.spinbtn_linewrap_adj  = spinbtn_linewrap_adj;
+       compose.checkbtn_wrapquote    = checkbtn_wrapquote;
+       compose.checkbtn_autowrap     = checkbtn_autowrap;
+       compose.checkbtn_wrapatsend   = checkbtn_wrapatsend;
 
+       compose.checkbtn_autosave     = checkbtn_autosave;
+       compose.entry_autosave_length = entry_autosave_length;
+       
        compose.checkbtn_forward_as_attachment =
                checkbtn_forward_as_attachment;
+       compose.checkbtn_redirect_keep_from =
+               checkbtn_redirect_keep_from;
        compose.checkbtn_smart_wrapping = 
                checkbtn_smart_wrapping;
        compose.checkbtn_block_cursor   =
                checkbtn_block_cursor;
-
+       compose.checkbtn_default_reply_list = checkbtn_default_reply_list;
 }
 
 static void prefs_quote_create(void)
@@ -1859,6 +1946,9 @@ static void prefs_quote_create(void)
        GtkWidget *entry_fw_quotemark;
        GtkWidget *text_fw_quotefmt;
 
+       GtkWidget *entry_quote_chars;
+       GtkWidget *label_quote_chars;
+       
        GtkWidget *btn_quotedesc;
 
        GtkWidget *checkbtn_reply_with_quote;
@@ -1961,11 +2051,40 @@ static void prefs_quote_create(void)
        gtk_signal_connect(GTK_OBJECT(btn_quotedesc), "clicked",
                           GTK_SIGNAL_FUNC(quote_fmt_quote_description), NULL);
 
+       /* quote chars */
+
+       PACK_FRAME (vbox1, frame_quote, _("Quoting characters"));
+
+       vbox_quote = gtk_vbox_new (FALSE, VSPACING_NARROW);
+       gtk_widget_show (vbox_quote);
+       gtk_container_add (GTK_CONTAINER (frame_quote), vbox_quote);
+       gtk_container_set_border_width (GTK_CONTAINER (vbox_quote), 8);
+
+       hbox1 = gtk_hbox_new (FALSE, 32);
+       gtk_widget_show (hbox1);
+       gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, FALSE, FALSE, 0);
+
+       hbox2 = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox2);
+       gtk_box_pack_start (GTK_BOX (hbox1), hbox2, FALSE, FALSE, 0);
+
+       label_quote_chars = gtk_label_new (_("Treat these characters as quotation marks: "));
+       gtk_widget_show (label_quote_chars);
+       gtk_box_pack_start (GTK_BOX (hbox2), label_quote_chars, FALSE, FALSE, 0);
+
+       entry_quote_chars = gtk_entry_new ();
+       gtk_widget_show (entry_quote_chars);
+       gtk_box_pack_start (GTK_BOX (hbox2), entry_quote_chars,
+                           FALSE, FALSE, 0);
+       gtk_widget_set_usize (entry_quote_chars, 64, -1);
+
+
        compose.checkbtn_reply_with_quote= checkbtn_reply_with_quote;
        quote.entry_quotemark    = entry_quotemark;
        quote.text_quotefmt      = text_quotefmt;
        quote.entry_fw_quotemark = entry_fw_quotemark;
        quote.text_fw_quotefmt   = text_fw_quotefmt;
+       quote.entry_quote_chars  = entry_quote_chars;
 }
 
 static void prefs_display_create(void)
@@ -1976,8 +2095,13 @@ static void prefs_display_create(void)
        GtkWidget *label_textfont;
        GtkWidget *entry_textfont;
        GtkWidget *button_textfont;
-       GtkWidget *chkbtn_folder_unread;
+       GtkWidget *chkbtn_display_img;
        GtkWidget *chkbtn_transhdr;
+       GtkWidget *chkbtn_folder_unread;
+       GtkWidget *hbox1;
+       GtkWidget *label_ng_abbrev;
+       GtkWidget *spinbtn_ng_abbrev_len;
+       GtkObject *spinbtn_ng_abbrev_len_adj;
        GtkWidget *frame_summary;
        GtkWidget *vbox2;
        GtkWidget *chkbtn_swapfrom;
@@ -1986,7 +2110,6 @@ static void prefs_display_create(void)
        GtkWidget *chkbtn_expand_thread;
        GtkWidget *chkbtn_bold_unread;
        GtkWidget *vbox3;
-       GtkWidget *hbox1;
        GtkWidget *label_datefmt;
        GtkWidget *button_datefmt;
        GtkWidget *entry_datefmt;
@@ -2095,6 +2218,35 @@ static void prefs_display_create(void)
        PACK_CHECK_BUTTON (vbox2, chkbtn_folder_unread,
                           _("Display unread number next to folder name"));
 
+       PACK_CHECK_BUTTON (vbox2, chkbtn_display_img,
+                          _("Automatically display images"));
+
+       PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
+
+       hbox1 = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox1);
+       gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
+
+       label_ng_abbrev = gtk_label_new
+               (_("Abbreviate newsgroups longer than"));
+       gtk_widget_show (label_ng_abbrev);
+       gtk_box_pack_start (GTK_BOX (hbox1), label_ng_abbrev, FALSE, FALSE, 0);
+
+       spinbtn_ng_abbrev_len_adj = gtk_adjustment_new (16, 0, 999, 1, 10, 10);
+       spinbtn_ng_abbrev_len = gtk_spin_button_new
+               (GTK_ADJUSTMENT (spinbtn_ng_abbrev_len_adj), 1, 0);
+       gtk_widget_show (spinbtn_ng_abbrev_len);
+       gtk_box_pack_start (GTK_BOX (hbox1), spinbtn_ng_abbrev_len,
+                           FALSE, FALSE, 0);
+       gtk_widget_set_usize (spinbtn_ng_abbrev_len, 56, -1);
+       gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_ng_abbrev_len),
+                                    TRUE);
+
+       label_ng_abbrev = gtk_label_new
+               (_("letters"));
+       gtk_widget_show (label_ng_abbrev);
+       gtk_box_pack_start (GTK_BOX (hbox1), label_ng_abbrev, FALSE, FALSE, 0);
+
        /* ---- Summary ---- */
 
        PACK_FRAME(vbox1, frame_summary, _("Summary View"));
@@ -2146,7 +2298,7 @@ static void prefs_display_create(void)
        gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
 
        button_dispitem = gtk_button_new_with_label
-               (_(" Set display item of summary... "));
+               (_(" Set displayed items of summary... "));
        gtk_widget_show (button_dispitem);
        gtk_box_pack_start (GTK_BOX (hbox1), button_dispitem, FALSE, TRUE, 0);
        gtk_signal_connect (GTK_OBJECT (button_dispitem), "clicked",
@@ -2156,8 +2308,11 @@ static void prefs_display_create(void)
        display.entry_textfont  = entry_textfont;
        display.button_textfont = button_textfont;
 
-       display.chkbtn_folder_unread = chkbtn_folder_unread;
-       display.chkbtn_transhdr   = chkbtn_transhdr;
+       display.chkbtn_display_img   = chkbtn_display_img;
+       display.chkbtn_transhdr           = chkbtn_transhdr;
+       display.chkbtn_folder_unread      = chkbtn_folder_unread;
+       display.spinbtn_ng_abbrev_len     = spinbtn_ng_abbrev_len;
+       display.spinbtn_ng_abbrev_len_adj = spinbtn_ng_abbrev_len_adj;
 
        display.chkbtn_swapfrom      = chkbtn_swapfrom;
        display.chkbtn_hscrollbar    = chkbtn_hscrollbar;
@@ -2333,15 +2488,17 @@ static void prefs_privacy_create(void)
 {
        GtkWidget *vbox1;
        GtkWidget *vbox2;
+       GtkWidget *vbox3;
        GtkWidget *hbox1;
+       GtkWidget *hbox_spc;
+       GtkWidget *label;
        GtkWidget *checkbtn_auto_check_signatures;
        GtkWidget *checkbtn_gpg_signature_popup;
+       GtkWidget *checkbtn_store_passphrase;
+       GtkObject *spinbtn_store_passphrase_adj;
+       GtkWidget *spinbtn_store_passphrase;
        GtkWidget *checkbtn_passphrase_grab;
        GtkWidget *checkbtn_gpg_warning;
-       GtkWidget *label;
-       GtkWidget *menuitem;
-       GtkWidget *optmenu;
-       GtkWidget *optmenu_menu;
 
        vbox1 = gtk_vbox_new (FALSE, VSPACING);
        gtk_widget_show (vbox1);
@@ -2358,87 +2515,78 @@ static void prefs_privacy_create(void)
        PACK_CHECK_BUTTON (vbox2, checkbtn_gpg_signature_popup,
                           _("Show signature check result in a popup window"));
 
-#ifndef __MINGW32__
-       PACK_CHECK_BUTTON (vbox2, checkbtn_passphrase_grab,
-                          _("Grab input while entering a passphrase"));
-#endif
+       PACK_CHECK_BUTTON (vbox2, checkbtn_store_passphrase,
+                          _("Store passphrase in memory temporarily"));
 
-       PACK_CHECK_BUTTON
-               (vbox2, checkbtn_gpg_warning,
-                _("Display warning on startup if GnuPG doesn't work"));
+       vbox3 = gtk_vbox_new (FALSE, 0);
+       gtk_widget_show (vbox3);
+       gtk_box_pack_start (GTK_BOX (vbox2), vbox3, FALSE, FALSE, 0);
 
        hbox1 = gtk_hbox_new (FALSE, 8);
        gtk_widget_show (hbox1);
-       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (vbox3), hbox1, FALSE, FALSE, 0);
+
+       hbox_spc = gtk_hbox_new (FALSE, 0);
+       gtk_widget_show (hbox_spc);
+       gtk_box_pack_start (GTK_BOX (hbox1), hbox_spc, FALSE, FALSE, 0);
+       gtk_widget_set_usize (hbox_spc, 12, -1);
 
-       /* create default signkey box */
-       label = gtk_label_new (_("Default Sign Key"));
+       label = gtk_label_new (_("Expire after"));
        gtk_widget_show (label);
        gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
-       optmenu = gtk_option_menu_new ();
-       gtk_widget_show (optmenu);
-       gtk_box_pack_start(GTK_BOX (hbox1), optmenu, FALSE, FALSE, 0);
-       optmenu_menu = gtk_menu_new ();
-
-       MENUITEM_ADD(optmenu_menu, menuitem, "Default Key", "def_key");
-       MENUITEM_ADD(optmenu_menu, menuitem, "Second Key", "2nd_key");
-       gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu), optmenu_menu);
-       /* FIXME: disabled because not implemented */
-       gtk_widget_set_sensitive(optmenu, FALSE);
 
-       privacy.checkbtn_auto_check_signatures
-                                        = checkbtn_auto_check_signatures;
-       privacy.checkbtn_gpg_signature_popup
-                                        = checkbtn_gpg_signature_popup;
-       privacy.checkbtn_passphrase_grab = checkbtn_passphrase_grab;
-       privacy.checkbtn_gpg_warning     = checkbtn_gpg_warning;
-       privacy.optmenu_default_signkey  = optmenu;
-}
+       spinbtn_store_passphrase_adj = gtk_adjustment_new (0, 0, 1440, 1, 5, 5);
+       spinbtn_store_passphrase = gtk_spin_button_new
+               (GTK_ADJUSTMENT (spinbtn_store_passphrase_adj), 1, 0);
+       gtk_widget_show (spinbtn_store_passphrase);
+       gtk_box_pack_start (GTK_BOX (hbox1), spinbtn_store_passphrase, FALSE, FALSE, 0);
+       gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_store_passphrase),
+                                    TRUE);
+       gtk_widget_set_usize (spinbtn_store_passphrase, 64, -1);
 
-static void
-prefs_common_default_signkey_set_data_from_optmenu(PrefParam *pparam)
-{
-#if 0
-       GtkWidget *menu;
-       GtkWidget *menuitem;
-       gchar *charset;
+       label = gtk_label_new (_("minute(s) "));
+       gtk_widget_show (label);
+       gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
 
-       menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
-       menuitem = gtk_menu_get_active(GTK_MENU(menu));
-       charset = gtk_object_get_user_data(GTK_OBJECT(menuitem));
-       g_free(*((gchar **)pparam->data));
-       *((gchar **)pparam->data) = g_strdup(charset);
-#endif
-}
+       hbox1 = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox1);
+       gtk_box_pack_start (GTK_BOX (vbox3), hbox1, FALSE, FALSE, 0);
 
-static void prefs_common_default_signkey_set_optmenu(PrefParam *pparam)
-{
-#if 0
-       GList *cur;
-       GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
-       GtkWidget *menu;
-       GtkWidget *menuitem;
-       gchar *charset;
-       gint n = 0;
+       hbox_spc = gtk_hbox_new (FALSE, 0);
+       gtk_widget_show (hbox_spc);
+       gtk_box_pack_start (GTK_BOX (hbox1), hbox_spc, FALSE, FALSE, 0);
+       gtk_widget_set_usize (hbox_spc, 12, -1);
 
-       g_return_if_fail(optmenu != NULL);
-       g_return_if_fail(*((gchar **)pparam->data) != NULL);
+       label = gtk_label_new (_("(Setting to '0' will store the passphrase\n"
+                                " for the whole session)"));
+       gtk_widget_show (label);
+       gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
+       gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
 
-       menu = gtk_option_menu_get_menu(optmenu);
-       for (cur = GTK_MENU_SHELL(menu)->children;
-            cur != NULL; cur = cur->next) {
-               menuitem = GTK_WIDGET(cur->data);
-               charset = gtk_object_get_user_data(GTK_OBJECT(menuitem));
-               if (!strcmp(charset, *((gchar **)pparam->data))) {
-                       gtk_option_menu_set_history(optmenu, n);
-                       return;
-               }
-               n++;
-       }
+       SET_TOGGLE_SENSITIVITY (checkbtn_store_passphrase, vbox3);
 
-       gtk_option_menu_set_history(optmenu, 0);
-       prefs_common_charset_set_data_from_optmenu(pparam);
+#ifndef __MINGW32__
+       PACK_CHECK_BUTTON (vbox2, checkbtn_passphrase_grab,
+                          _("Grab input while entering a passphrase"));
 #endif
+
+       PACK_CHECK_BUTTON
+               (vbox2, checkbtn_gpg_warning,
+                _("Display warning on startup if GnuPG doesn't work"));
+
+       hbox1 = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox1);
+       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
+
+       privacy.checkbtn_auto_check_signatures
+                                            = checkbtn_auto_check_signatures;
+       privacy.checkbtn_gpg_signature_popup
+                                            = checkbtn_gpg_signature_popup;
+       privacy.checkbtn_store_passphrase    = checkbtn_store_passphrase;
+       privacy.spinbtn_store_passphrase     = spinbtn_store_passphrase;
+       privacy.spinbtn_store_passphrase_adj = spinbtn_store_passphrase_adj;
+       privacy.checkbtn_passphrase_grab     = checkbtn_passphrase_grab;
+       privacy.checkbtn_gpg_warning         = checkbtn_gpg_warning;
 }
 #endif /* USE_GPGME */
 
@@ -2448,14 +2596,20 @@ static void prefs_interface_create(void)
        GtkWidget *vbox2;
        GtkWidget *vbox3;
        /* GtkWidget *checkbtn_emacs; */
+       GtkWidget *checkbtn_show_msg_with_cursor;
        GtkWidget *checkbtn_openunread;
+       GtkWidget *checkbtn_mark_as_read_on_newwin;
        GtkWidget *checkbtn_openinbox;
        GtkWidget *checkbtn_immedexec;
        GtkWidget *hbox1;
        GtkWidget *label;
+       GtkWidget *dialogs_table;
        GtkWidget *optmenu_recvdialog;
+       GtkWidget *optmenu_senddialog;
        GtkWidget *menu;
        GtkWidget *menuitem;
+       GtkWidget *checkbtn_no_recv_err_panel;
+       GtkWidget *checkbtn_close_recv_dialog;
 
        GtkWidget *frame_addr;
        GtkWidget *vbox_addr;
@@ -2489,10 +2643,18 @@ static void prefs_interface_create(void)
        gtk_label_set_justify (GTK_LABEL (GTK_BIN (checkbtn_emacs)->child),
                               GTK_JUSTIFY_LEFT);   */
 
+       PACK_CHECK_BUTTON
+               (vbox2, checkbtn_show_msg_with_cursor,
+                _("Open message when cursor keys are pressed on summary"));
+
        PACK_CHECK_BUTTON
                (vbox2, checkbtn_openunread,
                 _("Open first unread message when entering a folder"));
 
+       PACK_CHECK_BUTTON
+               (vbox2, checkbtn_mark_as_read_on_newwin,
+                _("Only mark message as read when opened in new window"));
+
        PACK_CHECK_BUTTON
                (vbox2, checkbtn_openinbox,
                 _("Go to inbox after receiving new mail"));
@@ -2518,18 +2680,41 @@ static void prefs_interface_create(void)
 
        PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW);
 
-       hbox1 = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox1);
-       gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0);
+       dialogs_table = gtk_table_new (2, 2, FALSE);
+       gtk_widget_show (dialogs_table);
+       gtk_container_add (GTK_CONTAINER (vbox2), dialogs_table);
+       gtk_container_set_border_width (GTK_CONTAINER (dialogs_table), 8);
+       gtk_table_set_row_spacings (GTK_TABLE (dialogs_table), VSPACING_NARROW);
+       gtk_table_set_col_spacings (GTK_TABLE (dialogs_table), 8);
+
+       label = gtk_label_new (_("Show send dialog"));
+       gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+       gtk_widget_show (label);
+       gtk_table_attach (GTK_TABLE (dialogs_table), label, 0, 1, 0, 1,
+                         GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
+
+
+       optmenu_senddialog = gtk_option_menu_new ();
+       gtk_widget_show (optmenu_senddialog);
+       gtk_table_attach (GTK_TABLE (dialogs_table), optmenu_senddialog, 1, 2, 0, 1,
+                         GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
+       
+       menu = gtk_menu_new ();
+       MENUITEM_ADD (menu, menuitem, _("Always"), SEND_DIALOG_ALWAYS);
+       MENUITEM_ADD (menu, menuitem, _("Never"), SEND_DIALOG_NEVER);
+
+       gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_senddialog), menu);
 
        label = gtk_label_new (_("Show receive dialog"));
+       gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
        gtk_widget_show (label);
-       gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
+       gtk_table_attach (GTK_TABLE (dialogs_table), label, 0, 1, 1, 2,
+                         GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
 
        optmenu_recvdialog = gtk_option_menu_new ();
        gtk_widget_show (optmenu_recvdialog);
-       gtk_box_pack_start (GTK_BOX (hbox1), optmenu_recvdialog,
-                           FALSE, FALSE, 0);
+       gtk_table_attach (GTK_TABLE (dialogs_table), optmenu_recvdialog, 1, 2, 1, 2,
+                         GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
 
        menu = gtk_menu_new ();
        MENUITEM_ADD (menu, menuitem, _("Always"), RECV_DIALOG_ALWAYS);
@@ -2539,6 +2724,12 @@ static void prefs_interface_create(void)
 
        gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_recvdialog), menu);
 
+       PACK_CHECK_BUTTON (vbox2, checkbtn_no_recv_err_panel,
+                          _("Don't popup error dialog on receive error"));
+
+       PACK_CHECK_BUTTON (vbox2, checkbtn_close_recv_dialog,
+                          _("Close receive dialog when finished"));
+
        PACK_FRAME (vbox1, frame_addr, _("Address book"));
 
        vbox_addr = gtk_vbox_new (FALSE, 0);
@@ -2607,7 +2798,7 @@ static void prefs_interface_create(void)
        gtk_signal_connect (GTK_OBJECT (button_keybind), "clicked",
                            GTK_SIGNAL_FUNC (prefs_keybind_select), NULL);
 
-       PACK_FRAME(vbox1, frame_pixmap_theme, "Pixmap theme");
+       PACK_FRAME(vbox1, frame_pixmap_theme, _("Icon theme"));
        
        vbox_pixmap_theme = gtk_vbox_new(FALSE, 0);
        gtk_widget_show(vbox_pixmap_theme);
@@ -2625,14 +2816,21 @@ static void prefs_interface_create(void)
        stock_pixmap_themes_list_free(avail_pixmap_themes);
 
        /* interface.checkbtn_emacs          = checkbtn_emacs; */
+       interface.checkbtn_show_msg_with_cursor
+                                             = checkbtn_show_msg_with_cursor;
        interface.checkbtn_openunread         = checkbtn_openunread;
+       interface.checkbtn_mark_as_read_on_newwin
+                                             = checkbtn_mark_as_read_on_newwin;
        interface.checkbtn_openinbox          = checkbtn_openinbox;
        interface.checkbtn_immedexec          = checkbtn_immedexec;
        interface.optmenu_recvdialog          = optmenu_recvdialog;
+       interface.optmenu_senddialog          = optmenu_senddialog;
+       interface.checkbtn_no_recv_err_panel  = checkbtn_no_recv_err_panel;
+       interface.checkbtn_close_recv_dialog  = checkbtn_close_recv_dialog;
        interface.checkbtn_addaddrbyclick     = checkbtn_addaddrbyclick;
        interface.optmenu_nextunreadmsgdialog = optmenu_nextunreadmsgdialog;
-       interface.combo_pixmap_theme            = combo_pixmap_theme;
-       interface.entry_pixmap_theme            = entry_pixmap_theme;
+       interface.combo_pixmap_theme          = combo_pixmap_theme;
+       interface.entry_pixmap_theme          = entry_pixmap_theme;
 }
 
 static void prefs_other_create(void)
@@ -2653,6 +2851,13 @@ static void prefs_other_create(void)
        GtkWidget *exteditor_combo;
        GtkWidget *exteditor_entry;
 
+       GtkWidget *frame_cliplog;
+       GtkWidget *vbox_cliplog;
+       GtkWidget *hbox_cliplog;
+       GtkWidget *checkbtn_cliplog;
+       GtkWidget *loglength_label;
+       GtkWidget *loglength_entry;
+
        GtkWidget *frame_exit;
        GtkWidget *vbox_exit;
        GtkWidget *checkbtn_confonexit;
@@ -2686,11 +2891,13 @@ static void prefs_other_create(void)
        gtk_table_attach (GTK_TABLE (ext_table), uri_combo, 1, 2, 0, 1,
                          GTK_EXPAND | GTK_FILL, 0, 0, 0);
        gtkut_combo_set_items (GTK_COMBO (uri_combo),
+                              "galeon '%s'",
+                              "mozilla -remote 'openurl(%s,new-window)'",
                               "netscape -remote 'openURL(%s,raise)'",
                               "netscape '%s'",
                               "gnome-moz-remote --raise --newwin '%s'",
-                              "kfmclient openProfile webbrowsing '%s'",
-                              "opera -newwindow '%s'",        
+                              "kfmclient openURL '%s'",
+                              "opera -newwindow '%s'",
                               "kterm -e w3m '%s'",
                               "kterm -e lynx '%s'",
                               NULL);
@@ -2728,6 +2935,33 @@ static void prefs_other_create(void)
                               NULL);
        exteditor_entry = GTK_COMBO (exteditor_combo)->entry;
 
+       /* Clip Log */
+       PACK_FRAME (vbox1, frame_cliplog, _("Log Size"));
+
+       vbox_cliplog = gtk_vbox_new (FALSE, 0);
+       gtk_widget_show (vbox_cliplog);
+       gtk_container_add (GTK_CONTAINER (frame_cliplog), vbox_cliplog);
+       gtk_container_set_border_width (GTK_CONTAINER (vbox_cliplog), 8);
+       PACK_CHECK_BUTTON (vbox_cliplog, checkbtn_cliplog,
+                          _("Clip the log size"));
+       hbox_cliplog = gtk_hbox_new (FALSE, 3);
+       gtk_container_add (GTK_CONTAINER (vbox_cliplog), hbox_cliplog);
+       gtk_widget_show (hbox_cliplog);
+       
+       loglength_label = gtk_label_new (_("Log window length"));
+       gtk_box_pack_start (GTK_BOX (hbox_cliplog), loglength_label,
+                           FALSE, TRUE, 0);
+       gtk_widget_show (GTK_WIDGET (loglength_label));
+       loglength_entry = gtk_entry_new ();
+       gtk_widget_set_usize (GTK_WIDGET (loglength_entry), 64, -1);
+       gtk_box_pack_start (GTK_BOX (hbox_cliplog), loglength_entry,
+                           FALSE, TRUE, 0);
+       gtk_widget_show (GTK_WIDGET (loglength_entry));
+       loglength_label = gtk_label_new (_("(0 to stop logging in the log window)"));
+       gtk_box_pack_start (GTK_BOX (hbox_cliplog), loglength_label,
+                           FALSE, TRUE, 0);
+       SET_TOGGLE_SENSITIVITY(checkbtn_cliplog, loglength_entry);
+
        /* On Exit */
        PACK_FRAME (vbox1, frame_exit, _("On exit"));
 
@@ -2759,6 +2993,9 @@ static void prefs_other_create(void)
        other.exteditor_combo = exteditor_combo;
        other.exteditor_entry = exteditor_entry;
 
+       other.checkbtn_cliplog     = checkbtn_cliplog;
+       other.loglength_entry      = loglength_entry;
+
        other.checkbtn_confonexit  = checkbtn_confonexit;
        other.checkbtn_cleanonexit = checkbtn_cleanonexit;
        other.checkbtn_askonclean  = checkbtn_askonclean;
@@ -2828,6 +3065,7 @@ static void date_format_entry_on_change(GtkEditable *editable,
        text = gtk_editable_get_chars(editable, 0, -1);
        if (text)
                strftime(buffer, sizeof buffer, text, cal_time); 
+       g_free(text);
        gtk_label_set_text(example, buffer);
 }
 
@@ -3076,6 +3314,7 @@ static void prefs_quote_colors_dialog_create(void)
        GtkWidget *quotelevel2_label;
        GtkWidget *quotelevel3_label;
        GtkWidget *uri_label;
+       GtkWidget *signature_label;
        GtkWidget *tgt_folder_label;
        GtkWidget *hbbox;
        GtkWidget *ok_btn;
@@ -3094,7 +3333,7 @@ static void prefs_quote_colors_dialog_create(void)
        gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
        PACK_FRAME(vbox, frame_colors, _("Colors"));
 
-       table = gtk_table_new (4, 2, FALSE);
+       table = gtk_table_new (5, 2, FALSE);
        gtk_container_add (GTK_CONTAINER (frame_colors), table);
        gtk_container_set_border_width (GTK_CONTAINER (table), 8);
        gtk_table_set_row_spacings (GTK_TABLE (table), 2);
@@ -3133,6 +3372,12 @@ static void prefs_quote_colors_dialog_create(void)
        gtk_widget_set_usize (color_buttons.tgt_folder_btn, 40, 30);
        gtk_container_set_border_width (GTK_CONTAINER (color_buttons.tgt_folder_btn), 5);
 
+       color_buttons.signature_btn = gtk_button_new_with_label ("");
+       gtk_table_attach (GTK_TABLE (table), color_buttons.signature_btn,
+                         0, 1, 5, 6, 0, 0, 0, 0);
+       gtk_widget_set_usize (color_buttons.signature_btn, 40, 30);
+       gtk_container_set_border_width (GTK_CONTAINER (color_buttons.signature_btn), 5);
+
        quotelevel1_label = gtk_label_new (_("Quoted Text - First Level"));
        gtk_table_attach (GTK_TABLE (table), quotelevel1_label, 1, 2, 0, 1,
                          (GTK_EXPAND | GTK_FILL), 0, 0, 0);
@@ -3163,6 +3408,12 @@ static void prefs_quote_colors_dialog_create(void)
        gtk_label_set_justify (GTK_LABEL (tgt_folder_label), GTK_JUSTIFY_LEFT);
        gtk_misc_set_alignment (GTK_MISC (tgt_folder_label), 0, 0.5);
 
+       signature_label = gtk_label_new (_("Signatures"));
+       gtk_table_attach (GTK_TABLE (table), signature_label, 1, 2, 5, 6,
+                         (GTK_EXPAND | GTK_FILL), 0, 0, 0);
+       gtk_label_set_justify (GTK_LABEL (signature_label), GTK_JUSTIFY_LEFT);
+       gtk_misc_set_alignment (GTK_MISC (signature_label), 0, 0.5);
+
        PACK_CHECK_BUTTON (vbox, recycle_colors_btn,
                           _("Recycle quote colors"));
 
@@ -3188,6 +3439,8 @@ static void prefs_quote_colors_dialog_create(void)
                           GTK_SIGNAL_FUNC(quote_color_set_dialog), "URI");
        gtk_signal_connect(GTK_OBJECT(color_buttons.tgt_folder_btn), "clicked",
                           GTK_SIGNAL_FUNC(quote_color_set_dialog), "TGTFLD");
+       gtk_signal_connect(GTK_OBJECT(color_buttons.signature_btn), "clicked",
+                          GTK_SIGNAL_FUNC(quote_color_set_dialog), "SIGNATURE");
        gtk_signal_connect(GTK_OBJECT(recycle_colors_btn), "toggled",
                           GTK_SIGNAL_FUNC(prefs_recycle_colors_toggled), NULL);
        gtk_signal_connect(GTK_OBJECT(ok_btn), "clicked",
@@ -3204,6 +3457,8 @@ static void prefs_quote_colors_dialog_create(void)
                            prefs_common.uri_col);
        set_button_bg_color(color_buttons.tgt_folder_btn,
                            prefs_common.tgt_folder_col);
+       set_button_bg_color(color_buttons.signature_btn,
+                           prefs_common.signature_col);
        gtk_toggle_button_set_active((GtkToggleButton *)recycle_colors_btn,
                                     prefs_common.recycle_quote_colors);
 
@@ -3241,7 +3496,10 @@ static void quote_color_set_dialog(GtkWidget *widget, gpointer data)
        } else if(g_strcasecmp(type, "TGTFLD") == 0) {
                title = _("Pick color for target folder");
                rgbvalue = prefs_common.tgt_folder_col;
-#if USE_PSPELL         
+       } else if(g_strcasecmp(type, "SIGNATURE") == 0) {
+               title = _("Pick color for signatures");
+               rgbvalue = prefs_common.signature_col;
+#if USE_ASPELL         
        } else if(g_strcasecmp(type, "Misspelled word") == 0) {
                title = _("Pick color for misspelled word");
                rgbvalue = prefs_common.misspelled_col;
@@ -3313,7 +3571,10 @@ static void quote_colors_set_dialog_ok(GtkWidget *widget, gpointer data)
                prefs_common.tgt_folder_col = rgbvalue;
                set_button_bg_color(color_buttons.tgt_folder_btn, rgbvalue);
                folderview_set_target_folder_color(prefs_common.tgt_folder_col);
-#if USE_PSPELL         
+       } else if (g_strcasecmp(type, "SIGNATURE") == 0) {
+               prefs_common.signature_col = rgbvalue;
+               set_button_bg_color(color_buttons.signature_btn, rgbvalue);
+#if USE_ASPELL         
        } else if (g_strcasecmp(type, "Misspelled word") == 0) {
                prefs_common.misspelled_col = rgbvalue;
                set_button_bg_color(spelling.misspelled_btn, rgbvalue);
@@ -3557,15 +3818,16 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                "(menu-path \"<Main>/View/Go to/Other folder...\" \"G\")\n"
                "(menu-path \"<Main>/View/Open in new window\" \"<control><alt>N\")\n"
                "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
-               "(menu-path \"<Main>/View/Show all header\" \"<control>H\")\n"
+               "(menu-path \"<Main>/View/Show all headers\" \"<control>H\")\n"
                "(menu-path \"<Main>/View/Update\" \"<control><alt>U\")\n"
 
                "(menu-path \"<Main>/Message/Get new mail\" \"<control>I\")\n"
                "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><control>I\")\n"
                "(menu-path \"<Main>/Message/Compose an email message\" \"<control>M\")\n"
                "(menu-path \"<Main>/Message/Reply\" \"<control>R\")\n"
-               "(menu-path \"<Main>/Message/Reply to sender\" \"\")\n"
-               "(menu-path \"<Main>/Message/Reply to all\" \"<shift><control>R\")\n"
+               "(menu-path \"<Main>/Message/Reply to/all\" \"<shift><control>R\")\n"
+               "(menu-path \"<Main>/Message/Reply to/sender\" \"\")\n"
+               "(menu-path \"<Main>/Message/Reply to/mailing list\" \"<control>L\")\n"
                "(menu-path \"<Main>/Message/Forward\" \"<control><alt>F\")\n"
                /* "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n" */
                "(menu-path \"<Main>/Message/Move...\" \"<control>O\")\n"
@@ -3576,9 +3838,9 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>exclam\")\n"
                "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
 
-               "(menu-path \"<Main>/Tool/Address book\" \"<shift><control>A\")\n"
-               "(menu-path \"<Main>/Tool/Execute\" \"X\")\n"
-               "(menu-path \"<Main>/Tool/Log window\" \"<control>L\")\n"
+               "(menu-path \"<Main>/Tools/Address book\" \"<shift><control>A\")\n"
+               "(menu-path \"<Main>/Tools/Execute\" \"X\")\n"
+               "(menu-path \"<Main>/Tools/Log window\" \"<shift><control>L\")\n"
 
                "(menu-path \"<Compose>/File/Close\" \"<control>W\")\n"
                "(menu-path \"<Compose>/Edit/Select all\" \"<control>A\")\n"
@@ -3609,15 +3871,16 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                "(menu-path \"<Main>/View/Go to/Other folder...\" \"G\")\n"
                "(menu-path \"<Main>/View/Open in new window\" \"<control><alt>N\")\n"
                "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
-               "(menu-path \"<Main>/View/Show all header\" \"<shift>H\")\n"
+               "(menu-path \"<Main>/View/Show all headers\" \"<shift>H\")\n"
                "(menu-path \"<Main>/View/Update\" \"<shift>S\")\n"
 
                "(menu-path \"<Main>/Message/Get new mail\" \"<control>I\")\n"
                "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><control>I\")\n"
                "(menu-path \"<Main>/Message/Compose an email message\" \"W\")\n"
                "(menu-path \"<Main>/Message/Reply\" \"<control>R\")\n"
-               "(menu-path \"<Main>/Message/Reply to sender\" \"\")\n"
-               "(menu-path \"<Main>/Message/Reply to all\" \"<shift>A\")\n"
+               "(menu-path \"<Main>/Message/Reply to/all\" \"<shift>A\")\n"
+               "(menu-path \"<Main>/Message/Reply to/sender\" \"\")\n"
+               "(menu-path \"<Main>/Message/Reply to/mailing list\" \"<control>L\")\n"
                "(menu-path \"<Main>/Message/Forward\" \"F\")\n"
                /* "(menu-path \"<Main>/Message/Forward as attachment\" \"<shift>F\")\n" */
                "(menu-path \"<Main>/Message/Move...\" \"O\")\n"
@@ -3628,9 +3891,9 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>exclam\")\n"
                "(menu-path \"<Main>/Message/Mark/Mark as read\" \"<shift>R\")\n"
 
-               "(menu-path \"<Main>/Tool/Address book\" \"<shift><control>A\")\n"
-               "(menu-path \"<Main>/Tool/Execute\" \"X\")\n"
-               "(menu-path \"<Main>/Tool/Log window\" \"<control>L\")\n"
+               "(menu-path \"<Main>/Tools/Address book\" \"<shift><control>A\")\n"
+               "(menu-path \"<Main>/Tools/Execute\" \"X\")\n"
+               "(menu-path \"<Main>/Tools/Log window\" \"<shift><control>L\")\n"
 
                "(menu-path \"<Compose>/File/Close\" \"<alt>W\")\n"
                "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
@@ -3660,15 +3923,16 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                "(menu-path \"<Main>/View/Go to/Other folder...\" \"C\")\n"
                "(menu-path \"<Main>/View/Open in new window\" \"<control><alt>N\")\n"
                "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
-               "(menu-path \"<Main>/View/Show all header\" \"<control>H\")\n"
+               "(menu-path \"<Main>/View/Show all headers\" \"<control>H\")\n"
                "(menu-path \"<Main>/View/Update\" \"<control><alt>U\")\n"
 
                "(menu-path \"<Main>/Message/Get new mail\" \"<control>I\")\n"
                "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><control>I\")\n"
                "(menu-path \"<Main>/Message/Compose new message\" \"M\")\n"
                "(menu-path \"<Main>/Message/Reply\" \"R\")\n"
-               "(menu-path \"<Main>/Message/Reply to all\" \"G\")\n"
-               "(menu-path \"<Main>/Message/Reply to sender\" \"\")\n"
+               "(menu-path \"<Main>/Message/Reply to/all\" \"G\")\n"
+               "(menu-path \"<Main>/Message/Reply to/sender\" \"\")\n"
+               "(menu-path \"<Main>/Message/Reply to/mailing list\" \"<control>L\")\n"
                "(menu-path \"<Main>/Message/Forward\" \"F\")\n"
                "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n"
                "(menu-path \"<Main>/Message/Move...\" \"<control>O\")\n"
@@ -3679,9 +3943,9 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>N\")\n"
                "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
 
-               "(menu-path \"<Main>/Tool/Address book\" \"<shift><control>A\")\n"
-               "(menu-path \"<Main>/Tool/Execute\" \"X\")\n"
-               "(menu-path \"<Main>/Tool/Log window\" \"<control>L\")\n"
+               "(menu-path \"<Main>/Tools/Address book\" \"<shift><control>A\")\n"
+               "(menu-path \"<Main>/Tools/Execute\" \"X\")\n"
+               "(menu-path \"<Main>/Tools/Log window\" \"<shift><control>L\")\n"
 
                "(menu-path \"<Compose>/File/Close\" \"<alt>W\")\n"
                "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
@@ -3712,15 +3976,16 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                "(menu-path \"<Main>/View/Go to/Other folder...\" \"<alt>G\")\n"
                "(menu-path \"<Main>/View/Open in new window\" \"<shift><control>N\")\n"
                "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
-               "(menu-path \"<Main>/View/Show all header\" \"<control>H\")\n"
+               "(menu-path \"<Main>/View/Show all headers\" \"<control>H\")\n"
                "(menu-path \"<Main>/View/Update\" \"<alt>U\")\n"
 
                "(menu-path \"<Main>/Message/Get new mail\" \"<alt>I\")\n"
                "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><alt>I\")\n"
                "(menu-path \"<Main>/Message/Compose an email message\" \"<alt>N\")\n"
                "(menu-path \"<Main>/Message/Reply\" \"<alt>R\")\n"
-               "(menu-path \"<Main>/Message/Reply to sender\" \"<control><alt>R\")\n"
-               "(menu-path \"<Main>/Message/Reply to all\" \"<shift><alt>R\")\n"
+               "(menu-path \"<Main>/Message/Reply to/all\" \"<shift><alt>R\")\n"
+               "(menu-path \"<Main>/Message/Reply to/sender\" \"<control><alt>R\")\n"
+               "(menu-path \"<Main>/Message/Reply to/mailing list\" \"<control>L\")\n"
                "(menu-path \"<Main>/Message/Forward\" \"<shift><alt>F\")\n"
                /* "(menu-path \"<Main>/Message/Forward as attachment\" \"<shift><control>F\")\n" */
                "(menu-path \"<Main>/Message/Move...\" \"<alt>O\")\n"
@@ -3731,9 +3996,9 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>exclam\")\n"
                "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
 
-               "(menu-path \"<Main>/Tool/Address book\" \"<alt>A\")\n"
-               "(menu-path \"<Main>/Tool/Execute\" \"<alt>X\")\n"
-               "(menu-path \"<Main>/Tool/Log window\" \"<alt>L\")\n"
+               "(menu-path \"<Main>/Tools/Address book\" \"<alt>A\")\n"
+               "(menu-path \"<Main>/Tools/Execute\" \"<alt>X\")\n"
+               "(menu-path \"<Main>/Tools/Log window\" \"<alt>L\")\n"
 
                "(menu-path \"<Compose>/File/Close\" \"<alt>W\")\n"
                "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
@@ -3764,15 +4029,16 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                "(menu-path \"<Main>/View/Go to/Other folder...\" \"\")\n"
                "(menu-path \"<Main>/View/Open in new window\" \"\")\n"
                "(menu-path \"<Main>/View/View source\" \"\")\n"
-               "(menu-path \"<Main>/View/Show all header\" \"\")\n"
+               "(menu-path \"<Main>/View/Show all headers\" \"\")\n"
                "(menu-path \"<Main>/View/Update\" \"\")\n"
 
                "(menu-path \"<Main>/Message/Get new mail\" \"\")\n"
                "(menu-path \"<Main>/Message/Get from all accounts\" \"\")\n"
                "(menu-path \"<Main>/Message/Compose an email message\" \"\")\n"
                "(menu-path \"<Main>/Message/Reply\" \"\")\n"
-               "(menu-path \"<Main>/Message/Reply to sender\" \"\")\n"
-               "(menu-path \"<Main>/Message/Reply to all\" \"\")\n"
+               "(menu-path \"<Main>/Message/Reply to/all\" \"\")\n"
+               "(menu-path \"<Main>/Message/Reply to/sender\" \"\")\n"
+               "(menu-path \"<Main>/Message/Reply to/mailing list\" \"\")\n"
                "(menu-path \"<Main>/Message/Forward\" \"\")\n"
                /* "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n" */
                "(menu-path \"<Main>/Message/Move...\" \"\")\n"
@@ -3783,9 +4049,9 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"\")\n"
                "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
 
-               "(menu-path \"<Main>/Tool/Address book\" \"\")\n"
-               "(menu-path \"<Main>/Tool/Execute\" \"\")\n"
-               "(menu-path \"<Main>/Tool/Log window\" \"\")\n"
+               "(menu-path \"<Main>/Tools/Address book\" \"\")\n"
+               "(menu-path \"<Main>/Tools/Execute\" \"\")\n"
+               "(menu-path \"<Main>/Tools/Log window\" \"\")\n"
 
                "(menu-path \"<Compose>/File/Close\" \"\")\n"
                "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
@@ -3831,30 +4097,20 @@ static void prefs_common_charset_set_data_from_optmenu(PrefParam *pparam)
 
 static void prefs_common_charset_set_optmenu(PrefParam *pparam)
 {
-       GList *cur;
        GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
-       GtkWidget *menu;
-       GtkWidget *menuitem;
-       gchar *charset;
-       gint n = 0;
+       gint index;
 
        g_return_if_fail(optmenu != NULL);
        g_return_if_fail(*((gchar **)pparam->data) != NULL);
 
-       menu = gtk_option_menu_get_menu(optmenu);
-       for (cur = GTK_MENU_SHELL(menu)->children;
-            cur != NULL; cur = cur->next) {
-               menuitem = GTK_WIDGET(cur->data);
-               charset = gtk_object_get_user_data(GTK_OBJECT(menuitem));
-               if (!strcmp(charset, *((gchar **)pparam->data))) {
-                       gtk_option_menu_set_history(optmenu, n);
-                       return;
-               }
-               n++;
+       index = menu_find_option_menu_index(optmenu, *((gchar **)pparam->data),
+                                           (GCompareFunc)strcmp);
+       if (index >= 0)
+               gtk_option_menu_set_history(optmenu, index);
+       else {
+               gtk_option_menu_set_history(optmenu, 0);
+               prefs_common_charset_set_data_from_optmenu(pparam);
        }
-
-       gtk_option_menu_set_history(optmenu, 0);
-       prefs_common_charset_set_data_from_optmenu(pparam);
 }
 
 static void prefs_common_recv_dialog_set_data_from_optmenu(PrefParam *pparam)
@@ -3886,6 +4142,41 @@ static void prefs_common_recv_dialog_set_optmenu(PrefParam *pparam)
                gtk_option_menu_set_history(optmenu, 2);
                break;
        default:
+               break;
+       }
+
+       menu = gtk_option_menu_get_menu(optmenu);
+       menuitem = gtk_menu_get_active(GTK_MENU(menu));
+       gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
+}
+
+static void prefs_common_send_dialog_set_data_from_optmenu(PrefParam *pparam)
+{
+       GtkWidget *menu;
+       GtkWidget *menuitem;
+
+       menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
+       menuitem = gtk_menu_get_active(GTK_MENU(menu));
+       *((SendDialogMode *)pparam->data) = GPOINTER_TO_INT
+               (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
+}
+
+static void prefs_common_send_dialog_set_optmenu(PrefParam *pparam)
+{
+       SendDialogMode mode = *((SendDialogMode *)pparam->data);
+       GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
+       GtkWidget *menu;
+       GtkWidget *menuitem;
+
+       switch (mode) {
+       case SEND_DIALOG_ALWAYS:
+               gtk_option_menu_set_history(optmenu, 0);
+               break;
+       case SEND_DIALOG_NEVER:
+               gtk_option_menu_set_history(optmenu, 1);
+               break;
+       default:
+               break;
        }
 
        menu = gtk_option_menu_get_menu(optmenu);
@@ -3972,7 +4263,6 @@ static void prefs_nextunreadmsgdialog_set_optmenu(PrefParam *pparam)
        case NEXTUNREADMSGDIALOG_ASSUME_NO:
                gtk_option_menu_set_history(optmenu, 2);
                break;
-       default:
        }
 
        menu = gtk_option_menu_get_menu(optmenu);
@@ -3987,37 +4277,6 @@ static void prefs_common_cancel(void)
 }
 
 
-static struct _ComposePrefs
-{
-       GtkWidget *window;
-
-       GtkWidget *close_btn;
-} composeprefs;
-
-static void compose_prefs_key_pressed(GtkWidget *widget, GdkEventKey *event);
-static gint compose_prefs_delete_event(GtkWidget *widget, GdkEventAny *event);
-static void compose_prefs_close(GtkWidget *widget);
-static void compose_prefs_fmt_create(void);
-
-static void compose_prefs_close(GtkWidget *widget)
-{
-       gtk_widget_hide(composeprefs.window);
-}
-
-static gint compose_prefs_delete_event(GtkWidget *widget, GdkEventAny *event)
-{
-       gtk_widget_hide(composeprefs.window);
-
-       return TRUE;
-}
-
-static void compose_prefs_key_pressed(GtkWidget *widget, GdkEventKey *event)
-{
-       if (event && event->keyval == GDK_Escape) {
-               gtk_widget_hide(composeprefs.window);
-       }
-}
-
 /* static void prefs_recvdialog_set_data_from_optmenu(PrefParam *pparam)
 {
        GtkWidget *menu;