sync with 0.8.1cvs14
[claws.git] / src / prefs_common.c
index 1dbba1d58d44cb140b961897cb7e3e48b744e4a7..971b2d197673710dbc4ec9ad346f897e548f23c5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2001 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2002 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -53,6 +53,8 @@
 #include "folder.h"
 #include "filesel.h"
 #include "folderview.h"
+#include "stock_pixmap.h"
+#include "quote_fmt.h"
 
 #if USE_PSPELL
 #include "gtkspell.h"
@@ -76,10 +78,14 @@ static struct Receive {
        GtkObject *spinbtn_autochk_adj;
 
        GtkWidget *checkbtn_chkonstartup;
-       GtkWidget *checkbtn_noerrorpanel;
        GtkWidget *checkbtn_scan_after_inc;
 
 
+       GtkWidget *checkbtn_newmail_auto;
+       GtkWidget *checkbtn_newmail_manu;
+       GtkWidget *entry_newmail_notify_cmd;
+       GtkWidget *hbox_newmail_notify;
+
        GtkWidget *spinbtn_maxarticle;
        GtkObject *spinbtn_maxarticle_adj;
 } receive;
@@ -93,8 +99,6 @@ static struct Send {
        GtkWidget *checkbtn_queuemsg;
 
        GtkWidget *optmenu_charset;
-       
-       GtkWidget *checkbtn_returnreceipt;
 } send;
 
 static struct Compose {
@@ -107,17 +111,18 @@ 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_forward_as_attachment;
+       GtkWidget *checkbtn_redirect_keep_from;
        GtkWidget *checkbtn_smart_wrapping;
        GtkWidget *checkbtn_block_cursor;
        GtkWidget *checkbtn_reply_with_quote;
@@ -131,6 +136,9 @@ static struct Spelling {
        GtkWidget *btn_pspell_path;
        GtkWidget *optmenu_dictionary;
        GtkWidget *optmenu_sugmode;
+       GtkWidget *misspelled_btn;
+       GtkWidget *checkbtn_use_alternate;
+       GtkWidget *checkbtn_check_while_typing;
 } spelling;
 #endif
 
@@ -140,6 +148,8 @@ static struct Quote {
 
        GtkWidget *entry_fw_quotemark;
        GtkWidget *text_fw_quotefmt;
+       
+       GtkWidget *entry_quote_chars;
 } quote;
 
 static struct Display {
@@ -151,6 +161,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;
 
@@ -159,7 +173,6 @@ static struct Display {
        GtkWidget *chkbtn_useaddrbook;
        GtkWidget *chkbtn_expand_thread;
        GtkWidget *chkbtn_bold_unread;
-
        GtkWidget *entry_datefmt;
 } display;
 
@@ -181,29 +194,28 @@ static struct Message {
 
 #if USE_GPGME
 static struct Privacy {
-       GtkWidget *checkbtn_default_encrypt;
-        GtkWidget *checkbtn_ascii_armored;
-       GtkWidget *checkbtn_default_sign;
        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_openinbox;
        GtkWidget *checkbtn_immedexec;
-       GtkWidget *checkbtn_confonexit;
-       GtkWidget *checkbtn_cleanonexit;
-       GtkWidget *checkbtn_askonclean;
-       GtkWidget *checkbtn_warnqueued;
        GtkWidget *checkbtn_addaddrbyclick;
        GtkWidget *optmenu_recvdialog;
+       GtkWidget *checkbtn_no_recv_err_panel;
        GtkWidget *optmenu_nextunreadmsgdialog;
+       GtkWidget *entry_pixmap_theme;
+       GtkWidget *combo_pixmap_theme;
 } interface;
 
 static struct Other {
@@ -212,6 +224,13 @@ static struct Other {
        GtkWidget *printcmd_entry;
        GtkWidget *exteditor_combo;
        GtkWidget *exteditor_entry;
+       GtkWidget *checkbtn_confonexit;
+       GtkWidget *checkbtn_cleanonexit;
+       GtkWidget *checkbtn_askonclean;
+       GtkWidget *checkbtn_warnqueued;
+        GtkWidget *checkbtn_cliplog;
+        GtkWidget *loglength_entry;
+
 } other;
 
 static struct MessageColorButtons {
@@ -220,10 +239,13 @@ static struct MessageColorButtons {
        GtkWidget *quote_level3_btn;
        GtkWidget *uri_btn;
        GtkWidget *tgt_folder_btn;
-       GtkWidget *misspelled_btn;
 } color_buttons;
 
-static GtkWidget *quote_desc_win;
+static struct KeybindDialog {
+       GtkWidget *window;
+       GtkWidget *combo;
+} keybind;
+
 static GtkWidget *font_sel_win;
 static guint font_sel_conn_id; 
 static GtkWidget *quote_color_win;
@@ -231,13 +253,8 @@ 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);
-static void prefs_common_ascii_armored_warning(GtkWidget* widget, 
-                                              gpointer unused);
-#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_nextunreadmsgdialog_set_data_from_optmenu(PrefParam *pparam);
@@ -286,12 +303,19 @@ 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},
+       {"newmail_notify_manu", "FALSE", &prefs_common.newmail_notify_manu,
+        P_BOOL, &receive.checkbtn_newmail_manu,
+        prefs_set_data_from_toggle, prefs_set_toggle},
+       {"newmail_notify_auto", "FALSE", &prefs_common.newmail_notify_auto,
+       P_BOOL, &receive.checkbtn_newmail_auto,
+        prefs_set_data_from_toggle, prefs_set_toggle},
+       {"newmail_notify_cmd", "", &prefs_common.newmail_notify_cmd, P_STRING,
+        &receive.entry_newmail_notify_cmd,
+        prefs_set_data_from_entry, prefs_set_entry},
        {"max_news_articles", "300", &prefs_common.max_articles, P_INT,
         &receive.spinbtn_maxarticle,
         prefs_set_data_from_spinbtn, prefs_set_spinbtn},
@@ -325,10 +349,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,
@@ -336,24 +369,21 @@ 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,
-        prefs_set_data_from_toggle, prefs_set_toggle},
 #if USE_PSPELL
        {"enable_pspell", "TRUE", &prefs_common.enable_pspell,
         P_BOOL, &spelling.checkbtn_enable_pspell,
         prefs_set_data_from_toggle, prefs_set_toggle},
-       {"pspell_path", "/usr/local/share/pspell/", &prefs_common.pspell_path, 
+       {"pspell_path", PSPELL_PATH, &prefs_common.pspell_path, 
         P_STRING, &spelling.entry_pspell_path, 
         prefs_set_data_from_entry, prefs_set_entry},
        {"dictionary",  "", &prefs_common.dictionary,
@@ -362,6 +392,12 @@ static PrefParam param[] = {
        {"pspell_sugmode",  "1", &prefs_common.pspell_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,
+        P_BOOL, &spelling.checkbtn_use_alternate,
+        prefs_set_data_from_toggle, prefs_set_toggle},
+       {"check_while_typing", "TRUE", &prefs_common.check_while_typing,
+        P_BOOL, &spelling.checkbtn_check_while_typing,
+        prefs_set_data_from_toggle, prefs_set_toggle},
        {"misspelled_color", "16711680", &prefs_common.misspelled_col, P_INT,
         NULL, NULL, NULL},
 #endif
@@ -401,6 +437,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,
@@ -428,12 +466,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,
@@ -454,12 +501,15 @@ 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},
 
+       {"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},
        {"summary_col_show_unread", "TRUE",
@@ -627,15 +677,6 @@ static PrefParam param[] = {
 
 #if USE_GPGME
        /* Privacy */
-       {"default_encrypt", "FALSE", &prefs_common.default_encrypt, P_BOOL,
-        &privacy.checkbtn_default_encrypt,
-        prefs_set_data_from_toggle, prefs_set_toggle},
-       {"ascii_armored", "FALSE", &prefs_common.ascii_armored, P_BOOL,
-        &privacy.checkbtn_ascii_armored,
-        prefs_set_data_from_toggle, prefs_set_toggle},
-       {"default_sign", "FALSE", &prefs_common.default_sign, P_BOOL,
-        &privacy.checkbtn_default_sign,
-        prefs_set_data_from_toggle, prefs_set_toggle},
        {"auto_check_signatures", "TRUE",
         &prefs_common.auto_check_signatures, P_BOOL,
         &privacy.checkbtn_auto_check_signatures,
@@ -644,6 +685,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,
@@ -652,10 +700,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 */
@@ -666,11 +710,14 @@ 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},
-       {"open_inbox_on_inc", "TRUE", &prefs_common.open_inbox_on_inc,
+       {"open_inbox_on_inc", "FALSE", &prefs_common.open_inbox_on_inc,
         P_BOOL, &interface.checkbtn_openinbox,
         prefs_set_data_from_toggle, prefs_set_toggle},
        {"immediate_execution", "TRUE", &prefs_common.immediate_exec, P_BOOL,
@@ -680,6 +727,9 @@ static PrefParam param[] = {
         &interface.optmenu_recvdialog,
         prefs_common_recv_dialog_set_data_from_optmenu,
         prefs_common_recv_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},
        {"nextunreadmsg_dialog", NULL, &prefs_common.next_unread_msg_dialog, P_ENUM,
         &interface.optmenu_nextunreadmsgdialog,
         prefs_nextunreadmsgdialog_set_data_from_optmenu,
@@ -688,22 +738,10 @@ static PrefParam param[] = {
        {"add_address_by_click", "FALSE", &prefs_common.add_address_by_click,
         P_BOOL, &interface.checkbtn_addaddrbyclick,
         prefs_set_data_from_toggle, prefs_set_toggle},
-       {"confirm_on_exit", "TRUE", &prefs_common.confirm_on_exit, P_BOOL,
-        &interface.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,
-        &interface.checkbtn_cleanonexit,
-        prefs_set_data_from_toggle, prefs_set_toggle},
-       {"ask_on_cleaning", "TRUE", &prefs_common.ask_on_clean, P_BOOL,
-        &interface.checkbtn_askonclean,
-        prefs_set_data_from_toggle, prefs_set_toggle},
-       {"warn_queued_on_exit", "TRUE", &prefs_common.warn_queued_on_exit,
-        P_BOOL, &interface.checkbtn_warnqueued,
-        prefs_set_data_from_toggle, prefs_set_toggle},
-
+       {"pixmap_theme_path", DEFAULT_PIXMAP_THEME, 
+        &prefs_common.pixmap_theme_path, P_STRING,
+        &interface.entry_pixmap_theme, prefs_set_data_from_entry, prefs_set_entry},
+       
        /* Other */
        {"uri_open_command", "netscape -remote 'openURL(%s,raise)'",
         &prefs_common.uri_cmd, P_STRING,
@@ -714,10 +752,36 @@ static PrefParam param[] = {
         &prefs_common.ext_editor_cmd, P_STRING,
         &other.exteditor_entry, prefs_set_data_from_entry, prefs_set_entry},
 
+       {"confirm_on_exit", "TRUE", &prefs_common.confirm_on_exit, P_BOOL,
+        &other.checkbtn_confonexit,
+        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},
+       {"ask_on_cleaning", "TRUE", &prefs_common.ask_on_clean, P_BOOL,
+        &other.checkbtn_askonclean,
+        prefs_set_data_from_toggle, prefs_set_toggle},
+       {"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,
         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}
 };
@@ -754,13 +818,8 @@ static void date_format_select_row         (GtkWidget      *date_format_list,
                                                 gint            column,
                                                 GdkEventButton *event,
                                                 GtkWidget      *date_format);
-static GtkWidget *date_format_create           (GtkButton      *button,
-                                                void           *data);
-
-static void prefs_quote_description_create     (void);
-static void prefs_quote_description_key_pressed        (GtkWidget      *widget,
-                                                GdkEventKey    *event,
-                                                gpointer        data);
+static GtkWidget *date_format_create            (GtkButton      *button,
+                                                 void           *data);
 
 static void prefs_quote_colors_dialog          (void);
 static void prefs_quote_colors_dialog_create   (void);
@@ -788,6 +847,16 @@ static void prefs_font_selection_key_pressed       (GtkWidget      *widget,
                                                 gpointer        data);
 static void prefs_font_selection_ok            (GtkButton      *button, GtkEntry *entry);
 
+static void prefs_keybind_select               (void);
+static gint prefs_keybind_deleted              (GtkWidget      *widget,
+                                                GdkEventAny    *event,
+                                                gpointer        data);
+static void prefs_keybind_key_pressed          (GtkWidget      *widget,
+                                                GdkEventKey    *event,
+                                                gpointer        data);
+static void prefs_keybind_cancel               (void);
+static void prefs_keybind_apply_clicked                (GtkWidget      *widget);
+
 static gint prefs_common_deleted       (GtkWidget      *widget,
                                         GdkEventAny    *event,
                                         gpointer        data);
@@ -813,7 +882,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;
@@ -841,7 +910,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;
@@ -890,10 +959,8 @@ static void prefs_common_create(void)
                            GTK_SIGNAL_FUNC(prefs_common_deleted), NULL);
        gtk_signal_connect (GTK_OBJECT(dialog.window), "key_press_event",
                            GTK_SIGNAL_FUNC(prefs_common_key_pressed), NULL);
-       gtk_signal_connect (GTK_OBJECT(dialog.window), "focus_in_event",
-                           GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
-       gtk_signal_connect (GTK_OBJECT(dialog.window), "focus_out_event",
-                           GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
+       MANAGE_WINDOW_SIGNALS_CONNECT(dialog.window);
+
        gtk_signal_connect (GTK_OBJECT(dialog.ok_btn), "clicked",
                            GTK_SIGNAL_FUNC(prefs_common_ok), NULL);
        gtk_signal_connect (GTK_OBJECT(dialog.apply_btn), "clicked",
@@ -955,10 +1022,16 @@ static void prefs_receive_create(void)
        GtkWidget *spinbtn_autochk;
        GtkWidget *label_autochk2;
        GtkWidget *checkbtn_chkonstartup;
-       GtkWidget *checkbtn_noerrorpanel;
        GtkWidget *checkbtn_scan_after_inc;
 
 
+       GtkWidget *frame_newmail;
+       GtkWidget *hbox_newmail_notify;
+       GtkWidget *checkbtn_newmail_auto;
+       GtkWidget *checkbtn_newmail_manu;
+       GtkWidget *entry_newmail_notify_cmd;
+       GtkWidget *label_newmail_notify_cmd;
+
        GtkWidget *frame_news;
        GtkWidget *label_maxarticle;
        GtkWidget *spinbtn_maxarticle;
@@ -1062,12 +1135,54 @@ 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"));
 
+       
+       PACK_FRAME(vbox1, frame_newmail, _("Run command when new mail "
+                                          "arrives"));
+       vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW);
+       gtk_widget_show (vbox2);
+       gtk_container_add (GTK_CONTAINER (frame_newmail), vbox2);
+       gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
+
+       hbox = gtk_hbox_new (TRUE, 8);
+       gtk_widget_show (hbox);
+       PACK_CHECK_BUTTON (hbox, checkbtn_newmail_auto,
+                          _("after autochecking"));
+       PACK_CHECK_BUTTON (hbox, checkbtn_newmail_manu,
+                          _("after manual checking"));
+       gtk_box_pack_start (GTK_BOX(vbox2), hbox, FALSE, FALSE, 0);
+       gtk_signal_connect(GTK_OBJECT(checkbtn_newmail_auto), "toggled",
+                          GTK_SIGNAL_FUNC(prefs_common_recv_dialog_newmail_notify_toggle_cb),
+                          NULL);
+       gtk_signal_connect(GTK_OBJECT(checkbtn_newmail_manu), "toggled",
+                          GTK_SIGNAL_FUNC(prefs_common_recv_dialog_newmail_notify_toggle_cb),
+                          NULL);
+
+       hbox_newmail_notify = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox);
+       gtk_box_pack_start (GTK_BOX (vbox2), hbox_newmail_notify, FALSE, 
+                           FALSE, 0);
+
+       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), 
+                             GTK_JUSTIFY_RIGHT);
+       gtk_widget_show (label_newmail_notify_cmd);
+       gtk_box_pack_start (GTK_BOX (hbox_newmail_notify), 
+                           label_newmail_notify_cmd, FALSE, FALSE, 0);
+
+       entry_newmail_notify_cmd = gtk_entry_new ();
+       gtk_widget_show (entry_newmail_notify_cmd);
+       gtk_box_pack_start (GTK_BOX (hbox_newmail_notify), 
+                           entry_newmail_notify_cmd, TRUE, TRUE, 0);
+
+       gtk_widget_set_sensitive(hbox_newmail_notify, 
+                                prefs_common.newmail_notify_auto || 
+                                prefs_common.newmail_notify_manu);
+
        PACK_FRAME(vbox1, frame_news, _("News"));
 
        hbox = gtk_hbox_new (FALSE, 8);
@@ -1106,10 +1221,14 @@ 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;
 
 
+       receive.checkbtn_newmail_auto  = checkbtn_newmail_auto;
+       receive.checkbtn_newmail_manu  = checkbtn_newmail_manu;
+       receive.hbox_newmail_notify    = hbox_newmail_notify;
+       receive.entry_newmail_notify_cmd = entry_newmail_notify_cmd;
+
        receive.spinbtn_maxarticle     = spinbtn_maxarticle;
        receive.spinbtn_maxarticle_adj = spinbtn_maxarticle_adj;
 }
@@ -1131,7 +1250,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);
@@ -1173,11 +1291,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);
@@ -1203,18 +1319,19 @@ static void prefs_send_create(void)
 #if HAVE_LIBJCONV
        SET_MENUITEM(_("Unicode (UTF-8)"),               CS_UTF_8);
 #endif
-       SET_MENUITEM(_("Western European (ISO-8859-1)"), CS_ISO_8859_1);
-       SET_MENUITEM(_("Central European (ISO-8859-2)"), CS_ISO_8859_2);
-       SET_MENUITEM(_("Baltic (ISO-8859-13)"),          CS_ISO_8859_13);
-       SET_MENUITEM(_("Baltic (ISO-8859-4)"),           CS_ISO_8859_4);
-       SET_MENUITEM(_("Greek (ISO-8859-7)"),            CS_ISO_8859_7);
-       SET_MENUITEM(_("Turkish (ISO-8859-9)"),          CS_ISO_8859_9);
+       SET_MENUITEM(_("Western European (ISO-8859-1)"),  CS_ISO_8859_1);
+       SET_MENUITEM(_("Western European (ISO-8859-15)"), CS_ISO_8859_15);
+       SET_MENUITEM(_("Central European (ISO-8859-2)"),  CS_ISO_8859_2);
+       SET_MENUITEM(_("Baltic (ISO-8859-13)"),           CS_ISO_8859_13);
+       SET_MENUITEM(_("Baltic (ISO-8859-4)"),            CS_ISO_8859_4);
+       SET_MENUITEM(_("Greek (ISO-8859-7)"),             CS_ISO_8859_7);
+       SET_MENUITEM(_("Turkish (ISO-8859-9)"),           CS_ISO_8859_9);
 #if HAVE_LIBJCONV
-       SET_MENUITEM(_("Cyrillic (ISO-8859-5)"),         CS_ISO_8859_5);
+       SET_MENUITEM(_("Cyrillic (ISO-8859-5)"),          CS_ISO_8859_5);
 #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);
@@ -1252,28 +1369,38 @@ static void prefs_send_create(void)
 
        send.checkbtn_savemsg  = checkbtn_savemsg;
        send.checkbtn_queuemsg = checkbtn_queuemsg;
-       send.checkbtn_returnreceipt = checkbtn_returnreceipt;
 
        send.optmenu_charset = optmenu;
 }
 
+static void prefs_common_recv_dialog_newmail_notify_toggle_cb(GtkWidget *w, gpointer data)
+{
+       gboolean toggled;
+
+       toggled = gtk_toggle_button_get_active
+                       (GTK_TOGGLE_BUTTON(receive.checkbtn_newmail_manu)) ||
+                 gtk_toggle_button_get_active
+                       (GTK_TOGGLE_BUTTON(receive.checkbtn_newmail_auto));
+       gtk_widget_set_sensitive(receive.hbox_newmail_notify, toggled);
+}
+
 #if USE_PSPELL
 static void prefs_dictionary_set_data_from_optmenu(PrefParam *param)
 {
        gchar *str;
-       gchar *dict_name;
+       gchar *dict_fullname;
        
        g_return_if_fail(param);
        g_return_if_fail(param->data);
        g_return_if_fail(param->widget);
        g_return_if_fail(*(param->widget));
 
-       dict_name = gtkpspell_get_dictionary_menu_active_item
+       dict_fullname = gtkpspell_get_dictionary_menu_active_item
                (gtk_option_menu_get_menu(GTK_OPTION_MENU(*(param->widget))));
        str = *((gchar **) param->data);
        if (str)
                g_free(str);
-       *((gchar **) param->data) = dict_name;
+       *((gchar **) param->data) = dict_fullname;
 }
 
 static void prefs_dictionary_set_optmenu(PrefParam *pparam)
@@ -1293,7 +1420,8 @@ static void prefs_dictionary_set_optmenu(PrefParam *pparam)
                for (cur = GTK_MENU_SHELL(menu)->children;
                     cur != NULL; cur = cur->next) {
                        menuitem = GTK_WIDGET(cur->data);
-                       dict_name = gtk_object_get_data(GTK_OBJECT(menuitem), "dict_name");
+                       dict_name = gtk_object_get_data(GTK_OBJECT(menuitem), 
+                                                       "dict_name");
                        if (!strcmp2(dict_name, *((gchar **)pparam->data))) {
                                gtk_option_menu_set_history(optmenu, n);
                                return;
@@ -1322,8 +1450,6 @@ static void prefs_speller_sugmode_set_data_from_optmenu(PrefParam *param)
 static void prefs_speller_sugmode_set_optmenu(PrefParam *pparam)
 {
        GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
-       GtkWidget *menu;
-       GtkWidget *menuitem;
        gint sugmode;
 
        g_return_if_fail(optmenu != NULL);
@@ -1346,7 +1472,9 @@ static void prefs_spelling_checkbtn_enable_pspell_toggle_cb
        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(color_buttons.misspelled_btn, 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,
@@ -1365,20 +1493,28 @@ static void prefs_spelling_btn_pspell_path_clicked_cb(GtkWidget *widget,
          
                if (prefs_common.pspell_path)
                        g_free(prefs_common.pspell_path);
-               prefs_common.pspell_path = g_strdup_printf("%s%s",tmp,G_DIR_SEPARATOR_S);
+               prefs_common.pspell_path = g_strdup_printf("%s%s",tmp,
+                                                          G_DIR_SEPARATOR_S);
 
                new_menu = gtkpspell_dictionary_option_menu_new(prefs_common.pspell_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_pspell_path), 
+                                  prefs_common.pspell_path);                                    
                /* select first one */
-               gtk_option_menu_set_history(GTK_OPTION_MENU(spelling.optmenu_dictionary), 0);
-               
-               prefs_common.dictionary = gtkpspell_get_dictionary_menu_active_item(
-                               gtk_option_menu_get_menu(GTK_OPTION_MENU(spelling.optmenu_dictionary)));
-               g_free(tmp);
+               gtk_option_menu_set_history(GTK_OPTION_MENU(
+                                       spelling.optmenu_dictionary), 0);
        
+               if (prefs_common.dictionary)
+                       g_free(prefs_common.dictionary);
+
+               prefs_common.dictionary = 
+                       gtkpspell_get_dictionary_menu_active_item(
+                               gtk_option_menu_get_menu(
+                                       GTK_OPTION_MENU(
+                                               spelling.optmenu_dictionary)));
+               g_free(tmp);
 
        }
 }
@@ -1387,7 +1523,6 @@ static void prefs_spelling_create()
 {
        GtkWidget *vbox1;
        GtkWidget *frame_spell;
-       GtkWidget *hbox_spell;
        GtkWidget *vbox_spell;
        GtkWidget *hbox_pspell_path;
        GtkWidget *checkbtn_enable_pspell;
@@ -1399,11 +1534,12 @@ static void prefs_spelling_create()
        GtkWidget *optmenu_dictionary;
        GtkWidget *sugmode_label;
        GtkWidget *sugmode_optmenu;
+       GtkWidget *checkbtn_use_alternate;
+       GtkWidget *help_label;
+       GtkWidget *checkbtn_check_while_typing;
        GtkWidget *color_label;
-       GtkWidget *hbox_col;
        GtkWidget *col_align;
 
-
        vbox1 = gtk_vbox_new (FALSE, VSPACING);
        gtk_widget_show (vbox1);
        gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
@@ -1423,28 +1559,39 @@ static void prefs_spelling_create()
                           GTK_SIGNAL_FUNC(prefs_spelling_checkbtn_enable_pspell_toggle_cb),
                           NULL);
 
+       /* Check while typing */
+       PACK_CHECK_BUTTON(vbox_spell, checkbtn_check_while_typing, 
+                         _("Check while typing"));
+
+       PACK_CHECK_BUTTON(vbox_spell, checkbtn_use_alternate, 
+                         _("Enable alternate dictionary"));
+
+       help_label = gtk_label_new(_("Enabling alternate dictionary makes switching\nwith the last used dictionary faster."));
+       gtk_widget_show(help_label);
+       gtk_box_pack_start(GTK_BOX(vbox_spell), help_label, FALSE, TRUE, 0);
+       
        spell_table = gtk_table_new(4, 3, FALSE);
-       gtk_container_set_border_width (GTK_CONTAINER (spell_table), 0);
+       gtk_container_set_border_width (GTK_CONTAINER (spell_table), VSPACING);
        gtk_table_set_row_spacings(GTK_TABLE(spell_table), 8);
        gtk_table_set_col_spacings(GTK_TABLE(spell_table), 8);
 
        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, 1,
-                         GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
+       gtk_table_attach (GTK_TABLE (spell_table), label_pspell_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, 1,
-                         GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
+       gtk_table_attach (GTK_TABLE (spell_table), hbox_pspell_path, 1, 2, 0,
+                         1, GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
        gtk_widget_show(hbox_pspell_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, TRUE, 0);        
+       gtk_box_pack_start(GTK_BOX(hbox_pspell_path), entry_pspell_path, TRUE,
+                          TRUE, 0);    
        
        gtk_widget_set_sensitive(entry_pspell_path, prefs_common.enable_pspell);
 
@@ -1466,9 +1613,10 @@ 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));
-       gtk_table_attach (GTK_TABLE (spell_table), optmenu_dictionary, 1, 2, 1, 2,
-                         GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
+                                gtkpspell_dictionary_option_menu_new(
+                                        prefs_common.pspell_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);
 
        /* Suggestion mode */
@@ -1498,14 +1646,14 @@ static void prefs_spelling_create()
        gtk_table_attach (GTK_TABLE (spell_table), col_align, 1, 2, 3, 4,
                          GTK_FILL, GTK_SHRINK, 0, 0);
 
-       color_buttons.misspelled_btn = gtk_button_new_with_label ("");
-       set_button_bg_color(color_buttons.misspelled_btn,
+       spelling.misspelled_btn = gtk_button_new_with_label ("");
+       set_button_bg_color(spelling.misspelled_btn,
                            prefs_common.misspelled_col);
-       gtk_widget_set_usize (color_buttons.misspelled_btn, 30, 20);
-       gtk_widget_set_sensitive(color_buttons.misspelled_btn, prefs_common.enable_pspell);
-       gtk_signal_connect (GTK_OBJECT (color_buttons.misspelled_btn), "clicked",
+       gtk_widget_set_usize (spelling.misspelled_btn, 30, 20);
+       gtk_widget_set_sensitive(spelling.misspelled_btn, prefs_common.enable_pspell);
+       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), color_buttons.misspelled_btn);
+       gtk_container_add(GTK_CONTAINER(col_align), spelling.misspelled_btn);
 
 
        spelling.checkbtn_enable_pspell = checkbtn_enable_pspell;
@@ -1513,6 +1661,8 @@ static void prefs_spelling_create()
        spelling.btn_pspell_path        = btn_pspell_path;
        spelling.optmenu_dictionary     = optmenu_dictionary;
        spelling.optmenu_sugmode        = sugmode_optmenu;
+       spelling.checkbtn_use_alternate = checkbtn_use_alternate;
+       spelling.checkbtn_check_while_typing = checkbtn_check_while_typing;
 }
 
 #endif
@@ -1521,11 +1671,8 @@ static void prefs_spelling_create()
 static void prefs_compose_create(void)
 {
        GtkWidget *vbox1;
-        GtkWidget *vbox2;
-        GtkWidget *vbox3;
+       GtkWidget *vbox2;
        GtkWidget *hbox1;
-       GtkWidget *hbox2;
-       GtkWidget *btn_quotefmt;
 
        GtkWidget *frame_sig;
        GtkWidget *vbox_sig;
@@ -1533,13 +1680,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 *hbox_autosel;
        GtkWidget *checkbtn_reply_account_autosel;
        GtkWidget *checkbtn_forward_account_autosel;
        GtkWidget *checkbtn_reedit_account_autosel;
@@ -1558,33 +1702,20 @@ 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_forward_as_attachment;
+       GtkWidget *checkbtn_redirect_keep_from;
        GtkWidget *checkbtn_smart_wrapping;
        GtkWidget *checkbtn_block_cursor;
+       GtkWidget *frame_msgwrap;
 
        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);
@@ -1609,7 +1740,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);
@@ -1630,12 +1761,42 @@ static void prefs_compose_create(void)
        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_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);
@@ -1658,43 +1819,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;
@@ -1715,10 +1853,13 @@ static void prefs_compose_create(void)
        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_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   =
@@ -1741,6 +1882,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;
@@ -1841,13 +1985,42 @@ static void prefs_quote_create(void)
        gtk_widget_show (btn_quotedesc);
        gtk_box_pack_start (GTK_BOX (hbox1), btn_quotedesc, FALSE, FALSE, 0);
        gtk_signal_connect(GTK_OBJECT(btn_quotedesc), "clicked",
-                          GTK_SIGNAL_FUNC(prefs_quote_description), NULL);
+                          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)
@@ -1858,8 +2031,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;
@@ -1868,7 +2046,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;
@@ -1977,6 +2154,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"));
@@ -2038,8 +2244,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;
@@ -2215,18 +2424,17 @@ static void prefs_privacy_create(void)
 {
        GtkWidget *vbox1;
        GtkWidget *vbox2;
+       GtkWidget *vbox3;
        GtkWidget *hbox1;
-       GtkWidget *checkbtn_default_encrypt;
-        GtkWidget *checkbtn_ascii_armored;
-       GtkWidget *checkbtn_default_sign;
+       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);
@@ -2237,119 +2445,84 @@ static void prefs_privacy_create(void)
        gtk_widget_show (vbox2);
        gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
 
-       PACK_CHECK_BUTTON (vbox2, checkbtn_default_encrypt,
-                          _("Encrypt message by default"));
-
-       PACK_CHECK_BUTTON (vbox2, checkbtn_ascii_armored,
-                          _("Plain ASCII armored"));
-       gtk_signal_connect(GTK_OBJECT(checkbtn_ascii_armored), "toggled",
-                               prefs_common_ascii_armored_warning, (gpointer)0);
-
-       PACK_CHECK_BUTTON (vbox2, checkbtn_default_sign,
-                          _("Sign message by default"));
-
        PACK_CHECK_BUTTON (vbox2, checkbtn_auto_check_signatures,
                           _("Automatically check signatures"));
 
        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);
 
-       /* create default signkey box */
-       label = gtk_label_new (_("Default Sign Key"));
+       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);
+
+       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);
+       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);
 
