0.9.6claws97
[claws.git] / src / prefs_common.c
index a31673b853474130ed953d9420bce8095fde4ace..5c9e1bd793ddb701ec1ca4b78944cf3686c468ce 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2002 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2003 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
@@ -36,7 +36,7 @@
 
 #include "intl.h"
 #include "main.h"
-#include "prefs.h"
+#include "prefs_gtk.h"
 #include "prefs_common.h"
 #include "prefs_display_header.h"
 #include "prefs_summary_column.h"
 #include "gtkutils.h"
 #include "alertpanel.h"
 #include "folder.h"
+#include "socket.h"
 #include "filesel.h"
 #include "folderview.h"
 #include "stock_pixmap.h"
 #include "quote_fmt.h"
 
-#if USE_ASPELL
-#include "gtkaspell.h"
-#endif
-
 PrefsCommon prefs_common;
 
 static PrefsDialog dialog;
@@ -69,10 +66,6 @@ static struct Receive {
        GtkWidget *entry_incext;
        GtkWidget *button_incext;
 
-       GtkWidget *checkbtn_local;
-       GtkWidget *checkbtn_filter_on_inc;
-       GtkWidget *entry_spool;
-
        GtkWidget *checkbtn_autochk;
        GtkWidget *spinbtn_autochk;
        GtkObject *spinbtn_autochk_adj;
@@ -85,26 +78,21 @@ static struct Receive {
        GtkWidget *checkbtn_newmail_manu;
        GtkWidget *entry_newmail_notify_cmd;
        GtkWidget *hbox_newmail_notify;
-
-       GtkWidget *spinbtn_maxarticle;
-       GtkObject *spinbtn_maxarticle_adj;
+       GtkWidget *optmenu_recvdialog;
+       GtkWidget *checkbtn_no_recv_err_panel;
+       GtkWidget *checkbtn_close_recv_dialog;
 } receive;
 
 static struct Send {
-       GtkWidget *checkbtn_extsend;
-       GtkWidget *entry_extsend;
-       GtkWidget *button_extsend;
-
        GtkWidget *checkbtn_savemsg;
        GtkWidget *checkbtn_queuemsg;
+       GtkWidget *optmenu_senddialog;
 
        GtkWidget *optmenu_charset;
+       GtkWidget *optmenu_encoding_method;
 } p_send;
 
 static struct Compose {
-       GtkWidget *checkbtn_autosig;
-       GtkWidget *entry_sigsep;
-
        GtkWidget *entry_fw_quotemark;
        GtkWidget *text_fw_quotefmt;
 
@@ -132,20 +120,6 @@ static struct Compose {
        GtkWidget *entry_autosave_length;
 } compose;
 
-       /* spelling */
-#if USE_ASPELL
-static struct Spelling {
-       GtkWidget *checkbtn_enable_aspell;
-       GtkWidget *entry_aspell_path;
-       GtkWidget *btn_aspell_path;
-       GtkWidget *optmenu_dictionary;
-       GtkWidget *optmenu_sugmode;
-       GtkWidget *misspelled_btn;
-       GtkWidget *checkbtn_use_alternate;
-       GtkWidget *checkbtn_check_while_typing;
-} spelling;
-#endif
-
 static struct Quote {
        GtkWidget *entry_quotemark;
        GtkWidget *text_quotefmt;
@@ -157,13 +131,6 @@ static struct Quote {
 } quote;
 
 static struct Display {
-       GtkWidget *entry_textfont;
-       GtkWidget *button_textfont;
-
-       GtkWidget *entry_smallfont;
-       GtkWidget *entry_normalfont;
-       GtkWidget *entry_boldfont;
-
        GtkWidget *chkbtn_folder_unread;
        GtkWidget *entry_ng_abbrev_len;
        GtkWidget *spinbtn_ng_abbrev_len;
@@ -173,7 +140,7 @@ static struct Display {
 
        GtkWidget *chkbtn_swapfrom;
        GtkWidget *chkbtn_useaddrbook;
-       GtkWidget *chkbtn_expand_thread;
+       GtkWidget *chkbtn_threadsubj;
        GtkWidget *entry_datefmt;
 } display;
 
@@ -192,14 +159,12 @@ static struct Message {
        GtkObject *spinbtn_scrollstep_adj;
        GtkWidget *chkbtn_halfpage;
 
-       GtkWidget *chkbtn_display_img;
-       GtkWidget *chkbtn_resize_image;
+       GtkWidget *chkbtn_attach_desc;
 } message;
 
 #if USE_GPGME
 static struct Privacy {
        GtkWidget *checkbtn_auto_check_signatures;
-       GtkWidget *checkbtn_gpg_signature_popup;
        GtkWidget *checkbtn_store_passphrase;
        GtkWidget *spinbtn_store_passphrase;
        GtkObject *spinbtn_store_passphrase_adj;
@@ -210,15 +175,11 @@ static struct Privacy {
 
 static struct Interface {
        /* GtkWidget *checkbtn_emacs; */
-       GtkWidget *checkbtn_show_msg_with_cursor;
+       GtkWidget *checkbtn_always_show_msg;
        GtkWidget *checkbtn_openunread;
        GtkWidget *checkbtn_mark_as_read_on_newwin;
        GtkWidget *checkbtn_openinbox;
        GtkWidget *checkbtn_immedexec;
-       GtkWidget *optmenu_recvdialog;
-       GtkWidget *optmenu_senddialog;
-       GtkWidget *checkbtn_no_recv_err_panel;
-       GtkWidget *checkbtn_close_recv_dialog;
        GtkWidget *optmenu_nextunreadmsgdialog;
        GtkWidget *entry_pixmap_theme;
        GtkWidget *combo_pixmap_theme;
@@ -230,6 +191,7 @@ static struct Other {
        GtkWidget *printcmd_entry;
        GtkWidget *exteditor_combo;
        GtkWidget *exteditor_entry;
+
        GtkWidget *checkbtn_addaddrbyclick;
        GtkWidget *checkbtn_confonexit;
        GtkWidget *checkbtn_cleanonexit;
@@ -243,6 +205,8 @@ static struct Other {
 #endif
 #endif
 
+       GtkWidget *spinbtn_iotimeout;
+       GtkObject *spinbtn_iotimeout_adj;
 } other;
 
 static struct MessageColorButtons {
@@ -259,13 +223,15 @@ static struct KeybindDialog {
        GtkWidget *combo;
 } keybind;
 
-static GtkWidget *font_sel_win;
-static guint font_sel_conn_id; 
 static GtkWidget *quote_color_win;
 static GtkWidget *color_dialog;
 
-static void prefs_common_charset_set_data_from_optmenu(PrefParam *pparam);
-static void prefs_common_charset_set_optmenu         (PrefParam *pparam);
+static void prefs_common_charset_set_data_from_optmenu    (PrefParam *pparam);
+static void prefs_common_charset_set_optmenu              (PrefParam *pparam);
+static void prefs_common_encoding_set_data_from_optmenu    (PrefParam *pparam);
+static void prefs_common_encoding_set_optmenu             (PrefParam *pparam);
+static void prefs_common_recv_dialog_set_data_from_optmenu (PrefParam *pparam);
+static void prefs_common_recv_dialog_set_optmenu          (PrefParam *pparam);
 static void prefs_common_recv_dialog_newmail_notify_toggle_cb  (GtkWidget *w,
                                                                 gpointer data);
 static void prefs_common_recv_dialog_set_data_from_optmenu(PrefParam *pparam);
@@ -275,14 +241,6 @@ static void prefs_common_send_dialog_set_optmenu(PrefParam *pparam);
 static void prefs_nextunreadmsgdialog_set_data_from_optmenu(PrefParam *pparam);
 static void prefs_nextunreadmsgdialog_set_optmenu(PrefParam *pparam);
 
-#if USE_ASPELL
-static void prefs_dictionary_set_data_from_optmenu     (PrefParam *param);
-static void prefs_dictionary_set_optmenu               (PrefParam *pparam);
-static void prefs_speller_sugmode_set_data_from_optmenu        (PrefParam *pparam);
-static void prefs_speller_sugmode_set_optmenu          (PrefParam *pparam);
-#endif
-
-
 /*
    parameter name, default value, pointer to the prefs variable, data type,
    pointer to the widget pointer,
@@ -299,16 +257,6 @@ static PrefParam param[] = {
         &receive.entry_incext,
         prefs_set_data_from_entry, prefs_set_entry},
 
-       {"inc_local", "TRUE", &prefs_common.inc_local, P_BOOL,
-        &receive.checkbtn_local,
-        prefs_set_data_from_toggle, prefs_set_toggle},
-       {"filter_on_inc_local", "FALSE", &prefs_common.filter_on_inc, P_BOOL,
-        &receive.checkbtn_filter_on_inc,
-        prefs_set_data_from_toggle, prefs_set_toggle},
-       {"spool_path", DEFAULT_SPOOL_PATH, &prefs_common.spool_path, P_STRING,
-        &receive.entry_spool,
-        prefs_set_data_from_entry, prefs_set_entry},
-
        {"autochk_newmail", "FALSE", &prefs_common.autochk_newmail, P_BOOL,
         &receive.checkbtn_autochk,
         prefs_set_data_from_toggle, prefs_set_toggle},
@@ -330,37 +278,39 @@ static PrefParam param[] = {
        {"newmail_notify_cmd", "", &prefs_common.newmail_notify_cmd, P_STRING,
         &receive.entry_newmail_notify_cmd,
         prefs_set_data_from_entry, prefs_set_entry},
+       {"receive_dialog_mode", "1", &prefs_common.recv_dialog_mode, P_ENUM,
+        &receive.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, &receive.checkbtn_no_recv_err_panel,
+        prefs_set_data_from_toggle, prefs_set_toggle},
+       {"close_receive_dialog", "TRUE", &prefs_common.close_recv_dialog,
+        P_BOOL, &receive.checkbtn_close_recv_dialog,
+        prefs_set_data_from_toggle, prefs_set_toggle},
  
-       {"max_news_articles", "300", &prefs_common.max_articles, P_INT,
-        &receive.spinbtn_maxarticle,
-        prefs_set_data_from_spinbtn, prefs_set_spinbtn},
-
        /* Send */
-       {"use_ext_sendmail", "FALSE", &prefs_common.use_extsend, P_BOOL,
-        &p_send.checkbtn_extsend,
-        prefs_set_data_from_toggle, prefs_set_toggle},
-       {"ext_sendmail_cmd", DEFAULT_SENDMAIL_CMD,
-        &prefs_common.extsend_cmd, P_STRING,
-        &p_send.entry_extsend, prefs_set_data_from_entry, prefs_set_entry},
        {"save_message", "TRUE", &prefs_common.savemsg, P_BOOL,
         &p_send.checkbtn_savemsg,
         prefs_set_data_from_toggle, prefs_set_toggle},
        {"queue_message", "FALSE", &prefs_common.queue_msg, P_BOOL,
         &p_send.checkbtn_queuemsg,
         prefs_set_data_from_toggle, prefs_set_toggle},
+       {"send_dialog_mode", "0", &prefs_common.send_dialog_mode, P_ENUM,
+        &p_send.optmenu_senddialog,
+        prefs_common_send_dialog_set_data_from_optmenu,
+        prefs_common_send_dialog_set_optmenu},
 
        {"outgoing_charset", CS_AUTO, &prefs_common.outgoing_charset, P_STRING,
         &p_send.optmenu_charset,
         prefs_common_charset_set_data_from_optmenu,
         prefs_common_charset_set_optmenu},
+       {"encoding_method", "0", &prefs_common.encoding_method, P_ENUM,
+        &p_send.optmenu_encoding_method,
+        prefs_common_encoding_set_data_from_optmenu,
+        prefs_common_encoding_set_optmenu},
 
        /* Compose */
-       {"auto_signature", "TRUE", &prefs_common.auto_sig, P_BOOL,
-        &compose.checkbtn_autosig,
-        prefs_set_data_from_toggle, prefs_set_toggle},
-       {"signature_separator", "-- ", &prefs_common.sig_sep, P_STRING,
-        &compose.entry_sigsep, prefs_set_data_from_entry, prefs_set_entry},
-
        {"auto_ext_editor", "FALSE", &prefs_common.auto_exteditor, P_BOOL,
         &compose.checkbtn_autoextedit,
         prefs_set_data_from_toggle, prefs_set_toggle},
@@ -401,25 +351,19 @@ static PrefParam param[] = {
         P_INT, &compose.entry_autosave_length,
         prefs_set_data_from_entry, prefs_set_entry},
 #if USE_ASPELL
-       {"enable_aspell", "TRUE", &prefs_common.enable_aspell,
-        P_BOOL, &spelling.checkbtn_enable_aspell,
-        prefs_set_data_from_toggle, prefs_set_toggle},
-       {"aspell_path", ASPELL_PATH, &prefs_common.aspell_path, 
-        P_STRING, &spelling.entry_aspell_path, 
-        prefs_set_data_from_entry, prefs_set_entry},
-       {"dictionary",  "", &prefs_common.dictionary,
-        P_STRING, &spelling.optmenu_dictionary, 
-        prefs_dictionary_set_data_from_optmenu, prefs_dictionary_set_optmenu },
-       {"aspell_sugmode",  "1", &prefs_common.aspell_sugmode,
-        P_INT, &spelling.optmenu_sugmode, 
-        prefs_speller_sugmode_set_data_from_optmenu, prefs_speller_sugmode_set_optmenu },
-       {"use_alternate_dict", "FALSE", &prefs_common.use_alternate,
-        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,
+       {"enable_aspell", "TRUE", &prefs_common.enable_aspell, P_BOOL,
+        NULL, NULL, NULL},
+       {"aspell_path", ASPELL_PATH, &prefs_common.aspell_path, P_STRING,
+        NULL, NULL, NULL},
+       {"dictionary",  "", &prefs_common.dictionary, P_STRING,
+        NULL, NULL, NULL},
+       {"aspell_sugmode", "1", &prefs_common.aspell_sugmode, P_INT,
+        NULL, NULL, NULL},
+       {"use_alternate_dict", "FALSE", &prefs_common.use_alternate, P_BOOL,
+        NULL, NULL, NULL},
+       {"check_while_typing", "TRUE", &prefs_common.check_while_typing, P_BOOL,
+        NULL, NULL, NULL},
+       {"misspelled_color", "16711680", &prefs_common.misspelled_col, P_COLOR,
         NULL, NULL, NULL},
 #endif
        {"reply_with_quote", "TRUE", &prefs_common.reply_with_quote, P_BOOL,
@@ -469,21 +413,13 @@ static PrefParam param[] = {
        {"widget_font", NULL, &prefs_common.widgetfont, P_STRING,
         NULL, NULL, NULL},
        {"message_font", "-misc-fixed-medium-r-normal--14-*-*-*-*-*-*-*",
-        &prefs_common.textfont, P_STRING,
-        &display.entry_textfont,
-        prefs_set_data_from_entry, prefs_set_entry},
+        &prefs_common.textfont, P_STRING, NULL, NULL, NULL},
        {"small_font",   "-*-helvetica-medium-r-normal--10-*-*-*-*-*-*-*",
-        &prefs_common.smallfont,   P_STRING,
-        &display.entry_smallfont,
-        prefs_set_data_from_entry, prefs_set_entry},
+        &prefs_common.smallfont,   P_STRING, NULL, NULL, NULL},
        {"bold_font",    "-*-helvetica-bold-r-normal--12-*-*-*-*-*-*-*",
-        &prefs_common.boldfont,    P_STRING,
-        &display.entry_boldfont,
-        prefs_set_data_from_entry, prefs_set_entry},
+        &prefs_common.boldfont,    P_STRING, NULL, NULL, NULL},
        {"normal_font",  "-*-helvetica-medium-r-normal--12-*-*-*-*-*-*-*",
-        &prefs_common.normalfont,  P_STRING,
-        &display.entry_normalfont, 
-        prefs_set_data_from_entry, prefs_set_entry},
+        &prefs_common.normalfont,  P_STRING, NULL, NULL, NULL},
 
 
        {"display_folder_unread_num", "TRUE",
@@ -506,17 +442,19 @@ static PrefParam param[] = {
        {"use_address_book", "TRUE", &prefs_common.use_addr_book, P_BOOL,
         &display.chkbtn_useaddrbook,
         prefs_set_data_from_toggle, prefs_set_toggle},
+       {"thread_by_subject", "TRUE", &prefs_common.thread_by_subject, P_BOOL,
+        &display.chkbtn_threadsubj,
+        prefs_set_data_from_toggle, prefs_set_toggle},
        {"date_format", "%y/%m/%d(%a) %H:%M", &prefs_common.date_format,
         P_STRING, &display.entry_datefmt,
         prefs_set_data_from_entry, prefs_set_entry},
-       {"expand_thread", "TRUE", &prefs_common.expand_thread, P_BOOL,
-        &display.chkbtn_expand_thread,
-        prefs_set_data_from_toggle, prefs_set_toggle},
 
        {"enable_hscrollbar", "TRUE", &prefs_common.enable_hscrollbar, P_BOOL,
         NULL, NULL, NULL},
        {"bold_unread", "TRUE", &prefs_common.bold_unread, P_BOOL,
         NULL, NULL, NULL},
+       {"thread_by_subject_max_age", "10", &prefs_common.thread_by_subject_max_age,
+       P_INT, NULL, NULL, NULL },
 
        {"enable_thread", "TRUE", &prefs_common.enable_thread, P_BOOL,
         NULL, NULL, NULL},
@@ -534,7 +472,7 @@ static PrefParam param[] = {
        {"summary_col_show_mark", "TRUE",
         &prefs_common.summary_col_visible[S_COL_MARK], P_BOOL, NULL, NULL, NULL},
        {"summary_col_show_unread", "TRUE",
-        &prefs_common.summary_col_visible[S_COL_UNREAD], P_BOOL, NULL, NULL, NULL},
+        &prefs_common.summary_col_visible[S_COL_STATUS], P_BOOL, NULL, NULL, NULL},
        {"summary_col_show_mime", "TRUE",
         &prefs_common.summary_col_visible[S_COL_MIME], P_BOOL, NULL, NULL, NULL},
        {"summary_col_show_subject", "TRUE",
@@ -555,7 +493,7 @@ static PrefParam param[] = {
        {"summary_col_pos_mark", "0",
          &prefs_common.summary_col_pos[S_COL_MARK], P_INT, NULL, NULL, NULL},
        {"summary_col_pos_unread", "1",
-         &prefs_common.summary_col_pos[S_COL_UNREAD], P_INT, NULL, NULL, NULL},
+         &prefs_common.summary_col_pos[S_COL_STATUS], P_INT, NULL, NULL, NULL},
        {"summary_col_pos_mime", "2",
          &prefs_common.summary_col_pos[S_COL_MIME], P_INT, NULL, NULL, NULL},
        {"summary_col_pos_subject", "3",
@@ -576,7 +514,7 @@ static PrefParam param[] = {
        {"summary_col_size_mark", "10",
         &prefs_common.summary_col_size[S_COL_MARK], P_INT, NULL, NULL, NULL},
        {"summary_col_size_unread", "13",
-        &prefs_common.summary_col_size[S_COL_UNREAD], P_INT, NULL, NULL, NULL},
+        &prefs_common.summary_col_size[S_COL_STATUS], P_INT, NULL, NULL, NULL},
        {"summary_col_size_mime", "10",
         &prefs_common.summary_col_size[S_COL_MIME], P_INT, NULL, NULL, NULL},
        {"summary_col_size_subject", "200",
@@ -595,10 +533,17 @@ static PrefParam param[] = {
         &prefs_common.summary_col_size[S_COL_LOCKED], P_INT, NULL, NULL, NULL},
 
        /* Widget size */
+       {"folderwin_x", "16", &prefs_common.folderwin_x, P_INT,
+        NULL, NULL, NULL},
+       {"folderwin_y", "16", &prefs_common.folderwin_y, P_INT,
+        NULL, NULL, NULL},
        {"folderview_width", "179", &prefs_common.folderview_width, P_INT,
         NULL, NULL, NULL},
        {"folderview_height", "600", &prefs_common.folderview_height, P_INT,
         NULL, NULL, NULL},
+       {"folderview_visible", "TRUE", &prefs_common.folderview_visible, P_BOOL,
+        NULL, NULL, NULL},
+
        {"folder_col_folder", "150", &prefs_common.folder_col_folder, P_INT,
         NULL, NULL, NULL},
        {"folder_col_new", "32", &prefs_common.folder_col_new, P_INT,
@@ -613,6 +558,17 @@ static PrefParam param[] = {
        {"summaryview_height", "173", &prefs_common.summaryview_height, P_INT,
         NULL, NULL, NULL},
 
+       {"main_messagewin_x", "256", &prefs_common.main_msgwin_x, P_INT,
+        NULL, NULL, NULL},
+       {"main_messagewin_y", "210", &prefs_common.main_msgwin_y, P_INT,
+        NULL, NULL, NULL},
+       {"messageview_width", "600", &prefs_common.msgview_width, P_INT,
+        NULL, NULL, NULL},
+       {"messageview_height", "540", &prefs_common.msgview_height, P_INT,
+        NULL, NULL, NULL},
+       {"messageview_visible", "TRUE", &prefs_common.msgview_visible, P_BOOL,
+        NULL, NULL, NULL},
+
        {"mainview_x", "64", &prefs_common.mainview_x, P_INT,
         NULL, NULL, NULL},
        {"mainview_y", "64", &prefs_common.mainview_y, P_INT,
@@ -633,6 +589,10 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"messagewin_height", "540", &prefs_common.msgwin_height, P_INT,
         NULL, NULL, NULL},
+       {"sourcewin_width", "600", &prefs_common.sourcewin_width, P_INT,
+        NULL, NULL, NULL},
+       {"sourcewin_height", "500", &prefs_common.sourcewin_height, P_INT,
+        NULL, NULL, NULL},
        {"compose_width", "600", &prefs_common.compose_width, P_INT,
         NULL, NULL, NULL},
        {"compose_height", "560", &prefs_common.compose_height, P_INT,
@@ -643,17 +603,17 @@ static PrefParam param[] = {
         &message.chkbtn_enablecol,
         prefs_set_data_from_toggle, prefs_set_toggle},
 
-       {"quote_level1_color", "179", &prefs_common.quote_level1_col, P_INT,
+       {"quote_level1_color", "179", &prefs_common.quote_level1_col, P_COLOR,
         NULL, NULL, NULL},
-       {"quote_level2_color", "179", &prefs_common.quote_level2_col, P_INT,
+       {"quote_level2_color", "179", &prefs_common.quote_level2_col, P_COLOR,
         NULL, NULL, NULL},
-       {"quote_level3_color", "179", &prefs_common.quote_level3_col, P_INT,
+       {"quote_level3_color", "179", &prefs_common.quote_level3_col, P_COLOR,
         NULL, NULL, NULL},
-       {"uri_color", "32512", &prefs_common.uri_col, P_INT,
+       {"uri_color", "32512", &prefs_common.uri_col, P_COLOR,
         NULL, NULL, NULL},
-       {"target_folder_color", "14294218", &prefs_common.tgt_folder_col, P_INT,
+       {"target_folder_color", "14294218", &prefs_common.tgt_folder_col, P_COLOR,
         NULL, NULL, NULL},
-       {"signature_color", "7960953", &prefs_common.signature_col, P_INT,
+       {"signature_color", "7960953", &prefs_common.signature_col, P_COLOR,
         NULL, NULL, NULL},
        {"recycle_quote_colors", "FALSE", &prefs_common.recycle_quote_colors,
         P_BOOL, NULL, NULL, NULL},
@@ -685,16 +645,13 @@ static PrefParam param[] = {
         &message.chkbtn_halfpage,
         prefs_set_data_from_toggle, prefs_set_toggle},
 
-       {"display_img", "TRUE", &prefs_common.display_img, P_BOOL,
-        &message.chkbtn_display_img,
-        prefs_set_data_from_toggle, prefs_set_toggle},
-       {"resize_image", "TRUE", &prefs_common.resize_image, P_BOOL,
-        &message.chkbtn_resize_image,
-        prefs_set_data_from_toggle, prefs_set_toggle},
-
        {"show_other_header", "FALSE", &prefs_common.show_other_header, P_BOOL,
         NULL, NULL, NULL},
 
+       {"attach_desc", "TRUE", &prefs_common.attach_desc, P_BOOL,
+        &message.chkbtn_attach_desc,
+        prefs_set_data_from_toggle, prefs_set_toggle},
+
        /* MIME viewer */
        {"mime_image_viewer", "display '%s'",
         &prefs_common.mime_image_viewer, P_STRING, NULL, NULL, NULL},
@@ -709,10 +666,6 @@ static PrefParam param[] = {
         &prefs_common.auto_check_signatures, P_BOOL,
         &privacy.checkbtn_auto_check_signatures,
         prefs_set_data_from_toggle, prefs_set_toggle},
-       {"gpg_signature_popup", "FALSE",
-        &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},
@@ -738,9 +691,9 @@ 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,
+       {"always_show_message_when_selected", "FALSE",
+        &prefs_common.always_show_msg,
+        P_BOOL, &interface.checkbtn_always_show_msg,
         prefs_set_data_from_toggle, prefs_set_toggle},
        {"open_unread_on_enter", "FALSE", &prefs_common.open_unread_on_enter,
         P_BOOL, &interface.checkbtn_openunread,
@@ -755,20 +708,6 @@ static PrefParam param[] = {
        {"immediate_execution", "TRUE", &prefs_common.immediate_exec, P_BOOL,
         &interface.checkbtn_immedexec,
         prefs_set_data_from_toggle, prefs_set_toggle},
-       {"receive_dialog_mode", "1", &prefs_common.recv_dialog_mode, P_ENUM,
-        &interface.optmenu_recvdialog,
-        prefs_common_recv_dialog_set_data_from_optmenu,
-        prefs_common_recv_dialog_set_optmenu},
-       {"send_dialog_mode", "0", &prefs_common.send_dialog_mode, P_ENUM,
-        &interface.optmenu_senddialog,
-        prefs_common_send_dialog_set_data_from_optmenu,
-        prefs_common_send_dialog_set_optmenu},
-       {"no_receive_error_panel", "FALSE", &prefs_common.no_recv_err_panel,
-        P_BOOL, &interface.checkbtn_no_recv_err_panel,
-        prefs_set_data_from_toggle, prefs_set_toggle},
-       {"close_receive_dialog", "TRUE", &prefs_common.close_recv_dialog,
-        P_BOOL, &interface.checkbtn_close_recv_dialog,
-        prefs_set_data_from_toggle, prefs_set_toggle},
        {"nextunreadmsg_dialog", NULL, &prefs_common.next_unread_msg_dialog, P_ENUM,
         &interface.optmenu_nextunreadmsgdialog,
         prefs_nextunreadmsgdialog_set_data_from_optmenu,
@@ -777,6 +716,9 @@ static PrefParam param[] = {
        {"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},
+
+       {"hover_timeout", "500", &prefs_common.hover_timeout, P_INT,
+        NULL, NULL, NULL},
        
        /* Other */
        {"uri_open_command", DEFAULT_BROWSER_CMD,
@@ -816,14 +758,17 @@ static PrefParam param[] = {
        {"summary_quicksearch_type", "0", &prefs_common.summary_quicksearch_type, P_INT,
         NULL, NULL, NULL},
 
+       {"io_timeout_secs", "60", &prefs_common.io_timeout_secs,
+        P_INT, &other.spinbtn_iotimeout,
+        prefs_set_data_from_spinbtn, prefs_set_spinbtn},
        {"hide_score", "-9999", &prefs_common.kill_score, P_INT,
         NULL, NULL, NULL},
        {"important_score", "1", &prefs_common.important_score, P_INT,
         NULL, NULL, NULL},
-        {"clip_log", "FALSE", &prefs_common.cliplog, P_BOOL,
+        {"clip_log", "TRUE", &prefs_common.cliplog, P_BOOL,
         &other.checkbtn_cliplog,
         prefs_set_data_from_toggle, prefs_set_toggle},
-       {"log_length", "1000", &prefs_common.loglength, P_INT,
+       {"log_length", "500", &prefs_common.loglength, P_INT,
         &other.loglength_entry,
         prefs_set_data_from_entry, prefs_set_entry},
 
@@ -832,6 +777,9 @@ static PrefParam param[] = {
        {"cache_min_keep_time", "15", &prefs_common.cache_min_keep_time, P_INT,
         NULL, NULL, NULL},
 
+       {"color_new", "179", &prefs_common.color_new, P_COLOR,
+        NULL, NULL, NULL},
+
        {NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
 };
 
@@ -839,9 +787,6 @@ static PrefParam param[] = {
 static void prefs_common_create                (void);
 static void prefs_receive_create       (void);
 static void prefs_send_create          (void);
-#ifdef USE_ASPELL
-static void prefs_spelling_create      (void);
-#endif
 static void prefs_compose_create       (void);
 static void prefs_quote_create         (void);
 static void prefs_display_create       (void);
@@ -891,13 +836,6 @@ static void set_button_bg_color                    (GtkWidget      *widget,
 static void prefs_enable_message_color_toggled (void);
 static void prefs_recycle_colors_toggled       (GtkWidget      *widget);
 
-static void prefs_font_select  (GtkButton *button, GtkEntry *entry);
-
-static void prefs_font_selection_key_pressed   (GtkWidget      *widget,
-                                                GdkEventKey    *event,
-                                                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,
@@ -918,10 +856,16 @@ static void prefs_common_ok               (void);
 static void prefs_common_apply         (void);
 static void prefs_common_cancel                (void);
 
-void prefs_common_init() {
+void prefs_common_init(void) 
+{
        prefs_common.disphdr_list = NULL;
 }
 
+PrefsCommon *prefs_common_get(void)
+{
+       return &prefs_common;
+}
+
 void prefs_common_read_config(void)
 {
        FILE *fp;
@@ -1026,10 +970,6 @@ static void prefs_common_create(void)
        SET_NOTEBOOK_LABEL(dialog.notebook, _("Send"),      page++);
        prefs_compose_create();
        SET_NOTEBOOK_LABEL(dialog.notebook, _("Compose"),   page++);
-#if USE_ASPELL
-       prefs_spelling_create();
-       SET_NOTEBOOK_LABEL(dialog.notebook, _("Spell Checker"),   page++);
-#endif 
        prefs_quote_create();
        SET_NOTEBOOK_LABEL(dialog.notebook, _("Quote"),   page++);
        prefs_display_create();
@@ -1059,12 +999,6 @@ static void prefs_receive_create(void)
        GtkWidget *entry_incext;
        /* GtkWidget *button_incext; */
 
-       GtkWidget *frame_spool;
-       GtkWidget *checkbtn_local;
-       GtkWidget *checkbtn_filter_on_inc;
-       GtkWidget *label_spool;
-       GtkWidget *entry_spool;
-
        GtkWidget *hbox_autochk;
        GtkWidget *checkbtn_autochk;
        GtkWidget *label_autochk1;
@@ -1082,10 +1016,13 @@ static void prefs_receive_create(void)
        GtkWidget *entry_newmail_notify_cmd;
        GtkWidget *label_newmail_notify_cmd;
 
-       GtkWidget *frame_news;
-       GtkWidget *label_maxarticle;
-       GtkWidget *spinbtn_maxarticle;
-       GtkObject *spinbtn_maxarticle_adj;
+       GtkWidget *hbox_recvdialog;
+       GtkWidget *label_recvdialog;
+       GtkWidget *menu;
+       GtkWidget *menuitem;
+       GtkWidget *optmenu_recvdialog;
+       GtkWidget *checkbtn_no_recv_err_panel;
+       GtkWidget *checkbtn_close_recv_dialog;
 
        vbox1 = gtk_vbox_new (FALSE, VSPACING);
        gtk_widget_show (vbox1);
@@ -1122,35 +1059,6 @@ static void prefs_receive_create(void)
        gtk_box_pack_start (GTK_BOX (hbox), button_incext, FALSE, FALSE, 0);
 #endif
 
-       PACK_FRAME(vbox1, frame_spool, _("Local spool"));
-
-       vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW);
-       gtk_widget_show (vbox2);
-       gtk_container_add (GTK_CONTAINER (frame_spool), vbox2);
-       gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
-
-       hbox = gtk_hbox_new (FALSE, 32);
-       gtk_widget_show (hbox);
-       gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
-
-       PACK_CHECK_BUTTON (hbox, checkbtn_local, _("Incorporate from spool"));
-       PACK_CHECK_BUTTON (hbox, checkbtn_filter_on_inc,
-                          _("Filter on incorporation"));
-       SET_TOGGLE_SENSITIVITY (checkbtn_local, checkbtn_filter_on_inc);
-
-       hbox = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox);
-       gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
-       SET_TOGGLE_SENSITIVITY (checkbtn_local, hbox);
-
-       label_spool = gtk_label_new (_("Spool directory"));
-       gtk_widget_show (label_spool);
-       gtk_box_pack_start (GTK_BOX (hbox), label_spool, FALSE, FALSE, 0);
-
-       entry_spool = gtk_entry_new ();
-       gtk_widget_show (entry_spool);
-       gtk_box_pack_start (GTK_BOX (hbox), entry_spool, TRUE, TRUE, 0);
-
        vbox2 = gtk_vbox_new (FALSE, 0);
        gtk_widget_show (vbox2);
        gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
@@ -1188,6 +1096,34 @@ static void prefs_receive_create(void)
        PACK_CHECK_BUTTON (vbox2, checkbtn_scan_after_inc,
                           _("Update all local folders after incorporation"));
 
+
+       /* receive dialog */
+       hbox_recvdialog = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox_recvdialog);
+       gtk_box_pack_start (GTK_BOX (vbox2), hbox_recvdialog, FALSE, FALSE, 0);
+
+       label_recvdialog = gtk_label_new (_("Show receive dialog"));
+       gtk_misc_set_alignment(GTK_MISC(label_recvdialog), 0, 0.5);
+       gtk_widget_show (label_recvdialog);
+       gtk_box_pack_start (GTK_BOX (hbox_recvdialog), label_recvdialog, FALSE, FALSE, 0);
+
+       optmenu_recvdialog = gtk_option_menu_new ();
+       gtk_widget_show (optmenu_recvdialog);
+       gtk_box_pack_start (GTK_BOX (hbox_recvdialog), optmenu_recvdialog, FALSE, FALSE, 0);
+
+       menu = gtk_menu_new ();
+       MENUITEM_ADD (menu, menuitem, _("Always"), RECV_DIALOG_ALWAYS);
+       MENUITEM_ADD (menu, menuitem, _("Only on manual receiving"),
+                     RECV_DIALOG_MANUAL);
+       MENUITEM_ADD (menu, menuitem, _("Never"), RECV_DIALOG_NEVER);
+
+       gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_recvdialog), menu);
+
+       PACK_CHECK_BUTTON (vbox2, checkbtn_no_recv_err_panel,
+                          _("Don't popup error dialog on receive error"));
+
+       PACK_CHECK_BUTTON (vbox2, checkbtn_close_recv_dialog,
+                          _("Close receive dialog when finished"));
        
        PACK_FRAME(vbox1, frame_newmail, _("Run command when new mail "
                                           "arrives"));
@@ -1233,39 +1169,10 @@ static void prefs_receive_create(void)
                                 prefs_common.newmail_notify_auto || 
                                 prefs_common.newmail_notify_manu);
 
-       PACK_FRAME(vbox1, frame_news, _("News"));
-
-       hbox = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox);
-       gtk_container_add (GTK_CONTAINER (frame_news), hbox);
-       gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
-
-       label_maxarticle = gtk_label_new
-               (_("Maximum number of articles to download\n"
-                  "(unlimited if 0 is specified)"));
-       gtk_widget_show (label_maxarticle);
-       gtk_box_pack_start (GTK_BOX (hbox), label_maxarticle, FALSE, FALSE, 0);
-       gtk_label_set_justify (GTK_LABEL (label_maxarticle), GTK_JUSTIFY_LEFT);
-
-       spinbtn_maxarticle_adj =
-               gtk_adjustment_new (300, 0, 10000, 10, 100, 100);
-       spinbtn_maxarticle = gtk_spin_button_new
-               (GTK_ADJUSTMENT (spinbtn_maxarticle_adj), 10, 0);
-       gtk_widget_show (spinbtn_maxarticle);
-       gtk_box_pack_start (GTK_BOX (hbox), spinbtn_maxarticle,
-                           FALSE, FALSE, 0);
-       gtk_widget_set_usize (spinbtn_maxarticle, 64, -1);
-       gtk_spin_button_set_numeric
-               (GTK_SPIN_BUTTON (spinbtn_maxarticle), TRUE);
-
        receive.checkbtn_incext = checkbtn_incext;
        receive.entry_incext    = entry_incext;
        /* receive.button_incext   = button_incext; */
 
-       receive.checkbtn_local         = checkbtn_local;
-       receive.checkbtn_filter_on_inc = checkbtn_filter_on_inc;
-       receive.entry_spool            = entry_spool;
-
        receive.checkbtn_autochk    = checkbtn_autochk;
        receive.spinbtn_autochk     = spinbtn_autochk;
        receive.spinbtn_autochk_adj = spinbtn_autochk_adj;
@@ -1278,64 +1185,36 @@ static void prefs_receive_create(void)
        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;
+       receive.optmenu_recvdialog          = optmenu_recvdialog;
+       receive.checkbtn_no_recv_err_panel  = checkbtn_no_recv_err_panel;
+       receive.checkbtn_close_recv_dialog  = checkbtn_close_recv_dialog;
 }
 
 static void prefs_send_create(void)
 {
        GtkWidget *vbox1;
        GtkWidget *vbox2;
-       GtkWidget *frame_extsend;
-       GtkWidget *vbox_extsend;
-       GtkWidget *checkbtn_extsend;
        GtkWidget *hbox1;
-       GtkWidget *label_extsend;
-       GtkWidget *entry_extsend;
-       /* GtkWidget *button_extsend; */
        GtkWidget *checkbtn_savemsg;
        GtkWidget *checkbtn_queuemsg;
        GtkWidget *label_outcharset;
-       GtkWidget *optmenu;
+       GtkWidget *optmenu_charset;
        GtkWidget *optmenu_menu;
        GtkWidget *menuitem;
-       GtkWidget *label_charset_desc;
+       GtkTooltips *charset_tooltip;
+       GtkWidget *optmenu_encoding;
+       GtkWidget *label_encoding;
+       GtkTooltips *encoding_tooltip;
+       GtkWidget *label_senddialog;
+       GtkWidget *menu;
+       GtkWidget *optmenu_senddialog;
+       GtkWidget *hbox_senddialog;
 
        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, frame_extsend, _("External program"));
-
-       vbox_extsend = gtk_vbox_new (FALSE, VSPACING_NARROW);
-       gtk_widget_show (vbox_extsend);
-       gtk_container_add (GTK_CONTAINER (frame_extsend), vbox_extsend);
-       gtk_container_set_border_width (GTK_CONTAINER (vbox_extsend), 8);
-
-       PACK_CHECK_BUTTON (vbox_extsend, checkbtn_extsend,
-                          _("Use external program for sending"));
-
-       hbox1 = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox1);
-       gtk_box_pack_start (GTK_BOX (vbox_extsend), hbox1, FALSE, FALSE, 0);
-       SET_TOGGLE_SENSITIVITY(checkbtn_extsend, hbox1);
-
-       label_extsend = gtk_label_new (_("Command"));
-       gtk_widget_show (label_extsend);
-       gtk_box_pack_start (GTK_BOX (hbox1), label_extsend, FALSE, FALSE, 0);
-
-       entry_extsend = gtk_entry_new ();
-       gtk_widget_show (entry_extsend);
-       gtk_box_pack_start (GTK_BOX (hbox1), entry_extsend, TRUE, TRUE, 0);
-
-#if 0
-       button_extsend = gtk_button_new_with_label ("... ");
-       gtk_widget_show (button_extsend);
-       gtk_box_pack_start (GTK_BOX (hbox1), button_extsend, FALSE, FALSE, 0);
-#endif
-
        vbox2 = gtk_vbox_new (FALSE, 0);
        gtk_widget_show (vbox2);
        gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
@@ -1345,6 +1224,23 @@ static void prefs_send_create(void)
        PACK_CHECK_BUTTON (vbox2, checkbtn_queuemsg,
                           _("Queue messages that fail to send"));
 
+       hbox_senddialog = gtk_hbox_new (FALSE, 8);
+       gtk_box_pack_start (GTK_BOX (vbox1), hbox_senddialog, FALSE, FALSE, 0);
+
+       label_senddialog = gtk_label_new (_("Show send dialog"));
+       gtk_widget_show (label_senddialog);
+       gtk_box_pack_start (GTK_BOX (hbox_senddialog), label_senddialog, FALSE, FALSE, 0);
+
+       optmenu_senddialog = gtk_option_menu_new ();
+       gtk_widget_show (optmenu_senddialog);
+       gtk_box_pack_start (GTK_BOX (hbox_senddialog), optmenu_senddialog, FALSE, FALSE, 0);
+       
+       menu = gtk_menu_new ();
+       MENUITEM_ADD (menu, menuitem, _("Always"), SEND_DIALOG_ALWAYS);
+       MENUITEM_ADD (menu, menuitem, _("Never"), SEND_DIALOG_NEVER);
+
+       gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_senddialog), menu);
+
        hbox1 = gtk_hbox_new (FALSE, 8);
        gtk_widget_show (hbox1);
        gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
@@ -1353,20 +1249,26 @@ static void prefs_send_create(void)
        gtk_widget_show (label_outcharset);
        gtk_box_pack_start (GTK_BOX (hbox1), label_outcharset, FALSE, FALSE, 0);
 
-       optmenu = gtk_option_menu_new ();
-       gtk_widget_show (optmenu);
-       gtk_box_pack_start (GTK_BOX (hbox1), optmenu, FALSE, FALSE, 0);
+       charset_tooltip = gtk_tooltips_new();
+
+       optmenu_charset = gtk_option_menu_new ();
+       gtk_widget_show (optmenu_charset);
+       gtk_tooltips_set_tip(GTK_TOOLTIPS(charset_tooltip), optmenu_charset,
+                            _("If `Automatic' is selected, the optimal encoding"
+                              " for the current locale will be used"),
+                            NULL);
+       gtk_box_pack_start (GTK_BOX (hbox1), optmenu_charset, FALSE, FALSE, 0);
 
        optmenu_menu = gtk_menu_new ();
 
-#define SET_MENUITEM(str, charset) \
+#define SET_MENUITEM(str, data) \
 { \
-       MENUITEM_ADD(optmenu_menu, menuitem, str, charset); \
+       MENUITEM_ADD(optmenu_menu, menuitem, str, data); \
 }
 
        SET_MENUITEM(_("Automatic (Recommended)"),       CS_AUTO);
        SET_MENUITEM(_("7bit ascii (US-ASCII)"),         CS_US_ASCII);
-#if HAVE_LIBJCONV
+#if HAVE_ICONV
        SET_MENUITEM(_("Unicode (UTF-8)"),               CS_UTF_8);
 #endif
        SET_MENUITEM(_("Western European (ISO-8859-1)"),  CS_ISO_8859_1);
@@ -1376,11 +1278,11 @@ static void prefs_send_create(void)
        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
+#if HAVE_ICONV
        SET_MENUITEM(_("Cyrillic (ISO-8859-5)"),          CS_ISO_8859_5);
 #endif
        SET_MENUITEM(_("Cyrillic (KOI8-R)"),             CS_KOI8_R);
-#if HAVE_LIBJCONV
+#if HAVE_ICONV
        SET_MENUITEM(_("Cyrillic (Windows-1251)"),       CS_WINDOWS_1251);
        SET_MENUITEM(_("Cyrillic (KOI8-U)"),             CS_KOI8_U);
 #endif
@@ -1399,28 +1301,51 @@ static void prefs_send_create(void)
        SET_MENUITEM(_("Thai (TIS-620)"),                CS_TIS_620);
        SET_MENUITEM(_("Thai (Windows-874)"),            CS_WINDOWS_874);
 
-       gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu), optmenu_menu);
+       gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_charset),
+                                 optmenu_menu);
 
        hbox1 = gtk_hbox_new (FALSE, 8);
        gtk_widget_show (hbox1);
        gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
 
-       label_charset_desc = gtk_label_new
-               (_("If `Automatic' is selected, the optimal encoding\n"
-                  "for the current locale will be used."));
-       gtk_widget_show (label_charset_desc);
-       gtk_box_pack_start (GTK_BOX (hbox1), label_charset_desc,
-                           FALSE, FALSE, 0);
-       gtk_label_set_justify(GTK_LABEL (label_charset_desc), GTK_JUSTIFY_LEFT);
+       hbox1 = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox1);
+       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
 
-       p_send.checkbtn_extsend = checkbtn_extsend;
-       p_send.entry_extsend    = entry_extsend;
-       /* p_send.button_extsend   = button_extsend; */
+       label_encoding = gtk_label_new (_("Transfer encoding"));
+       gtk_widget_show (label_encoding);
+       gtk_box_pack_start (GTK_BOX (hbox1), label_encoding, FALSE, FALSE, 0);
+
+       encoding_tooltip = gtk_tooltips_new();
+
+       optmenu_encoding = gtk_option_menu_new ();
+       gtk_widget_show (optmenu_encoding);
+       gtk_tooltips_set_tip(GTK_TOOLTIPS(encoding_tooltip), optmenu_encoding,
+                            _("Specify Content-Transfer-Encoding used when"
+                              " message body contains non-ASCII characters"),
+                            NULL);
+       gtk_box_pack_start (GTK_BOX (hbox1), optmenu_encoding, FALSE, FALSE, 0);
+
+       optmenu_menu = gtk_menu_new ();
+
+       SET_MENUITEM(_("Automatic"),     CTE_AUTO);
+       SET_MENUITEM("base64",           CTE_BASE64);
+       SET_MENUITEM("quoted-printable", CTE_QUOTED_PRINTABLE);
+       SET_MENUITEM("8bit",             CTE_8BIT);
+
+       gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_encoding),
+                                 optmenu_menu);
+
+       hbox1 = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox1);
+       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
 
        p_send.checkbtn_savemsg  = checkbtn_savemsg;
        p_send.checkbtn_queuemsg = checkbtn_queuemsg;
+       p_send.optmenu_senddialog = optmenu_senddialog;
 
-       p_send.optmenu_charset = optmenu;
+       p_send.optmenu_charset = optmenu_charset;
+       p_send.optmenu_encoding_method = optmenu_encoding;
 }
 
 static void prefs_common_recv_dialog_newmail_notify_toggle_cb(GtkWidget *w, gpointer data)
@@ -1434,303 +1359,10 @@ static void prefs_common_recv_dialog_newmail_notify_toggle_cb(GtkWidget *w, gpoi
        gtk_widget_set_sensitive(receive.hbox_newmail_notify, toggled);
 }
 
-#if USE_ASPELL
-static void prefs_dictionary_set_data_from_optmenu(PrefParam *param)
-{
-       gchar *str;
-       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_fullname = gtkaspell_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_fullname;
-}
-
-static void prefs_dictionary_set_optmenu(PrefParam *pparam)
-{
-       GList *cur;
-       GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
-       GtkWidget *menu;
-       GtkWidget *menuitem;
-       gchar *dict_name;
-       gint n = 0;
-
-       g_return_if_fail(optmenu != NULL);
-       g_return_if_fail(pparam->data != NULL);
-
-       if (*(gchar **) pparam->data) {
-               menu = gtk_option_menu_get_menu(optmenu);
-               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");
-                       if (!strcmp2(dict_name, *((gchar **)pparam->data))) {
-                               gtk_option_menu_set_history(optmenu, n);
-                               return;
-                       }
-                       n++;
-               }
-       }               
-
-       gtk_option_menu_set_history(optmenu, 0);
-       prefs_dictionary_set_data_from_optmenu(pparam);
-}
-
-static void prefs_speller_sugmode_set_data_from_optmenu(PrefParam *param)
-{
-       gint sugmode;
-       g_return_if_fail(param);
-       g_return_if_fail(param->data);
-       g_return_if_fail(param->widget);
-       g_return_if_fail(*(param->widget));
-
-       sugmode = gtkaspell_get_sugmode_from_option_menu
-               (GTK_OPTION_MENU(*(param->widget)));
-       *((gint *) param->data) = sugmode;
-}
-
-static void prefs_speller_sugmode_set_optmenu(PrefParam *pparam)
-{
-       GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
-       gint sugmode;
-
-       g_return_if_fail(optmenu != NULL);
-       g_return_if_fail(pparam->data != NULL);
-
-       sugmode = *(gint *) pparam->data;
-       gtkaspell_sugmode_option_menu_set(optmenu, sugmode);
-}
-       
-       
-static void prefs_spelling_checkbtn_enable_aspell_toggle_cb
-       (GtkWidget *widget,
-        gpointer data)
-{
-       gboolean toggled;
-
-       toggled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
-
-       gtk_widget_set_sensitive(spelling.entry_aspell_path,   toggled);
-       gtk_widget_set_sensitive(spelling.optmenu_dictionary,  toggled);
-       gtk_widget_set_sensitive(spelling.optmenu_sugmode,     toggled);
-       gtk_widget_set_sensitive(spelling.btn_aspell_path,     toggled);
-       gtk_widget_set_sensitive(spelling.misspelled_btn,      toggled);
-       gtk_widget_set_sensitive(spelling.checkbtn_use_alternate,      toggled);
-       gtk_widget_set_sensitive(spelling.checkbtn_check_while_typing, toggled);
-}
-
-static void prefs_spelling_btn_aspell_path_clicked_cb(GtkWidget *widget,
-                                                    gpointer data)
-{
-       gchar *file_path, *tmp;
-       GtkWidget *new_menu;
-
-       file_path = filesel_select_file(_("Select dictionaries location"),
-                                       prefs_common.aspell_path);
-       if (file_path == NULL) {
-               /* don't change */      
-       }
-       else {
-         tmp=g_dirname(file_path);
-         
-               if (prefs_common.aspell_path)
-                       g_free(prefs_common.aspell_path);
-               prefs_common.aspell_path = g_strdup_printf("%s%s",tmp,
-                                                          G_DIR_SEPARATOR_S);
-
-               new_menu = gtkaspell_dictionary_option_menu_new(prefs_common.aspell_path);
-               gtk_option_menu_set_menu(GTK_OPTION_MENU(spelling.optmenu_dictionary),
-                                        new_menu);
-
-               gtk_entry_set_text(GTK_ENTRY(spelling.entry_aspell_path), 
-                                  prefs_common.aspell_path);                                    
-               /* select first one */
-               gtk_option_menu_set_history(GTK_OPTION_MENU(
-                                       spelling.optmenu_dictionary), 0);
-       
-               if (prefs_common.dictionary)
-                       g_free(prefs_common.dictionary);
-
-               prefs_common.dictionary = 
-                       gtkaspell_get_dictionary_menu_active_item(
-                               gtk_option_menu_get_menu(
-                                       GTK_OPTION_MENU(
-                                               spelling.optmenu_dictionary)));
-               g_free(tmp);
-
-       }
-}
-
-static void prefs_spelling_create()
-{
-       GtkWidget *vbox1;
-       GtkWidget *frame_spell;
-       GtkWidget *vbox_spell;
-       GtkWidget *hbox_aspell_path;
-       GtkWidget *checkbtn_enable_aspell;
-       GtkWidget *label_aspell_path;
-       GtkWidget *entry_aspell_path;
-       GtkWidget *btn_aspell_path;
-       GtkWidget *spell_table;
-       GtkWidget *label_dictionary;
-       GtkWidget *optmenu_dictionary;
-       GtkWidget *sugmode_label;
-       GtkWidget *sugmode_optmenu;
-       GtkWidget *checkbtn_use_alternate;
-       GtkWidget *help_label;
-       GtkWidget *checkbtn_check_while_typing;
-       GtkWidget *color_label;
-       GtkWidget *col_align;
-
-       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);
-
-       /* spell checker defaults */                       
-       PACK_FRAME(vbox1, frame_spell, _("Global spelling checker settings"));
-       vbox_spell = gtk_vbox_new(FALSE, VSPACING_NARROW);
-       gtk_widget_show (vbox_spell);
-       gtk_container_add(GTK_CONTAINER(frame_spell), vbox_spell);
-       gtk_container_set_border_width(GTK_CONTAINER(vbox_spell), 8);
-
-       PACK_CHECK_BUTTON(vbox_spell, checkbtn_enable_aspell, 
-                         _("Enable spell checker"));
-
-       gtk_signal_connect(GTK_OBJECT(checkbtn_enable_aspell), "toggled",
-                          GTK_SIGNAL_FUNC(prefs_spelling_checkbtn_enable_aspell_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 an alternate dictionary makes switching\n"
-                                    "with the last used dictionary faster."));
-       gtk_misc_set_alignment (GTK_MISC (help_label), 0, 0);
-       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), 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_aspell_path = gtk_label_new (_("Dictionaries path:"));
-       gtk_misc_set_alignment(GTK_MISC(label_aspell_path), 1.0, 0.5);
-       gtk_widget_show(label_aspell_path);
-       gtk_table_attach (GTK_TABLE (spell_table), label_aspell_path, 0, 1, 0,
-                         1, GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
-       
-       hbox_aspell_path = gtk_hbox_new (FALSE, 8);
-       gtk_table_attach (GTK_TABLE (spell_table), hbox_aspell_path, 1, 2, 0,
-                         1, GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
-       gtk_widget_show(hbox_aspell_path);
-
-       entry_aspell_path = gtk_entry_new();
-       gtk_widget_show(entry_aspell_path);
-       gtk_box_pack_start(GTK_BOX(hbox_aspell_path), entry_aspell_path, TRUE,
-                          TRUE, 0);    
-       
-       gtk_widget_set_sensitive(entry_aspell_path, prefs_common.enable_aspell);
-
-       btn_aspell_path = gtk_button_new_with_label(" ... ");
-       gtk_widget_show(btn_aspell_path);
-       gtk_box_pack_start(GTK_BOX(hbox_aspell_path), btn_aspell_path, FALSE, FALSE, 0);
-       gtk_widget_set_sensitive(btn_aspell_path, prefs_common.enable_aspell);
-
-       gtk_signal_connect(GTK_OBJECT(btn_aspell_path), "clicked", 
-                          GTK_SIGNAL_FUNC(prefs_spelling_btn_aspell_path_clicked_cb),
-                          NULL);
-
-       label_dictionary = gtk_label_new(_("Default dictionary:"));
-       gtk_misc_set_alignment(GTK_MISC(label_dictionary), 1.0, 0.5);
-       gtk_widget_show(label_dictionary);
-       gtk_table_attach (GTK_TABLE (spell_table), label_dictionary, 0, 1, 1, 2,
-                         GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
-
-       optmenu_dictionary = gtk_option_menu_new();
-       gtk_widget_show(optmenu_dictionary);
-       gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu_dictionary), 
-                                gtkaspell_dictionary_option_menu_new(
-                                        prefs_common.aspell_path));
-       gtk_table_attach (GTK_TABLE (spell_table), optmenu_dictionary, 1, 2, 1,
-                         2, GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
-       gtk_widget_set_sensitive(optmenu_dictionary, prefs_common.enable_aspell);
-
-       /* Suggestion mode */
-       sugmode_label = gtk_label_new(_("Default suggestion mode"));
-       gtk_misc_set_alignment(GTK_MISC(sugmode_label), 1.0, 0.5);
-       gtk_widget_show(sugmode_label);
-       gtk_table_attach(GTK_TABLE (spell_table), sugmode_label, 0, 1, 2, 3,
-                        GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
-
-       sugmode_optmenu = gtk_option_menu_new();
-       gtk_widget_show(sugmode_optmenu);
-       gtk_option_menu_set_menu(GTK_OPTION_MENU(sugmode_optmenu),
-                           gtkaspell_sugmode_option_menu_new(prefs_common.aspell_sugmode));
-       gtk_table_attach(GTK_TABLE(spell_table), sugmode_optmenu, 1, 2, 2, 3,
-                        GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
-       gtk_widget_set_sensitive(sugmode_optmenu, prefs_common.enable_aspell);
-
-       /* Color */
-       color_label = gtk_label_new(_("Misspelled word color:"));
-       gtk_misc_set_alignment(GTK_MISC(color_label), 1.0, 0.5);
-       gtk_table_attach (GTK_TABLE (spell_table), color_label, 0, 1, 3, 4,
-                         GTK_FILL, GTK_SHRINK, 0, 0);
-       gtk_widget_show(color_label);
-       
-       col_align = gtk_alignment_new(0.0, 0.5, 0, 0);
-       gtk_widget_show(col_align);
-       gtk_table_attach (GTK_TABLE (spell_table), col_align, 1, 2, 3, 4,
-                         GTK_FILL, GTK_SHRINK, 0, 0);
-
-       spelling.misspelled_btn = gtk_button_new_with_label ("");
-       set_button_bg_color(spelling.misspelled_btn,
-                           prefs_common.misspelled_col);
-       gtk_widget_set_usize (spelling.misspelled_btn, 30, 20);
-       gtk_widget_set_sensitive(spelling.misspelled_btn, prefs_common.enable_aspell);
-       gtk_signal_connect (GTK_OBJECT (spelling.misspelled_btn), "clicked",
-                           GTK_SIGNAL_FUNC(quote_color_set_dialog), "Misspelled word");
-       gtk_container_add(GTK_CONTAINER(col_align), spelling.misspelled_btn);
-
-
-       spelling.checkbtn_enable_aspell = checkbtn_enable_aspell;
-       spelling.entry_aspell_path      = entry_aspell_path;
-       spelling.btn_aspell_path        = btn_aspell_path;
-       spelling.optmenu_dictionary     = optmenu_dictionary;
-       spelling.optmenu_sugmode        = sugmode_optmenu;
-       spelling.checkbtn_use_alternate = checkbtn_use_alternate;
-       spelling.checkbtn_check_while_typing = checkbtn_check_while_typing;
-}
-
-#endif
-
-
 static void prefs_compose_create(void)
 {
        GtkWidget *vbox1;
        GtkWidget *vbox2;
-       GtkWidget *hbox1;
-
-       GtkWidget *frame_sig;
-       GtkWidget *vbox_sig;
-       GtkWidget *checkbtn_autosig;
-       GtkWidget *label_sigsep;
-       GtkWidget *entry_sigsep;
 
        GtkWidget *checkbtn_autoextedit;
 
@@ -1775,29 +1407,6 @@ static void prefs_compose_create(void)
        gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
        gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
 
-       PACK_FRAME(vbox1, frame_sig, _("Signature"));
-
-       vbox_sig = gtk_vbox_new (FALSE, VSPACING_NARROW);
-       gtk_widget_show (vbox_sig);
-       gtk_container_add (GTK_CONTAINER (frame_sig), vbox_sig);
-       gtk_container_set_border_width (GTK_CONTAINER (vbox_sig), 8);
-
-       PACK_CHECK_BUTTON (vbox_sig, checkbtn_autosig,
-                          _("Insert signature automatically"));
-
-       hbox1 = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox1);
-       gtk_box_pack_start (GTK_BOX (vbox_sig), hbox1, TRUE, TRUE, 0);
-       label_sigsep = gtk_label_new (_("Signature separator"));
-       gtk_widget_show (label_sigsep);
-       gtk_box_pack_start (GTK_BOX (hbox1), label_sigsep, FALSE, FALSE, 0);
-
-       entry_sigsep = gtk_entry_new ();
-       gtk_widget_show (entry_sigsep);
-       gtk_box_pack_start (GTK_BOX (hbox1), entry_sigsep, FALSE, FALSE, 0);
-
-       gtk_widget_set_usize (entry_sigsep, 64, -1);
-
         /* Account autoselection */
        PACK_FRAME(vbox1, frame_autosel, _("Automatic account selection"));
 
@@ -1917,8 +1526,6 @@ static void prefs_compose_create(void)
        compose.entry_quotemark  = entry_quotemark;
        compose.text_quotefmt    = text_quotefmt;
        */
-       compose.checkbtn_autosig = checkbtn_autosig;
-       compose.entry_sigsep     = entry_sigsep;
 
        compose.checkbtn_autoextedit = checkbtn_autoextedit;
 
@@ -2108,11 +1715,6 @@ static void prefs_quote_create(void)
 static void prefs_display_create(void)
 {
        GtkWidget *vbox1;
-       GtkWidget *frame_font;
-       GtkWidget *table1;
-       GtkWidget *label_textfont;
-       GtkWidget *entry_textfont;
-       GtkWidget *button_textfont;
        GtkWidget *chkbtn_transhdr;
        GtkWidget *chkbtn_folder_unread;
        GtkWidget *hbox1;
@@ -2123,105 +1725,18 @@ static void prefs_display_create(void)
        GtkWidget *vbox2;
        GtkWidget *chkbtn_swapfrom;
        GtkWidget *chkbtn_useaddrbook;
-       GtkWidget *chkbtn_expand_thread;
+       GtkWidget *chkbtn_threadsubj;
        GtkWidget *vbox3;
        GtkWidget *label_datefmt;
        GtkWidget *button_datefmt;
        GtkWidget *entry_datefmt;
        GtkWidget *button_dispitem;
-       GtkWidget *tmplabel, *tmpbutton, *tmpentry;
 
        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, frame_font, _("Font"));
-
-       table1 = gtk_table_new (4, 3, FALSE);
-
-       gtk_widget_show (table1);
-       gtk_container_add (GTK_CONTAINER (frame_font), table1);
-       gtk_container_set_border_width (GTK_CONTAINER (table1), 8);
-       gtk_table_set_row_spacings (GTK_TABLE (table1), 8);
-       gtk_table_set_col_spacings (GTK_TABLE (table1), 8);
-
-       label_textfont = gtk_label_new (_("Text"));
-       gtk_misc_set_alignment(GTK_MISC(label_textfont), 0, 0.5);
-       gtk_widget_show (label_textfont);
-       gtk_table_attach (GTK_TABLE (table1), label_textfont, 0, 1, 0, 1,
-                         GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
-
-       entry_textfont = gtk_entry_new ();
-       gtk_widget_show (entry_textfont);
-       gtk_table_attach (GTK_TABLE (table1), entry_textfont, 1, 2, 0, 1,
-                         (GTK_EXPAND | GTK_FILL), 0, 0, 0);
-
-       button_textfont = gtk_button_new_with_label (" ... ");
-
-       gtk_widget_show (button_textfont);
-       gtk_table_attach (GTK_TABLE (table1), button_textfont, 2, 3, 0, 1,
-                         0, 0, 0, 0);
-       gtk_signal_connect (GTK_OBJECT (button_textfont), "clicked",
-                           GTK_SIGNAL_FUNC (prefs_font_select), entry_textfont);
-
-       tmplabel = gtk_label_new (_("Small"));
-       gtk_misc_set_alignment(GTK_MISC(tmplabel), 0, 0.5);
-       gtk_widget_show (tmplabel);
-       gtk_table_attach (GTK_TABLE (table1), tmplabel, 0, 1, 1, 2,
-                         GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
-
-       tmpentry = gtk_entry_new ();
-       gtk_widget_show (tmpentry);
-       gtk_table_attach (GTK_TABLE (table1), tmpentry, 1, 2, 1, 2,
-                         (GTK_EXPAND | GTK_FILL), 0, 0, 0);
-
-       tmpbutton = gtk_button_new_with_label (" ... ");
-       gtk_widget_show (tmpbutton);
-       gtk_table_attach (GTK_TABLE (table1), tmpbutton, 2, 3, 1, 2,
-                         0, 0, 0, 0);
-       gtk_signal_connect (GTK_OBJECT(tmpbutton), "clicked",
-                           GTK_SIGNAL_FUNC(prefs_font_select), tmpentry);
-       display.entry_smallfont = tmpentry;                       
-
-       tmplabel = gtk_label_new (_("Normal"));
-       gtk_misc_set_alignment(GTK_MISC(tmplabel), 0, 0.5);
-       gtk_widget_show (tmplabel);
-       gtk_table_attach (GTK_TABLE (table1), tmplabel, 0, 1, 2, 3,
-                         GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
-
-       tmpentry = gtk_entry_new ();
-       gtk_widget_show (tmpentry);
-       gtk_table_attach (GTK_TABLE (table1), tmpentry, 1, 2, 2, 3,
-                         (GTK_EXPAND | GTK_FILL), 0, 0, 0);
-
-       tmpbutton = gtk_button_new_with_label (" ... ");
-       gtk_widget_show (tmpbutton);
-       gtk_table_attach (GTK_TABLE (table1), tmpbutton, 2, 3, 2, 3,
-                         0, 0, 0, 0);
-       gtk_signal_connect (GTK_OBJECT(tmpbutton), "clicked",
-                               GTK_SIGNAL_FUNC(prefs_font_select), tmpentry);
-       display.entry_normalfont = tmpentry;                      
-
-       tmplabel = gtk_label_new (_("Bold"));
-       gtk_misc_set_alignment(GTK_MISC(tmplabel), 0, 0.5);
-       gtk_widget_show (tmplabel);
-       gtk_table_attach (GTK_TABLE (table1), tmplabel, 0, 1, 3, 4,
-                         GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
-
-       tmpentry = gtk_entry_new ();
-       gtk_widget_show (tmpentry);
-       gtk_table_attach (GTK_TABLE (table1), tmpentry, 1, 2, 3, 4,
-                         (GTK_EXPAND | GTK_FILL), 0, 0, 0);
-
-       tmpbutton = gtk_button_new_with_label (" ... ");
-       gtk_widget_show (tmpbutton);
-       gtk_table_attach (GTK_TABLE (table1), tmpbutton, 2, 3, 3, 4,
-                         0, 0, 0, 0);
-       gtk_signal_connect (GTK_OBJECT(tmpbutton), "clicked",
-                               GTK_SIGNAL_FUNC(prefs_font_select), tmpentry);
-       display.entry_boldfont = tmpentry;
-
        vbox2 = gtk_vbox_new (FALSE, 0);
        gtk_widget_show (vbox2);
        gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, TRUE, 0);
@@ -2270,12 +1785,13 @@ static void prefs_display_create(void)
 
        PACK_CHECK_BUTTON
                (vbox2, chkbtn_swapfrom,
-                _("Display recipient on `From' column if sender is yourself"));
+                _("Display recipient in `From' column if sender is yourself"));
        PACK_CHECK_BUTTON
                (vbox2, chkbtn_useaddrbook,
                 _("Display sender using address book"));
        PACK_CHECK_BUTTON
-               (vbox2, chkbtn_expand_thread, _("Expand threads"));
+               (vbox2, chkbtn_threadsubj,
+                _("Thread using subject in addition to standard headers"));
 
        PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
 
@@ -2312,17 +1828,14 @@ static void prefs_display_create(void)
                            GTK_SIGNAL_FUNC (prefs_summary_column_open),
                            NULL);
 
-       display.entry_textfont  = entry_textfont;
-       display.button_textfont = button_textfont;
-
        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_expand_thread = chkbtn_expand_thread;
        display.chkbtn_useaddrbook   = chkbtn_useaddrbook;
+       display.chkbtn_threadsubj    = chkbtn_threadsubj;
        display.entry_datefmt        = entry_datefmt;
 }
 
@@ -2353,8 +1866,7 @@ static void prefs_message_create(void)
        GtkWidget *spinbtn_scrollstep;
        GtkWidget *chkbtn_halfpage;
 
-       GtkWidget *chkbtn_display_img;
-       GtkWidget *chkbtn_resize_image;
+       GtkWidget *chkbtn_attach_desc;
 
        vbox1 = gtk_vbox_new (FALSE, VSPACING);
        gtk_widget_show (vbox1);
@@ -2371,9 +1883,9 @@ static void prefs_message_create(void)
 
        PACK_CHECK_BUTTON (hbox1, chkbtn_enablecol,
                           _("Enable coloration of message"));
-       gtk_signal_connect (GTK_OBJECT (chkbtn_enablecol), "toggled",
-                                               GTK_SIGNAL_FUNC (prefs_enable_message_color_toggled),
-                                               NULL);
+       gtk_signal_connect(GTK_OBJECT(chkbtn_enablecol), "toggled",
+                          GTK_SIGNAL_FUNC(prefs_enable_message_color_toggled),
+                          NULL);
 
        button_edit_col = gtk_button_new_with_label (_(" Edit... "));
        gtk_widget_show (button_edit_col);
@@ -2484,11 +1996,9 @@ static void prefs_message_create(void)
        gtk_widget_show (vbox3);
        gtk_box_pack_start (GTK_BOX (vbox1), vbox3, FALSE, FALSE, 0);
 
-       PACK_CHECK_BUTTON(vbox3, chkbtn_display_img,
-                          _("Automatically display attached images"));
+       PACK_CHECK_BUTTON(vbox3, chkbtn_attach_desc,
+                         _("Show attachment descriptions (rather than names)"));
 
-       PACK_CHECK_BUTTON(vbox3, chkbtn_resize_image,
-                         _("Resize attached images"));
 
        message.chkbtn_enablecol   = chkbtn_enablecol;
        message.button_edit_col    = button_edit_col;
@@ -2503,8 +2013,7 @@ static void prefs_message_create(void)
        message.spinbtn_scrollstep_adj = spinbtn_scrollstep_adj;
        message.chkbtn_halfpage        = chkbtn_halfpage;
 
-       message.chkbtn_display_img  = chkbtn_display_img;
-       message.chkbtn_resize_image = chkbtn_resize_image;
+       message.chkbtn_attach_desc  = chkbtn_attach_desc;
 }
 
 #if USE_GPGME
@@ -2517,10 +2026,10 @@ static void prefs_privacy_create(void)
        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;
+       GtkTooltips *store_tooltip;
        GtkWidget *checkbtn_passphrase_grab;
        GtkWidget *checkbtn_gpg_warning;
 
@@ -2536,9 +2045,6 @@ static void prefs_privacy_create(void)
        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"));
-
        PACK_CHECK_BUTTON (vbox2, checkbtn_store_passphrase,
                           _("Store passphrase in memory temporarily"));
 
@@ -2559,11 +2065,17 @@ static void prefs_privacy_create(void)
        gtk_widget_show (label);
        gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
 
+       store_tooltip = gtk_tooltips_new();
+
        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_tooltips_set_tip(GTK_TOOLTIPS(store_tooltip), spinbtn_store_passphrase,
+                            _("Setting to '0' will store the passphrase"
+                              " for the whole session"),
+                            NULL);
+       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);
@@ -2581,12 +2093,6 @@ static void prefs_privacy_create(void)
        gtk_box_pack_start (GTK_BOX (hbox1), hbox_spc, FALSE, FALSE, 0);
        gtk_widget_set_usize (hbox_spc, 12, -1);
 
-       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);
-
        SET_TOGGLE_SENSITIVITY (checkbtn_store_passphrase, vbox3);
 
 #ifndef __MINGW32__
@@ -2604,8 +2110,6 @@ static void prefs_privacy_create(void)
 
        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;
@@ -2620,25 +2124,20 @@ static void prefs_interface_create(void)
        GtkWidget *vbox2;
        GtkWidget *vbox3;
        /* GtkWidget *checkbtn_emacs; */
-       GtkWidget *checkbtn_show_msg_with_cursor;
+       GtkWidget *checkbtn_always_show_msg;
        GtkWidget *checkbtn_openunread;
        GtkWidget *checkbtn_mark_as_read_on_newwin;
        GtkWidget *checkbtn_openinbox;
        GtkWidget *checkbtn_immedexec;
-       GtkWidget *frame_dialogs;
-       GtkWidget *vbox_dialogs;
+       GtkTooltips *immedexec_tooltip;
        GtkWidget *hbox1;
        GtkWidget *label;
-       GtkWidget *dialogs_table;
-       GtkWidget *optmenu_recvdialog;
-       GtkWidget *optmenu_senddialog;
        GtkWidget *menu;
        GtkWidget *menuitem;
-       GtkWidget *checkbtn_no_recv_err_panel;
-       GtkWidget *checkbtn_close_recv_dialog;
 
        GtkWidget *button_keybind;
 
+       GtkWidget *hbox_nextunreadmsgdialog;
        GtkWidget *optmenu_nextunreadmsgdialog;
 
        GtkWidget *frame_pixmap_theme;
@@ -2663,8 +2162,8 @@ static void prefs_interface_create(void)
                               GTK_JUSTIFY_LEFT);   */
 
        PACK_CHECK_BUTTON
-               (vbox2, checkbtn_show_msg_with_cursor,
-                _("Open messages in summary with cursor keys"));
+               (vbox2, checkbtn_always_show_msg,
+                _("Always open messages in summary when selected"));
 
        PACK_CHECK_BUTTON
                (vbox2, checkbtn_openunread,
@@ -2682,47 +2181,32 @@ static void prefs_interface_create(void)
        gtk_widget_show (vbox3);
        gtk_box_pack_start (GTK_BOX (vbox2), vbox3, FALSE, FALSE, 0);
 
+       immedexec_tooltip = gtk_tooltips_new();
+
        PACK_CHECK_BUTTON
                (vbox3, checkbtn_immedexec,
                 _("Execute immediately when moving or deleting messages"));
+       gtk_tooltips_set_tip(GTK_TOOLTIPS(immedexec_tooltip), checkbtn_immedexec,
+                            _("Messages will be marked until execution"
+                              " if this is turned off"),
+                            NULL);
 
        hbox1 = gtk_hbox_new (FALSE, 0);
        gtk_widget_show (hbox1);
        gtk_box_pack_start (GTK_BOX (vbox3), hbox1, FALSE, FALSE, 0);
 
-       label = gtk_label_new
-               (_("(Messages will be marked until execution\n"
-                  " if this is turned off)"));
-       gtk_widget_show (label);
-       gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 8);
-       gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
-
-       PACK_FRAME (vbox1, frame_dialogs, _("Dialogs"));
-       vbox_dialogs = gtk_vbox_new (FALSE, 0);
-       gtk_widget_show (vbox_dialogs);
-       gtk_container_add (GTK_CONTAINER (frame_dialogs), vbox_dialogs);
-       gtk_container_set_border_width (GTK_CONTAINER (vbox_dialogs), 8);
-
-       dialogs_table = gtk_table_new (2, 2, FALSE);
-       gtk_widget_show (dialogs_table);
-       gtk_container_add (GTK_CONTAINER (vbox_dialogs), dialogs_table);
-       gtk_container_set_border_width (GTK_CONTAINER (dialogs_table), 4);
-       gtk_table_set_row_spacings (GTK_TABLE (dialogs_table), VSPACING_NARROW);
-       gtk_table_set_col_spacings (GTK_TABLE (dialogs_table), 8);
-
        /* Next Unread Message Dialog */
+       hbox_nextunreadmsgdialog = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox1);
+       gtk_box_pack_start (GTK_BOX (vbox1), hbox_nextunreadmsgdialog, FALSE, FALSE, 0);
+
        label = gtk_label_new (_("Show no-unread-message dialog"));
-       gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
        gtk_widget_show (label);
-       gtk_table_attach (GTK_TABLE (dialogs_table), label, 0, 1, 0, 1,
-                         GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
-
+       gtk_box_pack_start (GTK_BOX (hbox_nextunreadmsgdialog), label, FALSE, FALSE, 8);
 
        optmenu_nextunreadmsgdialog = gtk_option_menu_new ();
        gtk_widget_show (optmenu_nextunreadmsgdialog);
-       gtk_table_attach (GTK_TABLE (dialogs_table), 
-                         optmenu_nextunreadmsgdialog, 1, 2, 0, 1,
-                         GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
+       gtk_box_pack_start (GTK_BOX (hbox_nextunreadmsgdialog), optmenu_nextunreadmsgdialog, FALSE, FALSE, 8);
        
        menu = gtk_menu_new ();
        MENUITEM_ADD (menu, menuitem, _("Always"), NEXTUNREADMSGDIALOG_ALWAYS);
@@ -2733,50 +2217,6 @@ static void prefs_interface_create(void)
 
        gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_nextunreadmsgdialog), menu);
 
-       label = gtk_label_new (_("Show send dialog"));
-       gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-       gtk_widget_show (label);
-       gtk_table_attach (GTK_TABLE (dialogs_table), label, 0, 1, 1, 2,
-                         GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
-
-       optmenu_senddialog = gtk_option_menu_new ();
-       gtk_widget_show (optmenu_senddialog);
-       gtk_table_attach (GTK_TABLE (dialogs_table), 
-                         optmenu_senddialog, 1, 2, 1, 2,
-                         GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
-       
-       menu = gtk_menu_new ();
-       MENUITEM_ADD (menu, menuitem, _("Always"), SEND_DIALOG_ALWAYS);
-       MENUITEM_ADD (menu, menuitem, _("Never"), SEND_DIALOG_NEVER);
-
-       gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_senddialog), menu);
-
-       label = gtk_label_new (_("Show receive dialog"));
-       gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-       gtk_widget_show (label);
-       gtk_table_attach (GTK_TABLE (dialogs_table), label, 0, 1, 2, 3,
-                         GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
-
-       optmenu_recvdialog = gtk_option_menu_new ();
-       gtk_widget_show (optmenu_recvdialog);
-       gtk_table_attach (GTK_TABLE (dialogs_table), optmenu_recvdialog, 1, 2, 2, 3,
-                         GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
-
-       menu = gtk_menu_new ();
-       MENUITEM_ADD (menu, menuitem, _("Always"), RECV_DIALOG_ALWAYS);
-       MENUITEM_ADD (menu, menuitem, _("Only if a window is active"),
-                     RECV_DIALOG_ACTIVE);
-       MENUITEM_ADD (menu, menuitem, _("Never"), RECV_DIALOG_NEVER);
-
-       gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_recvdialog), menu);
-
-       PACK_CHECK_BUTTON (vbox_dialogs, checkbtn_no_recv_err_panel,
-                          _("Don't popup error dialog on receive error"));
-
-       PACK_CHECK_BUTTON (vbox_dialogs, checkbtn_close_recv_dialog,
-                          _("Close receive dialog when finished"));
-
-
        hbox1 = gtk_hbox_new (FALSE, 8);
        gtk_widget_show (hbox1);
        gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
@@ -2805,17 +2245,12 @@ static void prefs_interface_create(void)
        stock_pixmap_themes_list_free(avail_pixmap_themes);
 
        /* interface.checkbtn_emacs          = checkbtn_emacs; */
-       interface.checkbtn_show_msg_with_cursor
-                                             = checkbtn_show_msg_with_cursor;
+       interface.checkbtn_always_show_msg    = checkbtn_always_show_msg;
        interface.checkbtn_openunread         = checkbtn_openunread;
        interface.checkbtn_mark_as_read_on_newwin
                                              = checkbtn_mark_as_read_on_newwin;
        interface.checkbtn_openinbox          = checkbtn_openinbox;
        interface.checkbtn_immedexec          = checkbtn_immedexec;
-       interface.optmenu_recvdialog          = optmenu_recvdialog;
-       interface.optmenu_senddialog          = optmenu_senddialog;
-       interface.checkbtn_no_recv_err_panel  = checkbtn_no_recv_err_panel;
-       interface.checkbtn_close_recv_dialog  = checkbtn_close_recv_dialog;
        interface.optmenu_nextunreadmsgdialog = optmenu_nextunreadmsgdialog;
        interface.combo_pixmap_theme          = combo_pixmap_theme;
        interface.entry_pixmap_theme          = entry_pixmap_theme;
@@ -2849,6 +2284,7 @@ static void prefs_other_create(void)
        GtkWidget *checkbtn_cliplog;
        GtkWidget *loglength_label;
        GtkWidget *loglength_entry;
+       GtkTooltips *loglength_tooltip;
 
        GtkWidget *frame_exit;
        GtkWidget *vbox_exit;
@@ -2856,6 +2292,11 @@ static void prefs_other_create(void)
        GtkWidget *checkbtn_cleanonexit;
        GtkWidget *checkbtn_askonclean;
        GtkWidget *checkbtn_warnqueued;
+
+       GtkWidget *label_iotimeout;
+       GtkWidget *spinbtn_iotimeout;
+       GtkObject *spinbtn_iotimeout_adj;
+
 #if 0
 #ifdef USE_OPENSSL
        GtkWidget *frame_ssl;
@@ -2964,12 +2405,17 @@ static void prefs_other_create(void)
        gtk_box_pack_start (GTK_BOX (hbox_cliplog), loglength_label,
                            FALSE, TRUE, 0);
        gtk_widget_show (GTK_WIDGET (loglength_label));
+       
+       loglength_tooltip = gtk_tooltips_new();
+       
        loglength_entry = gtk_entry_new ();
        gtk_widget_set_usize (GTK_WIDGET (loglength_entry), 64, -1);
        gtk_box_pack_start (GTK_BOX (hbox_cliplog), loglength_entry,
                            FALSE, TRUE, 0);
        gtk_widget_show (GTK_WIDGET (loglength_entry));
-       loglength_label = gtk_label_new (_("(0 to stop logging in the log window)"));
+       gtk_tooltips_set_tip(GTK_TOOLTIPS(loglength_tooltip), loglength_entry,
+                            _("0 to stop logging in the log window"),
+                            NULL);
        gtk_box_pack_start (GTK_BOX (hbox_cliplog), loglength_label,
                            FALSE, TRUE, 0);
        SET_TOGGLE_SENSITIVITY(checkbtn_cliplog, loglength_entry);
@@ -3015,6 +2461,27 @@ static void prefs_other_create(void)
        PACK_CHECK_BUTTON (vbox_exit, checkbtn_warnqueued,
                           _("Warn if there are queued messages"));
 
+       hbox1 = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox1);
+       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
+
+       label_iotimeout = gtk_label_new (_("Socket I/O timeout:"));
+       gtk_widget_show (label_iotimeout);
+       gtk_box_pack_start (GTK_BOX (hbox1), label_iotimeout, FALSE, FALSE, 0);
+
+       spinbtn_iotimeout_adj = gtk_adjustment_new (60, 0, 1000, 1, 10, 10);
+       spinbtn_iotimeout = gtk_spin_button_new
+               (GTK_ADJUSTMENT (spinbtn_iotimeout_adj), 1, 0);
+       gtk_widget_show (spinbtn_iotimeout);
+       gtk_box_pack_start (GTK_BOX (hbox1), spinbtn_iotimeout,
+                           FALSE, FALSE, 0);
+       gtk_widget_set_usize (spinbtn_iotimeout, 64, -1);
+       gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_iotimeout), TRUE);
+
+       label_iotimeout = gtk_label_new (_("seconds"));
+       gtk_widget_show (label_iotimeout);
+       gtk_box_pack_start (GTK_BOX (hbox1), label_iotimeout, FALSE, FALSE, 0);
+
        other.uri_combo = uri_combo;
        other.uri_entry = uri_entry;
        other.printcmd_entry = printcmd_entry;
@@ -3031,6 +2498,9 @@ static void prefs_other_create(void)
        other.checkbtn_cleanonexit = checkbtn_cleanonexit;
        other.checkbtn_askonclean  = checkbtn_askonclean;
        other.checkbtn_warnqueued  = checkbtn_warnqueued;
+
+       other.spinbtn_iotimeout     = spinbtn_iotimeout;
+       other.spinbtn_iotimeout_adj = spinbtn_iotimeout_adj;
        
 #if 0
 #ifdef USE_OPENSSL
@@ -3536,11 +3006,6 @@ static void quote_color_set_dialog(GtkWidget *widget, gpointer data)
        } else if(g_strcasecmp(type, "SIGNATURE") == 0) {
                title = _("Pick color for signatures");
                rgbvalue = prefs_common.signature_col;
-#if USE_ASPELL         
-       } else if(g_strcasecmp(type, "Misspelled word") == 0) {
-               title = _("Pick color for misspelled word");
-               rgbvalue = prefs_common.misspelled_col;
-#endif         
        } else {   /* Should never be called */
                g_warning("Unrecognized datatype '%s' in quote_color_set_dialog\n", type);
                return;
@@ -3611,11 +3076,6 @@ static void quote_colors_set_dialog_ok(GtkWidget *widget, gpointer data)
        } else if (g_strcasecmp(type, "SIGNATURE") == 0) {
                prefs_common.signature_col = rgbvalue;
                set_button_bg_color(color_buttons.signature_btn, rgbvalue);
-#if USE_ASPELL         
-       } else if (g_strcasecmp(type, "Misspelled word") == 0) {
-               prefs_common.misspelled_col = rgbvalue;
-               set_button_bg_color(spelling.misspelled_btn, rgbvalue);
-#endif         
        } else
                fprintf( stderr, "Unrecognized datatype '%s' in quote_color_set_dialog_ok\n", type );
 
@@ -3666,75 +3126,6 @@ static void prefs_recycle_colors_toggled(GtkWidget *widget)
        prefs_common.recycle_quote_colors = is_active;
 }
 
-static void prefs_font_select(GtkButton *button, GtkEntry *entry)
-{
-       gchar *font_name;
-       
-       g_return_if_fail(entry != NULL);
-       
-       if (!font_sel_win) {
-               font_sel_win = gtk_font_selection_dialog_new
-                       (_("Font selection"));
-               gtk_window_position(GTK_WINDOW(font_sel_win),
-                                   GTK_WIN_POS_CENTER);
-               gtk_signal_connect(GTK_OBJECT(font_sel_win), "delete_event",
-                                  GTK_SIGNAL_FUNC(gtk_widget_hide_on_delete),
-                                  NULL);
-               gtk_signal_connect
-                       (GTK_OBJECT(font_sel_win), "key_press_event",
-                        GTK_SIGNAL_FUNC(prefs_font_selection_key_pressed),
-                        NULL);
-               gtk_signal_connect_object
-                       (GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel_win)->cancel_button),
-                        "clicked",
-                        GTK_SIGNAL_FUNC(gtk_widget_hide_on_delete),
-                        GTK_OBJECT(font_sel_win));
-       }
-
-       if(font_sel_conn_id) {
-               gtk_signal_disconnect(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel_win)->ok_button), font_sel_conn_id);
-       }
-       font_sel_conn_id = gtk_signal_connect
-               (GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel_win)->ok_button),
-                "clicked",
-                GTK_SIGNAL_FUNC(prefs_font_selection_ok),
-                entry);
-       printf("%i\n", font_sel_conn_id);
-
-       font_name = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
-       gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(font_sel_win), font_name);
-       g_free(font_name);
-       manage_window_set_transient(GTK_WINDOW(font_sel_win));
-       gtk_window_set_modal(GTK_WINDOW(font_sel_win), TRUE);
-       gtk_widget_grab_focus
-               (GTK_FONT_SELECTION_DIALOG(font_sel_win)->ok_button);
-       gtk_widget_show(font_sel_win);
-}
-
-static void prefs_font_selection_key_pressed(GtkWidget *widget,
-                                            GdkEventKey *event,
-                                            gpointer data)
-{
-       if (event && event->keyval == GDK_Escape)
-               gtk_widget_hide(font_sel_win);
-}
-
-static void prefs_font_selection_ok(GtkButton *button, GtkEntry *entry)
-{
-       gchar *fontname;
-
-       fontname = gtk_font_selection_dialog_get_font_name
-               (GTK_FONT_SELECTION_DIALOG(font_sel_win));
-
-       if (fontname) {
-               gtk_entry_set_text(entry, fontname);
-
-               g_free(fontname);
-       }
-
-       gtk_widget_hide(font_sel_win);
-}
-
 static void prefs_keybind_select(void)
 {
        GtkWidget *window;
@@ -4052,59 +3443,6 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                "(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 headers\" \"\")\n"
-               "(menu-path \"<Main>/View/Update\" \"\")\n"
-
-               "(menu-path \"<Main>/Message/Get new mail\" \"\")\n"
-               "(menu-path \"<Main>/Message/Get from all accounts\" \"\")\n"
-               "(menu-path \"<Main>/Message/Compose an email message\" \"\")\n"
-               "(menu-path \"<Main>/Message/Reply\" \"\")\n"
-               "(menu-path \"<Main>/Message/Reply to/all\" \"\")\n"
-               "(menu-path \"<Main>/Message/Reply to/sender\" \"\")\n"
-               "(menu-path \"<Main>/Message/Reply to/mailing list\" \"\")\n"
-               "(menu-path \"<Main>/Message/Forward\" \"\")\n"
-               /* "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n" */
-               "(menu-path \"<Main>/Message/Move...\" \"\")\n"
-               "(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")))
@@ -4118,7 +3456,7 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
        else
                return;
 