-       privacy.checkbtn_default_encrypt = checkbtn_default_encrypt;
-        privacy.checkbtn_ascii_armored   = checkbtn_ascii_armored;
-       privacy.checkbtn_default_sign    = checkbtn_default_sign;
-       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;
-}
+       label = gtk_label_new (_("minute(s) "));
+       gtk_widget_show (label);
+       gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
 
-static void
-prefs_common_default_signkey_set_data_from_optmenu(PrefParam *pparam)
-{
-#if 0
-       GtkWidget *menu;
-       GtkWidget *menuitem;
-       gchar *charset;
-
-       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
-}
 
-static void prefs_common_ascii_armored_warning(GtkWidget* widget,
-                                              gpointer unused)
-{
-       if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))
-               && gtk_notebook_get_current_page(GTK_NOTEBOOK(dialog.notebook))) {
-               alertpanel_message(_("Warning - Privacy/Plain ASCII armored"),
-                       _("Its not recommend to use the old style plain ASCII\n"
-                       "armored mode for encypted messages. It doesn't comply\n"
-                       "with the RFC 3156 - MIME security with OpenPGP."));
-       }
+       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 */
 
@@ -2359,6 +2532,7 @@ static void prefs_interface_create(void)
        GtkWidget *vbox2;
        GtkWidget *vbox3;
        /* GtkWidget *checkbtn_emacs; */
+       GtkWidget *checkbtn_show_msg_with_cursor;
        GtkWidget *checkbtn_openunread;
        GtkWidget *checkbtn_openinbox;
        GtkWidget *checkbtn_immedexec;
@@ -2367,23 +2541,25 @@ static void prefs_interface_create(void)
        GtkWidget *optmenu_recvdialog;
        GtkWidget *menu;
        GtkWidget *menuitem;
+       GtkWidget *checkbtn_no_recv_err_panel;
 
        GtkWidget *frame_addr;
-        GtkWidget *vbox_addr;
+       GtkWidget *vbox_addr;
        GtkWidget *checkbtn_addaddrbyclick;
 
-       GtkWidget *frame_exit;
-       GtkWidget *vbox_exit;
-       GtkWidget *checkbtn_confonexit;
-       GtkWidget *checkbtn_cleanonexit;
-       GtkWidget *checkbtn_askonclean;
-       GtkWidget *checkbtn_warnqueued;
+       GtkWidget *button_keybind;
 
        GtkWidget *hbox2;
        GtkWidget *optmenu_nextunreadmsgdialog;
        GtkWidget *optmenu_nextunreadmsgdialog_menu;
        GtkWidget *nextunreadmsgdialog_menuitem;
 
+       GtkWidget *frame_pixmap_theme;
+       GtkWidget *vbox_pixmap_theme;
+       GtkWidget *entry_pixmap_theme;
+       GtkWidget *combo_pixmap_theme;
+       GList *avail_pixmap_themes = NULL;
+
        vbox1 = gtk_vbox_new (FALSE, VSPACING);
        gtk_widget_show (vbox1);
        gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