-       gtk_item_factory_parse_rc_string(empty_menurc);
+       menu_factory_clear_rc(rc_str);
        gtk_item_factory_parse_rc_string(rc_str);
 
        gtk_widget_destroy(keybind.window);
@@ -4157,6 +3495,36 @@ static void prefs_common_charset_set_optmenu(PrefParam *pparam)
        }
 }
 
+static void prefs_common_encoding_set_data_from_optmenu(PrefParam *pparam)
+{
+       GtkWidget *menu;
+       GtkWidget *menuitem;
+
+       menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
+       menuitem = gtk_menu_get_active(GTK_MENU(menu));
+       *((TransferEncodingMethod *)pparam->data) = GPOINTER_TO_INT
+               (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
+}
+
+static void prefs_common_encoding_set_optmenu(PrefParam *pparam)
+{
+       TransferEncodingMethod method =
+               *((TransferEncodingMethod *)pparam->data);
+       GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
+       gint index;
+
+       g_return_if_fail(optmenu != NULL);
+
+       index = menu_find_option_menu_index(optmenu, GINT_TO_POINTER(method),
+                                           NULL);
+       if (index >= 0)
+               gtk_option_menu_set_history(optmenu, index);
+       else {
+               gtk_option_menu_set_history(optmenu, 0);
+               prefs_common_encoding_set_data_from_optmenu(pparam);
+       }
+}
+
 static void prefs_common_recv_dialog_set_data_from_optmenu(PrefParam *pparam)
 {
        GtkWidget *menu;
@@ -4174,19 +3542,15 @@ static void prefs_common_recv_dialog_set_optmenu(PrefParam *pparam)
        GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
        GtkWidget *menu;
        GtkWidget *menuitem;
+       gint index;
 
-       switch (mode) {
-       case RECV_DIALOG_ALWAYS:
+       index = menu_find_option_menu_index(optmenu, GINT_TO_POINTER(mode),
+                                           NULL);
+       if (index >= 0)
+               gtk_option_menu_set_history(optmenu, index);
+       else {
                gtk_option_menu_set_history(optmenu, 0);
-               break;
-       case RECV_DIALOG_ACTIVE:
-               gtk_option_menu_set_history(optmenu, 1);
-               break;
-       case RECV_DIALOG_NEVER:
-               gtk_option_menu_set_history(optmenu, 2);
-               break;
-       default:
-               break;
+               prefs_common_recv_dialog_set_data_from_optmenu(pparam);
        }
 
        menu = gtk_option_menu_get_menu(optmenu);
@@ -4254,6 +3618,8 @@ static void prefs_common_apply(void)
 {
        gchar *entry_pixmap_theme_str;
        gboolean update_pixmap_theme;
+       gchar *backup_theme_path;
+       MainWindow *mainwindow;
        
        entry_pixmap_theme_str = gtk_entry_get_text(GTK_ENTRY(interface.entry_pixmap_theme));
        if (entry_pixmap_theme_str && 
@@ -4261,18 +3627,32 @@ static void prefs_common_apply(void)
                update_pixmap_theme = TRUE;
        else
                update_pixmap_theme = FALSE;
-       
+
+       /*!< FIXME: prefs_set_data_from_dialog() clears and frees all strings, 
+        * but prefs_common.pixmap_theme_path is stored in the StockPixmapData
+        * in stock_pixmap.c::pixmaps[].icon_path, and used when reflecting
+        * the pixmap changes. Work around by saving the old one and freeing 
+        * it later. */
+       backup_theme_path = prefs_common.pixmap_theme_path;
+       prefs_common.pixmap_theme_path = g_strdup(backup_theme_path);
        prefs_set_data_from_dialog(param);
+       sock_set_io_timeout(prefs_common.io_timeout_secs);
        
-       if (update_pixmap_theme)
-       {
+       if (update_pixmap_theme) {
                main_window_reflect_prefs_all_real(TRUE);
                compose_reflect_prefs_pixmap_theme();
        } else
                main_window_reflect_prefs_all_real(FALSE);
-       
+
+       /*!< FIXME: Now it's safe to delete the backup path */
+       g_free(backup_theme_path);
+
        prefs_common_save_config();
 
+       mainwindow = mainwindow_get_mainwindow();
+       log_window_set_clipping(mainwindow->logwin, prefs_common.cliplog,
+                               prefs_common.loglength);
+       
        inc_autocheck_timer_remove();
        inc_autocheck_timer_set();
 }