@@ -2399,6 +2575,10 @@ 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"));
@@ -2428,6 +2608,9 @@ static void prefs_interface_create(void)
 
        PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW);
 
+       PACK_CHECK_BUTTON (vbox2, checkbtn_no_recv_err_panel,
+                          _("No popup error dialog on receive error"));
+
        hbox1 = gtk_hbox_new (FALSE, 8);
        gtk_widget_show (hbox1);
        gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0);
@@ -2507,123 +2690,138 @@ static void prefs_interface_create(void)
 
        gtk_option_menu_set_menu (GTK_OPTION_MENU (recvdialog_optmenu), recvdialog_optmenu_menu);     */
 
-       /* On Exit */
-       PACK_FRAME (vbox1, frame_exit, _("On exit"));
-
-       vbox_exit = gtk_vbox_new (FALSE, 0);
-       gtk_widget_show (vbox_exit);
-       gtk_container_add (GTK_CONTAINER (frame_exit), vbox_exit);
-       gtk_container_set_border_width (GTK_CONTAINER (vbox_exit), 8);
-
-       PACK_CHECK_BUTTON (vbox_exit, checkbtn_confonexit,
-                          _("Confirm on exit"));
-
-       hbox1 = gtk_hbox_new (FALSE, 32);
+       hbox1 = gtk_hbox_new (FALSE, 8);
        gtk_widget_show (hbox1);
-       gtk_box_pack_start (GTK_BOX (vbox_exit), hbox1, FALSE, FALSE, 0);
-
-       PACK_CHECK_BUTTON (hbox1, checkbtn_cleanonexit,
-                          _("Empty trash on exit"));
-       PACK_CHECK_BUTTON (hbox1, checkbtn_askonclean,
-                          _("Ask before emptying"));
-       SET_TOGGLE_SENSITIVITY (checkbtn_cleanonexit, checkbtn_askonclean);
+       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
 
-       PACK_CHECK_BUTTON (vbox_exit, checkbtn_warnqueued,
-                          _("Warn if there are queued messages"));
+       button_keybind = gtk_button_new_with_label (_(" Set key bindings... "));
+       gtk_widget_show (button_keybind);
+       gtk_box_pack_start (GTK_BOX (hbox1), button_keybind, FALSE, FALSE, 0);
+       gtk_signal_connect (GTK_OBJECT (button_keybind), "clicked",
+                           GTK_SIGNAL_FUNC (prefs_keybind_select), NULL);
+
+       PACK_FRAME(vbox1, frame_pixmap_theme, _("Pixmap theme"));
+       
+       vbox_pixmap_theme = gtk_vbox_new(FALSE, 0);
+       gtk_widget_show(vbox_pixmap_theme);
+       gtk_container_add(GTK_CONTAINER(frame_pixmap_theme), vbox_pixmap_theme);
+       gtk_container_set_border_width(GTK_CONTAINER(vbox_pixmap_theme), 8);
+       avail_pixmap_themes = stock_pixmap_themes_list_new(); 
+       combo_pixmap_theme = gtk_combo_new ();
+       gtk_widget_show (combo_pixmap_theme);
+       gtk_box_pack_start (GTK_BOX (vbox_pixmap_theme), combo_pixmap_theme, TRUE, TRUE, 0);
+       gtk_combo_set_popdown_strings(GTK_COMBO(combo_pixmap_theme), avail_pixmap_themes);
+       entry_pixmap_theme = GTK_COMBO (combo_pixmap_theme)->entry;
+
+       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_openinbox          = checkbtn_openinbox;
        interface.checkbtn_immedexec          = checkbtn_immedexec;
        interface.optmenu_recvdialog          = optmenu_recvdialog;
+       interface.checkbtn_no_recv_err_panel  = checkbtn_no_recv_err_panel;
        interface.checkbtn_addaddrbyclick     = checkbtn_addaddrbyclick;
        interface.optmenu_nextunreadmsgdialog = optmenu_nextunreadmsgdialog;
-       interface.checkbtn_confonexit         = checkbtn_confonexit;
-       interface.checkbtn_cleanonexit        = checkbtn_cleanonexit;
-       interface.checkbtn_askonclean         = checkbtn_askonclean;
-       interface.checkbtn_warnqueued         = checkbtn_warnqueued;
+       interface.combo_pixmap_theme          = combo_pixmap_theme;
+       interface.entry_pixmap_theme          = entry_pixmap_theme;
 }
 
 static void prefs_other_create(void)
 {
        GtkWidget *vbox1;
+       GtkWidget *ext_frame;
+       GtkWidget *ext_table;
        GtkWidget *hbox1;
 
-       GtkWidget *uri_frame;
        GtkWidget *uri_label;
        GtkWidget *uri_combo;
        GtkWidget *uri_entry;
 
-       GtkWidget *print_frame;
        GtkWidget *printcmd_label;
        GtkWidget *printcmd_entry;
 
-       GtkWidget *exteditor_frame;
        GtkWidget *exteditor_label;
        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;
+       GtkWidget *checkbtn_cleanonexit;
+       GtkWidget *checkbtn_askonclean;
+       GtkWidget *checkbtn_warnqueued;
+
        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);
 
-       PACK_FRAME(vbox1, uri_frame,
-                  _("External Web browser (%s will be replaced with URI)"));
+       PACK_FRAME(vbox1, ext_frame,
+                  _("External commands (%s will be replaced with file name / URI)"));
 
-       hbox1 = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox1);
-       gtk_container_add (GTK_CONTAINER (uri_frame), hbox1);
-       gtk_container_set_border_width (GTK_CONTAINER (hbox1), 8);
+       ext_table = gtk_table_new (3, 2, FALSE);
+       gtk_widget_show (ext_table);
+       gtk_container_add (GTK_CONTAINER (ext_frame), ext_table);
+       gtk_container_set_border_width (GTK_CONTAINER (ext_table), 8);
+       gtk_table_set_row_spacings (GTK_TABLE (ext_table), VSPACING_NARROW);
+       gtk_table_set_col_spacings (GTK_TABLE (ext_table), 8);
 
-       uri_label = gtk_label_new (_("Command"));
+       uri_label = gtk_label_new (_("Web browser"));
        gtk_widget_show(uri_label);
-       gtk_box_pack_start (GTK_BOX (hbox1), uri_label, FALSE, TRUE, 0);
+       gtk_table_attach (GTK_TABLE (ext_table), uri_label, 0, 1, 0, 1,
+                         GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
+       gtk_misc_set_alignment (GTK_MISC (uri_label), 1, 0.5);
 
        uri_combo = gtk_combo_new ();
        gtk_widget_show (uri_combo);
-       gtk_box_pack_start (GTK_BOX (hbox1), uri_combo, TRUE, TRUE, 0);
+       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 openURL '%s'",
+                              "opera -newwindow '%s'",
                               "kterm -e w3m '%s'",
                               "kterm -e lynx '%s'",
                               NULL);
-
        uri_entry = GTK_COMBO (uri_combo)->entry;
 
-       PACK_FRAME(vbox1, print_frame,
-                  _("Printing (%s will be replaced with file name)"));
-
-       hbox1 = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox1);
-       gtk_container_add (GTK_CONTAINER (print_frame), hbox1);
-       gtk_container_set_border_width (GTK_CONTAINER (hbox1), 8);
-
-       printcmd_label = gtk_label_new (_("Command"));
+       printcmd_label = gtk_label_new (_("Print"));
        gtk_widget_show (printcmd_label);
-       gtk_box_pack_start (GTK_BOX (hbox1), printcmd_label, FALSE, FALSE, 0);
+       gtk_table_attach (GTK_TABLE (ext_table), printcmd_label, 0, 1, 1, 2,
+                         GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
+       gtk_misc_set_alignment (GTK_MISC (printcmd_label), 1, 0.5);
 
        printcmd_entry = gtk_entry_new ();
        gtk_widget_show (printcmd_entry);
-       gtk_box_pack_start (GTK_BOX (hbox1), printcmd_entry, TRUE, TRUE, 0);
+       gtk_table_attach (GTK_TABLE (ext_table), printcmd_entry, 1, 2, 1, 2,
+                         GTK_EXPAND | GTK_FILL, 0, 0, 0);
 
-       PACK_FRAME(vbox1, exteditor_frame,
-                  _("External editor (%s will be replaced with file name)"));
-
-       hbox1 = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox1);
-       gtk_container_add (GTK_CONTAINER (exteditor_frame), hbox1);
-       gtk_container_set_border_width (GTK_CONTAINER (hbox1), 8);
-
-       exteditor_label = gtk_label_new (_("Command"));
+       exteditor_label = gtk_label_new (_("Editor"));
        gtk_widget_show (exteditor_label);
-       gtk_box_pack_start (GTK_BOX (hbox1), exteditor_label, FALSE, FALSE, 0);
+       gtk_table_attach (GTK_TABLE (ext_table), exteditor_label, 0, 1, 2, 3,
+                         GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
+       gtk_misc_set_alignment (GTK_MISC (exteditor_label), 1, 0.5);
 
        exteditor_combo = gtk_combo_new ();
        gtk_widget_show (exteditor_combo);
-       gtk_box_pack_start (GTK_BOX (hbox1), exteditor_combo, TRUE, TRUE, 0);
+       gtk_table_attach (GTK_TABLE (ext_table), exteditor_combo, 1, 2, 2, 3,
+                         GTK_EXPAND | GTK_FILL, 0, 0, 0);
        gtkut_combo_set_items (GTK_COMBO (exteditor_combo),
                               "gedit %s",
                               "kedit %s",
@@ -2635,12 +2833,68 @@ 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));
+       SET_TOGGLE_SENSITIVITY(checkbtn_cliplog, loglength_entry);
+
+       /* On Exit */
+       PACK_FRAME (vbox1, frame_exit, _("On exit"));
+
+       vbox_exit = gtk_vbox_new (FALSE, 0);
+       gtk_widget_show (vbox_exit);
+       gtk_container_add (GTK_CONTAINER (frame_exit), vbox_exit);
+       gtk_container_set_border_width (GTK_CONTAINER (vbox_exit), 8);
+
+       PACK_CHECK_BUTTON (vbox_exit, checkbtn_confonexit,
+                          _("Confirm on exit"));
+
+       hbox1 = gtk_hbox_new (FALSE, 32);
+       gtk_widget_show (hbox1);
+       gtk_box_pack_start (GTK_BOX (vbox_exit), hbox1, FALSE, FALSE, 0);
+
+       PACK_CHECK_BUTTON (hbox1, checkbtn_cleanonexit,
+                          _("Empty trash on exit"));
+       PACK_CHECK_BUTTON (hbox1, checkbtn_askonclean,
+                          _("Ask before emptying"));
+       SET_TOGGLE_SENSITIVITY (checkbtn_cleanonexit, checkbtn_askonclean);
+
+       PACK_CHECK_BUTTON (vbox_exit, checkbtn_warnqueued,
+                          _("Warn if there are queued messages"));
+
        other.uri_combo = uri_combo;
        other.uri_entry = uri_entry;
        other.printcmd_entry = printcmd_entry;
 
        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;
+       other.checkbtn_warnqueued  = checkbtn_warnqueued;
 }
 
 static void date_format_ok_btn_clicked(GtkButton *button, GtkWidget **widget)
@@ -2706,6 +2960,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);
 }
 
@@ -2765,29 +3020,29 @@ static GtkWidget *date_format_create(GtkButton *button, void *data)
        GtkWidget *cancel_btn;
        GtkWidget *datefmt_entry;
 
-       const struct {
+       struct {
                gchar *fmt;
                gchar *txt;
        } time_format[] = {
-               { "%a", _("the full abbreviated weekday name") },
-               { "%A", _("the full weekday name") },
-               { "%b", _("the abbreviated month name") },
-               { "%B", _("the full month name") },
-               { "%c", _("the preferred date and time for the current locale") },
-               { "%C", _("the century number (year/100)") },
-               { "%d", _("the day of the month as a decimal number") },
-               { "%H", _("the hour as a decimal number using a 24-hour clock") },
-               { "%I", _("the hour as a decimal number using a 12-hour clock") },
-               { "%j", _("the day of the year as a decimal number") },
-               { "%m", _("the month as a decimal number") },
-               { "%M", _("the minute as a decimal number") },
-               { "%p", _("either AM or PM") },
-               { "%S", _("the second as a decimal number") },
-               { "%w", _("the day of the week as a decimal number") },
-               { "%x", _("the preferred date for the current locale") },
-               { "%y", _("the last two digits of a year") },
-               { "%Y", _("the year as a decimal number") },
-               { "%Z", _("the time zone or name or abbreviation") }
+               { "%a", NULL },
+               { "%A", NULL },
+               { "%b", NULL },
+               { "%B", NULL },
+               { "%c", NULL },
+               { "%C", NULL },
+               { "%d", NULL },
+               { "%H", NULL },
+               { "%I", NULL },
+               { "%j", NULL },
+               { "%m", NULL },
+               { "%M", NULL },
+               { "%p", NULL },
+               { "%S", NULL },
+               { "%w", NULL },
+               { "%x", NULL },
+               { "%y", NULL },
+               { "%Y", NULL },
+               { "%Z", NULL }
        };
 
        gchar *titles[2];
@@ -2795,6 +3050,26 @@ static GtkWidget *date_format_create(GtkButton *button, void *data)
        const gint TIME_FORMAT_ELEMS =
                sizeof time_format / sizeof time_format[0];
 
+       time_format[0].txt  = _("the full abbreviated weekday name");
+       time_format[1].txt  = _("the full weekday name");
+       time_format[2].txt  = _("the abbreviated month name");
+       time_format[3].txt  = _("the full month name");
+       time_format[4].txt  = _("the preferred date and time for the current locale");
+       time_format[5].txt  = _("the century number (year/100)");
+       time_format[6].txt  = _("the day of the month as a decimal number");
+       time_format[7].txt  = _("the hour as a decimal number using a 24-hour clock");
+       time_format[8].txt  = _("the hour as a decimal number using a 12-hour clock");
+       time_format[9].txt  = _("the day of the year as a decimal number");
+       time_format[10].txt = _("the month as a decimal number");
+       time_format[11].txt = _("the minute as a decimal number");
+       time_format[12].txt = _("either AM or PM");
+       time_format[13].txt = _("the second as a decimal number");
+       time_format[14].txt = _("the day of the week as a decimal number");
+       time_format[15].txt = _("the preferred date for the current locale");
+       time_format[16].txt = _("the last two digits of a year");
+       time_format[17].txt = _("the year as a decimal number");
+       time_format[18].txt = _("the time zone or name or abbreviation");
+
        if (datefmt_win) return datefmt_win;
 
        datefmt_win = gtk_window_new(GTK_WINDOW_DIALOG);
@@ -3029,10 +3304,7 @@ static void prefs_quote_colors_dialog_create(void)
        gtk_box_pack_end(GTK_BOX(vbox), hbbox, FALSE, FALSE, 0);
 
        gtk_widget_grab_default(ok_btn);
-       gtk_signal_connect(GTK_OBJECT(window), "focus_in_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
-       gtk_signal_connect(GTK_OBJECT(window), "focus_out_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
+       MANAGE_WINDOW_SIGNALS_CONNECT(window);
        gtk_signal_connect(GTK_OBJECT(window), "delete_event",
                           GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
        gtk_signal_connect(GTK_OBJECT(window), "key_press_event",
@@ -3177,7 +3449,7 @@ static void quote_colors_set_dialog_ok(GtkWidget *widget, gpointer data)
 #if USE_PSPELL         
        } else if (g_strcasecmp(type, "Misspelled word") == 0) {
                prefs_common.misspelled_col = rgbvalue;
-               set_button_bg_color(color_buttons.misspelled_btn, rgbvalue);
+               set_button_bg_color(spelling.misspelled_btn, rgbvalue);
 #endif         
        } else
                fprintf( stderr, "Unrecognized datatype '%s' in quote_color_set_dialog_ok\n", type );
@@ -3229,144 +3501,6 @@ static void prefs_recycle_colors_toggled(GtkWidget *widget)
        prefs_common.recycle_quote_colors = is_active;
 }
 
-void prefs_quote_description(void)
-{
-       if (!quote_desc_win)
-               prefs_quote_description_create();
-
-       manage_window_set_transient(GTK_WINDOW(quote_desc_win));
-       gtk_widget_show(quote_desc_win);
-       gtk_main();
-       gtk_widget_hide(quote_desc_win);
-}
-
-static void prefs_quote_description_create(void)
-{
-       GtkWidget *vbox;
-       GtkWidget *hbox;
-       GtkWidget *vbox2;
-       GtkWidget *label;
-       GtkWidget *hbbox;
-       GtkWidget *ok_btn;
-
-       quote_desc_win = gtk_window_new(GTK_WINDOW_DIALOG);
-       gtk_window_set_title(GTK_WINDOW(quote_desc_win),
-                            _("Description of symbols"));
-       gtk_container_set_border_width(GTK_CONTAINER(quote_desc_win), 8);
-       gtk_window_set_position(GTK_WINDOW(quote_desc_win), GTK_WIN_POS_CENTER);
-       gtk_window_set_modal(GTK_WINDOW(quote_desc_win), TRUE);
-       gtk_window_set_policy(GTK_WINDOW(quote_desc_win), FALSE, FALSE, FALSE);
-
-       vbox = gtk_vbox_new(FALSE, 8);
-       gtk_container_add(GTK_CONTAINER(quote_desc_win), vbox);
-
-       hbox = gtk_hbox_new(FALSE, 8);
-       gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0);
-
-       vbox2 = gtk_vbox_new(FALSE, 8);
-       gtk_box_pack_start(GTK_BOX(hbox), vbox2, TRUE, TRUE, 0);
-
-#define PACK_LABEL() \
-       gtk_box_pack_start(GTK_BOX(vbox2), label, TRUE, TRUE, 0); \
-       gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); \
-       gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-
-       label = gtk_label_new
-               ("%d\n"         /* date */
-                "%f\n"         /* from */
-                "%N\n"         /* full name of sender */
-                "%F\n"         /* first name of sender */
-                "%I\n"         /* initial of sender */
-                "%s\n"         /* subject */
-                "%t\n"         /* to */
-                "%c\n"         /* cc */
-                "%n\n"         /* newsgroups */
-                "%r\n"         /* references */
-                "%i");         /* message id */
-       PACK_LABEL();
-
-       label = gtk_label_new
-               ("?x{expr}");   /* condition */
-       PACK_LABEL();
-
-       label = gtk_label_new
-               ("%M\n"         /* message body */
-                "%Q\n"         /* quoted message body */
-                "%m\n"         /* message body without signature */
-                "%q\n"         /* quoted message body without signature */
-                "%%");         /* literal percent */
-       PACK_LABEL();
-
-       label = gtk_label_new
-               ("\\\\\n"       /* literal backslash */
-                "\\?\n"        /* literal question mark */
-                "\\{\n"        /* literal opening curly brace */
-                "\\}");        /* literal closing curly brace */
-       PACK_LABEL();
-
-       vbox2 = gtk_vbox_new(FALSE, 8);
-       gtk_box_pack_start(GTK_BOX(hbox), vbox2, TRUE, TRUE, 0);
-
-       label = gtk_label_new
-               (_("Date\n"
-                  "From\n"
-                  "Full Name of Sender\n"
-                  "First Name of Sender\n"
-                  "Initial of Sender\n"
-                  "Subject\n"
-                  "To\n"
-                  "Cc\n"
-                  "Newsgroups\n"
-                  "References\n"
-                  "Message-ID"));
-       PACK_LABEL();
-
-       label = gtk_label_new
-               (_("If x is set, displays expr"));
-       PACK_LABEL();
-
-       label = gtk_label_new
-               (_("Message body\n"
-                  "Quoted message body\n"
-                  "Message body without signature\n"
-                  "Quoted message body without signature\n"
-                  "Literal %"));
-       PACK_LABEL();
-
-       label = gtk_label_new
-               (_("Literal backslash\n"
-                  "Literal question mark\n"
-                  "Literal opening curly brace\n"
-                  "Literal closing curly brace"));
-       PACK_LABEL();
-
-#undef PACK_LABEL
-
-       gtkut_button_set_create(&hbbox, &ok_btn, _("OK"),
-                               NULL, NULL, NULL, NULL);
-       gtk_box_pack_end(GTK_BOX(vbox), hbbox, FALSE, FALSE, 0);
-
-       gtk_widget_grab_default(ok_btn);
-       gtk_signal_connect(GTK_OBJECT(ok_btn), "clicked",
-                          GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
-       gtk_signal_connect
-               (GTK_OBJECT(quote_desc_win), "key_press_event",
-                GTK_SIGNAL_FUNC(prefs_quote_description_key_pressed),
-                NULL);
-       gtk_signal_connect(GTK_OBJECT(quote_desc_win), "delete_event",
-                          GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
-
-       gtk_widget_show_all(vbox);
-}
-
-static void prefs_quote_description_key_pressed(GtkWidget *widget,
-                                               GdkEventKey *event,
-                                               gpointer data)
-{
-       if (event && event->keyval == GDK_Escape)
-               gtk_main_quit();
-}
-
 static void prefs_font_select(GtkButton *button, GtkEntry *entry)
 {
        gchar *font_name;
@@ -3436,6 +3570,385 @@ static void prefs_font_selection_ok(GtkButton *button, GtkEntry *entry)
        gtk_widget_hide(font_sel_win);
 }
 
+static void prefs_keybind_select(void)
+{
+       GtkWidget *window;
+       GtkWidget *vbox1;
+       GtkWidget *hbox1;
+       GtkWidget *label;
+       GtkWidget *combo;
+       GtkWidget *confirm_area;
+       GtkWidget *ok_btn;
+       GtkWidget *cancel_btn;
+
+       window = gtk_window_new (GTK_WINDOW_DIALOG);
+       gtk_container_set_border_width (GTK_CONTAINER (window), 8);
+       gtk_window_set_title (GTK_WINDOW (window), _("Key bindings"));
+       gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
+       gtk_window_set_modal (GTK_WINDOW (window), TRUE);
+       gtk_window_set_policy (GTK_WINDOW (window), FALSE, FALSE, FALSE);
+       manage_window_set_transient (GTK_WINDOW (window));
+
+       vbox1 = gtk_vbox_new (FALSE, VSPACING);
+       gtk_container_add (GTK_CONTAINER (window), vbox1);
+       gtk_container_set_border_width (GTK_CONTAINER (vbox1), 2);
+
+       hbox1 = gtk_hbox_new (FALSE, 8);
+       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
+
+       label = gtk_label_new
+               (_("Select the preset of key bindings.\n"
+                  "You can also modify each menu's shortcuts by pressing\n"
+                  "any key(s) when placing the mouse pointer on the item."));
+       gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
+       gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
+
+       hbox1 = gtk_hbox_new (FALSE, 8);
+       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
+
+       combo = gtk_combo_new ();
+       gtk_box_pack_start (GTK_BOX (hbox1), combo, TRUE, TRUE, 0);
+       gtkut_combo_set_items (GTK_COMBO (combo),
+                              _("Default"),
+                              "Mew / Wanderlust",
+                              "Mutt",
+                              _("Old Sylpheed"),
+                              NULL);
+       gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (combo)->entry), FALSE);
+
+       hbox1 = gtk_hbox_new (FALSE, 8);
+       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
+
+       gtkut_button_set_create (&confirm_area, &ok_btn, _("OK"),
+                                &cancel_btn, _("Cancel"), NULL, NULL);
+       gtk_box_pack_end (GTK_BOX (hbox1), confirm_area, FALSE, FALSE, 0);
+       gtk_widget_grab_default (ok_btn);
+
+       MANAGE_WINDOW_SIGNALS_CONNECT(window);
+       gtk_signal_connect (GTK_OBJECT (window), "delete_event",
+                           GTK_SIGNAL_FUNC (prefs_keybind_deleted), NULL);
+       gtk_signal_connect (GTK_OBJECT (window), "key_press_event",
+                           GTK_SIGNAL_FUNC (prefs_keybind_key_pressed), NULL);
+       gtk_signal_connect (GTK_OBJECT (ok_btn), "clicked",
+                           GTK_SIGNAL_FUNC (prefs_keybind_apply_clicked),
+                           NULL);
+       gtk_signal_connect (GTK_OBJECT (cancel_btn), "clicked",
+                           GTK_SIGNAL_FUNC (prefs_keybind_cancel),
+                           NULL);
+
+       gtk_widget_show_all(window);
+
+       keybind.window = window;
+       keybind.combo = combo;
+}
+
+static void prefs_keybind_key_pressed(GtkWidget *widget, GdkEventKey *event,
+                                     gpointer data)
+{
+       if (event && event->keyval == GDK_Escape)
+               prefs_keybind_cancel();
+}
+
+static gint prefs_keybind_deleted(GtkWidget *widget, GdkEventAny *event,
+                                 gpointer data)
+{
+       prefs_keybind_cancel();
+       return TRUE;
+}
+
+static void prefs_keybind_cancel(void)
+{
+       gtk_widget_destroy(keybind.window);
+       keybind.window = NULL;
+       keybind.combo = NULL;
+}
+
+static void prefs_keybind_apply_clicked(GtkWidget *widget)
+{
+       GtkEntry *entry = GTK_ENTRY(GTK_COMBO(keybind.combo)->entry);
+       gchar *text;
+       gchar *rc_str;
+
+       static gchar *default_menurc =
+               "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
+               "(menu-path \"<Main>/File/Save as...\" \"<control>S\")\n"
+               "(menu-path \"<Main>/File/Print...\" \"\")\n"
+               "(menu-path \"<Main>/File/Exit\" \"<control>Q\")\n"
+
+               "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
+               "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
+               "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
+               "(menu-path \"<Main>/Edit/Search folder...\" \"<shift><control>F\")\n"
+
+               "(menu-path \"<Main>/View/Expand Summary View\" \"V\")\n"
+               "(menu-path \"<Main>/View/Expand Message View\" \"<shift>V\")\n"
+               "(menu-path \"<Main>/View/Thread view\" \"<control>T\")\n"
+               "(menu-path \"<Main>/View/Go to/Prev message\" \"P\")\n"
+               "(menu-path \"<Main>/View/Go to/Next message\" \"N\")\n"
+               "(menu-path \"<Main>/View/Go to/Prev unread message\" \"<shift>P\")\n"
+               "(menu-path \"<Main>/View/Go to/Next unread message\" \"<shift>N\")\n"
+               "(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/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/Forward\" \"<control><alt>F\")\n"
+               /* "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n" */
+               "(menu-path \"<Main>/Message/Move...\" \"<control>O\")\n"
+               "(menu-path \"<Main>/Message/Copy...\" \"<shift><control>O\")\n"
+               "(menu-path \"<Main>/Message/Delete\" \"<control>D\")\n"
+               "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>asterisk\")\n"
+               "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
+               "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>exclam\")\n"
+               "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
+
+               "(menu-path \"<Main>/Tools/Address book\" \"<shift><control>A\")\n"
+               "(menu-path \"<Main>/Tools/Execute\" \"X\")\n"
+               "(menu-path \"<Main>/Tools/Log window\" \"<control>L\")\n"
+
+               "(menu-path \"<Compose>/File/Close\" \"<control>W\")\n"
+               "(menu-path \"<Compose>/Edit/Select all\" \"<control>A\")\n"
+               "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"\")\n"
+               "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"\")\n"
+               "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"\")\n"
+               "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"\")\n"
+               "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"\")";
+
+       static gchar *mew_wl_menurc =
+               "(menu-path \"<Main>/File/Empty trash\" \"<shift>D\")\n"
+               "(menu-path \"<Main>/File/Save as...\" \"Y\")\n"
+               "(menu-path \"<Main>/File/Print...\" \"<shift>numbersign\")\n"
+               "(menu-path \"<Main>/File/Exit\" \"<shift>Q\")\n"
+
+               "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
+               "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
+               "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
+               "(menu-path \"<Main>/Edit/Search folder...\" \"<control>S\")\n"
+
+               "(menu-path \"<Main>/View/Expand Summary View\" \"\")\n"
+               "(menu-path \"<Main>/View/Expand Message View\" \"\")\n"
+               "(menu-path \"<Main>/View/Thread view\" \"<shift>T\")\n"
+               "(menu-path \"<Main>/View/Go to/Prev message\" \"P\")\n"
+               "(menu-path \"<Main>/View/Go to/Next message\" \"N\")\n"
+               "(menu-path \"<Main>/View/Go to/Prev unread message\" \"<shift>P\")\n"
+               "(menu-path \"<Main>/View/Go to/Next unread message\" \"<shift>N\")\n"
+               "(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/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/Forward\" \"F\")\n"
+               /* "(menu-path \"<Main>/Message/Forward as attachment\" \"<shift>F\")\n" */
+               "(menu-path \"<Main>/Message/Move...\" \"O\")\n"
+               "(menu-path \"<Main>/Message/Copy...\" \"<shift>O\")\n"
+               "(menu-path \"<Main>/Message/Delete\" \"D\")\n"
+               "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>asterisk\")\n"
+               "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
+               "(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>/Tools/Address book\" \"<shift><control>A\")\n"
+               "(menu-path \"<Main>/Tools/Execute\" \"X\")\n"
+               "(menu-path \"<Main>/Tools/Log window\" \"<control>L\")\n"
+
+               "(menu-path \"<Compose>/File/Close\" \"<alt>W\")\n"
+               "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
+               "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"<alt>B\")\n"
+               "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"<alt>F\")\n"
+               "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"<control>A\")\n"
+               "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"<control>W\")\n"
+               "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"<alt>D\")";
+
+       static gchar *mutt_menurc =
+               "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
+               "(menu-path \"<Main>/File/Save as...\" \"S\")\n"
+               "(menu-path \"<Main>/File/Print...\" \"P\")\n"
+               "(menu-path \"<Main>/File/Exit\" \"Q\")\n"
+
+               "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
+               "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
+               "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
+               "(menu-path \"<Main>/Edit/Search messages...\" \"slash\")\n"
+
+               "(menu-path \"<Main>/View/Toggle summary view\" \"V\")\n"
+               "(menu-path \"<Main>/View/Thread view\" \"<control>T\")\n"
+               "(menu-path \"<Main>/View/Go to/Prev message\" \"\")\n"
+               "(menu-path \"<Main>/View/Go to/Next message\" \"\")\n"
+               "(menu-path \"<Main>/View/Go to/Prev unread message\" \"\")\n"
+               "(menu-path \"<Main>/View/Go to/Next unread message\" \"\")\n"
+               "(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/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/Forward\" \"F\")\n"
+               "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n"
+               "(menu-path \"<Main>/Message/Move...\" \"<control>O\")\n"
+               "(menu-path \"<Main>/Message/Copy...\" \"<shift>C\")\n"
+               "(menu-path \"<Main>/Message/Delete\" \"D\")\n"
+               "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>F\")\n"
+               "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
+               "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>N\")\n"
+               "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
+
+               "(menu-path \"<Main>/Tools/Address book\" \"<shift><control>A\")\n"
+               "(menu-path \"<Main>/Tools/Execute\" \"X\")\n"
+               "(menu-path \"<Main>/Tools/Log window\" \"<control>L\")\n"
+
+               "(menu-path \"<Compose>/File/Close\" \"<alt>W\")\n"
+               "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
+               "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"<alt>B\")\n"
+               "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"<alt>F\")\n"
+               "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"<control>A\")\n"
+               "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"<control>W\")\n"
+               "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"<alt>D\")";
+
+       static gchar *old_sylpheed_menurc =
+               "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
+               "(menu-path \"<Main>/File/Save as...\" \"\")\n"
+               "(menu-path \"<Main>/File/Print...\" \"<alt>P\")\n"
+               "(menu-path \"<Main>/File/Exit\" \"<alt>Q\")\n"
+
+               "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
+               "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
+               "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
+               "(menu-path \"<Main>/Edit/Search folder...\" \"<control>S\")\n"
+
+               "(menu-path \"<Main>/View/Expand Summary View\" \"\")\n"
+               "(menu-path \"<Main>/View/Expand Message View\" \"\")\n"
+               "(menu-path \"<Main>/View/Thread view\" \"<control>T\")\n"
+               "(menu-path \"<Main>/View/Go to/Prev message\" \"P\")\n"
+               "(menu-path \"<Main>/View/Go to/Next message\" \"N\")\n"
+               "(menu-path \"<Main>/View/Go to/Prev unread message\" \"<shift>P\")\n"
+               "(menu-path \"<Main>/View/Go to/Next unread message\" \"<shift>N\")\n"
+               "(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/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/Forward\" \"<shift><alt>F\")\n"
+               /* "(menu-path \"<Main>/Message/Forward as attachment\" \"<shift><control>F\")\n" */
+               "(menu-path \"<Main>/Message/Move...\" \"<alt>O\")\n"
+               "(menu-path \"<Main>/Message/Copy...\" \"\")\n"
+               "(menu-path \"<Main>/Message/Delete\" \"<alt>D\")\n"
+               "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>asterisk\")\n"
+               "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
+               "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>exclam\")\n"
+               "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\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"
+               "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"<alt>B\")\n"
+               "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"<alt>F\")\n"
+               "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"<control>A\")\n"
+               "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"<control>W\")\n"
+               "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"<alt>D\")";
+
+       static gchar *empty_menurc =
+               "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
+               "(menu-path \"<Main>/File/Save as...\" \"\")\n"
+               "(menu-path \"<Main>/File/Print...\" \"\")\n"
+               "(menu-path \"<Main>/File/Exit\" \"\")\n"
+
+               "(menu-path \"<Main>/Edit/Copy\" \"\")\n"
+               "(menu-path \"<Main>/Edit/Select all\" \"\")\n"
+               "(menu-path \"<Main>/Edit/Find in current message...\" \"\")\n"
+               "(menu-path \"<Main>/Edit/Search folder...\" \"\")\n"
+
+               "(menu-path \"<Main>/View/Expand Summary View\" \"\")\n"
+               "(menu-path \"<Main>/View/Expand Message View\" \"\")\n"
+               "(menu-path \"<Main>/View/Thread view\" \"\")\n"
+               "(menu-path \"<Main>/View/Go to/Prev message\" \"\")\n"
+               "(menu-path \"<Main>/View/Go to/Next message\" \"\")\n"
+               "(menu-path \"<Main>/View/Go to/Prev unread message\" \"\")\n"
+               "(menu-path \"<Main>/View/Go to/Next unread message\" \"\")\n"
+               "(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/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/Forward\" \"\")\n"
+               /* "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n" */
+               "(menu-path \"<Main>/Message/Move...\" \"\")\n"
+               "(menu-path \"<Main>/Message/Copy...\" \"\")\n"
+               "(menu-path \"<Main>/Message/Delete\" \"\")\n"
+               "(menu-path \"<Main>/Message/Mark/Mark\" \"\")\n"
+               "(menu-path \"<Main>/Message/Mark/Unmark\" \"\")\n"
+               "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"\")\n"
+               "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\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"
+               "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"\")\n"
+               "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"\")\n"
+               "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"\")\n"
+               "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"\")\n"
+               "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"\")";
+
+       text = gtk_entry_get_text(entry);
+
+       if (!strcmp(text, _("Default")))
+               rc_str = default_menurc;
+       else if (!strcmp(text, "Mew / Wanderlust"))
+               rc_str = mew_wl_menurc;
+       else if (!strcmp(text, "Mutt"))
+               rc_str = mutt_menurc;
+       else if (!strcmp(text, _("Old Sylpheed")))
+               rc_str = old_sylpheed_menurc;
+       else
+               return;
+
+       gtk_item_factory_parse_rc_string(empty_menurc);
+       gtk_item_factory_parse_rc_string(rc_str);
+
+       gtk_widget_destroy(keybind.window);
+       keybind.window = NULL;
+       keybind.combo = NULL;
+}
+
 static void prefs_common_charset_set_data_from_optmenu(PrefParam *pparam)
 {
        GtkWidget *menu;
@@ -3506,6 +4019,7 @@ 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);
@@ -3531,16 +4045,31 @@ static void prefs_common_ok(void)
 {
        prefs_common_apply();
        gtk_widget_hide(dialog.window);
-       if (quote_desc_win && GTK_WIDGET_VISIBLE(quote_desc_win))
-               gtk_widget_hide(quote_desc_win);
 
        inc_unlock();
 }
 
 static void prefs_common_apply(void)
 {
+       gchar *entry_pixmap_theme_str;
+       gboolean update_pixmap_theme;
+       
+       entry_pixmap_theme_str = gtk_entry_get_text(GTK_ENTRY(interface.entry_pixmap_theme));
+       if (entry_pixmap_theme_str && 
+               (strcmp(prefs_common.pixmap_theme_path, entry_pixmap_theme_str) != 0) )
+               update_pixmap_theme = TRUE;
+       else
+               update_pixmap_theme = FALSE;
+       
        prefs_set_data_from_dialog(param);
-       main_window_reflect_prefs_all();
+       
+       if (update_pixmap_theme)
+       {
+               main_window_reflect_prefs_all_real(TRUE);
+               compose_reflect_prefs_pixmap_theme();
+       } else
+               main_window_reflect_prefs_all_real(FALSE);
+       
        prefs_common_save_config();
 
        inc_autocheck_timer_remove();
@@ -3577,7 +4106,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);
@@ -3592,37 +4120,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;