2005-05-31 [colin] 1.9.11cvs28
authorColin Leroy <colin@colino.net>
Tue, 31 May 2005 19:00:21 +0000 (19:00 +0000)
committerColin Leroy <colin@colino.net>
Tue, 31 May 2005 19:00:21 +0000 (19:00 +0000)
* src/Makefile.am
* src/account.c
* src/action.c
* src/addr_compl.c
* src/addressbook.c
* src/codeconv.c
* src/compose.c
* src/export.c
* src/folder.c
* src/folderview.c
* src/image_viewer.c
* src/main.c
* src/mainwindow.c
* src/messageview.c
* src/mimeview.c
* src/msgcache.c
* src/prefs_account.c
* src/prefs_actions.c
* src/prefs_common.c
* src/prefs_compose_writing.c
* src/prefs_customheader.c
* src/prefs_ext_prog.c
* src/prefs_filtering.c
* src/prefs_filtering_action.c
* src/prefs_fonts.c
* src/prefs_image_viewer.c
* src/prefs_message.c
* src/prefs_message.h
* src/prefs_msg_colors.c
* src/prefs_other.c
* src/prefs_other.h
* src/prefs_quote.c
* src/prefs_receive.c
* src/prefs_receive.h
* src/prefs_send.c
* src/prefs_send.h
* src/prefs_spelling.c
* src/prefs_summaries.c
* src/prefs_summary_column.c
* src/prefs_template.c
* src/prefs_themes.c
* src/prefs_toolbar.c
* src/prefs_wrapping.c
* src/procmime.c
* src/procmsg.c
* src/send_message.h
* src/ssl_manager.c
* src/summary_search.c
* src/summaryview.c
* src/textview.c
* src/wizard.c
* src/common/smtp.c
* src/common/smtp.h
* src/gtk/gtkutils.h
o Move the rest of Common prefs to new style
o Lots of -Wall warning fixes
o fix FIXME in cache memusage calculation
o Let return receipts be sent from any account
o Little cache optimisation (read)
o Fix bug #746 (don't treat commas as separators
  when inside a quoted string)

57 files changed:
ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/Makefile.am
src/account.c
src/action.c
src/addr_compl.c
src/addressbook.c
src/codeconv.c
src/common/smtp.c
src/common/smtp.h
src/compose.c
src/export.c
src/folder.c
src/folderview.c
src/gtk/gtkutils.h
src/image_viewer.c
src/main.c
src/mainwindow.c
src/messageview.c
src/mimeview.c
src/msgcache.c
src/prefs_account.c
src/prefs_actions.c
src/prefs_common.c
src/prefs_compose_writing.c
src/prefs_customheader.c
src/prefs_ext_prog.c
src/prefs_filtering.c
src/prefs_filtering_action.c
src/prefs_fonts.c
src/prefs_image_viewer.c
src/prefs_message.c [new file with mode: 0644]
src/prefs_message.h [new file with mode: 0644]
src/prefs_msg_colors.c
src/prefs_other.c [new file with mode: 0644]
src/prefs_other.h [new file with mode: 0644]
src/prefs_quote.c
src/prefs_receive.c [new file with mode: 0644]
src/prefs_receive.h [new file with mode: 0644]
src/prefs_send.c [new file with mode: 0644]
src/prefs_send.h [new file with mode: 0644]
src/prefs_spelling.c
src/prefs_summaries.c
src/prefs_summary_column.c
src/prefs_template.c
src/prefs_themes.c
src/prefs_toolbar.c
src/prefs_wrapping.c
src/procmime.c
src/procmsg.c
src/send_message.h
src/ssl_manager.c
src/summary_search.c
src/summaryview.c
src/textview.c
src/wizard.c

index 9032b97..1d0de3e 100644 (file)
@@ -1,3 +1,67 @@
+2005-05-31 [colin]     1.9.11cvs28
+
+       * src/Makefile.am
+       * src/account.c
+       * src/action.c
+       * src/addr_compl.c
+       * src/addressbook.c
+       * src/codeconv.c
+       * src/compose.c
+       * src/export.c
+       * src/folder.c
+       * src/folderview.c
+       * src/image_viewer.c
+       * src/main.c
+       * src/mainwindow.c
+       * src/messageview.c
+       * src/mimeview.c
+       * src/msgcache.c
+       * src/prefs_account.c
+       * src/prefs_actions.c
+       * src/prefs_common.c
+       * src/prefs_compose_writing.c
+       * src/prefs_customheader.c
+       * src/prefs_ext_prog.c
+       * src/prefs_filtering.c
+       * src/prefs_filtering_action.c
+       * src/prefs_fonts.c
+       * src/prefs_image_viewer.c
+       * src/prefs_message.c
+       * src/prefs_message.h
+       * src/prefs_msg_colors.c
+       * src/prefs_other.c
+       * src/prefs_other.h
+       * src/prefs_quote.c
+       * src/prefs_receive.c
+       * src/prefs_receive.h
+       * src/prefs_send.c
+       * src/prefs_send.h
+       * src/prefs_spelling.c
+       * src/prefs_summaries.c
+       * src/prefs_summary_column.c
+       * src/prefs_template.c
+       * src/prefs_themes.c
+       * src/prefs_toolbar.c
+       * src/prefs_wrapping.c
+       * src/procmime.c
+       * src/procmsg.c
+       * src/send_message.h
+       * src/ssl_manager.c
+       * src/summary_search.c
+       * src/summaryview.c
+       * src/textview.c
+       * src/wizard.c
+       * src/common/smtp.c
+       * src/common/smtp.h
+       * src/gtk/gtkutils.h
+               o Move the rest of Common prefs to new style
+               o Lots of -Wall warning fixes
+               o fix FIXME in cache memusage calculation
+               o Let return receipts be sent from any account
+               o Little cache optimisation (read)
+               o Fix bug #746 (don't treat commas as separators
+                 when inside a quoted string)
+
 2005-05-31 [paul]      1.9.11cvs27
 
        * src/prefs_common.c
index a1bd1b5..d8054b2 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.155.2.24 -r 1.155.2.25 src/Makefile.am; cvs diff -u -r 1.115.2.36 -r 1.115.2.37 src/main.c; cvs diff -u -r 1.204.2.41 -r 1.204.2.42 src/prefs_common.c; diff -u /dev/null src/prefs_summaries.c; diff -u /dev/null src/prefs_summaries.h; ) > 1.9.11cvs25.patchset
 ( cvs diff -u -r 1.61.2.24 -r 1.61.2.25 src/account.c;  cvs diff -u -r 1.27.2.9 -r 1.27.2.10 src/addr_compl.c;  cvs diff -u -r 1.382.2.123 -r 1.382.2.124 src/compose.c;  cvs diff -u -r 1.26.2.15 -r 1.26.2.16 src/foldersel.c;  cvs diff -u -r 1.60.2.14 -r 1.60.2.15 src/prefs_actions.c;  cvs diff -u -r 1.204.2.42 -r 1.204.2.43 src/prefs_common.c;  cvs diff -u -r 1.103.2.18 -r 1.103.2.19 src/prefs_common.h;  cvs diff -u -r 1.16.2.8 -r 1.16.2.9 src/prefs_customheader.c;  cvs diff -u -r 1.16.2.8 -r 1.16.2.9 src/prefs_display_header.c;  cvs diff -u -r 1.59.2.17 -r 1.59.2.18 src/prefs_filtering.c;  cvs diff -u -r 1.1.4.13 -r 1.1.4.14 src/prefs_filtering_action.c;  cvs diff -u -r 1.43.2.18 -r 1.43.2.19 src/prefs_matcher.c;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 src/prefs_summaries.c;  cvs diff -u -r 1.10.2.6 -r 1.10.2.7 src/prefs_summary_column.c;  cvs diff -u -r 1.12.2.9 -r 1.12.2.10 src/prefs_template.c;  cvs diff -u -r 1.30.2.12 -r 1.30.2.13 src/prefs_toolbar.c;  cvs diff -u -r 1.3.2.8 -r 1.3.2.9 src/ssl_manager.c;  cvs diff -u -r 1.5.2.13 -r 1.5.2.14 src/gtk/pluginwindow.c;  cvs diff -u -r 1.12.2.18 -r 1.12.2.19 src/gtk/prefswindow.c;  cvs diff -u -r 1.1.4.9 -r 1.1.4.10 src/gtk/progressdialog.c;  ) > 1.9.11cvs26.patchset
 ( cvs diff -u -r 1.204.2.43 -r 1.204.2.44 src/prefs_common.c;  ) > 1.9.11cvs27.patchset
+( cvs diff -u -r 1.155.2.25 -r 1.155.2.26 src/Makefile.am;  cvs diff -u -r 1.61.2.25 -r 1.61.2.26 src/account.c;  cvs diff -u -r 1.12.2.22 -r 1.12.2.23 src/action.c;  cvs diff -u -r 1.27.2.10 -r 1.27.2.11 src/addr_compl.c;  cvs diff -u -r 1.60.2.15 -r 1.60.2.16 src/addressbook.c;  cvs diff -u -r 1.65.2.28 -r 1.65.2.29 src/codeconv.c;  cvs diff -u -r 1.382.2.124 -r 1.382.2.125 src/compose.c;  cvs diff -u -r 1.8.2.7 -r 1.8.2.8 src/export.c;  cvs diff -u -r 1.213.2.28 -r 1.213.2.29 src/folder.c;  cvs diff -u -r 1.207.2.38 -r 1.207.2.39 src/folderview.c;  cvs diff -u -r 1.1.2.2 -r 1.1.2.3 src/image_viewer.c;  cvs diff -u -r 1.115.2.37 -r 1.115.2.38 src/main.c;  cvs diff -u -r 1.274.2.39 -r 1.274.2.40 src/mainwindow.c;  cvs diff -u -r 1.94.2.51 -r 1.94.2.52 src/messageview.c;  cvs diff -u -r 1.83.2.32 -r 1.83.2.33 src/mimeview.c;  cvs diff -u -r 1.16.2.17 -r 1.16.2.18 src/msgcache.c;  cvs diff -u -r 1.105.2.23 -r 1.105.2.24 src/prefs_account.c;  cvs diff -u -r 1.60.2.15 -r 1.60.2.16 src/prefs_actions.c;  cvs diff -u -r 1.204.2.44 -r 1.204.2.45 src/prefs_common.c;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 src/prefs_compose_writing.c;  cvs diff -u -r 1.16.2.9 -r 1.16.2.10 src/prefs_customheader.c;  cvs diff -u -r 1.3.2.5 -r 1.3.2.6 src/prefs_ext_prog.c;  cvs diff -u -r 1.59.2.18 -r 1.59.2.19 src/prefs_filtering.c;  cvs diff -u -r 1.1.4.14 -r 1.1.4.15 src/prefs_filtering_action.c;  cvs diff -u -r 1.4.2.9 -r 1.4.2.10 src/prefs_fonts.c;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 src/prefs_image_viewer.c;  diff -u /dev/null src/prefs_message.c;  diff -u /dev/null src/prefs_message.h;  cvs diff -u -r 1.1.2.8 -r 1.1.2.9 src/prefs_msg_colors.c;  diff -u /dev/null src/prefs_other.c;  diff -u /dev/null src/prefs_other.h;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 src/prefs_quote.c;  diff -u /dev/null src/prefs_receive.c;  diff -u /dev/null src/prefs_receive.h;  diff -u /dev/null src/prefs_send.c;  diff -u /dev/null src/prefs_send.h;  cvs diff -u -r 1.5.2.7 -r 1.5.2.8 src/prefs_spelling.c;  cvs diff -u -r 1.1.2.2 -r 1.1.2.3 src/prefs_summaries.c;  cvs diff -u -r 1.10.2.7 -r 1.10.2.8 src/prefs_summary_column.c;  cvs diff -u -r 1.12.2.10 -r 1.12.2.11 src/prefs_template.c;  cvs diff -u -r 1.3.2.19 -r 1.3.2.20 src/prefs_themes.c;  cvs diff -u -r 1.30.2.13 -r 1.30.2.14 src/prefs_toolbar.c;  cvs diff -u -r 1.1.2.4 -r 1.1.2.5 src/prefs_wrapping.c;  cvs diff -u -r 1.49.2.42 -r 1.49.2.43 src/procmime.c;  cvs diff -u -r 1.150.2.26 -r 1.150.2.27 src/procmsg.c;  cvs diff -u -r 1.1 -r 1.2 src/send_message.h;  cvs diff -u -r 1.3.2.9 -r 1.3.2.10 src/ssl_manager.c;  cvs diff -u -r 1.15.2.15 -r 1.15.2.16 src/summary_search.c;  cvs diff -u -r 1.395.2.71 -r 1.395.2.72 src/summaryview.c;  cvs diff -u -r 1.96.2.55 -r 1.96.2.56 src/textview.c;  cvs diff -u -r 1.1.2.8 -r 1.1.2.9 src/wizard.c;  cvs diff -u -r 1.11.2.10 -r 1.11.2.11 src/common/smtp.c;  cvs diff -u -r 1.6.2.6 -r 1.6.2.7 src/common/smtp.h;  cvs diff -u -r 1.4.2.10 -r 1.4.2.11 src/gtk/gtkutils.h;  ) > 1.9.11cvs28.patchset
index b19d593..6eb84eb 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=11
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=27
+EXTRA_VERSION=28
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index aa54d64..a7fb7cf 100644 (file)
@@ -96,8 +96,12 @@ sylpheed_SOURCES = \
        prefs_gtk.c \
        prefs_image_viewer.c \
        prefs_matcher.c \
+       prefs_message.c \
        prefs_msg_colors.c \
+       prefs_other.c \
        prefs_quote.c \
+       prefs_receive.c \
+       prefs_send.c \
        prefs_spelling.c \
        prefs_summaries.c \
        prefs_summary_column.c \
@@ -229,8 +233,12 @@ sylpheedinclude_HEADERS = \
        prefs_gtk.h \
        prefs_image_viewer.h \
        prefs_matcher.h \
+       prefs_message.h \
        prefs_msg_colors.h \
+       prefs_other.h \
        prefs_quote.h \
+       prefs_receive.h \
+       prefs_send.h \
        prefs_spelling.h \
        prefs_summaries.h \
        prefs_summary_column.h \
index 7fac482..59ec416 100644 (file)
@@ -603,8 +603,6 @@ static void account_edit_create(void)
        GtkWidget *hbox;
        GtkWidget *scrolledwin;
        GtkWidget *list_view;
-       gchar *titles[N_EDIT_ACCOUNT_COLS];
-       gint i;
 
        GtkWidget *vbox2;
        GtkWidget *add_btn;
@@ -925,7 +923,6 @@ static void account_clone(GtkWidget *widget, gpointer data)
 static void account_delete(GtkWidget *widget, gpointer data)
 {
        PrefsAccount *ac_prefs;
-       gint account_id;
        GList *list;
        Folder *folder;
  
@@ -1421,7 +1418,6 @@ GtkTreePath *account_list_view_get_selected_account_path(GtkWidget *list_view)
        GtkTreeSelection *selector;
        GtkTreeModel *model;
        GtkTreeIter iter;
-       GtkTreePath *res;
 
        selector = gtk_tree_view_get_selection(GTK_TREE_VIEW(list_view));
        
index 27bfe91..55d6441 100644 (file)
@@ -1145,7 +1145,6 @@ static void create_io_dialog(Children *children)
        GtkWidget *progress_bar = NULL;
        GtkWidget *abort_button;
        GtkWidget *close_button;
-       PangoFontDescription *text_font;
 
        debug_print("Creating action IO dialog\n");
 
index e33dde0..9bfa7c6 100644 (file)
@@ -131,9 +131,6 @@ struct _CompletionWindow {
 
 static GtkListStore *addr_compl_create_store   (void);
 
-static void addr_compl_list_view_add_address   (GtkWidget *list_view,
-                                                const gchar *address);
-
 static GtkWidget *addr_compl_list_view_create  (CompletionWindow *window);
 
 static void addr_compl_create_list_view_columns        (GtkWidget *list_view);
@@ -1468,19 +1465,6 @@ static GtkListStore *addr_compl_create_store(void)
                                  G_TYPE_STRING,
                                  -1);
 }
-
-static void addr_compl_list_view_add_address(GtkWidget *list_view,
-                                            const gchar *address)
-{
-       GtkTreeIter iter;
-       GtkListStore *store = GTK_LIST_STORE(gtk_tree_view_get_model
-                                       (GTK_TREE_VIEW(list_view)));
-       
-       gtk_list_store_append(store, &iter);
-       gtk_list_store_set(store, &iter,
-                          ADDR_COMPL_ADDRESS, address,
-                          -1);
-}
                                             
 static GtkWidget *addr_compl_list_view_create(CompletionWindow *window)
 {
index 2bc9aae..ad5daf0 100644 (file)
@@ -3733,7 +3733,7 @@ static void addressbook_perform_search(
        gchar *name;
        gint queryID;
        guint idleID;
-       AddressObjectType aoType;
+       AddressObjectType aoType = ADDR_NONE;
 
        /* Setup a query */
        if( *searchTerm == '\0' || strlen( searchTerm ) < 1 ) return;
index 71f8804..877d48d 100644 (file)
@@ -116,9 +116,7 @@ static void conv_anytoutf8(gchar *outbuf, gint outlen, const gchar *inbuf);
 static void conv_utf8toeuc(gchar *outbuf, gint outlen, const gchar *inbuf);
 static void conv_utf8tojis(gchar *outbuf, gint outlen, const gchar *inbuf);
 
-static void conv_unreadable_eucjp(gchar *str);
 static void conv_unreadable_8bit(gchar *str);
-static void conv_unreadable_latin(gchar *str);
 
 static void conv_jistodisp(gchar *outbuf, gint outlen, const gchar *inbuf);
 static void conv_sjistodisp(gchar *outbuf, gint outlen, const gchar *inbuf);
@@ -511,131 +509,6 @@ static void conv_utf8tojis(gchar *outbuf, gint outlen, const gchar *inbuf)
        conv_euctojis(outbuf, outlen, eucstr);
 }
 
-static gchar valid_eucjp_tbl[][96] = {
-       /* 0xa2a0 - 0xa2ff */
-       { 0, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 0,
-         0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 1, 1, 1, 1, 1, 1,
-         1, 1, 0, 0, 0, 0, 0, 0,  0, 0, 1, 1, 1, 1, 1, 1,
-         1, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 1, 1, 1, 1,
-         1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 0, 0, 0, 0, 0,
-         0, 0, 1, 1, 1, 1, 1, 1,  1, 1, 0, 0, 0, 0, 1, 0 },
-
-       /* 0xa3a0 - 0xa3ff */
-       { 0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,
-         1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 0, 0, 0, 0, 0, 0,
-         0, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-         1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 0, 0, 0, 0, 0,
-         0, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-         1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 0, 0, 0, 0, 0 },
-
-       /* 0xa4a0 - 0xa4ff */
-       { 0, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-         1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-         1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-         1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-         1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-         1, 1, 1, 1, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0 },
-
-       /* 0xa5a0 - 0xa5ff */
-       { 0, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-         1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-         1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-         1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-         1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-         1, 1, 1, 1, 1, 1, 1, 0,  0, 0, 0, 0, 0, 0, 0, 0 },
-
-       /* 0xa6a0 - 0xa6ff */
-       { 0, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-         1, 1, 1, 1, 1, 1, 1, 1,  1, 0, 0, 0, 0, 0, 0, 0,
-         0, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-         1, 1, 1, 1, 1, 1, 1, 1,  1, 0, 0, 0, 0, 0, 0, 0,
-         0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,
-         0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0 },
-
-       /* 0xa7a0 - 0xa7ff */
-       { 0, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-         1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-         1, 1, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,
-         0, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-         1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-         1, 1, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0 },
-
-       /* 0xa8a0 - 0xa8ff */
-       { 0, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-         1, 1, 1, 1, 1, 1, 1, 1,  1, 1, 1, 1, 1, 1, 1, 1,
-         1, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,
-         0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,
-         0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,
-         0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0 }
-};
-
-static gboolean isprintableeuckanji(guchar c1, guchar c2)
-{
-       if (c1 <= 0xa0 || c1 >= 0xf5)
-               return FALSE;
-       if (c2 <= 0xa0 || c2 == 0xff)
-               return FALSE;
-
-       if (c1 >= 0xa9 && c1 <= 0xaf)
-               return FALSE;
-
-       if (c1 >= 0xa2 && c1 <= 0xa8)
-               return (gboolean)valid_eucjp_tbl[c1 - 0xa2][c2 - 0xa0];
-
-       if (c1 == 0xcf) {
-               if (c2 >= 0xd4 && c2 <= 0xfe)
-                       return FALSE;
-       } else if (c1 == 0xf4) {
-               if (c2 >= 0xa7 && c2 <= 0xfe)
-                       return FALSE;
-       }
-
-       return TRUE;
-}
-
-static void conv_unreadable_eucjp(gchar *str)
-{
-       register guchar *p = str;
-
-       while (*p != '\0') {
-               if (IS_ASCII(*p)) {
-                       /* convert CR+LF -> LF */
-                       if (*p == '\r' && *(p + 1) == '\n')
-                               memmove(p, p + 1, strlen(p));
-                       /* printable 7 bit code */
-                       p++;
-               } else if (iseuckanji(*p)) {
-                       if (isprintableeuckanji(*p, *(p + 1))) {
-                               /* printable euc-jp code */
-                               p += 2;
-                       } else {
-                               /* substitute unprintable code */
-                               *p++ = SUBST_CHAR;
-                               if (*p != '\0') {
-                                       if (IS_ASCII(*p))
-                                               p++;
-                                       else
-                                               *p++ = SUBST_CHAR;
-                               }
-                       }
-               } else if (iseuchwkana1(*p)) {
-                       if (iseuchwkana2(*(p + 1)))
-                               /* euc-jp hankaku kana */
-                               p += 2;
-                       else
-                               *p++ = SUBST_CHAR;
-               } else if (iseucaux(*p)) {
-                       if (iseuckanji(*(p + 1)) && iseuckanji(*(p + 2))) {
-                               /* auxiliary kanji */
-                               p += 3;
-                       } else
-                               *p++ = SUBST_CHAR;
-               } else
-                       /* substitute unprintable 1 byte code */
-                       *p++ = SUBST_CHAR;
-       }
-}
-
 static void conv_unreadable_8bit(gchar *str)
 {
        register guchar *p = str;
@@ -649,20 +522,6 @@ static void conv_unreadable_8bit(gchar *str)
        }
 }
 
-static void conv_unreadable_latin(gchar *str)
-{
-       register guchar *p = str;
-
-       while (*p != '\0') {
-               /* convert CR+LF -> LF */
-               if (*p == '\r' && *(p + 1) == '\n')
-                       memmove(p, p + 1, strlen(p));
-               else if ((*p & 0xff) >= 0x7f && (*p & 0xff) <= 0x9f)
-                       *p = SUBST_CHAR;
-               p++;
-       }
-}
-
 #define NCV    '\0'
 
 void conv_mb_alnum(gchar *str)
index a28ef13..4148617 100644 (file)
@@ -34,8 +34,6 @@
 
 static void smtp_session_destroy(Session *session);
 
-gint smtp_from(SMTPSession *session);
-
 static gint smtp_auth(SMTPSession *session);
 static gint smtp_starttls(SMTPSession *session);
 static gint smtp_auth_cram_md5(SMTPSession *session);
@@ -50,7 +48,6 @@ static gint smtp_rcpt(SMTPSession *session);
 static gint smtp_data(SMTPSession *session);
 static gint smtp_send_data(SMTPSession *session);
 static gint smtp_make_ready(SMTPSession *session);
-gint smtp_quit(SMTPSession *session);
 static gint smtp_eom(SMTPSession *session);
 
 static gint smtp_session_recv_msg(Session *session, const gchar *msg);
index e30deae..7d89773 100644 (file)
@@ -121,5 +121,7 @@ struct _SMTPSession
 };
 
 Session *smtp_session_new      (void);
+gint smtp_from(SMTPSession *session);
+gint smtp_quit(SMTPSession *session);
 
 #endif /* __SMTP_H__ */
index 1182958..b92a53e 100644 (file)
@@ -1233,7 +1233,7 @@ Compose *compose_forward_multiple(PrefsAccount *account, GSList *msginfo_list)
 
 void compose_reedit(MsgInfo *msginfo)
 {
-       Compose *compose;
+       Compose *compose = NULL;
        PrefsAccount *account = NULL;
        GtkTextView *textview;
        GtkTextBuffer *textbuf;
@@ -1452,7 +1452,8 @@ void compose_entry_append(Compose *compose, const gchar *address,
                          ComposeEntryType type)
 {
        gchar *header;
-       gchar **parts = g_strsplit(address, ",", 0);
+       gchar *cur, *begin;
+       gboolean in_quote = FALSE;
        int i = 0;
        if (!address || *address == '\0') return;
 
@@ -1478,14 +1479,39 @@ void compose_entry_append(Compose *compose, const gchar *address,
                break;
        }
        header = prefs_common.trans_hdr ? gettext(header) : header;
-       while (parts[i] && *parts[i]) {
-               gchar *tmp = parts[i];
+       
+       cur = begin = (gchar *)address;
+       
+       /* we separate the line by commas, but not if we're inside a quoted
+        * string */
+       while (*cur != '\0') {
+               if (*cur == '"') 
+                       in_quote = !in_quote;
+               if (*cur == ',' && !in_quote) {
+                       gchar *tmp = g_strdup(begin);
+                       gchar *o_tmp = tmp;
+                       tmp[cur-begin]='\0';
+                       cur++;
+                       begin = cur;
+                       while (*tmp == ' ')
+                               tmp++;
+                       compose_add_header_entry(compose, header, tmp);
+                       g_free(o_tmp);
+                       continue;
+               }
+               cur++;
+       }
+       if (begin < cur) {
+               gchar *tmp = g_strdup(begin);
+               gchar *o_tmp = tmp;
+               tmp[cur-begin]='\0';
+               cur++;
+               begin = cur;
                while (*tmp == ' ')
                        tmp++;
                compose_add_header_entry(compose, header, tmp);
-               i++;
+               g_free(o_tmp);          
        }
-       g_strfreev(parts);
 }
 
 void compose_entry_mark_default_to(Compose *compose, const gchar *mailto)
@@ -1585,7 +1611,7 @@ static void compose_entries_set(Compose *compose, const gchar *mailto)
                compose_entry_append(compose, to, COMPOSE_TO);
        if (cc)
                compose_entry_append(compose, cc, COMPOSE_CC);
-       if (subject)
+       if (subject) {
                if (!g_utf8_validate (subject, -1, NULL)) {
                        temp = g_locale_to_utf8 (subject, -1, NULL, &len, NULL);
                        gtk_entry_set_text(GTK_ENTRY(compose->subject_entry), temp);
@@ -1593,6 +1619,7 @@ static void compose_entries_set(Compose *compose, const gchar *mailto)
                } else {
                        gtk_entry_set_text(GTK_ENTRY(compose->subject_entry), subject);
                }
+       }
        if (body) {
                GtkTextView *text = GTK_TEXT_VIEW(compose->text);
                GtkTextBuffer *buffer = gtk_text_view_get_buffer(text);
@@ -2694,7 +2721,6 @@ static gboolean compose_get_line_break_pos(GtkTextBuffer *buffer,
 
 static gboolean compose_is_sig_separator(Compose *compose, GtkTextBuffer *textbuf, GtkTextIter *iter) 
 {
-       char *text = NULL;
        GtkTextIter start = *iter;
        GtkTextIter end_iter;
        int start_pos = gtk_text_iter_get_offset(&start);
@@ -3498,11 +3524,12 @@ static gint compose_write_to_file(Compose *compose, FILE *fp, gint action)
                            g_strdup(out_codeset));
        /* protect trailing spaces when signing message */
        if (action == COMPOSE_WRITE_FOR_SEND && compose->use_signing && 
-           privacy_system_can_sign(compose->privacy_system))
+           privacy_system_can_sign(compose->privacy_system)) {
                if (encoding == ENC_7BIT)
                        encoding = ENC_QUOTED_PRINTABLE;
                else if (encoding == ENC_8BIT)
                        encoding = ENC_BASE64;
+       }
        if (encoding != ENC_UNKNOWN)
                procmime_encode_content(mimetext, encoding);
 
@@ -3546,7 +3573,6 @@ static gint compose_write_body_to_file(Compose *compose, const gchar *file)
        FILE *fp;
        size_t len;
        gchar *chars, *tmp;
-       const gchar *src_codeset, *dest_codeset;
 
        if ((fp = fopen(file, "wb")) == NULL) {
                FILE_OP_ERROR(file, "fopen");
@@ -5409,7 +5435,6 @@ static void compose_attach_info_free(AttachInfo *ainfo)
 static void compose_attach_remove_selected(Compose *compose)
 {
        GtkTreeView *tree_view = GTK_TREE_VIEW(compose->attach_clist);
-       AttachInfo *ainfo;
        GtkTreeSelection *selection;
        GList *sel, *cur;
        GtkTreeModel *model;
@@ -6134,8 +6159,6 @@ static gboolean attach_button_pressed(GtkWidget *widget, GdkEventButton *event,
                                      gpointer data)
 {
        Compose *compose = (Compose *)data;
-       GtkTreeView *tree_view = GTK_TREE_VIEW(compose->attach_clist);
-       GtkTreeIter iter;
 
        if (!event) return FALSE;
 
index 86794db..c782128 100644 (file)
@@ -105,7 +105,6 @@ gint export_mbox(FolderItem *default_src)
                        const gchar *dest_codeset = conv_get_locale_charset_str();
                        gchar *mbox;
 
-#warning FIXME_GTK2 /* should we use g_filename_from_utf8()? */
                        mbox = conv_codeset_strdup(utf8mbox, src_codeset, dest_codeset);
                        if (!mbox) {
                                g_warning("faild to convert character set\n");
index a643532..16357e9 100644 (file)
@@ -1549,7 +1549,7 @@ static gint syncronize_flags(FolderItem *item, MsgInfoList *msglist)
            item->folder, item, msglist, relation)) == 0) {
                GTuples *tuples;
                MsgInfo *msginfo;
-               MsgPermFlags permflags;
+               MsgPermFlags permflags = 0;
                gboolean skip;
 
                for (cur = msglist; cur != NULL; cur = g_slist_next(cur)) {
@@ -2082,7 +2082,7 @@ GSList *folder_item_get_msg_list(FolderItem *item)
        return msgcache_get_msg_list(item->cache);
 }
 
-static void msginfo_set_mime_flags(GNode *node, gpointer data)
+void msginfo_set_mime_flags(GNode *node, gpointer data)
 {
        MsgInfo *msginfo = data;
        MimeInfo *mimeinfo = node->data;
index 6a95650..f14c258 100644 (file)
@@ -1200,7 +1200,6 @@ static void folderview_update_node(FolderView *folderview, GtkCTreeNode *node)
                style = bold_tgtfold_style;
        } else if (item->prefs->color > 0) {
                GdkColor gdk_color;
-
                gtkut_convert_int_to_gdk_color(item->prefs->color, &gdk_color);
                color_style = gtk_style_copy(normal_style);
                color_style->fg[GTK_STATE_NORMAL] = gdk_color;
@@ -1267,7 +1266,6 @@ gboolean folderview_update_item_claws(gpointer source, gpointer data)
        FolderView *folderview = (FolderView *)data;
        GtkCTree *ctree;
        GtkCTreeNode *node;
-
        g_return_val_if_fail(update_info != NULL, TRUE);
        g_return_val_if_fail(update_info->item != NULL, TRUE);
        g_return_val_if_fail(folderview != NULL, FALSE);
@@ -2089,7 +2087,7 @@ static gboolean folderview_drag_motion_cb(GtkWidget      *widget,
                                          FolderView     *folderview)
 {
        gint row, column;
-       FolderItem *item, *src_item = NULL;
+       FolderItem *item = NULL, *src_item = NULL;
        GtkCTreeNode *node = NULL;
        gboolean acceptable = FALSE;
        GtkAdjustment *pos = gtk_scrolled_window_get_vadjustment(
index 5415b65..a363835 100644 (file)
@@ -179,5 +179,6 @@ GtkWidget *gtkut_account_menu_new   (GList                  *ac_list,
 void gtkut_set_widget_bgcolor_rgb      (GtkWidget      *widget,
                                         guint           rgbvalue);
 
+void gtkut_widget_set_small_font_size(GtkWidget *widget);
 GtkWidget *gtkut_get_focused_child     (GtkContainer   *parent);
 #endif /* __GTKUTILS_H__ */
index 95917c7..0e4d6ff 100644 (file)
@@ -114,7 +114,7 @@ static void image_viewer_load_file(ImageViewer *imageviewer, const gchar *imgfil
                        (GTK_SCROLLED_WINDOW(imageviewer->scrolledwin),
                         imageviewer->image);
        } else
-               gtk_pixmap_set(imageviewer->image, pixmap, mask);
+               gtk_pixmap_set(GTK_PIXMAP(imageviewer->image), pixmap, mask);
 
        gtk_widget_show(imageviewer->image);
 
index 0e5648a..e4751a9 100644 (file)
 #include "prefs_ext_prog.h"
 #include "prefs_fonts.h"
 #include "prefs_image_viewer.h"
+#include "prefs_message.h"
+#include "prefs_receive.h"
 #include "prefs_msg_colors.h"
 #include "prefs_quote.h"
 #include "prefs_spelling.h"
 #include "prefs_summaries.h"
 #include "prefs_themes.h"
+#include "prefs_other.h"
+#include "prefs_send.h"
 #include "prefs_wrapping.h"
 #include "prefs_compose_writing.h"
 #include "prefs_display_header.h"
@@ -308,7 +312,6 @@ int main(int argc, char *argv[])
        set_log_file(RC_DIR G_DIR_SEPARATOR_S "sylpheed.log");
 
        folder_system_init();
-       prefs_common_init();
        prefs_common_read_config();
 
        prefs_themes_init();
@@ -321,6 +324,10 @@ int main(int argc, char *argv[])
        prefs_image_viewer_init();
        prefs_quote_init();
        prefs_summaries_init();
+       prefs_message_init();
+       prefs_other_init();
+       prefs_receive_init();
+       prefs_send_init();
 #ifdef USE_ASPELL
        gtkaspell_checkers_init();
        prefs_spelling_init();
@@ -519,6 +526,10 @@ static void exit_sylpheed(MainWindow *mainwin)
        image_viewer_done();
        prefs_quote_done();
        prefs_summaries_done();
+       prefs_message_done();
+       prefs_other_done();
+       prefs_receive_done();
+       prefs_send_done();
 #ifdef USE_ASPELL       
        prefs_spelling_done();
        gtkaspell_checkers_quit();
@@ -674,7 +685,6 @@ static void initial_processing(FolderItem *item, gpointer data)
 static void draft_all_messages(void)
 {
        GList *compose_list = NULL;
-       GList *elem = NULL;
        
        while ((compose_list = compose_get_compose_list()) != NULL) {
                Compose *c = (Compose*)compose_list->data;
index 5f68750..7f41e9c 100644 (file)
@@ -363,9 +363,6 @@ static void create_processing_cb (MainWindow        *mainwin,
                                  guint          action,
                                  GtkWidget     *widget);
 
-static void prefs_common_open_cb       (MainWindow     *mainwin,
-                                        guint           action,
-                                        GtkWidget      *widget);
 static void prefs_template_open_cb     (MainWindow     *mainwin,
                                         guint           action,
                                         GtkWidget      *widget);
@@ -2992,12 +2989,6 @@ static void create_processing_cb(MainWindow *mainwin, guint action,
        summary_filter_open(mainwin->summaryview, (PrefsFilterType)action, 1);
 }
 
-static void prefs_common_open_cb(MainWindow *mainwin, guint action,
-                                GtkWidget *widget)
-{
-       /* prefs_common_open(); */
-}
-
 static void prefs_pre_processing_open_cb(MainWindow *mainwin, guint action,
                                         GtkWidget *widget)
 {
index 6ddd8f5..772557c 100644 (file)
@@ -499,7 +499,7 @@ static gint disposition_notification_send(MsgInfo *msginfo)
        gchar tmp[MAXPATHLEN + 1];
        FILE *fp;
        GList *ac_list;
-       PrefsAccount *account;
+       PrefsAccount *account = NULL;
        gint ok;
        gchar *to;
        FolderItem *queue, *outbox;
@@ -553,23 +553,34 @@ static gint disposition_notification_send(MsgInfo *msginfo)
        ac_list = account_find_all_from_address(ac_list, msginfo->cc);
 
        if (ac_list == NULL) {
-               alertpanel_error(_("This message is asking for a return "
+               AlertValue val = 
+               alertpanel_with_type(_("Warning"),
+                               _("This message is asking for a return "
                                   "receipt notification\n"
                                   "but according to its 'To:' and 'CC:' "
                                   "headers it was not\nofficially addressed "
                                   "to you.\n"
-                                  "Receipt notification cancelled."));
-               return -1;
+                                  "It is advised to not to send the return ."
+                                  "receipt."),
+                               _("Send"), _("+Don't Send"), NULL, 
+                               NULL, ALERT_WARNING);
+               if (val != G_ALERTDEFAULT)
+                       return -1;
        }
 
        if (g_list_length(ac_list) > 1)
                account = select_account_from_list(ac_list);
-       else
+       else if (ac_list != NULL)
                account = (PrefsAccount *) ac_list->data;
        g_list_free(ac_list);
 
        if (account == NULL)
+               account = account_get_default();
+       if (!account || account->protocol == A_NNTP) {
+               alertpanel_error(_("Account for sending mail is not specified.\n"
+                                  "Please select a mail account before sending."));
                return -1;
+       }
 
        /* write to temporary file */
        g_snprintf(tmp, sizeof(tmp), "%s%ctmpmsg%d",
@@ -1403,7 +1414,6 @@ static void reply_cb(gpointer data, guint action, GtkWidget *widget)
 {
        MessageView *messageview = (MessageView *)data;
        GSList *msginfo_list = NULL;
-       MsgInfo *msginfo;
 
        g_return_if_fail(messageview->msginfo);
 
index 2e22907..8e35ecd 100644 (file)
@@ -1507,7 +1507,7 @@ static void toggle_icon(GtkToggleButton *button, MimeView *mimeview)
 
 static void icon_list_append_icon (MimeView *mimeview, MimeInfo *mimeinfo) 
 {
-       GtkWidget *pixmap;
+       GtkWidget *pixmap = NULL;
        GtkWidget *vbox;
        GtkWidget *button;
        gchar *tip;
index 10f6e8f..3bfbec8 100644 (file)
@@ -225,13 +225,14 @@ gint msgcache_get_memory_usage(MsgCache *cache)
  *  Cache saving functions
  */
 
-#define READ_CACHE_DATA(data, fp) \
+#define READ_CACHE_DATA(data, fp, total_len) \
 { \
-       if (msgcache_read_cache_data_str(fp, &data, conv) < 0) { \
+       if ((tmp_len = msgcache_read_cache_data_str(fp, &data, conv)) < 0) { \
                procmsg_msginfo_free(msginfo); \
                error = TRUE; \
                break; \
        } \
+       total_len += tmp_len; \
 }
 
 #define READ_CACHE_DATA_INT(n, fp) \
@@ -305,7 +306,7 @@ static FILE *msgcache_open_data_file(const gchar *file, guint version,
                        fp = NULL;
                }
        }
-
+       
        if (mode == DATA_READ)
                return fp;
 
@@ -360,7 +361,7 @@ static gint msgcache_read_cache_data_str(FILE *fp, gchar **str,
        } else 
                *str = tmpstr;
 
-       return 0;
+       return len;
 }
 
 gchar *strconv_strdup_convert(StringConverter *conv, gchar *srcstr)
@@ -396,7 +397,15 @@ MsgCache *msgcache_read_cache(FolderItem *item, const gchar *cache_file)
        StringConverter *conv = NULL;
        gchar *srccharset = NULL;
        const gchar *dstcharset = NULL;
-
+       gchar *ref = NULL;
+       guint memusage = 0;
+       guint tmp_len = 0;
+#if 0
+       struct timeval start;
+       struct timeval end;
+       struct timeval diff;
+       gettimeofday(&start, NULL);
+#endif
        g_return_val_if_fail(cache_file != NULL, NULL);
        g_return_val_if_fail(item != NULL, NULL);
 
@@ -444,35 +453,38 @@ MsgCache *msgcache_read_cache(FolderItem *item, const gchar *cache_file)
 
        cache = msgcache_new();
        g_hash_table_freeze(cache->msgnum_table);
+       g_hash_table_freeze(cache->msgid_table);
 
        while (fread(&num, sizeof(num), 1, fp) == 1) {
                msginfo = procmsg_msginfo_new();
                msginfo->msgnum = num;
+               memusage += sizeof(MsgInfo);
+               
                READ_CACHE_DATA_INT(msginfo->size, fp);
                READ_CACHE_DATA_INT(msginfo->mtime, fp);
                READ_CACHE_DATA_INT(msginfo->date_t, fp);
                READ_CACHE_DATA_INT(msginfo->flags.tmp_flags, fp);
-
-               READ_CACHE_DATA(msginfo->fromname, fp);
-
-               READ_CACHE_DATA(msginfo->date, fp);
-               READ_CACHE_DATA(msginfo->from, fp);
-               READ_CACHE_DATA(msginfo->to, fp);
-               READ_CACHE_DATA(msginfo->cc, fp);
-               READ_CACHE_DATA(msginfo->newsgroups, fp);
-               READ_CACHE_DATA(msginfo->subject, fp);
-               READ_CACHE_DATA(msginfo->msgid, fp);
-               READ_CACHE_DATA(msginfo->inreplyto, fp);
-               READ_CACHE_DATA(msginfo->xref, fp);
+                               
+               READ_CACHE_DATA(msginfo->fromname, fp, memusage);
+
+               READ_CACHE_DATA(msginfo->date, fp, memusage);
+               READ_CACHE_DATA(msginfo->from, fp, memusage);
+               READ_CACHE_DATA(msginfo->to, fp, memusage);
+               READ_CACHE_DATA(msginfo->cc, fp, memusage);
+               READ_CACHE_DATA(msginfo->newsgroups, fp, memusage);
+               READ_CACHE_DATA(msginfo->subject, fp, memusage);
+               READ_CACHE_DATA(msginfo->msgid, fp, memusage);
+               READ_CACHE_DATA(msginfo->inreplyto, fp, memusage);
+               READ_CACHE_DATA(msginfo->xref, fp, memusage);
+               
                READ_CACHE_DATA_INT(msginfo->planned_download, fp);
                READ_CACHE_DATA_INT(msginfo->total_size, fp);
-
                READ_CACHE_DATA_INT(refnum, fp);
-
+               
                for (; refnum != 0; refnum--) {
-                       gchar *ref = NULL;
+                       ref = NULL;
 
-                       READ_CACHE_DATA(ref, fp);
+                       READ_CACHE_DATA(ref, fp, memusage);
 
                        if (ref && strlen(ref))
                                msginfo->references =
@@ -488,10 +500,10 @@ MsgCache *msgcache_read_cache(FolderItem *item, const gchar *cache_file)
                g_hash_table_insert(cache->msgnum_table, &msginfo->msgnum, msginfo);
                if(msginfo->msgid)
                        g_hash_table_insert(cache->msgid_table, msginfo->msgid, msginfo);
-               cache->memusage += procmsg_msginfo_memusage(msginfo);
        }
        fclose(fp);
        g_hash_table_thaw(cache->msgnum_table);
+       g_hash_table_thaw(cache->msgid_table);
 
        if (conv != NULL) {
                if (conv->free != NULL)
@@ -505,10 +517,15 @@ MsgCache *msgcache_read_cache(FolderItem *item, const gchar *cache_file)
        }
 
        cache->last_access = time(NULL);
+       cache->memusage = memusage;
 
        debug_print("done. (%d items read)\n", g_hash_table_size(cache->msgnum_table));
        debug_print("Cache size: %d messages, %d byte\n", g_hash_table_size(cache->msgnum_table), cache->memusage);
-
+#if 0
+       gettimeofday(&end, NULL);
+       timersub(&end, &start, &diff);
+       printf("spent %d seconds %d usages %d;%d\n", diff.tv_sec, diff.tv_usec, cache->memusage, memusage);
+#endif
        return cache;
 }
 
index cdb1f88..4b92777 100644 (file)
@@ -561,15 +561,7 @@ static void pop_bfr_smtp_tm_set_sens               (GtkWidget      *widget,
 
 static void prefs_account_edit_custom_header   (void);
 
-static gint prefs_account_deleted              (GtkWidget      *widget,
-                                                GdkEventAny    *event,
-                                                gpointer        data);
-static gboolean prefs_account_key_pressed      (GtkWidget      *widget,
-                                                GdkEventKey    *event,
-                                                gpointer        data);
-static void prefs_account_ok                   (void);
 static gint prefs_account_apply                        (void);
-static void prefs_account_cancel               (void);
 
 typedef struct AccountPage
 {
@@ -2352,27 +2344,6 @@ static void prefs_account_advanced_create(void)
        advanced.trash_folder_entry  = trash_folder_entry;
 }
 
-static gint prefs_account_deleted(GtkWidget *widget, GdkEventAny *event,
-                                 gpointer data)
-{
-       prefs_account_cancel();
-       return TRUE;
-}
-
-static gboolean prefs_account_key_pressed(GtkWidget *widget, GdkEventKey *event,
-                                         gpointer data)
-{
-       if (event && event->keyval == GDK_Escape)
-               prefs_account_cancel();
-       return FALSE;
-}
-
-static void prefs_account_ok(void)
-{
-       if (prefs_account_apply() == 0)
-               gtk_main_quit();
-}
-
 static gint prefs_account_apply(void)
 {
        RecvProtocol protocol;
@@ -2436,12 +2407,6 @@ static gint prefs_account_apply(void)
        return 0;
 }
 
-static void prefs_account_cancel(void)
-{
-       cancelled = TRUE;
-       gtk_main_quit();
-}
-
 static void pop_bfr_smtp_tm_set_sens(GtkWidget *widget, gpointer data)
 {
        gtk_widget_set_sensitive(p_send.pop_bfr_smtp_tm_entry, 
index 84fcc31..3bafd5d 100644 (file)
@@ -432,7 +432,6 @@ static void prefs_actions_set_dialog(void)
 
 static void prefs_actions_set_list(void)
 {
-       gchar *action;
        GtkTreeIter iter;
        GtkListStore *store;
        
@@ -897,7 +896,7 @@ static gboolean prefs_actions_selected(GtkTreeSelection *selector,
        if (cmd && cmd[2])
                ENTRY_SET_TEXT(actions.cmd_entry, &cmd[2]);
        else
-               return;
+               return TRUE;
 
        *cmd = 0x00;
        ENTRY_SET_TEXT(actions.name_entry, buf);
index b37f0d5..f7186c4 100644 (file)
@@ -67,115 +67,6 @@ PrefsCommon prefs_common;
 
 GtkWidget *notebook;
 
-static struct Receive {
-       GtkWidget *checkbtn_incext;
-       GtkWidget *entry_incext;
-       GtkWidget *button_incext;
-
-       GtkWidget *checkbtn_autochk;
-       GtkWidget *spinbtn_autochk;
-       GtkObject *spinbtn_autochk_adj;
-
-       GtkWidget *checkbtn_chkonstartup;
-       GtkWidget *checkbtn_scan_after_inc;
-
-
-       GtkWidget *checkbtn_newmail_auto;
-       GtkWidget *checkbtn_newmail_manu;
-       GtkWidget *entry_newmail_notify_cmd;
-       GtkWidget *hbox_newmail_notify;
-       GtkWidget *optmenu_recvdialog;
-       GtkWidget *checkbtn_no_recv_err_panel;
-       GtkWidget *checkbtn_close_recv_dialog;
-} receive;
-
-static struct Send {
-       GtkWidget *checkbtn_savemsg;
-       GtkWidget *optmenu_senddialog;
-
-       GtkWidget *optmenu_charset;
-       GtkWidget *optmenu_encoding_method;
-} p_send;
-
-static struct Display {
-       GtkWidget *chkbtn_folder_unread;
-       GtkWidget *entry_ng_abbrev_len;
-       GtkWidget *spinbtn_ng_abbrev_len;
-       GtkObject *spinbtn_ng_abbrev_len_adj;
-
-       GtkWidget *chkbtn_transhdr;
-
-       GtkWidget *chkbtn_swapfrom;
-       GtkWidget *chkbtn_useaddrbook;
-       GtkWidget *chkbtn_threadsubj;
-       GtkWidget *entry_datefmt;
-} display;
-
-static struct Message {
-       GtkWidget *chkbtn_mbalnum;
-       GtkWidget *chkbtn_disphdrpane;
-       GtkWidget *chkbtn_disphdr;
-       GtkWidget *chkbtn_html;
-       GtkWidget *chkbtn_cursor;
-       GtkWidget *spinbtn_linespc;
-       GtkObject *spinbtn_linespc_adj;
-
-       GtkWidget *chkbtn_smoothscroll;
-       GtkWidget *spinbtn_scrollstep;
-       GtkObject *spinbtn_scrollstep_adj;
-       GtkWidget *chkbtn_halfpage;
-
-       GtkWidget *chkbtn_attach_desc;
-} message;
-
-static struct Interface {
-       /* GtkWidget *checkbtn_emacs; */
-       GtkWidget *checkbtn_always_show_msg;
-       GtkWidget *checkbtn_openunread;
-       GtkWidget *checkbtn_mark_as_read_on_newwin;
-       GtkWidget *checkbtn_openinbox;
-       GtkWidget *checkbtn_immedexec;
-       GtkWidget *optmenu_nextunreadmsgdialog;
-} interface;
-
-static struct Other {
-       GtkWidget *checkbtn_addaddrbyclick;
-       GtkWidget *checkbtn_confonexit;
-       GtkWidget *checkbtn_cleanonexit;
-       GtkWidget *checkbtn_askonclean;
-       GtkWidget *checkbtn_warnqueued;
-        GtkWidget *checkbtn_cliplog;
-        GtkWidget *loglength_entry;
-#if 0
-#ifdef USE_OPENSSL
-       GtkWidget *checkbtn_ssl_ask_unknown_valid;
-#endif
-#endif
-
-       GtkWidget *spinbtn_iotimeout;
-       GtkObject *spinbtn_iotimeout_adj;
-} other;
-
-static struct KeybindDialog {
-       GtkWidget *window;
-       GtkWidget *combo;
-} keybind;
-
-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);
-static void prefs_common_recv_dialog_set_optmenu(PrefParam *pparam);
-static void prefs_common_send_dialog_set_data_from_optmenu(PrefParam *pparam);
-static void prefs_common_send_dialog_set_optmenu(PrefParam *pparam);
-static void prefs_nextunreadmsgdialog_set_data_from_optmenu(PrefParam *pparam);
-static void prefs_nextunreadmsgdialog_set_optmenu(PrefParam *pparam);
-
 /*
    parameter name, default value, pointer to the prefs variable, data type,
    pointer to the widget pointer,
@@ -186,61 +77,41 @@ static void prefs_nextunreadmsgdialog_set_optmenu(PrefParam *pparam);
 static PrefParam param[] = {
        /* Receive */
        {"use_ext_inc", "FALSE", &prefs_common.use_extinc, P_BOOL,
-        &receive.checkbtn_incext,
-        prefs_set_data_from_toggle, prefs_set_toggle},
+        NULL, NULL, NULL},
        {"ext_inc_path", DEFAULT_INC_PATH, &prefs_common.extinc_cmd, P_STRING,
-        &receive.entry_incext,
-        prefs_set_data_from_entry, prefs_set_entry},
+        NULL, NULL, NULL},
 
        {"autochk_newmail", "FALSE", &prefs_common.autochk_newmail, P_BOOL,
-        &receive.checkbtn_autochk,
-        prefs_set_data_from_toggle, prefs_set_toggle},
+        NULL, NULL, NULL},
        {"autochk_interval", "10", &prefs_common.autochk_itv, P_INT,
-        &receive.spinbtn_autochk,
-        prefs_set_data_from_spinbtn, prefs_set_spinbtn},
+        NULL, NULL, NULL},
        {"check_on_startup", "FALSE", &prefs_common.chk_on_startup, P_BOOL,
-        &receive.checkbtn_chkonstartup,
-        prefs_set_data_from_toggle, prefs_set_toggle},
+        NULL, NULL, NULL},
        {"scan_all_after_inc", "FALSE", &prefs_common.scan_all_after_inc,
-        P_BOOL, &receive.checkbtn_scan_after_inc,
-        prefs_set_data_from_toggle, prefs_set_toggle},
+        P_BOOL, NULL, NULL, NULL},
        {"newmail_notify_manu", "FALSE", &prefs_common.newmail_notify_manu,
-        P_BOOL, &receive.checkbtn_newmail_manu,
-        prefs_set_data_from_toggle, prefs_set_toggle},
+        P_BOOL, NULL, NULL, NULL},
        {"newmail_notify_auto", "FALSE", &prefs_common.newmail_notify_auto,
-       P_BOOL, &receive.checkbtn_newmail_auto,
-        prefs_set_data_from_toggle, prefs_set_toggle},
+       P_BOOL, NULL, NULL, NULL},
        {"newmail_notify_cmd", "", &prefs_common.newmail_notify_cmd, P_STRING,
-        &receive.entry_newmail_notify_cmd,
-        prefs_set_data_from_entry, prefs_set_entry},
+        NULL, NULL, NULL},
        {"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},
+        NULL, NULL, NULL},
        {"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},
+        P_BOOL, NULL, NULL, NULL},
        {"close_receive_dialog", "TRUE", &prefs_common.close_recv_dialog,
-        P_BOOL, &receive.checkbtn_close_recv_dialog,
-        prefs_set_data_from_toggle, prefs_set_toggle},
+        P_BOOL, NULL, NULL, NULL},
  
        /* Send */
        {"save_message", "TRUE", &prefs_common.savemsg, P_BOOL,
-        &p_send.checkbtn_savemsg,
-        prefs_set_data_from_toggle, prefs_set_toggle},
+        NULL, NULL, NULL},
        {"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},
+        NULL, NULL, NULL},
 
        {"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},
+        NULL, NULL, NULL},
        {"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},
+        NULL, NULL, NULL},
 
        {"allow_jisx0201_kana", "FALSE", &prefs_common.allow_jisx0201_kana,
         P_BOOL, NULL, NULL, NULL},
@@ -547,41 +418,32 @@ static PrefParam param[] = {
         P_BOOL, NULL, NULL, NULL},
 
        {"convert_mb_alnum", "FALSE", &prefs_common.conv_mb_alnum, P_BOOL,
-        &message.chkbtn_mbalnum,
-        prefs_set_data_from_toggle, prefs_set_toggle},
+        NULL, NULL, NULL},
        {"display_header_pane", "TRUE", &prefs_common.display_header_pane,
-        P_BOOL, &message.chkbtn_disphdrpane,
-        prefs_set_data_from_toggle, prefs_set_toggle},
+        P_BOOL, NULL, NULL, NULL},
        {"display_header", "TRUE", &prefs_common.display_header, P_BOOL,
-        &message.chkbtn_disphdr,
-        prefs_set_data_from_toggle, prefs_set_toggle},
+        NULL, NULL, NULL},
        {"render_html", "TRUE", &prefs_common.render_html, P_BOOL,
-        &message.chkbtn_html,
-        prefs_set_data_from_toggle, prefs_set_toggle},
+        NULL, NULL, NULL},
        {"textview_cursor_visible", "FALSE",
         &prefs_common.textview_cursor_visible, P_BOOL,
-        &message.chkbtn_cursor, prefs_set_data_from_toggle, prefs_set_toggle},
+        NULL, NULL, NULL},
        {"line_space", "2", &prefs_common.line_space, P_INT,
-        &message.spinbtn_linespc,
-        prefs_set_data_from_spinbtn, prefs_set_spinbtn},
+        NULL, NULL, NULL},
 
        {"enable_smooth_scroll", "FALSE",
         &prefs_common.enable_smooth_scroll, P_BOOL,
-        &message.chkbtn_smoothscroll,
-        prefs_set_data_from_toggle, prefs_set_toggle},
+        NULL, NULL, NULL},
        {"scroll_step", "1", &prefs_common.scroll_step, P_INT,
-        &message.spinbtn_scrollstep,
-        prefs_set_data_from_spinbtn, prefs_set_spinbtn},
+        NULL, NULL, NULL},
        {"scroll_half_page", "FALSE", &prefs_common.scroll_halfpage, P_BOOL,
-        &message.chkbtn_halfpage,
-        prefs_set_data_from_toggle, prefs_set_toggle},
+        NULL, NULL, NULL},
 
        {"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},
+        NULL, NULL, NULL},
        {"attach_save_directory", NULL,
         &prefs_common.attach_save_dir, P_STRING, NULL, NULL, NULL},
 
@@ -603,28 +465,21 @@ static PrefParam param[] = {
         NULL, NULL, NULL}, */
        {"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},
+        P_BOOL, NULL, NULL, NULL},
        {"open_unread_on_enter", "FALSE", &prefs_common.open_unread_on_enter,
-        P_BOOL, &interface.checkbtn_openunread,
-        prefs_set_data_from_toggle, prefs_set_toggle},
+        P_BOOL, NULL, NULL, NULL},
        {"mark_as_read_on_new_window", "FALSE",
         &prefs_common.mark_as_read_on_new_window,
-        P_BOOL, &interface.checkbtn_mark_as_read_on_newwin,
-        prefs_set_data_from_toggle, prefs_set_toggle},
+        P_BOOL, NULL, NULL, NULL},
        {"mark_as_read_delay", "0",
         &prefs_common.mark_as_read_delay, P_INT, 
         NULL, NULL, NULL},
        {"open_inbox_on_inc", "FALSE", &prefs_common.open_inbox_on_inc,
-        P_BOOL, &interface.checkbtn_openinbox,
-        prefs_set_data_from_toggle, prefs_set_toggle},
+        P_BOOL, NULL, NULL, NULL},
        {"immediate_execution", "TRUE", &prefs_common.immediate_exec, P_BOOL,
-        &interface.checkbtn_immedexec,
-        prefs_set_data_from_toggle, prefs_set_toggle},
+        NULL, NULL, NULL},
        {"nextunreadmsg_dialog", NULL, &prefs_common.next_unread_msg_dialog, P_ENUM,
-        &interface.optmenu_nextunreadmsgdialog,
-        prefs_nextunreadmsgdialog_set_data_from_optmenu,
-        prefs_nextunreadmsgdialog_set_optmenu},
+        NULL, NULL, NULL},
 
        {"pixmap_theme_path", DEFAULT_PIXMAP_THEME, 
         &prefs_common.pixmap_theme_path, P_STRING,
@@ -642,28 +497,15 @@ static PrefParam param[] = {
         &prefs_common.ext_editor_cmd, P_STRING, NULL, NULL, NULL},
 
        {"add_address_by_click", "FALSE", &prefs_common.add_address_by_click,
-        P_BOOL, &other.checkbtn_addaddrbyclick,
-        prefs_set_data_from_toggle, prefs_set_toggle},
-
+        P_BOOL, NULL, NULL, NULL},
        {"confirm_on_exit", "FALSE", &prefs_common.confirm_on_exit, P_BOOL,
-        &other.checkbtn_confonexit,
-        prefs_set_data_from_toggle, prefs_set_toggle},
+        NULL, NULL, NULL},
        {"clean_trash_on_exit", "FALSE", &prefs_common.clean_on_exit, P_BOOL,
-        &other.checkbtn_cleanonexit,
-        prefs_set_data_from_toggle, prefs_set_toggle},
+        NULL, NULL, NULL},
        {"ask_on_cleaning", "TRUE", &prefs_common.ask_on_clean, P_BOOL,
-        &other.checkbtn_askonclean,
-        prefs_set_data_from_toggle, prefs_set_toggle},
+        NULL, NULL, NULL},
        {"warn_queued_on_exit", "TRUE", &prefs_common.warn_queued_on_exit,
-        P_BOOL, &other.checkbtn_warnqueued,
-        prefs_set_data_from_toggle, prefs_set_toggle},
-#if 0
-#ifdef USE_OPENSSL
-       {"ssl_ask_unknown_valid", "TRUE", &prefs_common.ssl_ask_unknown_valid,
-        P_BOOL, &other.checkbtn_ssl_ask_unknown_valid,
-        prefs_set_data_from_toggle, prefs_set_toggle},
-#endif
-#endif
+        P_BOOL, NULL, NULL, NULL},
        {"work_offline", "FALSE", &prefs_common.work_offline, P_BOOL,
         NULL, NULL, NULL},
        {"summary_quicksearch_type", "0", &prefs_common.summary_quicksearch_type, P_INT,
@@ -674,18 +516,15 @@ static PrefParam param[] = {
         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},
+        P_INT, NULL, NULL, NULL},
        {"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", "TRUE", &prefs_common.cliplog, P_BOOL,
-        &other.checkbtn_cliplog,
-        prefs_set_data_from_toggle, prefs_set_toggle},
+        NULL, NULL, NULL},
        {"log_length", "500", &prefs_common.loglength, P_INT,
-        &other.loglength_entry,
-        prefs_set_data_from_entry, prefs_set_entry},
+        NULL, NULL, NULL},
 
        {"cache_max_mem_usage", "4096", &prefs_common.cache_max_mem_usage, P_INT,
         NULL, NULL, NULL},
@@ -705,103 +544,6 @@ static PrefParam param[] = {
        {NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
 };
 
-/* widget creating functions */
-static void prefs_common_create                (void);
-static void prefs_receive_create       (void);
-static void prefs_send_create          (void);
-static void prefs_message_create       (void);
-static void prefs_interface_create     (void);
-static void prefs_other_create         (void);
-
-static void date_format_ok_btn_clicked         (GtkButton      *button,
-                                                GtkWidget     **widget);
-static void date_format_cancel_btn_clicked     (GtkButton      *button,
-                                                GtkWidget     **widget);
-static gboolean date_format_key_pressed                (GtkWidget      *keywidget,
-                                                GdkEventKey    *event,
-                                                GtkWidget     **widget);
-static gboolean date_format_on_delete          (GtkWidget      *dialogwidget,
-                                                GdkEventAny    *event,
-                                                GtkWidget     **widget);
-static void date_format_entry_on_change                (GtkEditable    *editable,
-                                                GtkLabel       *example);
-static void date_format_select_row             (GtkTreeView *list_view,
-                                                GtkTreePath *path,
-                                                GtkTreeViewColumn *column,
-                                                GtkWidget *date_format);
-static void prefs_keybind_select               (void);
-static gint prefs_keybind_deleted              (GtkWidget      *widget,
-                                                GdkEventAny    *event,
-                                                gpointer        data);
-static gboolean prefs_keybind_key_pressed      (GtkWidget      *widget,
-                                                GdkEventKey    *event,
-                                                gpointer        data);
-static void prefs_keybind_cancel               (void);
-static void prefs_keybind_apply_clicked                (GtkWidget      *widget);
-
-static void prefs_common_apply         (void);
-
-typedef struct CommonPage
-{
-        PrefsPage page;
-        GtkWidget *vbox;
-} CommonPage;
-
-static CommonPage common_page;
-
-static void create_widget_func(PrefsPage * _page,
-                                           GtkWindow * window,
-                                           gpointer data)
-{
-       CommonPage *page = (CommonPage *) _page;
-       GtkWidget *vbox;
-
-       vbox = gtk_vbox_new(FALSE, 6);
-       gtk_widget_show(vbox);
-
-       if (notebook == NULL)
-               prefs_common_create();
-       gtk_box_pack_start (GTK_BOX (vbox), notebook, TRUE, TRUE, 0);
-       gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook), 0);
-
-       prefs_set_dialog(param);
-
-       page->vbox = vbox;
-
-       page->page.widget = vbox;
-}
-
-static void destroy_widget_func(PrefsPage *_page)
-{
-       CommonPage *page = (CommonPage *) _page;
-
-       gtk_container_remove(GTK_CONTAINER (page->vbox), notebook);
-}
-
-static void save_func(PrefsPage * _page)
-{
-       prefs_common_apply();
-}
-
-void prefs_common_init(void) 
-{
-        static gchar *path[2];
-
-       prefs_common.disphdr_list = NULL;
-            
-        path[0] = _("Common");
-        path[1] = NULL;
-        
-        common_page.page.path = path;
-       common_page.page.weight = 1000.0;
-        common_page.page.create_widget = create_widget_func;
-        common_page.page.destroy_widget = destroy_widget_func;
-        common_page.page.save_page = save_func;
-
-        prefs_gtk_register_page((PrefsPage *) &common_page);
-}
-
 PrefsCommon *prefs_common_get(void)
 {
        return &prefs_common;
@@ -887,1524 +629,6 @@ void prefs_common_write_config(void)
                prefs_common.summary_quicksearch_history);
 }
 
-static void prefs_common_create(void)
-{
-       gint page = 0;
-
-       debug_print("Creating common preferences window...\n");
-
-       notebook = gtk_notebook_new ();
-       gtk_widget_show(notebook);
-       gtk_container_set_border_width (GTK_CONTAINER (notebook), 2);
-       /* GTK_WIDGET_UNSET_FLAGS (notebook, GTK_CAN_FOCUS); */
-       gtk_notebook_set_scrollable (GTK_NOTEBOOK (notebook), TRUE);
-       
-       gtk_notebook_popup_enable (GTK_NOTEBOOK (notebook));
-
-       gtk_widget_ref(notebook);
-
-       /* create all widgets on notebook */
-       prefs_receive_create();
-       SET_NOTEBOOK_LABEL(notebook, _("Receive"),   page++);
-       prefs_send_create();
-       SET_NOTEBOOK_LABEL(notebook, _("Send"),      page++);
-       prefs_message_create();
-       SET_NOTEBOOK_LABEL(notebook, _("Message"),   page++);
-       prefs_interface_create();
-       SET_NOTEBOOK_LABEL(notebook, _("Interface"), page++);
-       prefs_other_create();
-       SET_NOTEBOOK_LABEL(notebook, _("Other"),     page++);
-
-       gtk_widget_show_all(notebook);
-}
-
-static void prefs_receive_create(void)
-{
-       GtkWidget *vbox1;
-       GtkWidget *vbox2;
-       GtkWidget *frame_incext;
-       GtkWidget *checkbtn_incext;
-       GtkWidget *hbox;
-       GtkWidget *label_incext;
-       GtkWidget *entry_incext;
-       /* GtkWidget *button_incext; */
-
-       GtkWidget *hbox_autochk;
-       GtkWidget *checkbtn_autochk;
-       GtkWidget *label_autochk1;
-       GtkObject *spinbtn_autochk_adj;
-       GtkWidget *spinbtn_autochk;
-       GtkWidget *label_autochk2;
-       GtkWidget *checkbtn_chkonstartup;
-       GtkWidget *checkbtn_scan_after_inc;
-
-
-       GtkWidget *frame_newmail;
-       GtkWidget *hbox_newmail_notify;
-       GtkWidget *checkbtn_newmail_auto;
-       GtkWidget *checkbtn_newmail_manu;
-       GtkWidget *entry_newmail_notify_cmd;
-       GtkWidget *label_newmail_notify_cmd;
-
-       GtkWidget *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);
-       gtk_container_add (GTK_CONTAINER (notebook), vbox1);
-       gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
-
-       PACK_FRAME(vbox1, frame_incext, _("External program"));
-
-       vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW);
-       gtk_widget_show (vbox2);
-       gtk_container_add (GTK_CONTAINER (frame_incext), vbox2);
-       gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
-
-       /* Use of external incorporation program */
-       PACK_CHECK_BUTTON (vbox2, checkbtn_incext,
-                          _("Use external program for incorporation"));
-
-       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_incext, hbox);
-
-       label_incext = gtk_label_new (_("Command"));
-       gtk_widget_show (label_incext);
-       gtk_box_pack_start (GTK_BOX (hbox), label_incext, FALSE, FALSE, 0);
-
-       entry_incext = gtk_entry_new ();
-       gtk_widget_show (entry_incext);
-       gtk_box_pack_start (GTK_BOX (hbox), entry_incext, TRUE, TRUE, 0);
-
-#if 0
-       button_incext = gtk_button_new_with_label ("... ");
-       gtk_widget_show (button_incext);
-       gtk_box_pack_start (GTK_BOX (hbox), button_incext, 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);
-
-       /* Auto-checking */
-       hbox_autochk = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox_autochk);
-       gtk_box_pack_start (GTK_BOX (vbox2), hbox_autochk, FALSE, FALSE, 0);
-
-       PACK_CHECK_BUTTON (hbox_autochk, checkbtn_autochk,
-                          _("Auto-check new mail"));
-
-       label_autochk1 = gtk_label_new (_("every"));
-       gtk_widget_show (label_autochk1);
-       gtk_box_pack_start (GTK_BOX (hbox_autochk), label_autochk1, FALSE, FALSE, 0);
-
-       spinbtn_autochk_adj = gtk_adjustment_new (5, 1, 100, 1, 10, 10);
-       spinbtn_autochk = gtk_spin_button_new
-               (GTK_ADJUSTMENT (spinbtn_autochk_adj), 1, 0);
-       gtk_widget_show (spinbtn_autochk);
-       gtk_box_pack_start (GTK_BOX (hbox_autochk), spinbtn_autochk, FALSE, FALSE, 0);
-       gtk_widget_set_size_request (spinbtn_autochk, 64, -1);
-       gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_autochk), TRUE);
-
-       label_autochk2 = gtk_label_new (_("minute(s)"));
-       gtk_widget_show (label_autochk2);
-       gtk_box_pack_start (GTK_BOX (hbox_autochk), label_autochk2, FALSE, FALSE, 0);
-
-       SET_TOGGLE_SENSITIVITY(checkbtn_autochk, label_autochk1);
-       SET_TOGGLE_SENSITIVITY(checkbtn_autochk, spinbtn_autochk);
-       SET_TOGGLE_SENSITIVITY(checkbtn_autochk, label_autochk2);
-
-       PACK_CHECK_BUTTON (vbox2, checkbtn_chkonstartup,
-                          _("Check new mail on startup"));
-       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"));
-       vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW);
-       gtk_widget_show (vbox2);
-       gtk_container_add (GTK_CONTAINER (frame_newmail), vbox2);
-       gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
-
-       hbox = gtk_hbox_new (TRUE, 8);
-       gtk_widget_show (hbox);
-       PACK_CHECK_BUTTON (hbox, checkbtn_newmail_auto,
-                          _("after autochecking"));
-       PACK_CHECK_BUTTON (hbox, checkbtn_newmail_manu,
-                          _("after manual checking"));
-       gtk_box_pack_start (GTK_BOX(vbox2), hbox, FALSE, FALSE, 0);
-       g_signal_connect(G_OBJECT(checkbtn_newmail_auto), "toggled",
-                        G_CALLBACK(prefs_common_recv_dialog_newmail_notify_toggle_cb),
-                        NULL);
-       g_signal_connect(G_OBJECT(checkbtn_newmail_manu), "toggled",
-                        G_CALLBACK(prefs_common_recv_dialog_newmail_notify_toggle_cb),
-                        NULL);
-
-       hbox_newmail_notify = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox);
-       gtk_box_pack_start (GTK_BOX (vbox2), hbox_newmail_notify, FALSE, 
-                           FALSE, 0);
-
-       label_newmail_notify_cmd = gtk_label_new (_("Command to execute:\n"
-                                                   "(use %d as number of new "
-                                                   "mails)"));
-       gtk_label_set_justify(GTK_LABEL(label_newmail_notify_cmd), 
-                             GTK_JUSTIFY_RIGHT);
-       gtk_widget_show (label_newmail_notify_cmd);
-       gtk_box_pack_start (GTK_BOX (hbox_newmail_notify), 
-                           label_newmail_notify_cmd, FALSE, FALSE, 0);
-
-       entry_newmail_notify_cmd = gtk_entry_new ();
-       gtk_widget_show (entry_newmail_notify_cmd);
-       gtk_box_pack_start (GTK_BOX (hbox_newmail_notify), 
-                           entry_newmail_notify_cmd, TRUE, TRUE, 0);
-
-       gtk_widget_set_sensitive(hbox_newmail_notify, 
-                                prefs_common.newmail_notify_auto || 
-                                prefs_common.newmail_notify_manu);
-
-       receive.checkbtn_incext = checkbtn_incext;
-       receive.entry_incext    = entry_incext;
-       /* receive.button_incext   = button_incext; */
-
-       receive.checkbtn_autochk    = checkbtn_autochk;
-       receive.spinbtn_autochk     = spinbtn_autochk;
-       receive.spinbtn_autochk_adj = spinbtn_autochk_adj;
-
-       receive.checkbtn_chkonstartup = checkbtn_chkonstartup;
-       receive.checkbtn_scan_after_inc = checkbtn_scan_after_inc;
-
-
-       receive.checkbtn_newmail_auto  = checkbtn_newmail_auto;
-       receive.checkbtn_newmail_manu  = checkbtn_newmail_manu;
-       receive.hbox_newmail_notify    = hbox_newmail_notify;
-       receive.entry_newmail_notify_cmd = entry_newmail_notify_cmd;
-       receive.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 *hbox1;
-       GtkWidget *checkbtn_savemsg;
-       GtkWidget *label_outcharset;
-       GtkWidget *optmenu_charset;
-       GtkWidget *optmenu_menu;
-       GtkWidget *menuitem;
-       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 (notebook), vbox1);
-       gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
-
-       vbox2 = gtk_vbox_new (FALSE, 0);
-       gtk_widget_show (vbox2);
-       gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
-
-       PACK_CHECK_BUTTON (vbox2, checkbtn_savemsg,
-                          _("Save sent messages to Sent folder"));
-
-       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);
-
-       label_outcharset = gtk_label_new (_("Outgoing encoding"));
-       gtk_widget_show (label_outcharset);
-       gtk_box_pack_start (GTK_BOX (hbox1), label_outcharset, 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, data) \
-{ \
-       MENUITEM_ADD(optmenu_menu, menuitem, str, data); \
-}
-
-       SET_MENUITEM(_("Automatic (Recommended)"),       CS_AUTO);
-       SET_MENUITEM(NULL, NULL);
-       SET_MENUITEM(_("7bit ascii (US-ASCII)"),         CS_US_ASCII);
-       SET_MENUITEM(NULL, NULL);
-       SET_MENUITEM(_("Unicode (UTF-8)"),               CS_UTF_8);
-       SET_MENUITEM(NULL, NULL);
-       SET_MENUITEM(_("Western European (ISO-8859-1)"),  CS_ISO_8859_1);
-       SET_MENUITEM(_("Western European (ISO-8859-15)"), CS_ISO_8859_15);
-       SET_MENUITEM(NULL, NULL);
-       SET_MENUITEM(_("Central European (ISO-8859-2)"),  CS_ISO_8859_2);
-       SET_MENUITEM(NULL, NULL);
-       SET_MENUITEM(_("Baltic (ISO-8859-13)"),           CS_ISO_8859_13);
-       SET_MENUITEM(_("Baltic (ISO-8859-4)"),            CS_ISO_8859_4);
-       SET_MENUITEM(NULL, NULL);
-       SET_MENUITEM(_("Greek (ISO-8859-7)"),             CS_ISO_8859_7);
-       SET_MENUITEM(NULL, NULL);
-       SET_MENUITEM(_("Turkish (ISO-8859-9)"),           CS_ISO_8859_9);
-       SET_MENUITEM(NULL, NULL);
-       SET_MENUITEM(_("Cyrillic (ISO-8859-5)"),          CS_ISO_8859_5);
-       SET_MENUITEM(_("Cyrillic (KOI8-R)"),             CS_KOI8_R);
-       SET_MENUITEM(_("Cyrillic (KOI8-U)"),             CS_KOI8_U);
-       SET_MENUITEM(_("Cyrillic (Windows-1251)"),       CS_WINDOWS_1251);
-       SET_MENUITEM(NULL, NULL);
-       SET_MENUITEM(_("Japanese (ISO-2022-JP)"),        CS_ISO_2022_JP);
-#if 0
-       SET_MENUITEM(_("Japanese (EUC-JP)"),             CS_EUC_JP);
-       SET_MENUITEM(_("Japanese (Shift_JIS)"),          CS_SHIFT_JIS);
-#endif /* 0 */
-       SET_MENUITEM(NULL, NULL);
-       SET_MENUITEM(_("Simplified Chinese (GB2312)"),   CS_GB2312);
-       SET_MENUITEM(_("Simplified Chinese (GBK)"),      CS_GBK);
-       SET_MENUITEM(_("Traditional Chinese (Big5)"),    CS_BIG5);
-#if 0
-       SET_MENUITEM(_("Traditional Chinese (EUC-TW)"),  CS_EUC_TW);
-       SET_MENUITEM(_("Chinese (ISO-2022-CN)"),         CS_ISO_2022_CN);
-#endif /* 0 */
-       SET_MENUITEM(NULL, NULL);
-       SET_MENUITEM(_("Korean (EUC-KR)"),               CS_EUC_KR);
-       SET_MENUITEM(NULL, NULL);
-       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_charset),
-                                 optmenu_menu);
-
-       hbox1 = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox1);
-       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
-
-       hbox1 = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox1);
-       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
-
-       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.optmenu_senddialog = optmenu_senddialog;
-
-       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)
-{
-       gboolean toggled;
-
-       toggled = gtk_toggle_button_get_active
-                       (GTK_TOGGLE_BUTTON(receive.checkbtn_newmail_manu)) ||
-                 gtk_toggle_button_get_active
-                       (GTK_TOGGLE_BUTTON(receive.checkbtn_newmail_auto));
-       gtk_widget_set_sensitive(receive.hbox_newmail_notify, toggled);
-}
-
-static void prefs_message_create(void)
-{
-       GtkWidget *vbox1;
-       GtkWidget *vbox2;
-       GtkWidget *vbox3;
-       GtkWidget *hbox1;
-       GtkWidget *chkbtn_mbalnum;
-       GtkWidget *chkbtn_disphdrpane;
-       GtkWidget *chkbtn_disphdr;
-       GtkWidget *button_edit_disphdr;
-       GtkWidget *chkbtn_html;
-       GtkWidget *chkbtn_cursor;
-       GtkWidget *hbox_linespc;
-       GtkWidget *label_linespc;
-       GtkObject *spinbtn_linespc_adj;
-       GtkWidget *spinbtn_linespc;
-
-       GtkWidget *frame_scr;
-       GtkWidget *vbox_scr;
-       GtkWidget *chkbtn_smoothscroll;
-       GtkWidget *hbox_scr;
-       GtkWidget *label_scr;
-       GtkObject *spinbtn_scrollstep_adj;
-       GtkWidget *spinbtn_scrollstep;
-       GtkWidget *chkbtn_halfpage;
-
-       GtkWidget *chkbtn_attach_desc;
-
-       vbox1 = gtk_vbox_new (FALSE, VSPACING);
-       gtk_widget_show (vbox1);
-       gtk_container_add (GTK_CONTAINER (notebook), vbox1);
-       gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
-
-       vbox2 = gtk_vbox_new (FALSE, 0);
-       gtk_widget_show (vbox2);
-       gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
-
-       PACK_CHECK_BUTTON
-               (vbox2, chkbtn_mbalnum,
-                _("Display multi-byte alphanumeric as\n"
-                  "ASCII character (Japanese only)"));
-       gtk_label_set_justify (GTK_LABEL (GTK_BIN(chkbtn_mbalnum)->child),
-                              GTK_JUSTIFY_LEFT);
-
-       PACK_CHECK_BUTTON(vbox2, chkbtn_disphdrpane,
-                         _("Display header pane above message view"));
-
-       hbox1 = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox1);
-       gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
-
-       PACK_CHECK_BUTTON(hbox1, chkbtn_disphdr,
-                         _("Display short headers on message view"));
-
-       button_edit_disphdr = gtk_button_new_with_label (_(" Edit... "));
-       gtk_widget_show (button_edit_disphdr);
-       gtk_box_pack_end (GTK_BOX (hbox1), button_edit_disphdr,
-                         FALSE, TRUE, 0);
-       g_signal_connect (G_OBJECT (button_edit_disphdr), "clicked",
-                         G_CALLBACK (prefs_display_header_open),
-                         NULL);
-
-       SET_TOGGLE_SENSITIVITY(chkbtn_disphdr, button_edit_disphdr);
-
-       PACK_CHECK_BUTTON(vbox2, chkbtn_html,
-                         _("Render HTML messages as text"));
-
-       PACK_CHECK_BUTTON(vbox2, chkbtn_cursor,
-                         _("Display cursor in message view"));
-
-       PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
-
-       hbox1 = gtk_hbox_new (FALSE, 32);
-       gtk_widget_show (hbox1);
-       gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
-
-       hbox_linespc = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox1);
-       gtk_box_pack_start (GTK_BOX (hbox1), hbox_linespc, FALSE, TRUE, 0);
-
-       label_linespc = gtk_label_new (_("Line space"));
-       gtk_widget_show (label_linespc);
-       gtk_box_pack_start (GTK_BOX (hbox_linespc), label_linespc,
-                           FALSE, FALSE, 0);
-
-       spinbtn_linespc_adj = gtk_adjustment_new (2, 0, 16, 1, 1, 16);
-       spinbtn_linespc = gtk_spin_button_new
-               (GTK_ADJUSTMENT (spinbtn_linespc_adj), 1, 0);
-       gtk_widget_show (spinbtn_linespc);
-       gtk_box_pack_start (GTK_BOX (hbox_linespc), spinbtn_linespc,
-                           FALSE, FALSE, 0);
-       gtk_widget_set_size_request (spinbtn_linespc, 64, -1);
-       gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_linespc), TRUE);
-
-       label_linespc = gtk_label_new (_("pixel(s)"));
-       gtk_widget_show (label_linespc);
-       gtk_box_pack_start (GTK_BOX (hbox_linespc), label_linespc,
-                           FALSE, FALSE, 0);
-
-       PACK_FRAME(vbox1, frame_scr, _("Scroll"));
-
-       vbox_scr = gtk_vbox_new (FALSE, 0);
-       gtk_widget_show (vbox_scr);
-       gtk_container_add (GTK_CONTAINER (frame_scr), vbox_scr);
-       gtk_container_set_border_width (GTK_CONTAINER (vbox_scr), 8);
-
-       PACK_CHECK_BUTTON(vbox_scr, chkbtn_halfpage, _("Half page"));
-
-       hbox1 = gtk_hbox_new (FALSE, 32);
-       gtk_widget_show (hbox1);
-       gtk_box_pack_start (GTK_BOX (vbox_scr), hbox1, FALSE, TRUE, 0);
-
-       PACK_CHECK_BUTTON(hbox1, chkbtn_smoothscroll, _("Smooth scroll"));
-
-       hbox_scr = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox_scr);
-       gtk_box_pack_start (GTK_BOX (hbox1), hbox_scr, FALSE, FALSE, 0);
-
-       label_scr = gtk_label_new (_("Step"));
-       gtk_widget_show (label_scr);
-       gtk_box_pack_start (GTK_BOX (hbox_scr), label_scr, FALSE, FALSE, 0);
-
-       spinbtn_scrollstep_adj = gtk_adjustment_new (1, 1, 100, 1, 10, 10);
-       spinbtn_scrollstep = gtk_spin_button_new
-               (GTK_ADJUSTMENT (spinbtn_scrollstep_adj), 1, 0);
-       gtk_widget_show (spinbtn_scrollstep);
-       gtk_box_pack_start (GTK_BOX (hbox_scr), spinbtn_scrollstep,
-                           FALSE, FALSE, 0);
-       gtk_widget_set_size_request (spinbtn_scrollstep, 64, -1);
-       gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_scrollstep),
-                                    TRUE);
-
-       label_scr = gtk_label_new (_("pixel(s)"));
-       gtk_widget_show (label_scr);
-       gtk_box_pack_start (GTK_BOX (hbox_scr), label_scr, FALSE, FALSE, 0);
-
-       SET_TOGGLE_SENSITIVITY (chkbtn_smoothscroll, hbox_scr)
-
-       vbox3 = gtk_vbox_new (FALSE, 0);
-       gtk_widget_show (vbox3);
-       gtk_box_pack_start (GTK_BOX (vbox1), vbox3, FALSE, FALSE, 0);
-
-       PACK_CHECK_BUTTON(vbox3, chkbtn_attach_desc,
-                         _("Show attachment descriptions (rather than names)"));
-
-       message.chkbtn_mbalnum     = chkbtn_mbalnum;
-       message.chkbtn_disphdrpane = chkbtn_disphdrpane;
-       message.chkbtn_disphdr     = chkbtn_disphdr;
-       message.chkbtn_html        = chkbtn_html;
-       message.chkbtn_cursor      = chkbtn_cursor;
-       message.spinbtn_linespc    = spinbtn_linespc;
-
-       message.chkbtn_smoothscroll    = chkbtn_smoothscroll;
-       message.spinbtn_scrollstep     = spinbtn_scrollstep;
-       message.spinbtn_scrollstep_adj = spinbtn_scrollstep_adj;
-       message.chkbtn_halfpage        = chkbtn_halfpage;
-
-       message.chkbtn_attach_desc  = chkbtn_attach_desc;
-}
-
-static void prefs_interface_create(void)
-{
-       GtkWidget *vbox1;
-       GtkWidget *vbox2;
-       GtkWidget *vbox3;
-       /* GtkWidget *checkbtn_emacs; */
-       GtkWidget *checkbtn_always_show_msg;
-       GtkWidget *checkbtn_openunread;
-       GtkWidget *checkbtn_mark_as_read_on_newwin;
-       GtkWidget *checkbtn_openinbox;
-       GtkWidget *checkbtn_immedexec;
-       GtkTooltips *immedexec_tooltip;
-       GtkWidget *hbox1;
-       GtkWidget *label;
-       GtkWidget *menu;
-       GtkWidget *menuitem;
-
-       GtkWidget *button_keybind;
-
-       GtkWidget *hbox_nextunreadmsgdialog;
-       GtkWidget *optmenu_nextunreadmsgdialog;
-
-       vbox1 = gtk_vbox_new (FALSE, VSPACING);
-       gtk_widget_show (vbox1);
-       gtk_container_add (GTK_CONTAINER (notebook), vbox1);
-       gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
-
-       vbox2 = gtk_vbox_new (FALSE, 0);
-       gtk_widget_show (vbox2);
-       gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
-
-       /* PACK_CHECK_BUTTON (vbox2, checkbtn_emacs,
-                          _("Emulate the behavior of mouse operation of\n"
-                            "Emacs-based mailer"));
-       gtk_label_set_justify (GTK_LABEL (GTK_BIN (checkbtn_emacs)->child),
-                              GTK_JUSTIFY_LEFT);   */
-
-       PACK_CHECK_BUTTON
-               (vbox2, checkbtn_always_show_msg,
-                _("Always open messages in summary when selected"));
-
-       PACK_CHECK_BUTTON
-               (vbox2, checkbtn_openunread,
-                _("Open first unread message when entering a folder"));
-
-       PACK_CHECK_BUTTON
-               (vbox2, checkbtn_mark_as_read_on_newwin,
-                _("Only mark message as read when opened in new window"));
-
-       PACK_CHECK_BUTTON
-               (vbox2, checkbtn_openinbox,
-                _("Go to inbox after receiving new mail"));
-
-       vbox3 = gtk_vbox_new (FALSE, 0);
-       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);
-
-       /* 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_widget_show (label);
-       gtk_box_pack_start (GTK_BOX (hbox_nextunreadmsgdialog), label, FALSE, FALSE, 8);
-
-       optmenu_nextunreadmsgdialog = gtk_option_menu_new ();
-       gtk_widget_show (optmenu_nextunreadmsgdialog);
-       gtk_box_pack_start (GTK_BOX (hbox_nextunreadmsgdialog), optmenu_nextunreadmsgdialog, FALSE, FALSE, 8);
-       
-       menu = gtk_menu_new ();
-       MENUITEM_ADD (menu, menuitem, _("Always"), NEXTUNREADMSGDIALOG_ALWAYS);
-       MENUITEM_ADD (menu, menuitem, _("Assume 'Yes'"), 
-                     NEXTUNREADMSGDIALOG_ASSUME_YES);
-       MENUITEM_ADD (menu, menuitem, _("Assume 'No'"), 
-                     NEXTUNREADMSGDIALOG_ASSUME_NO);
-
-       gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_nextunreadmsgdialog), menu);
-
-       hbox1 = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox1);
-       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
-
-       button_keybind = gtk_button_new_with_label (_(" Set key bindings... "));
-       gtk_widget_show (button_keybind);
-       gtk_box_pack_start (GTK_BOX (hbox1), button_keybind, FALSE, FALSE, 0);
-       g_signal_connect (G_OBJECT (button_keybind), "clicked",
-                         G_CALLBACK (prefs_keybind_select), NULL);
-
-       /* interface.checkbtn_emacs          = checkbtn_emacs; */
-       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_nextunreadmsgdialog = optmenu_nextunreadmsgdialog;
-}
-
-static void prefs_other_create(void)
-{
-       GtkWidget *vbox1;
-       GtkWidget *hbox1;
-
-       GtkWidget *frame_addr;
-       GtkWidget *vbox_addr;
-       GtkWidget *checkbtn_addaddrbyclick;
-       
-       GtkWidget *frame_cliplog;
-       GtkWidget *vbox_cliplog;
-       GtkWidget *hbox_cliplog;
-       GtkWidget *checkbtn_cliplog;
-       GtkWidget *loglength_label;
-       GtkWidget *loglength_entry;
-       GtkTooltips *loglength_tooltip;
-
-       GtkWidget *frame_exit;
-       GtkWidget *vbox_exit;
-       GtkWidget *checkbtn_confonexit;
-       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;
-       GtkWidget *vbox_ssl;
-       GtkWidget *hbox_ssl;
-       GtkWidget *checkbtn_ssl_ask_unknown_valid;
-#endif
-#endif
-       vbox1 = gtk_vbox_new (FALSE, VSPACING);
-       gtk_widget_show (vbox1);
-       gtk_container_add (GTK_CONTAINER (notebook), vbox1);
-       gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
-
-       PACK_FRAME (vbox1, frame_addr, _("Address book"));
-
-       vbox_addr = gtk_vbox_new (FALSE, 0);
-       gtk_widget_show (vbox_addr);
-       gtk_container_add (GTK_CONTAINER (frame_addr), vbox_addr);
-       gtk_container_set_border_width (GTK_CONTAINER (vbox_addr), 8);
-
-       PACK_CHECK_BUTTON
-               (vbox_addr, checkbtn_addaddrbyclick,
-                _("Add address to destination when double-clicked"));
-
-       /* Clip Log */
-       PACK_FRAME (vbox1, frame_cliplog, _("Log Size"));
-
-       vbox_cliplog = gtk_vbox_new (FALSE, 0);
-       gtk_widget_show (vbox_cliplog);
-       gtk_container_add (GTK_CONTAINER (frame_cliplog), vbox_cliplog);
-       gtk_container_set_border_width (GTK_CONTAINER (vbox_cliplog), 8);
-       PACK_CHECK_BUTTON (vbox_cliplog, checkbtn_cliplog,
-                          _("Clip the log size"));
-       hbox_cliplog = gtk_hbox_new (FALSE, 3);
-       gtk_container_add (GTK_CONTAINER (vbox_cliplog), hbox_cliplog);
-       gtk_widget_show (hbox_cliplog);
-       
-       loglength_label = gtk_label_new (_("Log window length"));
-       gtk_box_pack_start (GTK_BOX (hbox_cliplog), loglength_label,
-                           FALSE, TRUE, 0);
-       gtk_widget_show (GTK_WIDGET (loglength_label));
-       
-       loglength_tooltip = gtk_tooltips_new();
-       
-       loglength_entry = gtk_entry_new ();
-       gtk_widget_set_size_request (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));
-       gtk_tooltips_set_tip(GTK_TOOLTIPS(loglength_tooltip), loglength_entry,
-                            _("0 to stop logging in the log window"),
-                            NULL);
-       SET_TOGGLE_SENSITIVITY(checkbtn_cliplog, loglength_entry);
-
-#if 0
-#ifdef USE_OPENSSL
-       /* SSL */
-       PACK_FRAME (vbox1, frame_ssl, _("Security"));
-
-       vbox_ssl = gtk_vbox_new (FALSE, 0);
-       gtk_widget_show (vbox_ssl);
-       gtk_container_add (GTK_CONTAINER (frame_ssl), vbox_ssl);
-       gtk_container_set_border_width (GTK_CONTAINER (vbox_ssl), 8);
-       PACK_CHECK_BUTTON (vbox_ssl, checkbtn_ssl_ask_unknown_valid, 
-                          _("Ask before accepting SSL certificates"));
-       hbox_ssl = gtk_hbox_new (FALSE, 3);
-       gtk_container_add (GTK_CONTAINER (vbox_ssl), hbox_ssl);
-       gtk_widget_show (hbox_ssl);
-#endif
-#endif
-       
-       /* On Exit */
-       PACK_FRAME (vbox1, frame_exit, _("On exit"));
-
-       vbox_exit = gtk_vbox_new (FALSE, 0);
-       gtk_widget_show (vbox_exit);
-       gtk_container_add (GTK_CONTAINER (frame_exit), vbox_exit);
-       gtk_container_set_border_width (GTK_CONTAINER (vbox_exit), 8);
-
-       PACK_CHECK_BUTTON (vbox_exit, checkbtn_confonexit,
-                          _("Confirm on exit"));
-
-       hbox1 = gtk_hbox_new (FALSE, 32);
-       gtk_widget_show (hbox1);
-       gtk_box_pack_start (GTK_BOX (vbox_exit), hbox1, FALSE, FALSE, 0);
-
-       PACK_CHECK_BUTTON (hbox1, checkbtn_cleanonexit,
-                          _("Empty trash on exit"));
-       PACK_CHECK_BUTTON (hbox1, checkbtn_askonclean,
-                          _("Ask before emptying"));
-       SET_TOGGLE_SENSITIVITY (checkbtn_cleanonexit, checkbtn_askonclean);
-
-       PACK_CHECK_BUTTON (vbox_exit, checkbtn_warnqueued,
-                          _("Warn if there are queued messages"));
-
-       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_size_request (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.checkbtn_addaddrbyclick = checkbtn_addaddrbyclick;
-       
-       other.checkbtn_cliplog     = checkbtn_cliplog;
-       other.loglength_entry      = loglength_entry;
-
-       other.checkbtn_confonexit  = checkbtn_confonexit;
-       other.checkbtn_cleanonexit = checkbtn_cleanonexit;
-       other.checkbtn_askonclean  = checkbtn_askonclean;
-       other.checkbtn_warnqueued  = checkbtn_warnqueued;
-
-       other.spinbtn_iotimeout     = spinbtn_iotimeout;
-       other.spinbtn_iotimeout_adj = spinbtn_iotimeout_adj;
-       
-#if 0
-#ifdef USE_OPENSSL
-       other.checkbtn_ssl_ask_unknown_valid = checkbtn_ssl_ask_unknown_valid;
-#endif
-#endif
-}
-
-static void date_format_ok_btn_clicked(GtkButton *button, GtkWidget **widget)
-{
-       GtkWidget *datefmt_sample = NULL;
-       gchar *text;
-
-       g_return_if_fail(widget != NULL);
-       g_return_if_fail(*widget != NULL);
-       g_return_if_fail(display.entry_datefmt != NULL);
-
-       datefmt_sample = GTK_WIDGET(g_object_get_data
-                                   (G_OBJECT(*widget), "datefmt_sample"));
-       g_return_if_fail(datefmt_sample != NULL);
-
-       text = gtk_editable_get_chars(GTK_EDITABLE(datefmt_sample), 0, -1);
-       g_free(prefs_common.date_format);
-       prefs_common.date_format = text;
-       gtk_entry_set_text(GTK_ENTRY(display.entry_datefmt), text);
-
-       gtk_widget_destroy(*widget);
-       *widget = NULL;
-}
-
-static void date_format_cancel_btn_clicked(GtkButton *button,
-                                          GtkWidget **widget)
-{
-       g_return_if_fail(widget != NULL);
-       g_return_if_fail(*widget != NULL);
-
-       gtk_widget_destroy(*widget);
-       *widget = NULL;
-}
-
-static gboolean date_format_key_pressed(GtkWidget *keywidget, GdkEventKey *event,
-                                       GtkWidget **widget)
-{
-       if (event && event->keyval == GDK_Escape)
-               date_format_cancel_btn_clicked(NULL, widget);
-       return FALSE;
-}
-
-static gboolean date_format_on_delete(GtkWidget *dialogwidget,
-                                     GdkEventAny *event, GtkWidget **widget)
-{
-       g_return_val_if_fail(widget != NULL, FALSE);
-       g_return_val_if_fail(*widget != NULL, FALSE);
-
-       *widget = NULL;
-       return FALSE;
-}
-
-static void date_format_entry_on_change(GtkEditable *editable,
-                                       GtkLabel *example)
-{
-       time_t cur_time;
-       struct tm *cal_time;
-       gchar buffer[100];
-       gchar *text;
-
-       cur_time = time(NULL);
-       cal_time = localtime(&cur_time);
-       buffer[0] = 0;
-       text = gtk_editable_get_chars(editable, 0, -1);
-       if (text)
-               strftime(buffer, sizeof buffer, text, cal_time); 
-       g_free(text);
-
-       text = conv_codeset_strdup(buffer,
-                                  conv_get_locale_charset_str(),
-                                  CS_UTF_8);
-       if (!text)
-               text = g_strdup(buffer);
-
-       gtk_label_set_text(example, text);
-
-       g_free(text);
-}
-
-static void date_format_select_row(GtkTreeView *list_view,
-                                  GtkTreePath *path,
-                                  GtkTreeViewColumn *column,
-                                  GtkWidget *date_format)
-{
-       gint cur_pos;
-       gchar *format;
-       const gchar *old_format;
-       gchar *new_format;
-       GtkWidget *datefmt_sample;
-       GtkTreeIter iter;
-       GtkTreeModel *model;
-       
-       g_return_if_fail(date_format != NULL);
-
-       /* only on double click */
-       datefmt_sample = GTK_WIDGET(g_object_get_data(G_OBJECT(date_format), 
-                                                     "datefmt_sample"));
-
-       g_return_if_fail(datefmt_sample != NULL);
-
-       model = gtk_tree_view_get_model(list_view);
-
-       /* get format from list */
-       if (!gtk_tree_model_get_iter(model, &iter, path))
-               return;
-
-       gtk_tree_model_get(model, &iter, DATEFMT_FMT, &format, -1);             
-       
-       cur_pos = gtk_editable_get_position(GTK_EDITABLE(datefmt_sample));
-       old_format = gtk_entry_get_text(GTK_ENTRY(datefmt_sample));
-
-       /* insert the format into the text entry */
-       new_format = g_malloc(strlen(old_format) + 3);
-
-       strncpy(new_format, old_format, cur_pos);
-       new_format[cur_pos] = '\0';
-       strcat(new_format, format);
-       strcat(new_format, &old_format[cur_pos]);
-
-       gtk_entry_set_text(GTK_ENTRY(datefmt_sample), new_format);
-       gtk_editable_set_position(GTK_EDITABLE(datefmt_sample), cur_pos + 2);
-
-       g_free(new_format);
-}
-
-static void prefs_keybind_select(void)
-{
-       GtkWidget *window;
-       GtkWidget *vbox1;
-       GtkWidget *hbox1;
-       GtkWidget *label;
-       GtkWidget *combo;
-       GtkWidget *confirm_area;
-       GtkWidget *ok_btn;
-       GtkWidget *cancel_btn;
-
-       window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-       gtk_container_set_border_width (GTK_CONTAINER (window), 8);
-       gtk_window_set_title (GTK_WINDOW (window), _("Key bindings"));
-       gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
-       gtk_window_set_modal (GTK_WINDOW (window), TRUE);
-       gtk_window_set_resizable(GTK_WINDOW (window), FALSE);
-       manage_window_set_transient (GTK_WINDOW (window));
-
-       vbox1 = gtk_vbox_new (FALSE, VSPACING);
-       gtk_container_add (GTK_CONTAINER (window), vbox1);
-       gtk_container_set_border_width (GTK_CONTAINER (vbox1), 2);
-
-       hbox1 = gtk_hbox_new (FALSE, 8);
-       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
-
-       label = gtk_label_new
-               (_("Select preset:"));
-       gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
-       gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
-
-       hbox1 = gtk_hbox_new (FALSE, 8);
-       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
-
-       combo = gtk_combo_new ();
-       gtk_box_pack_start (GTK_BOX (hbox1), combo, TRUE, TRUE, 0);
-       gtkut_combo_set_items (GTK_COMBO (combo),
-                              _("Default"),
-                              "Mew / Wanderlust",
-                              "Mutt",
-                              _("Old Sylpheed"),
-                              NULL);
-       gtk_editable_set_editable(GTK_EDITABLE(GTK_COMBO (combo)->entry), FALSE);
-
-       hbox1 = gtk_hbox_new (FALSE, 8);
-       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
-
-       label = gtk_label_new
-               (_("You can also modify each menu shortcut by pressing\n"
-                  "any key(s) when placing the mouse pointer on the item."));
-       gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
-       gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
-
-       hbox1 = gtk_hbox_new (FALSE, 8);
-       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
-
-       gtkut_stock_button_set_create (&confirm_area, &ok_btn, GTK_STOCK_OK,
-                                      &cancel_btn, GTK_STOCK_CANCEL,
-                                      NULL, NULL);
-       gtk_box_pack_end (GTK_BOX (hbox1), confirm_area, FALSE, FALSE, 0);
-       gtk_widget_grab_default (ok_btn);
-
-       MANAGE_WINDOW_SIGNALS_CONNECT(window);
-       g_signal_connect (G_OBJECT (window), "delete_event",
-                         G_CALLBACK (prefs_keybind_deleted), NULL);
-       g_signal_connect (G_OBJECT (window), "key_press_event",
-                         G_CALLBACK (prefs_keybind_key_pressed), NULL);
-       g_signal_connect (G_OBJECT (ok_btn), "clicked",
-                         G_CALLBACK (prefs_keybind_apply_clicked),
-                         NULL);
-       g_signal_connect (G_OBJECT (cancel_btn), "clicked",
-                         G_CALLBACK (prefs_keybind_cancel),
-                         NULL);
-
-       gtk_widget_show_all(window);
-
-       keybind.window = window;
-       keybind.combo = combo;
-}
-
-static gboolean prefs_keybind_key_pressed(GtkWidget *widget, GdkEventKey *event,
-                                         gpointer data)
-{
-       if (event && event->keyval == GDK_Escape)
-               prefs_keybind_cancel();
-       return FALSE;
-}
-
-static gint prefs_keybind_deleted(GtkWidget *widget, GdkEventAny *event,
-                                 gpointer data)
-{
-       prefs_keybind_cancel();
-       return TRUE;
-}
-
-static void prefs_keybind_cancel(void)
-{
-       gtk_widget_destroy(keybind.window);
-       keybind.window = NULL;
-       keybind.combo = NULL;
-}
-  
-struct KeyBind {
-       const gchar *accel_path;
-       const gchar *accel_key;
-};
-
-static void prefs_keybind_apply(struct KeyBind keybind[], gint num)
-{
-       gint i;
-       guint key;
-       GdkModifierType mods;
-
-       for (i = 0; i < num; i++) {
-               const gchar *accel_key
-                       = keybind[i].accel_key ? keybind[i].accel_key : "";
-               gtk_accelerator_parse(accel_key, &key, &mods);
-               gtk_accel_map_change_entry(keybind[i].accel_path,
-                                          key, mods, TRUE);
-       }
-}
-
-static void prefs_keybind_apply_clicked(GtkWidget *widget)
-{
-       GtkEntry *entry = GTK_ENTRY(GTK_COMBO(keybind.combo)->entry);
-       const gchar *text;
-       struct KeyBind *menurc;
-       gint n_menurc;
-
-       static struct KeyBind default_menurc[] = {
-               {"<Main>/File/Empty all Trash folders",         ""},
-               {"<Main>/File/Save as...",                      "<control>S"},
-               {"<Main>/File/Print...",                        ""},
-               {"<Main>/File/Exit",                            "<control>Q"},
-
-               {"<Main>/Edit/Copy",                            "<control>C"},
-               {"<Main>/Edit/Select all",                      "<control>A"},
-               {"<Main>/Edit/Find in current message...",      "<control>F"},
-               {"<Main>/Edit/Search folder...",                "<shift><control>F"},
-
-               {"<Main>/View/Show or hide/Message View",       "V"},
-               {"<Main>/View/Thread view",                     "<control>T"},
-               {"<Main>/View/Go to/Prev message",              "P"},
-               {"<Main>/View/Go to/Next message",              "N"},
-               {"<Main>/View/Go to/Prev unread message",       "<shift>P"},
-               {"<Main>/View/Go to/Next unread message",       "<shift>N"},
-               {"<Main>/View/Go to/Other folder...",           "G"},
-               {"<Main>/View/Open in new window",              "<control><alt>N"},
-               {"<Main>/View/Message source",                  "<control>U"},
-               {"<Main>/View/Show all headers",                "<control>H"},
-               {"<Main>/View/Update summary",                  "<control><alt>U"},
-
-               {"<Main>/Message/Receive/Get from current account",
-                                                               "<control>I"},
-               {"<Main>/Message/Receive/Get from all accounts","<shift><control>I"},
-               {"<Main>/Message/Compose an email message",     "<control>M"},
-               {"<Main>/Message/Reply",                        "<control>R"},
-               {"<Main>/Message/Reply to/all",                 "<shift><control>R"},
-               {"<Main>/Message/Reply to/sender",              ""},
-               {"<Main>/Message/Reply to/mailing list",        "<control>L"},
-               {"<Main>/Message/Forward",                      "<control><alt>F"},
-               /* {"<Main>/Message/Forward as attachment",      ""}, */
-               {"<Main>/Message/Move...",                      "<control>O"},
-               {"<Main>/Message/Copy...",                      "<shift><control>O"},
-               {"<Main>/Message/Delete",                       "<control>D"},
-               {"<Main>/Message/Mark/Mark",                    "<shift>asterisk"},
-               {"<Main>/Message/Mark/Unmark",                  "U"},
-               {"<Main>/Message/Mark/Mark as unread",          "<shift>exclam"},
-               {"<Main>/Message/Mark/Mark as read",            ""},
-
-               {"<Main>/Tools/Address book",                   "<shift><control>A"},
-               {"<Main>/Tools/Execute",                        "X"},
-               {"<Main>/Tools/Log window",                     "<shift><control>L"},
-
-               {"<Compose>/Message/Close",                             "<control>W"},
-               {"<Compose>/Edit/Select all",                           "<control>A"},
-               {"<Compose>/Edit/Advanced/Move a word backward",        ""},
-               {"<Compose>/Edit/Advanced/Move a word forward",         ""},
-               {"<Compose>/Edit/Advanced/Move to beginning of line",   ""},
-               {"<Compose>/Edit/Advanced/Delete a word backward",      ""},
-               {"<Compose>/Edit/Advanced/Delete a word forward",       ""},
-       };
-
-       static struct KeyBind mew_wl_menurc[] = {
-               {"<Main>/File/Empty all Trash folders",                 "<shift>D"},
-               {"<Main>/File/Save as...",                      "Y"},
-               {"<Main>/File/Print...",                        "<shift>numbersign"},
-               {"<Main>/File/Exit",                            "<shift>Q"},
-
-               {"<Main>/Edit/Copy",                            "<control>C"},
-               {"<Main>/Edit/Select all",                      "<control>A"},
-               {"<Main>/Edit/Find in current message...",      "<control>F"},
-               {"<Main>/Edit/Search folder...",                "<control>S"},
-
-               {"<Main>/View/Show or hide/Message View",       ""},
-               {"<Main>/View/Thread view",                     "<shift>T"},
-               {"<Main>/View/Go to/Prev message",              "P"},
-               {"<Main>/View/Go to/Next message",              "N"},
-               {"<Main>/View/Go to/Prev unread message",       "<shift>P"},
-               {"<Main>/View/Go to/Next unread message",       "<shift>N"},
-               {"<Main>/View/Go to/Other folder...",           "G"},
-               {"<Main>/View/Open in new window",              "<control><alt>N"},
-               {"<Main>/View/Message source",                  "<control>U"},
-               {"<Main>/View/Show all headers",                "<shift>H"},
-               {"<Main>/View/Update summary",                  "<shift>S"},
-
-               {"<Main>/Message/Receive/Get from current account",
-                                                               "<control>I"},
-               {"<Main>/Message/Receive/Get from all accounts","<shift><control>I"},
-               {"<Main>/Message/Compose an email message",     "W"},
-               {"<Main>/Message/Reply",                        "<control>R"},
-               {"<Main>/Message/Reply to/all",                 "<shift>A"},
-               {"<Main>/Message/Reply to/sender",              ""},
-               {"<Main>/Message/Reply to/mailing list",        "<control>L"},
-               {"<Main>/Message/Forward",                      "F"},
-               /* {"<Main>/Message/Forward as attachment", "<shift>F"}, */
-               {"<Main>/Message/Move...",                      "O"},
-               {"<Main>/Message/Copy...",                      "<shift>O"},
-               {"<Main>/Message/Delete",                       "D"},
-               {"<Main>/Message/Mark/Mark",                    "<shift>asterisk"},
-               {"<Main>/Message/Mark/Unmark",                  "U"},
-               {"<Main>/Message/Mark/Mark as unread",          "<shift>exclam"},
-               {"<Main>/Message/Mark/Mark as read",            "<shift>R"},
-
-               {"<Main>/Tools/Address book",                   "<shift><control>A"},
-               {"<Main>/Tools/Execute",                        "X"},
-               {"<Main>/Tools/Log window",                     "<shift><control>L"},
-
-               {"<Compose>/Message/Close",                             "<alt>W"},
-               {"<Compose>/Edit/Select all",                           ""},
-               {"<Compose>/Edit/Advanced/Move a word backward,"        "<alt>B"},
-               {"<Compose>/Edit/Advanced/Move a word forward",         "<alt>F"},
-               {"<Compose>/Edit/Advanced/Move to beginning of line",   "<control>A"},
-               {"<Compose>/Edit/Advanced/Delete a word backward",      "<control>W"},
-               {"<Compose>/Edit/Advanced/Delete a word forward",       "<alt>D"},
-       };
-
-       static struct KeyBind mutt_menurc[] = {
-               {"<Main>/File/Empty all Trash folders",         ""},
-               {"<Main>/File/Save as...",                      "S"},
-               {"<Main>/File/Print...",                        "P"},
-               {"<Main>/File/Exit",                            "Q"},
-
-               {"<Main>/Edit/Copy",                            "<control>C"},
-               {"<Main>/Edit/Select all",                      "<control>A"},
-               {"<Main>/Edit/Find in current message...",      "<control>F"},
-               {"<Main>/Edit/Search messages...",              "slash"},
-
-               {"<Main>/View/Show or hide/Message view",       "V"},
-               {"<Main>/View/Thread view",                     "<control>T"},
-               {"<Main>/View/Go to/Prev message",              ""},
-               {"<Main>/View/Go to/Next message",              ""},
-               {"<Main>/View/Go to/Prev unread message",       ""},
-               {"<Main>/View/Go to/Next unread message",       ""},
-               {"<Main>/View/Go to/Other folder...",           "C"},
-               {"<Main>/View/Open in new window",              "<control><alt>N"},
-               {"<Main>/View/Message source",                  "<control>U"},
-               {"<Main>/View/Show all headers",                "<control>H"},
-               {"<Main>/View/Update summary",                          "<control><alt>U"},
-
-               {"<Main>/Message/Receive/Get from current account",
-                                                               "<control>I"},
-               {"<Main>/Message/Receive/Get from all accounts","<shift><control>I"},
-               {"<Main>/Message/Compose an email message",             "M"},
-               {"<Main>/Message/Reply",                        "R"},
-               {"<Main>/Message/Reply to/all",                 "G"},
-               {"<Main>/Message/Reply to/sender",              ""},
-               {"<Main>/Message/Reply to/mailing list",        "<control>L"},
-               {"<Main>/Message/Forward",                      "F"},
-               {"<Main>/Message/Forward as attachment",        ""},
-               {"<Main>/Message/Move...",                      "<control>O"},
-               {"<Main>/Message/Copy...",                      "<shift>C"},
-               {"<Main>/Message/Delete",                       "D"},
-               {"<Main>/Message/Mark/Mark",                    "<shift>F"},
-               {"<Main>/Message/Mark/Unmark",                  "U"},
-               {"<Main>/Message/Mark/Mark as unread",          "<shift>N"},
-               {"<Main>/Message/Mark/Mark as read",            ""},
-
-               {"<Main>/Tools/Address book",                   "<shift><control>A"},
-               {"<Main>/Tools/Execute",                        "X"},
-               {"<Main>/Tools/Log window",                     "<shift><control>L"},
-
-               {"<Compose>/Message/Close",                             "<alt>W"},
-               {"<Compose>/Edit/Select all",                           ""},
-               {"<Compose>/Edit/Advanced/Move a word backward",        "<alt>B"},
-               {"<Compose>/Edit/Advanced/Move a word forward",         "<alt>F"},
-               {"<Compose>/Edit/Advanced/Move to beginning of line",   "<control>A"},
-               {"<Compose>/Edit/Advanced/Delete a word backward",      "<control>W"},
-               {"<Compose>/Edit/Advanced/Delete a word forward",       "<alt>D"},
-       };
-
-       static struct KeyBind old_sylpheed_menurc[] = {
-               {"<Main>/File/Empty all Trash folders",         ""},
-               {"<Main>/File/Save as...",                      ""},
-               {"<Main>/File/Print...",                        "<alt>P"},
-               {"<Main>/File/Exit",                            "<alt>Q"},
-
-               {"<Main>/Edit/Copy",                            "<control>C"},
-               {"<Main>/Edit/Select all",                      "<control>A"},
-               {"<Main>/Edit/Find in current message...",      "<control>F"},
-               {"<Main>/Edit/Search folder...",                "<control>S"},
-
-               {"<Main>/View/Show or hide/Message View",       ""},
-               {"<Main>/View/Thread view",                     "<control>T"},
-               {"<Main>/View/Go to/Prev message",              "P"},
-               {"<Main>/View/Go to/Next message",              "N"},
-               {"<Main>/View/Go to/Prev unread message",       "<shift>P"},
-               {"<Main>/View/Go to/Next unread message",       "<shift>N"},
-               {"<Main>/View/Go to/Other folder...",           "<alt>G"},
-               {"<Main>/View/Open in new window",              "<shift><control>N"},
-               {"<Main>/View/Message source",                  "<control>U"},
-               {"<Main>/View/Show all headers",                "<control>H"},
-               {"<Main>/View/Update summary",                  "<alt>U"},
-
-               {"<Main>/Message/Receive/Get from current account",
-                                                               "<alt>I"},
-               {"<Main>/Message/Receive/Get from all accounts","<shift><alt>I"},
-               {"<Main>/Message/Compose an email message",     "<alt>N"},
-               {"<Main>/Message/Reply",                        "<alt>R"},
-               {"<Main>/Message/Reply to/all",                 "<shift><alt>R"},
-               {"<Main>/Message/Reply to/sender",              "<control><alt>R"},
-               {"<Main>/Message/Reply to/mailing list",        "<control>L"},
-               {"<Main>/Message/Forward",                       "<shift><alt>F"},
-               /* "(menu-path \"<Main>/Message/Forward as attachment", "<shift><control>F"}, */
-               {"<Main>/Message/Move...",                      "<alt>O"},
-               {"<Main>/Message/Copy...",                      ""},
-               {"<Main>/Message/Delete",                       "<alt>D"},
-               {"<Main>/Message/Mark/Mark",                    "<shift>asterisk"},
-               {"<Main>/Message/Mark/Unmark",                  "U"},
-               {"<Main>/Message/Mark/Mark as unread",          "<shift>exclam"},
-               {"<Main>/Message/Mark/Mark as read",            ""},
-
-               {"<Main>/Tools/Address book",                   "<alt>A"},
-               {"<Main>/Tools/Execute",                        "<alt>X"},
-               {"<Main>/Tools/Log window",                     "<alt>L"},
-
-               {"<Compose>/Message/Close",                             "<alt>W"},
-               {"<Compose>/Edit/Select all",                           ""},
-               {"<Compose>/Edit/Advanced/Move a word backward",        "<alt>B"},
-               {"<Compose>/Edit/Advanced/Move a word forward",         "<alt>F"},
-               {"<Compose>/Edit/Advanced/Move to beginning of line",   "<control>A"},
-               {"<Compose>/Edit/Advanced/Delete a word backward",      "<control>W"},
-               {"<Compose>/Edit/Advanced/Delete a word forward",       "<alt>D"},
-       };
-  
-       text = gtk_entry_get_text(entry);
-  
-       if (!strcmp(text, _("Default"))) {
-               menurc = default_menurc;
-               n_menurc = G_N_ELEMENTS(default_menurc);
-       } else if (!strcmp(text, "Mew / Wanderlust")) {
-               menurc = mew_wl_menurc;
-               n_menurc = G_N_ELEMENTS(mew_wl_menurc);
-       } else if (!strcmp(text, "Mutt")) {
-               menurc = mutt_menurc;
-               n_menurc = G_N_ELEMENTS(mutt_menurc);
-       } else if (!strcmp(text, _("Old Sylpheed"))) {
-               menurc = old_sylpheed_menurc;
-               n_menurc = G_N_ELEMENTS(old_sylpheed_menurc);
-       } else {
-               return;
-       }
-
-       /* prefs_keybind_apply(empty_menurc, G_N_ELEMENTS(empty_menurc)); */
-       prefs_keybind_apply(menurc, n_menurc);
-
-       gtk_widget_destroy(keybind.window);
-       keybind.window = NULL;
-       keybind.combo = NULL;
-}
-
-static void prefs_common_charset_set_data_from_optmenu(PrefParam *pparam)
-{
-       GtkWidget *menu;
-       GtkWidget *menuitem;
-       gchar *charset;
-
-       menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
-       menuitem = gtk_menu_get_active(GTK_MENU(menu));
-       charset = g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID);
-       g_free(*((gchar **)pparam->data));
-       *((gchar **)pparam->data) = g_strdup(charset);
-}
-
-static void prefs_common_charset_set_optmenu(PrefParam *pparam)
-{
-       GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
-       gint index;
-
-       g_return_if_fail(optmenu != NULL);
-       g_return_if_fail(*((gchar **)pparam->data) != NULL);
-
-       index = menu_find_option_menu_index(optmenu, *((gchar **)pparam->data),
-                                           (GCompareFunc)strcmp2);
-       if (index >= 0)
-               gtk_option_menu_set_history(optmenu, index);
-       else {
-               gtk_option_menu_set_history(optmenu, 0);
-               prefs_common_charset_set_data_from_optmenu(pparam);
-       }
-}
-
-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
-               (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID));
-}
-
-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;
-       GtkWidget *menuitem;
-
-       menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
-       menuitem = gtk_menu_get_active(GTK_MENU(menu));
-       *((RecvDialogMode *)pparam->data) = GPOINTER_TO_INT
-               (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID));
-}
-
-static void prefs_common_recv_dialog_set_optmenu(PrefParam *pparam)
-{
-       RecvDialogMode mode = *((RecvDialogMode *)pparam->data);
-       GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
-       GtkWidget *menu;
-       GtkWidget *menuitem;
-       gint index;
-
-       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);
-               prefs_common_recv_dialog_set_data_from_optmenu(pparam);
-       }
-
-       menu = gtk_option_menu_get_menu(optmenu);
-       menuitem = gtk_menu_get_active(GTK_MENU(menu));
-       gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
-}
-
-static void prefs_common_send_dialog_set_data_from_optmenu(PrefParam *pparam)
-{
-       GtkWidget *menu;
-       GtkWidget *menuitem;
-
-       menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
-       menuitem = gtk_menu_get_active(GTK_MENU(menu));
-       *((SendDialogMode *)pparam->data) = GPOINTER_TO_INT
-               (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID));
-}
-
-static void prefs_common_send_dialog_set_optmenu(PrefParam *pparam)
-{
-       SendDialogMode mode = *((SendDialogMode *)pparam->data);
-       GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
-       GtkWidget *menu;
-       GtkWidget *menuitem;
-
-       switch (mode) {
-       case SEND_DIALOG_ALWAYS:
-               gtk_option_menu_set_history(optmenu, 0);
-               break;
-       case SEND_DIALOG_NEVER:
-               gtk_option_menu_set_history(optmenu, 1);
-               break;
-       default:
-               break;
-       }
-
-       menu = gtk_option_menu_get_menu(optmenu);
-       menuitem = gtk_menu_get_active(GTK_MENU(menu));
-       gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
-}
-
-static void prefs_common_apply(void)
-{
-       MainWindow *mainwindow;
-
-       prefs_set_data_from_dialog(param);
-       sock_set_io_timeout(prefs_common.io_timeout_secs);
-       main_window_reflect_prefs_all_real(FALSE);
-       prefs_common_write_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();
-}
-
-static void prefs_nextunreadmsgdialog_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));
-       *((NextUnreadMsgDialogShow *)pparam->data) = GPOINTER_TO_INT
-               (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID));
-}
-
-static void prefs_nextunreadmsgdialog_set_optmenu(PrefParam *pparam)
-{
-       NextUnreadMsgDialogShow dialog_show;
-       GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
-       GtkWidget *menu;
-       GtkWidget *menuitem;
-
-       dialog_show = *((NextUnreadMsgDialogShow *)pparam->data);
-
-       switch (dialog_show) {
-       case NEXTUNREADMSGDIALOG_ALWAYS:
-               gtk_option_menu_set_history(optmenu, 0);
-               break;
-       case NEXTUNREADMSGDIALOG_ASSUME_YES:
-               gtk_option_menu_set_history(optmenu, 1);
-               break;
-       case NEXTUNREADMSGDIALOG_ASSUME_NO:
-               gtk_option_menu_set_history(optmenu, 2);
-               break;
-       }
-
-       menu = gtk_option_menu_get_menu(optmenu);
-       menuitem = gtk_menu_get_active(GTK_MENU(menu));
-       gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
-}
-
 void pref_set_textview_from_pref(GtkTextView *textview, gchar *txt)
 {
        GtkTextBuffer *buffer = gtk_text_view_get_buffer(textview);
index 5fc3b64..d451baa 100644 (file)
@@ -255,7 +255,7 @@ void prefs_compose_writing_init(void)
        page->page.create_widget = prefs_compose_writing_create_widget;
        page->page.destroy_widget = prefs_compose_writing_destroy_widget;
        page->page.save_page = prefs_compose_writing_save;
-       page->page.weight = 60.0;
+       page->page.weight = 190.0;
        prefs_gtk_register_page((PrefsPage *) page);
        prefs_writing = page;
 }
index ffec857..e1a2280 100644 (file)
@@ -154,8 +154,6 @@ static void prefs_custom_header_create(void)
        GtkWidget *up_btn;
        GtkWidget *down_btn;
 
-       gchar *title[1];
-
        debug_print("Creating custom header setting window...\n");
 
        window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
@@ -569,7 +567,7 @@ static void prefs_custom_header_up(void)
        if (!gtk_tree_selection_get_selected
                (gtk_tree_view_get_selection
                        (GTK_TREE_VIEW(customhdr.list_view)),
-                (GtkTreeModel **) &store,      
+                (GtkTreeModel **) &store,
                 &isel))
                return;
 
index cf7036c..3bc1027 100644 (file)
@@ -272,7 +272,7 @@ void prefs_ext_prog_init(void)
        page->page.create_widget = prefs_ext_prog_create_widget;
        page->page.destroy_widget = prefs_ext_prog_destroy_widget;
        page->page.save_page = prefs_ext_prog_save;
-       page->page.weight = 45.0;
+       page->page.weight = 155.0;
        prefs_gtk_register_page((PrefsPage *) page);
        prefs_ext_prog = page;
 }
index 8a8b34f..3eaf597 100644 (file)
@@ -213,8 +213,6 @@ static void prefs_filtering_create(void)
        GtkWidget *bottom_btn;
        static GdkGeometry geometry;
 
-       gchar *title[1];
-
        debug_print("Creating filtering configuration window...\n");
 
        window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
@@ -612,7 +610,6 @@ static void prefs_filtering_set_dialog(const gchar *header, const gchar *key)
        GSList *cur;
        GSList * prefs_filtering;
        gchar *cond_str;
-       gint row;
        GtkListStore *list_store;
        
        list_store = GTK_LIST_STORE(gtk_tree_view_get_model(list_view));
index d90dd26..39542ba 100644 (file)
@@ -567,8 +567,6 @@ static void prefs_filtering_action_list_view_set_row(GtkTreeIter *row,
  */
 static void prefs_filtering_action_set_dialog(GSList *action_list)
 {
-       GtkTreeView *list_view = GTK_TREE_VIEW
-                                       (filtering_action.action_list_view);
        GSList *cur;
 
        gtk_list_store_clear(GTK_LIST_STORE(gtk_tree_view_get_model
@@ -880,7 +878,6 @@ static void prefs_filtering_action_delete_cb(void)
        GtkTreeModel *model;
        gboolean is_valid;
        GtkTreeIter row;
-       FilteringAction *action;
 
        if (!gtk_tree_selection_get_selected(selection, &model, &row))
                return;
@@ -1316,7 +1313,6 @@ static void prefs_filtering_action_list_view_insert_action(GtkWidget   *list_vie
 {
        GtkListStore *store = GTK_LIST_STORE(gtk_tree_view_get_model
                                        (GTK_TREE_VIEW(list_view)));
-       gint result = -1;
        GtkTreeIter iter;
        
        
index c0baf62..9705ac3 100644 (file)
@@ -183,7 +183,7 @@ void prefs_fonts_init(void)
        page->page.create_widget = prefs_fonts_create_widget;
        page->page.destroy_widget = prefs_fonts_destroy_widget;
        page->page.save_page = prefs_fonts_save;
-       page->page.weight = 60.0;
+       page->page.weight = 135.0;
        prefs_gtk_register_page((PrefsPage *) page);
        prefs_fonts = page;
 }
index 33e777c..2ac7383 100644 (file)
@@ -151,7 +151,7 @@ void prefs_image_viewer_init(void)
        page->page.create_widget = imageviewer_create_widget_func;
        page->page.destroy_widget = imageviewer_destroy_widget_func;
        page->page.save_page = imageviewer_save_func;
-       page->page.weight = 60.0;
+       page->page.weight = 160.0;
        prefs_gtk_register_page((PrefsPage *) page);
        prefs_imageviewer = page;
 }
diff --git a/src/prefs_message.c b/src/prefs_message.c
new file mode 100644 (file)
index 0000000..950ac43
--- /dev/null
@@ -0,0 +1,301 @@
+/*
+ * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 2004 Hiroyuki Yamamoto & The Sylpheed-Claws Team
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include "defs.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <glib.h>
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
+
+#include "prefs_common.h"
+#include "prefs_gtk.h"
+#include "prefs_display_header.h"
+
+#include "gtk/gtkutils.h"
+#include "gtk/prefswindow.h"
+
+#include "manage_window.h"
+
+typedef struct _MessagePage
+{
+       PrefsPage page;
+
+       GtkWidget *window;
+
+       GtkWidget *chkbtn_mbalnum;
+       GtkWidget *chkbtn_disphdrpane;
+       GtkWidget *chkbtn_disphdr;
+       GtkWidget *chkbtn_html;
+       GtkWidget *chkbtn_cursor;
+       GtkWidget *spinbtn_linespc;
+
+       GtkWidget *chkbtn_smoothscroll;
+       GtkWidget *spinbtn_scrollstep;
+       GtkWidget *chkbtn_halfpage;
+
+       GtkWidget *chkbtn_attach_desc;
+} MessagePage;
+
+void prefs_message_create_widget(PrefsPage *_page, GtkWindow *window, 
+                                 gpointer data)
+{
+       MessagePage *prefs_message = (MessagePage *) _page;
+       
+       GtkWidget *vbox1;
+       GtkWidget *vbox2;
+       GtkWidget *vbox3;
+       GtkWidget *hbox1;
+       GtkWidget *chkbtn_mbalnum;
+       GtkWidget *chkbtn_disphdrpane;
+       GtkWidget *chkbtn_disphdr;
+       GtkWidget *button_edit_disphdr;
+       GtkWidget *chkbtn_html;
+       GtkWidget *chkbtn_cursor;
+       GtkWidget *hbox_linespc;
+       GtkWidget *label_linespc;
+       GtkObject *spinbtn_linespc_adj;
+       GtkWidget *spinbtn_linespc;
+
+       GtkWidget *frame_scr;
+       GtkWidget *vbox_scr;
+       GtkWidget *chkbtn_smoothscroll;
+       GtkWidget *hbox_scr;
+       GtkWidget *label_scr;
+       GtkObject *spinbtn_scrollstep_adj;
+       GtkWidget *spinbtn_scrollstep;
+       GtkWidget *chkbtn_halfpage;
+
+       GtkWidget *chkbtn_attach_desc;
+
+       vbox1 = gtk_vbox_new (FALSE, VSPACING);
+       gtk_widget_show (vbox1);
+       gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
+
+       vbox2 = gtk_vbox_new (FALSE, 0);
+       gtk_widget_show (vbox2);
+       gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
+
+       PACK_CHECK_BUTTON
+               (vbox2, chkbtn_mbalnum,
+                _("Display multi-byte alphanumeric as\n"
+                  "ASCII character (Japanese only)"));
+       gtk_label_set_justify (GTK_LABEL (GTK_BIN(chkbtn_mbalnum)->child),
+                              GTK_JUSTIFY_LEFT);
+
+       PACK_CHECK_BUTTON(vbox2, chkbtn_disphdrpane,
+                         _("Display header pane above message view"));
+
+       hbox1 = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox1);
+       gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
+
+       PACK_CHECK_BUTTON(hbox1, chkbtn_disphdr,
+                         _("Display short headers on message view"));
+
+       button_edit_disphdr = gtk_button_new_with_label (_(" Edit... "));
+       gtk_widget_show (button_edit_disphdr);
+       gtk_box_pack_end (GTK_BOX (hbox1), button_edit_disphdr,
+                         FALSE, TRUE, 0);
+       g_signal_connect (G_OBJECT (button_edit_disphdr), "clicked",
+                         G_CALLBACK (prefs_display_header_open),
+                         NULL);
+
+       SET_TOGGLE_SENSITIVITY(chkbtn_disphdr, button_edit_disphdr);
+
+       PACK_CHECK_BUTTON(vbox2, chkbtn_html,
+                         _("Render HTML messages as text"));
+
+       PACK_CHECK_BUTTON(vbox2, chkbtn_cursor,
+                         _("Display cursor in message view"));
+
+       PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
+
+       hbox1 = gtk_hbox_new (FALSE, 32);
+       gtk_widget_show (hbox1);
+       gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
+
+       hbox_linespc = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox1);
+       gtk_box_pack_start (GTK_BOX (hbox1), hbox_linespc, FALSE, TRUE, 0);
+
+       label_linespc = gtk_label_new (_("Line space"));
+       gtk_widget_show (label_linespc);
+       gtk_box_pack_start (GTK_BOX (hbox_linespc), label_linespc,
+                           FALSE, FALSE, 0);
+
+       spinbtn_linespc_adj = gtk_adjustment_new (2, 0, 16, 1, 1, 16);
+       spinbtn_linespc = gtk_spin_button_new
+               (GTK_ADJUSTMENT (spinbtn_linespc_adj), 1, 0);
+       gtk_widget_show (spinbtn_linespc);
+       gtk_box_pack_start (GTK_BOX (hbox_linespc), spinbtn_linespc,
+                           FALSE, FALSE, 0);
+       gtk_widget_set_size_request (spinbtn_linespc, 64, -1);
+       gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_linespc), TRUE);
+
+       label_linespc = gtk_label_new (_("pixel(s)"));
+       gtk_widget_show (label_linespc);
+       gtk_box_pack_start (GTK_BOX (hbox_linespc), label_linespc,
+                           FALSE, FALSE, 0);
+
+       PACK_FRAME(vbox1, frame_scr, _("Scroll"));
+
+       vbox_scr = gtk_vbox_new (FALSE, 0);
+       gtk_widget_show (vbox_scr);
+       gtk_container_add (GTK_CONTAINER (frame_scr), vbox_scr);
+       gtk_container_set_border_width (GTK_CONTAINER (vbox_scr), 8);
+
+       PACK_CHECK_BUTTON(vbox_scr, chkbtn_halfpage, _("Half page"));
+
+       hbox1 = gtk_hbox_new (FALSE, 32);
+       gtk_widget_show (hbox1);
+       gtk_box_pack_start (GTK_BOX (vbox_scr), hbox1, FALSE, TRUE, 0);
+
+       PACK_CHECK_BUTTON(hbox1, chkbtn_smoothscroll, _("Smooth scroll"));
+
+       hbox_scr = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox_scr);
+       gtk_box_pack_start (GTK_BOX (hbox1), hbox_scr, FALSE, FALSE, 0);
+
+       label_scr = gtk_label_new (_("Step"));
+       gtk_widget_show (label_scr);
+       gtk_box_pack_start (GTK_BOX (hbox_scr), label_scr, FALSE, FALSE, 0);
+
+       spinbtn_scrollstep_adj = gtk_adjustment_new (1, 1, 100, 1, 10, 10);
+       spinbtn_scrollstep = gtk_spin_button_new
+               (GTK_ADJUSTMENT (spinbtn_scrollstep_adj), 1, 0);
+       gtk_widget_show (spinbtn_scrollstep);
+       gtk_box_pack_start (GTK_BOX (hbox_scr), spinbtn_scrollstep,
+                           FALSE, FALSE, 0);
+       gtk_widget_set_size_request (spinbtn_scrollstep, 64, -1);
+       gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_scrollstep),
+                                    TRUE);
+
+       label_scr = gtk_label_new (_("pixel(s)"));
+       gtk_widget_show (label_scr);
+       gtk_box_pack_start (GTK_BOX (hbox_scr), label_scr, FALSE, FALSE, 0);
+
+       SET_TOGGLE_SENSITIVITY (chkbtn_smoothscroll, hbox_scr)
+
+       vbox3 = gtk_vbox_new (FALSE, 0);
+       gtk_widget_show (vbox3);
+       gtk_box_pack_start (GTK_BOX (vbox1), vbox3, FALSE, FALSE, 0);
+
+       PACK_CHECK_BUTTON(vbox3, chkbtn_attach_desc,
+                         _("Show attachment descriptions (rather than names)"));
+
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chkbtn_mbalnum),
+               prefs_common.conv_mb_alnum);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chkbtn_disphdrpane),
+               prefs_common.display_header_pane);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chkbtn_disphdr),
+               prefs_common.display_header);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chkbtn_html),
+               prefs_common.render_html);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chkbtn_cursor),
+               prefs_common.textview_cursor_visible);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chkbtn_smoothscroll),
+               prefs_common.enable_smooth_scroll);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chkbtn_halfpage),
+               prefs_common.scroll_halfpage);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chkbtn_attach_desc),
+               prefs_common.attach_desc);
+       gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinbtn_linespc),
+               prefs_common.line_space);
+       gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinbtn_scrollstep),
+               prefs_common.scroll_step);
+               
+       prefs_message->window = GTK_WIDGET(window);
+       prefs_message->chkbtn_mbalnum = chkbtn_mbalnum;
+       prefs_message->chkbtn_disphdrpane = chkbtn_disphdrpane;
+       prefs_message->chkbtn_disphdr = chkbtn_disphdr;
+       prefs_message->chkbtn_html = chkbtn_html;
+       prefs_message->chkbtn_cursor = chkbtn_cursor;
+       prefs_message->spinbtn_linespc = spinbtn_linespc;
+       prefs_message->chkbtn_smoothscroll = chkbtn_smoothscroll;
+       prefs_message->spinbtn_scrollstep = spinbtn_scrollstep;
+       prefs_message->chkbtn_halfpage = chkbtn_halfpage;
+       prefs_message->chkbtn_attach_desc = chkbtn_attach_desc;
+       
+       prefs_message->page.widget = vbox1;
+}
+
+void prefs_message_save(PrefsPage *_page)
+{
+       MessagePage *page = (MessagePage *) _page;
+
+       prefs_common.conv_mb_alnum = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->chkbtn_mbalnum));
+       prefs_common.display_header_pane = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->chkbtn_disphdrpane));
+       prefs_common.display_header = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->chkbtn_disphdr));
+       prefs_common.render_html = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->chkbtn_html));
+       prefs_common.textview_cursor_visible = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->chkbtn_cursor));
+       prefs_common.enable_smooth_scroll = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->chkbtn_smoothscroll));
+       prefs_common.scroll_halfpage = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->chkbtn_halfpage));
+       prefs_common.attach_desc = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->chkbtn_attach_desc));
+       prefs_common.line_space = gtk_spin_button_get_value_as_int(
+               GTK_SPIN_BUTTON(page->spinbtn_linespc));
+       prefs_common.scroll_step = gtk_spin_button_get_value_as_int(
+               GTK_SPIN_BUTTON(page->spinbtn_scrollstep));
+}
+
+static void prefs_message_destroy_widget(PrefsPage *_page)
+{
+}
+
+MessagePage *prefs_message;
+
+void prefs_message_init(void)
+{
+       MessagePage *page;
+       static gchar *path[3];
+
+       path[0] = _("Message View");
+       path[1] = _("Text options");
+       path[2] = NULL;
+
+       page = g_new0(MessagePage, 1);
+       page->page.path = path;
+       page->page.create_widget = prefs_message_create_widget;
+       page->page.destroy_widget = prefs_message_destroy_widget;
+       page->page.save_page = prefs_message_save;
+       page->page.weight = 170.0;
+       prefs_gtk_register_page((PrefsPage *) page);
+       prefs_message = page;
+}
+
+void prefs_message_done(void)
+{
+       prefs_gtk_unregister_page((PrefsPage *) prefs_message);
+       g_free(prefs_message);
+}
diff --git a/src/prefs_message.h b/src/prefs_message.h
new file mode 100644 (file)
index 0000000..a885f46
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 2004 Hiroyuki Yamamoto & the Sylpheed-Claws team
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef PREFS_MESSAGE_H
+#define PREFS_MESSAGE_H
+
+void prefs_message_init        (void);
+void prefs_message_done        (void);
+
+#endif /* PREFS_MESSAGE_H */ 
index 29fbc16..520433e 100644 (file)
@@ -400,7 +400,7 @@ void prefs_msg_colors_init(void)
        page->page.create_widget = prefs_msg_colors_create_widget;
        page->page.destroy_widget = prefs_msg_colors_destroy_widget;
        page->page.save_page = prefs_msg_colors_save;
-       page->page.weight = 60.0;
+       page->page.weight = 165.0;
        prefs_gtk_register_page((PrefsPage *) page);
        prefs_msg_colors = page;
 }
diff --git a/src/prefs_other.c b/src/prefs_other.c
new file mode 100644 (file)
index 0000000..6b52405
--- /dev/null
@@ -0,0 +1,272 @@
+/*
+ * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 2004 Hiroyuki Yamamoto & The Sylpheed-Claws Team
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include "defs.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <glib.h>
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
+
+#include "prefs_common.h"
+#include "prefs_gtk.h"
+
+#include "gtk/gtkutils.h"
+#include "gtk/prefswindow.h"
+
+#include "manage_window.h"
+
+typedef struct _OtherPage
+{
+       PrefsPage page;
+
+       GtkWidget *window;
+
+       GtkWidget *checkbtn_addaddrbyclick;
+       GtkWidget *checkbtn_confonexit;
+       GtkWidget *checkbtn_cleanonexit;
+       GtkWidget *checkbtn_askonclean;
+       GtkWidget *checkbtn_warnqueued;
+        GtkWidget *checkbtn_cliplog;
+        GtkWidget *loglength_entry;
+       GtkWidget *spinbtn_iotimeout;
+} OtherPage;
+
+void prefs_other_create_widget(PrefsPage *_page, GtkWindow *window, 
+                                 gpointer data)
+{
+       OtherPage *prefs_other = (OtherPage *) _page;
+       
+       GtkWidget *vbox1;
+       GtkWidget *hbox1;
+
+       GtkWidget *frame_addr;
+       GtkWidget *vbox_addr;
+       GtkWidget *checkbtn_addaddrbyclick;
+       
+       GtkWidget *frame_cliplog;
+       GtkWidget *vbox_cliplog;
+       GtkWidget *hbox_cliplog;
+       GtkWidget *checkbtn_cliplog;
+       GtkWidget *loglength_label;
+       GtkWidget *loglength_entry;
+       GtkTooltips *loglength_tooltip;
+
+       GtkWidget *frame_exit;
+       GtkWidget *vbox_exit;
+       GtkWidget *checkbtn_confonexit;
+       GtkWidget *checkbtn_cleanonexit;
+       GtkWidget *checkbtn_askonclean;
+       GtkWidget *checkbtn_warnqueued;
+
+       GtkWidget *label_iotimeout;
+       GtkWidget *spinbtn_iotimeout;
+       GtkObject *spinbtn_iotimeout_adj;
+       gchar *tmp;
+
+       vbox1 = gtk_vbox_new (FALSE, VSPACING);
+       gtk_widget_show (vbox1);
+       gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
+
+       PACK_FRAME (vbox1, frame_addr, _("Address book"));
+
+       vbox_addr = gtk_vbox_new (FALSE, 0);
+       gtk_widget_show (vbox_addr);
+       gtk_container_add (GTK_CONTAINER (frame_addr), vbox_addr);
+       gtk_container_set_border_width (GTK_CONTAINER (vbox_addr), 8);
+
+       PACK_CHECK_BUTTON
+               (vbox_addr, checkbtn_addaddrbyclick,
+                _("Add address to destination when double-clicked"));
+
+       /* Clip Log */
+       PACK_FRAME (vbox1, frame_cliplog, _("Log Size"));
+
+       vbox_cliplog = gtk_vbox_new (FALSE, 0);
+       gtk_widget_show (vbox_cliplog);
+       gtk_container_add (GTK_CONTAINER (frame_cliplog), vbox_cliplog);
+       gtk_container_set_border_width (GTK_CONTAINER (vbox_cliplog), 8);
+       PACK_CHECK_BUTTON (vbox_cliplog, checkbtn_cliplog,
+                          _("Clip the log size"));
+       hbox_cliplog = gtk_hbox_new (FALSE, 3);
+       gtk_container_add (GTK_CONTAINER (vbox_cliplog), hbox_cliplog);
+       gtk_widget_show (hbox_cliplog);
+       
+       loglength_label = gtk_label_new (_("Log window length"));
+       gtk_box_pack_start (GTK_BOX (hbox_cliplog), loglength_label,
+                           FALSE, TRUE, 0);
+       gtk_widget_show (GTK_WIDGET (loglength_label));
+       
+       loglength_tooltip = gtk_tooltips_new();
+       
+       loglength_entry = gtk_entry_new ();
+       gtk_widget_set_size_request (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));
+       gtk_tooltips_set_tip(GTK_TOOLTIPS(loglength_tooltip), loglength_entry,
+                            _("0 to stop logging in the log window"),
+                            NULL);
+       SET_TOGGLE_SENSITIVITY(checkbtn_cliplog, loglength_entry);
+
+       /* On Exit */
+       PACK_FRAME (vbox1, frame_exit, _("On exit"));
+
+       vbox_exit = gtk_vbox_new (FALSE, 0);
+       gtk_widget_show (vbox_exit);
+       gtk_container_add (GTK_CONTAINER (frame_exit), vbox_exit);
+       gtk_container_set_border_width (GTK_CONTAINER (vbox_exit), 8);
+
+       PACK_CHECK_BUTTON (vbox_exit, checkbtn_confonexit,
+                          _("Confirm on exit"));
+
+       hbox1 = gtk_hbox_new (FALSE, 32);
+       gtk_widget_show (hbox1);
+       gtk_box_pack_start (GTK_BOX (vbox_exit), hbox1, FALSE, FALSE, 0);
+
+       PACK_CHECK_BUTTON (hbox1, checkbtn_cleanonexit,
+                          _("Empty trash on exit"));
+       PACK_CHECK_BUTTON (hbox1, checkbtn_askonclean,
+                          _("Ask before emptying"));
+       SET_TOGGLE_SENSITIVITY (checkbtn_cleanonexit, checkbtn_askonclean);
+
+       PACK_CHECK_BUTTON (vbox_exit, checkbtn_warnqueued,
+                          _("Warn if there are queued messages"));
+
+       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_size_request (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);
+
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_addaddrbyclick), 
+               prefs_common.add_address_by_click);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_confonexit), 
+               prefs_common.confirm_on_exit);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_cleanonexit), 
+               prefs_common.clean_on_exit);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_askonclean), 
+               prefs_common.ask_on_clean);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_warnqueued), 
+               prefs_common.warn_queued_on_exit);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_cliplog), 
+               prefs_common.cliplog);
+       
+       tmp = g_strdup_printf("%d", prefs_common.loglength);
+       gtk_entry_set_text(GTK_ENTRY(loglength_entry), tmp);
+       g_free(tmp);
+
+       gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinbtn_iotimeout),
+               prefs_common.io_timeout_secs);
+
+       prefs_other->checkbtn_addaddrbyclick = checkbtn_addaddrbyclick;
+       prefs_other->checkbtn_confonexit = checkbtn_confonexit;
+       prefs_other->checkbtn_cleanonexit = checkbtn_cleanonexit;
+       prefs_other->checkbtn_askonclean = checkbtn_askonclean;
+       prefs_other->checkbtn_warnqueued = checkbtn_warnqueued;
+       prefs_other->checkbtn_cliplog = checkbtn_cliplog;
+       prefs_other->loglength_entry = loglength_entry;
+       prefs_other->spinbtn_iotimeout = spinbtn_iotimeout;
+
+       prefs_other->page.widget = vbox1;
+}
+
+void prefs_other_save(PrefsPage *_page)
+{
+       OtherPage *page = (OtherPage *) _page;
+       MainWindow *mainwindow;
+       
+       gchar *tmp = gtk_editable_get_chars(GTK_EDITABLE(page->loglength_entry), 0, -1);
+       
+       if (tmp && atoi(tmp)) {
+               prefs_common.loglength = atoi(tmp);
+       }
+       
+       prefs_common.add_address_by_click = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->checkbtn_addaddrbyclick));
+       prefs_common.confirm_on_exit = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->checkbtn_confonexit));
+       prefs_common.clean_on_exit = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->checkbtn_cleanonexit)); 
+       prefs_common.ask_on_clean = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->checkbtn_askonclean));
+       prefs_common.warn_queued_on_exit = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->checkbtn_warnqueued)); 
+       prefs_common.cliplog = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->checkbtn_cliplog));
+       prefs_common.io_timeout_secs = gtk_spin_button_get_value_as_int(
+               GTK_SPIN_BUTTON(page->spinbtn_iotimeout));
+       sock_set_io_timeout(prefs_common.io_timeout_secs);
+       mainwindow = mainwindow_get_mainwindow();
+       log_window_set_clipping(mainwindow->logwin, prefs_common.cliplog,
+                               prefs_common.loglength);
+
+}
+
+static void prefs_other_destroy_widget(PrefsPage *_page)
+{
+}
+
+OtherPage *prefs_other;
+
+void prefs_other_init(void)
+{
+       OtherPage *page;
+       static gchar *path[2];
+
+       path[0] = _("Other");
+       path[1] = NULL;
+
+       page = g_new0(OtherPage, 1);
+       page->page.path = path;
+       page->page.create_widget = prefs_other_create_widget;
+       page->page.destroy_widget = prefs_other_destroy_widget;
+       page->page.save_page = prefs_other_save;
+       page->page.weight = 5.0;
+       prefs_gtk_register_page((PrefsPage *) page);
+       prefs_other = page;
+}
+
+void prefs_other_done(void)
+{
+       prefs_gtk_unregister_page((PrefsPage *) prefs_other);
+       g_free(prefs_other);
+}
diff --git a/src/prefs_other.h b/src/prefs_other.h
new file mode 100644 (file)
index 0000000..25191e6
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 2004 Hiroyuki Yamamoto & the Sylpheed-Claws team
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef PREFS_OTHER_H
+#define PREFS_OTHER_H
+
+void prefs_other_init  (void);
+void prefs_other_done  (void);
+
+#endif /* PREFS_OTHER_H */ 
index 007547f..d7d267e 100644 (file)
@@ -81,8 +81,6 @@ void prefs_quote_create_widget(PrefsPage *_page, GtkWindow *window,
 
        GtkWidget *checkbtn_reply_with_quote;
 
-       GtkTextBuffer *buffer;
-
        vbox1 = gtk_vbox_new (FALSE, VSPACING);
        gtk_widget_show (vbox1);
        gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
@@ -239,8 +237,6 @@ void prefs_quote_create_widget(PrefsPage *_page, GtkWindow *window,
 void prefs_quote_save(PrefsPage *_page)
 {
        QuotePage *page = (QuotePage *) _page;
-       GtkTextBuffer *buffer;
-       GtkTextIter start, end;
        
        g_free(prefs_common.quotefmt); 
        prefs_common.quotefmt = NULL;
@@ -289,7 +285,7 @@ void prefs_quote_init(void)
        page->page.create_widget = prefs_quote_create_widget;
        page->page.destroy_widget = prefs_quote_destroy_widget;
        page->page.save_page = prefs_quote_save;
-       page->page.weight = 60.0;
+       page->page.weight = 185.0;
        prefs_gtk_register_page((PrefsPage *) page);
        prefs_quote = page;
 }
diff --git a/src/prefs_receive.c b/src/prefs_receive.c
new file mode 100644 (file)
index 0000000..cf3ad8f
--- /dev/null
@@ -0,0 +1,370 @@
+/*
+ * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 2004 Hiroyuki Yamamoto & The Sylpheed-Claws Team
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include "defs.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <glib.h>
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
+
+#include "prefs_common.h"
+#include "prefs_gtk.h"
+#include "inc.h"
+
+#include "gtk/gtkutils.h"
+#include "gtk/prefswindow.h"
+#include "gtk/menu.h"
+
+#include "manage_window.h"
+
+typedef struct _ReceivePage
+{
+       PrefsPage page;
+
+       GtkWidget *window;
+
+       GtkWidget *checkbtn_incext;
+       GtkWidget *entry_incext;
+       GtkWidget *checkbtn_autochk;
+       GtkWidget *spinbtn_autochk;
+       GtkWidget *checkbtn_chkonstartup;
+       GtkWidget *checkbtn_scan_after_inc;
+       GtkWidget *checkbtn_newmail_auto;
+       GtkWidget *checkbtn_newmail_manu;
+       GtkWidget *entry_newmail_notify_cmd;
+       GtkWidget *optmenu_recvdialog;
+       GtkWidget *checkbtn_no_recv_err_panel;
+       GtkWidget *checkbtn_close_recv_dialog;
+       GtkWidget *hbox_newmail_notify;
+} ReceivePage;
+
+ReceivePage *prefs_receive;
+
+static void prefs_common_recv_dialog_newmail_notify_toggle_cb(GtkWidget *w, gpointer data)
+{
+       gboolean toggled;
+
+       toggled = gtk_toggle_button_get_active
+                       (GTK_TOGGLE_BUTTON(prefs_receive->checkbtn_newmail_manu)) ||
+                 gtk_toggle_button_get_active
+                       (GTK_TOGGLE_BUTTON(prefs_receive->checkbtn_newmail_auto));
+       gtk_widget_set_sensitive(prefs_receive->hbox_newmail_notify, toggled);
+}
+
+
+void prefs_receive_create_widget(PrefsPage *_page, GtkWindow *window, 
+                                 gpointer data)
+{
+       ReceivePage *prefs_receive = (ReceivePage *) _page;
+       
+       GtkWidget *vbox1;
+       GtkWidget *vbox2;
+       GtkWidget *frame_incext;
+       GtkWidget *checkbtn_incext;
+       GtkWidget *hbox;
+       GtkWidget *label_incext;
+       GtkWidget *entry_incext;
+
+       GtkWidget *hbox_autochk;
+       GtkWidget *checkbtn_autochk;
+       GtkWidget *label_autochk1;
+       GtkObject *spinbtn_autochk_adj;
+       GtkWidget *spinbtn_autochk;
+       GtkWidget *label_autochk2;
+       GtkWidget *checkbtn_chkonstartup;
+       GtkWidget *checkbtn_scan_after_inc;
+
+
+       GtkWidget *frame_newmail;
+       GtkWidget *hbox_newmail_notify;
+       GtkWidget *checkbtn_newmail_auto;
+       GtkWidget *checkbtn_newmail_manu;
+       GtkWidget *entry_newmail_notify_cmd;
+       GtkWidget *label_newmail_notify_cmd;
+
+       GtkWidget *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);
+       gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
+
+       PACK_FRAME(vbox1, frame_incext, _("External program"));
+
+       vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW);
+       gtk_widget_show (vbox2);
+       gtk_container_add (GTK_CONTAINER (frame_incext), vbox2);
+       gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
+
+       /* Use of external incorporation program */
+       PACK_CHECK_BUTTON (vbox2, checkbtn_incext,
+                          _("Use external program for incorporation"));
+
+       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_incext, hbox);
+
+       label_incext = gtk_label_new (_("Command"));
+       gtk_widget_show (label_incext);
+       gtk_box_pack_start (GTK_BOX (hbox), label_incext, FALSE, FALSE, 0);
+
+       entry_incext = gtk_entry_new ();
+       gtk_widget_show (entry_incext);
+       gtk_box_pack_start (GTK_BOX (hbox), entry_incext, TRUE, TRUE, 0);
+
+       vbox2 = gtk_vbox_new (FALSE, 0);
+       gtk_widget_show (vbox2);
+       gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
+
+       /* Auto-checking */
+       hbox_autochk = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox_autochk);
+       gtk_box_pack_start (GTK_BOX (vbox2), hbox_autochk, FALSE, FALSE, 0);
+
+       PACK_CHECK_BUTTON (hbox_autochk, checkbtn_autochk,
+                          _("Auto-check new mail"));
+
+       label_autochk1 = gtk_label_new (_("every"));
+       gtk_widget_show (label_autochk1);
+       gtk_box_pack_start (GTK_BOX (hbox_autochk), label_autochk1, FALSE, FALSE, 0);
+
+       spinbtn_autochk_adj = gtk_adjustment_new (5, 1, 100, 1, 10, 10);
+       spinbtn_autochk = gtk_spin_button_new
+               (GTK_ADJUSTMENT (spinbtn_autochk_adj), 1, 0);
+       gtk_widget_show (spinbtn_autochk);
+       gtk_box_pack_start (GTK_BOX (hbox_autochk), spinbtn_autochk, FALSE, FALSE, 0);
+       gtk_widget_set_size_request (spinbtn_autochk, 64, -1);
+       gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_autochk), TRUE);
+
+       label_autochk2 = gtk_label_new (_("minute(s)"));
+       gtk_widget_show (label_autochk2);
+       gtk_box_pack_start (GTK_BOX (hbox_autochk), label_autochk2, FALSE, FALSE, 0);
+
+       SET_TOGGLE_SENSITIVITY(checkbtn_autochk, label_autochk1);
+       SET_TOGGLE_SENSITIVITY(checkbtn_autochk, spinbtn_autochk);
+       SET_TOGGLE_SENSITIVITY(checkbtn_autochk, label_autochk2);
+
+       PACK_CHECK_BUTTON (vbox2, checkbtn_chkonstartup,
+                          _("Check new mail on startup"));
+       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"));
+       vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW);
+       gtk_widget_show (vbox2);
+       gtk_container_add (GTK_CONTAINER (frame_newmail), vbox2);
+       gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
+
+       hbox = gtk_hbox_new (TRUE, 8);
+       gtk_widget_show (hbox);
+       PACK_CHECK_BUTTON (hbox, checkbtn_newmail_auto,
+                          _("after autochecking"));
+       PACK_CHECK_BUTTON (hbox, checkbtn_newmail_manu,
+                          _("after manual checking"));
+       gtk_box_pack_start (GTK_BOX(vbox2), hbox, FALSE, FALSE, 0);
+
+       hbox_newmail_notify = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox_newmail_notify);
+       gtk_box_pack_start (GTK_BOX (vbox2), hbox_newmail_notify, FALSE, 
+                           FALSE, 0);
+
+       label_newmail_notify_cmd = gtk_label_new (_("Command to execute:\n"
+                                                   "(use %d as number of new "
+                                                   "mails)"));
+       gtk_label_set_justify(GTK_LABEL(label_newmail_notify_cmd), 
+                             GTK_JUSTIFY_RIGHT);
+       gtk_widget_show (label_newmail_notify_cmd);
+       gtk_box_pack_start (GTK_BOX (hbox_newmail_notify), 
+                           label_newmail_notify_cmd, FALSE, FALSE, 0);
+
+       entry_newmail_notify_cmd = gtk_entry_new ();
+       gtk_widget_show (entry_newmail_notify_cmd);
+       gtk_box_pack_start (GTK_BOX (hbox_newmail_notify), 
+                           entry_newmail_notify_cmd, TRUE, TRUE, 0);
+
+       gtk_widget_set_sensitive(hbox_newmail_notify, 
+                                prefs_common.newmail_notify_auto || 
+                                prefs_common.newmail_notify_manu);
+
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_incext),
+               prefs_common.use_extinc);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_no_recv_err_panel),
+               prefs_common.no_recv_err_panel);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_close_recv_dialog),
+               prefs_common.close_recv_dialog);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_chkonstartup),
+               prefs_common.chk_on_startup);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_scan_after_inc),
+               prefs_common.scan_all_after_inc);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_newmail_auto),
+               prefs_common.newmail_notify_auto);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_newmail_manu),
+               prefs_common.newmail_notify_manu);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_autochk),
+               prefs_common.autochk_newmail);
+
+       gtk_entry_set_text(GTK_ENTRY(entry_incext), 
+               prefs_common.extinc_cmd);
+       gtk_entry_set_text(GTK_ENTRY(entry_newmail_notify_cmd), 
+               prefs_common.newmail_notify_cmd);
+       gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinbtn_autochk), 
+               prefs_common.autochk_itv);
+       gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu_recvdialog),
+               prefs_common.recv_dialog_mode);
+
+       prefs_receive->window = GTK_WIDGET(window);
+       prefs_receive->checkbtn_incext = checkbtn_incext;
+       prefs_receive->entry_incext = entry_incext;
+       prefs_receive->checkbtn_autochk = checkbtn_autochk;
+       prefs_receive->spinbtn_autochk = spinbtn_autochk;
+       prefs_receive->checkbtn_chkonstartup = checkbtn_chkonstartup;
+       prefs_receive->checkbtn_scan_after_inc = checkbtn_scan_after_inc;
+       prefs_receive->checkbtn_newmail_auto = checkbtn_newmail_auto;
+       prefs_receive->checkbtn_newmail_manu = checkbtn_newmail_manu;
+       prefs_receive->entry_newmail_notify_cmd = entry_newmail_notify_cmd;
+       prefs_receive->optmenu_recvdialog = optmenu_recvdialog;
+       prefs_receive->checkbtn_no_recv_err_panel = checkbtn_no_recv_err_panel;
+       prefs_receive->checkbtn_close_recv_dialog = checkbtn_close_recv_dialog;
+       prefs_receive->hbox_newmail_notify = hbox_newmail_notify;
+       prefs_receive->page.widget = vbox1;
+
+       g_signal_connect(G_OBJECT(checkbtn_newmail_auto), "toggled",
+                        G_CALLBACK(prefs_common_recv_dialog_newmail_notify_toggle_cb),
+                        NULL);
+       g_signal_connect(G_OBJECT(checkbtn_newmail_manu), "toggled",
+                        G_CALLBACK(prefs_common_recv_dialog_newmail_notify_toggle_cb),
+                        NULL);
+
+}
+
+void prefs_receive_save(PrefsPage *_page)
+{
+       ReceivePage *page = (ReceivePage *) _page;
+       gchar *tmp;
+       GtkWidget *menu;
+       GtkWidget *menuitem;
+
+       prefs_common.use_extinc = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->checkbtn_incext));
+       prefs_common.no_recv_err_panel = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->checkbtn_no_recv_err_panel));
+       prefs_common.close_recv_dialog = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->checkbtn_close_recv_dialog));
+       prefs_common.chk_on_startup = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->checkbtn_chkonstartup));
+       prefs_common.scan_all_after_inc = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->checkbtn_scan_after_inc));
+       prefs_common.newmail_notify_auto = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->checkbtn_newmail_auto));
+       prefs_common.newmail_notify_manu = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->checkbtn_newmail_manu));
+       prefs_common.autochk_newmail = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->checkbtn_autochk));
+       prefs_common.autochk_itv = gtk_spin_button_get_value_as_int(
+               GTK_SPIN_BUTTON(page->spinbtn_autochk));
+       
+       tmp = gtk_editable_get_chars(GTK_EDITABLE(page->entry_incext), 0, -1);
+       g_free(prefs_common.extinc_cmd);
+       prefs_common.extinc_cmd = tmp;
+       
+       tmp = gtk_editable_get_chars(GTK_EDITABLE(page->entry_newmail_notify_cmd), 0, -1);
+       g_free(prefs_common.newmail_notify_cmd);
+       prefs_common.newmail_notify_cmd = tmp;
+       
+       menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(page->optmenu_recvdialog));
+       menuitem = gtk_menu_get_active(GTK_MENU(menu));
+       prefs_common.recv_dialog_mode = GPOINTER_TO_INT
+               (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID));
+       inc_autocheck_timer_remove();
+       inc_autocheck_timer_set();
+
+}
+
+static void prefs_receive_destroy_widget(PrefsPage *_page)
+{
+}
+
+void prefs_receive_init(void)
+{
+       ReceivePage *page;
+       static gchar *path[3];
+
+       path[0] = _("Mail Handling");
+       path[1] = _("Receive");
+       path[2] = NULL;
+
+       page = g_new0(ReceivePage, 1);
+       page->page.path = path;
+       page->page.create_widget = prefs_receive_create_widget;
+       page->page.destroy_widget = prefs_receive_destroy_widget;
+       page->page.save_page = prefs_receive_save;
+       page->page.weight = 200.0;
+       prefs_gtk_register_page((PrefsPage *) page);
+       prefs_receive = page;
+}
+
+void prefs_receive_done(void)
+{
+       prefs_gtk_unregister_page((PrefsPage *) prefs_receive);
+       g_free(prefs_receive);
+}
diff --git a/src/prefs_receive.h b/src/prefs_receive.h
new file mode 100644 (file)
index 0000000..a66c4ec
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 2004 Hiroyuki Yamamoto & the Sylpheed-Claws team
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef PREFS_RECEIVE_H
+#define PREFS_RECEIVE_H
+
+void prefs_receive_init        (void);
+void prefs_receive_done        (void);
+
+#endif /* PREFS_RECEIVE_H */ 
diff --git a/src/prefs_send.c b/src/prefs_send.c
new file mode 100644 (file)
index 0000000..fa39f2f
--- /dev/null
@@ -0,0 +1,336 @@
+/*
+ * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 2004 Hiroyuki Yamamoto & The Sylpheed-Claws Team
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include "defs.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <glib.h>
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
+
+#include "prefs_common.h"
+#include "prefs_gtk.h"
+#include "gtk/menu.h"
+
+#include "gtk/gtkutils.h"
+#include "gtk/prefswindow.h"
+
+#include "manage_window.h"
+
+typedef struct _SendPage
+{
+       PrefsPage page;
+
+       GtkWidget *window;
+
+       GtkWidget *checkbtn_savemsg;
+       GtkWidget *optmenu_senddialog;
+       GtkWidget *optmenu_charset;
+       GtkWidget *optmenu_encoding_method;
+} SendPage;
+
+static gchar * prefs_common_charset_set_data_from_optmenu(GtkWidget *widget)
+{
+       GtkWidget *menu;
+       GtkWidget *menuitem;
+       gchar *charset;
+
+       menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(widget));
+       menuitem = gtk_menu_get_active(GTK_MENU(menu));
+       charset = g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID);
+       return g_strdup(charset);
+}
+
+static void prefs_common_charset_set_optmenu(GtkWidget *widget, gchar *data)
+{
+       GtkOptionMenu *optmenu = GTK_OPTION_MENU(widget);
+       gint index;
+
+       g_return_if_fail(optmenu != NULL);
+       g_return_if_fail(data != NULL);
+
+       index = menu_find_option_menu_index(optmenu, data,
+                                           (GCompareFunc)strcmp2);
+       if (index >= 0)
+               gtk_option_menu_set_history(optmenu, index);
+       else
+               gtk_option_menu_set_history(optmenu, 0);
+}
+
+static TransferEncodingMethod prefs_common_encoding_set_data_from_optmenu(GtkWidget *widget)
+{
+       GtkWidget *menu;
+       GtkWidget *menuitem;
+
+       menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(widget));
+       menuitem = gtk_menu_get_active(GTK_MENU(menu));
+       return GPOINTER_TO_INT
+               (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID));
+}
+
+static void prefs_common_encoding_set_optmenu(GtkWidget *widget, TransferEncodingMethod method)
+{
+       GtkOptionMenu *optmenu = GTK_OPTION_MENU(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);
+}
+
+
+void prefs_send_create_widget(PrefsPage *_page, GtkWindow *window, 
+                                 gpointer data)
+{
+       SendPage *prefs_send = (SendPage *) _page;
+       
+       GtkWidget *vbox1;
+       GtkWidget *vbox2;
+       GtkWidget *hbox1;
+       GtkWidget *checkbtn_savemsg;
+       GtkWidget *label_outcharset;
+       GtkWidget *optmenu_charset;
+       GtkWidget *optmenu_menu;
+       GtkWidget *menuitem;
+       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_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
+
+       vbox2 = gtk_vbox_new (FALSE, 0);
+       gtk_widget_show (vbox2);
+       gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
+
+       PACK_CHECK_BUTTON (vbox2, checkbtn_savemsg,
+                          _("Save sent messages to Sent folder"));
+
+       hbox_senddialog = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show(hbox_senddialog);
+       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);
+
+       label_outcharset = gtk_label_new (_("Outgoing encoding"));
+       gtk_widget_show (label_outcharset);
+       gtk_box_pack_start (GTK_BOX (hbox1), label_outcharset, 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, data) \
+{ \
+       MENUITEM_ADD(optmenu_menu, menuitem, str, data); \
+}
+
+       SET_MENUITEM(_("Automatic (Recommended)"),       CS_AUTO);
+       SET_MENUITEM(NULL, NULL);
+       SET_MENUITEM(_("7bit ascii (US-ASCII)"),         CS_US_ASCII);
+       SET_MENUITEM(NULL, NULL);
+       SET_MENUITEM(_("Unicode (UTF-8)"),               CS_UTF_8);
+       SET_MENUITEM(NULL, NULL);
+       SET_MENUITEM(_("Western European (ISO-8859-1)"),  CS_ISO_8859_1);
+       SET_MENUITEM(_("Western European (ISO-8859-15)"), CS_ISO_8859_15);
+       SET_MENUITEM(NULL, NULL);
+       SET_MENUITEM(_("Central European (ISO-8859-2)"),  CS_ISO_8859_2);
+       SET_MENUITEM(NULL, NULL);
+       SET_MENUITEM(_("Baltic (ISO-8859-13)"),           CS_ISO_8859_13);
+       SET_MENUITEM(_("Baltic (ISO-8859-4)"),            CS_ISO_8859_4);
+       SET_MENUITEM(NULL, NULL);
+       SET_MENUITEM(_("Greek (ISO-8859-7)"),             CS_ISO_8859_7);
+       SET_MENUITEM(NULL, NULL);
+       SET_MENUITEM(_("Turkish (ISO-8859-9)"),           CS_ISO_8859_9);
+       SET_MENUITEM(NULL, NULL);
+       SET_MENUITEM(_("Cyrillic (ISO-8859-5)"),          CS_ISO_8859_5);
+       SET_MENUITEM(_("Cyrillic (KOI8-R)"),             CS_KOI8_R);
+       SET_MENUITEM(_("Cyrillic (KOI8-U)"),             CS_KOI8_U);
+       SET_MENUITEM(_("Cyrillic (Windows-1251)"),       CS_WINDOWS_1251);
+       SET_MENUITEM(NULL, NULL);
+       SET_MENUITEM(_("Japanese (ISO-2022-JP)"),        CS_ISO_2022_JP);
+#if 0
+       SET_MENUITEM(_("Japanese (EUC-JP)"),             CS_EUC_JP);
+       SET_MENUITEM(_("Japanese (Shift_JIS)"),          CS_SHIFT_JIS);
+#endif /* 0 */
+       SET_MENUITEM(NULL, NULL);
+       SET_MENUITEM(_("Simplified Chinese (GB2312)"),   CS_GB2312);
+       SET_MENUITEM(_("Simplified Chinese (GBK)"),      CS_GBK);
+       SET_MENUITEM(_("Traditional Chinese (Big5)"),    CS_BIG5);
+#if 0
+       SET_MENUITEM(_("Traditional Chinese (EUC-TW)"),  CS_EUC_TW);
+       SET_MENUITEM(_("Chinese (ISO-2022-CN)"),         CS_ISO_2022_CN);
+#endif /* 0 */
+       SET_MENUITEM(NULL, NULL);
+       SET_MENUITEM(_("Korean (EUC-KR)"),               CS_EUC_KR);
+       SET_MENUITEM(NULL, NULL);
+       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_charset),
+                                 optmenu_menu);
+
+       hbox1 = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox1);
+       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
+
+       hbox1 = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox1);
+       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
+
+       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);
+
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_savemsg),
+               prefs_common.savemsg);
+       gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu_senddialog),
+               prefs_common.send_dialog_mode);
+       prefs_common_charset_set_optmenu(optmenu_charset, 
+               prefs_common.outgoing_charset);
+       prefs_common_encoding_set_optmenu(optmenu_encoding,
+               prefs_common.encoding_method);
+       
+       prefs_send->window                      = GTK_WIDGET(window);
+       
+       prefs_send->checkbtn_savemsg = checkbtn_savemsg;
+       prefs_send->optmenu_senddialog = optmenu_senddialog;
+       prefs_send->optmenu_charset = optmenu_charset;
+       prefs_send->optmenu_encoding_method = optmenu_encoding;
+
+       prefs_send->page.widget = vbox1;
+}
+
+void prefs_send_save(PrefsPage *_page)
+{
+       SendPage *page = (SendPage *) _page;
+       GtkWidget *menu;
+       GtkWidget *menuitem;
+
+       prefs_common.savemsg = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->checkbtn_savemsg));
+
+       menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(page->optmenu_senddialog));
+       menuitem = gtk_menu_get_active(GTK_MENU(menu));
+       prefs_common.send_dialog_mode = GPOINTER_TO_INT
+               (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID));
+       
+       g_free(prefs_common.outgoing_charset);
+       prefs_common.outgoing_charset = prefs_common_charset_set_data_from_optmenu(
+               page->optmenu_charset);
+       prefs_common.encoding_method = prefs_common_encoding_set_data_from_optmenu(
+               page->optmenu_encoding_method);
+}
+
+static void prefs_send_destroy_widget(PrefsPage *_page)
+{
+}
+
+SendPage *prefs_send;
+
+void prefs_send_init(void)
+{
+       SendPage *page;
+       static gchar *path[3];
+
+       path[0] = _("Mail Handling");
+       path[1] = _("Send");
+       path[2] = NULL;
+
+       page = g_new0(SendPage, 1);
+       page->page.path = path;
+       page->page.create_widget = prefs_send_create_widget;
+       page->page.destroy_widget = prefs_send_destroy_widget;
+       page->page.save_page = prefs_send_save;
+       page->page.weight = 195.0;
+       prefs_gtk_register_page((PrefsPage *) page);
+       prefs_send = page;
+}
+
+void prefs_send_done(void)
+{
+       prefs_gtk_unregister_page((PrefsPage *) prefs_send);
+       g_free(prefs_send);
+}
diff --git a/src/prefs_send.h b/src/prefs_send.h
new file mode 100644 (file)
index 0000000..4d6b345
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 2004 Hiroyuki Yamamoto & the Sylpheed-Claws team
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef PREFS_SEND_H
+#define PREFS_SEND_H
+
+void prefs_send_init   (void);
+void prefs_send_done   (void);
+
+#endif /* PREFS_SEND_H */ 
index 5468605..b460008 100644 (file)
@@ -367,7 +367,7 @@ void prefs_spelling_init(void)
        page->page.create_widget = prefs_spelling_create_widget;
        page->page.destroy_widget = prefs_spelling_destroy_widget;
        page->page.save_page = prefs_spelling_save;
-       page->page.weight = 50.0;
+       page->page.weight = 180.0;
 
        prefs_gtk_register_page((PrefsPage *) page);
        prefs_spelling = page;
index 9fd8ea9..1dc09b0 100644 (file)
@@ -35,6 +35,7 @@
 #include "prefs_gtk.h"
 #include "prefs_summary_column.h"
 
+#include "gtk/menu.h"
 #include "gtk/gtkutils.h"
 #include "gtk/prefswindow.h"
 
@@ -54,6 +55,14 @@ typedef struct _SummariesPage
        GtkWidget *chkbtn_threadsubj;
        GtkWidget *button_datefmt;
        GtkWidget *entry_datefmt;
+
+       GtkWidget *checkbtn_always_show_msg;
+       GtkWidget *checkbtn_openunread;
+       GtkWidget *checkbtn_mark_as_read_on_newwin;
+       GtkWidget *checkbtn_openinbox;
+       GtkWidget *checkbtn_immedexec;
+       GtkWidget *optmenu_nextunreadmsgdialog;
+
 } SummariesPage;
 
 enum {
@@ -121,7 +130,6 @@ static GtkWidget *date_format_create(GtkButton *button, void *data)
                { "%Z", NULL }
        };
 
-       gchar *titles[2];
        gint i;
        const gint TIME_FORMAT_ELEMS =
                sizeof time_format / sizeof time_format[0];
@@ -288,6 +296,393 @@ static GtkWidget *date_format_create(GtkButton *button, void *data)
        return datefmt_win;
 }
 
+static struct KeybindDialog {
+       GtkWidget *window;
+       GtkWidget *combo;
+} keybind;
+
+static void prefs_keybind_select               (void);
+static gint prefs_keybind_deleted              (GtkWidget      *widget,
+                                                GdkEventAny    *event,
+                                                gpointer        data);
+static gboolean prefs_keybind_key_pressed      (GtkWidget      *widget,
+                                                GdkEventKey    *event,
+                                                gpointer        data);
+static void prefs_keybind_cancel               (void);
+static void prefs_keybind_apply_clicked                (GtkWidget      *widget);
+
+
+static void prefs_keybind_select(void)
+{
+       GtkWidget *window;
+       GtkWidget *vbox1;
+       GtkWidget *hbox1;
+       GtkWidget *label;
+       GtkWidget *combo;
+       GtkWidget *confirm_area;
+       GtkWidget *ok_btn;
+       GtkWidget *cancel_btn;
+
+       window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+       gtk_container_set_border_width (GTK_CONTAINER (window), 8);
+       gtk_window_set_title (GTK_WINDOW (window), _("Key bindings"));
+       gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
+       gtk_window_set_modal (GTK_WINDOW (window), TRUE);
+       gtk_window_set_resizable(GTK_WINDOW (window), FALSE);
+       manage_window_set_transient (GTK_WINDOW (window));
+
+       vbox1 = gtk_vbox_new (FALSE, VSPACING);
+       gtk_container_add (GTK_CONTAINER (window), vbox1);
+       gtk_container_set_border_width (GTK_CONTAINER (vbox1), 2);
+
+       hbox1 = gtk_hbox_new (FALSE, 8);
+       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
+
+       label = gtk_label_new
+               (_("Select preset:"));
+       gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
+       gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
+
+       hbox1 = gtk_hbox_new (FALSE, 8);
+       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
+
+       combo = gtk_combo_new ();
+       gtk_box_pack_start (GTK_BOX (hbox1), combo, TRUE, TRUE, 0);
+       gtkut_combo_set_items (GTK_COMBO (combo),
+                              _("Default"),
+                              "Mew / Wanderlust",
+                              "Mutt",
+                              _("Old Sylpheed"),
+                              NULL);
+       gtk_editable_set_editable(GTK_EDITABLE(GTK_COMBO (combo)->entry), FALSE);
+
+       hbox1 = gtk_hbox_new (FALSE, 8);
+       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
+
+       label = gtk_label_new
+               (_("You can also modify each menu shortcut by pressing\n"
+                  "any key(s) when placing the mouse pointer on the item."));
+       gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
+       gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
+
+       hbox1 = gtk_hbox_new (FALSE, 8);
+       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
+
+       gtkut_stock_button_set_create (&confirm_area, &ok_btn, GTK_STOCK_OK,
+                                      &cancel_btn, GTK_STOCK_CANCEL,
+                                      NULL, NULL);
+       gtk_box_pack_end (GTK_BOX (hbox1), confirm_area, FALSE, FALSE, 0);
+       gtk_widget_grab_default (ok_btn);
+
+       MANAGE_WINDOW_SIGNALS_CONNECT(window);
+       g_signal_connect (G_OBJECT (window), "delete_event",
+                         G_CALLBACK (prefs_keybind_deleted), NULL);
+       g_signal_connect (G_OBJECT (window), "key_press_event",
+                         G_CALLBACK (prefs_keybind_key_pressed), NULL);
+       g_signal_connect (G_OBJECT (ok_btn), "clicked",
+                         G_CALLBACK (prefs_keybind_apply_clicked),
+                         NULL);
+       g_signal_connect (G_OBJECT (cancel_btn), "clicked",
+                         G_CALLBACK (prefs_keybind_cancel),
+                         NULL);
+
+       gtk_widget_show_all(window);
+
+       keybind.window = window;
+       keybind.combo = combo;
+}
+
+static gboolean prefs_keybind_key_pressed(GtkWidget *widget, GdkEventKey *event,
+                                         gpointer data)
+{
+       if (event && event->keyval == GDK_Escape)
+               prefs_keybind_cancel();
+       return FALSE;
+}
+
+static gint prefs_keybind_deleted(GtkWidget *widget, GdkEventAny *event,
+                                 gpointer data)
+{
+       prefs_keybind_cancel();
+       return TRUE;
+}
+
+static void prefs_keybind_cancel(void)
+{
+       gtk_widget_destroy(keybind.window);
+       keybind.window = NULL;
+       keybind.combo = NULL;
+}
+  
+struct KeyBind {
+       const gchar *accel_path;
+       const gchar *accel_key;
+};
+
+static void prefs_keybind_apply(struct KeyBind keybind[], gint num)
+{
+       gint i;
+       guint key;
+       GdkModifierType mods;
+
+       for (i = 0; i < num; i++) {
+               const gchar *accel_key
+                       = keybind[i].accel_key ? keybind[i].accel_key : "";
+               gtk_accelerator_parse(accel_key, &key, &mods);
+               gtk_accel_map_change_entry(keybind[i].accel_path,
+                                          key, mods, TRUE);
+       }
+}
+
+static void prefs_keybind_apply_clicked(GtkWidget *widget)
+{
+       GtkEntry *entry = GTK_ENTRY(GTK_COMBO(keybind.combo)->entry);
+       const gchar *text;
+       struct KeyBind *menurc;
+       gint n_menurc;
+
+       static struct KeyBind default_menurc[] = {
+               {"<Main>/File/Empty all Trash folders",         ""},
+               {"<Main>/File/Save as...",                      "<control>S"},
+               {"<Main>/File/Print...",                        ""},
+               {"<Main>/File/Exit",                            "<control>Q"},
+
+               {"<Main>/Edit/Copy",                            "<control>C"},
+               {"<Main>/Edit/Select all",                      "<control>A"},
+               {"<Main>/Edit/Find in current message...",      "<control>F"},
+               {"<Main>/Edit/Search folder...",                "<shift><control>F"},
+
+               {"<Main>/View/Show or hide/Message View",       "V"},
+               {"<Main>/View/Thread view",                     "<control>T"},
+               {"<Main>/View/Go to/Prev message",              "P"},
+               {"<Main>/View/Go to/Next message",              "N"},
+               {"<Main>/View/Go to/Prev unread message",       "<shift>P"},
+               {"<Main>/View/Go to/Next unread message",       "<shift>N"},
+               {"<Main>/View/Go to/Other folder...",           "G"},
+               {"<Main>/View/Open in new window",              "<control><alt>N"},
+               {"<Main>/View/Message source",                  "<control>U"},
+               {"<Main>/View/Show all headers",                "<control>H"},
+               {"<Main>/View/Update summary",                  "<control><alt>U"},
+
+               {"<Main>/Message/Receive/Get from current account",
+                                                               "<control>I"},
+               {"<Main>/Message/Receive/Get from all accounts","<shift><control>I"},
+               {"<Main>/Message/Compose an email message",     "<control>M"},
+               {"<Main>/Message/Reply",                        "<control>R"},
+               {"<Main>/Message/Reply to/all",                 "<shift><control>R"},
+               {"<Main>/Message/Reply to/sender",              ""},
+               {"<Main>/Message/Reply to/mailing list",        "<control>L"},
+               {"<Main>/Message/Forward",                      "<control><alt>F"},
+               /* {"<Main>/Message/Forward as attachment",      ""}, */
+               {"<Main>/Message/Move...",                      "<control>O"},
+               {"<Main>/Message/Copy...",                      "<shift><control>O"},
+               {"<Main>/Message/Delete",                       "<control>D"},
+               {"<Main>/Message/Mark/Mark",                    "<shift>asterisk"},
+               {"<Main>/Message/Mark/Unmark",                  "U"},
+               {"<Main>/Message/Mark/Mark as unread",          "<shift>exclam"},
+               {"<Main>/Message/Mark/Mark as read",            ""},
+
+               {"<Main>/Tools/Address book",                   "<shift><control>A"},
+               {"<Main>/Tools/Execute",                        "X"},
+               {"<Main>/Tools/Log window",                     "<shift><control>L"},
+
+               {"<Compose>/Message/Close",                             "<control>W"},
+               {"<Compose>/Edit/Select all",                           "<control>A"},
+               {"<Compose>/Edit/Advanced/Move a word backward",        ""},
+               {"<Compose>/Edit/Advanced/Move a word forward",         ""},
+               {"<Compose>/Edit/Advanced/Move to beginning of line",   ""},
+               {"<Compose>/Edit/Advanced/Delete a word backward",      ""},
+               {"<Compose>/Edit/Advanced/Delete a word forward",       ""},
+       };
+
+       static struct KeyBind mew_wl_menurc[] = {
+               {"<Main>/File/Empty all Trash folders",                 "<shift>D"},
+               {"<Main>/File/Save as...",                      "Y"},
+               {"<Main>/File/Print...",                        "<shift>numbersign"},
+               {"<Main>/File/Exit",                            "<shift>Q"},
+
+               {"<Main>/Edit/Copy",                            "<control>C"},
+               {"<Main>/Edit/Select all",                      "<control>A"},
+               {"<Main>/Edit/Find in current message...",      "<control>F"},
+               {"<Main>/Edit/Search folder...",                "<control>S"},
+
+               {"<Main>/View/Show or hide/Message View",       ""},
+               {"<Main>/View/Thread view",                     "<shift>T"},
+               {"<Main>/View/Go to/Prev message",              "P"},
+               {"<Main>/View/Go to/Next message",              "N"},
+               {"<Main>/View/Go to/Prev unread message",       "<shift>P"},
+               {"<Main>/View/Go to/Next unread message",       "<shift>N"},
+               {"<Main>/View/Go to/Other folder...",           "G"},
+               {"<Main>/View/Open in new window",              "<control><alt>N"},
+               {"<Main>/View/Message source",                  "<control>U"},
+               {"<Main>/View/Show all headers",                "<shift>H"},
+               {"<Main>/View/Update summary",                  "<shift>S"},
+
+               {"<Main>/Message/Receive/Get from current account",
+                                                               "<control>I"},
+               {"<Main>/Message/Receive/Get from all accounts","<shift><control>I"},
+               {"<Main>/Message/Compose an email message",     "W"},
+               {"<Main>/Message/Reply",                        "<control>R"},
+               {"<Main>/Message/Reply to/all",                 "<shift>A"},
+               {"<Main>/Message/Reply to/sender",              ""},
+               {"<Main>/Message/Reply to/mailing list",        "<control>L"},
+               {"<Main>/Message/Forward",                      "F"},
+               /* {"<Main>/Message/Forward as attachment", "<shift>F"}, */
+               {"<Main>/Message/Move...",                      "O"},
+               {"<Main>/Message/Copy...",                      "<shift>O"},
+               {"<Main>/Message/Delete",                       "D"},
+               {"<Main>/Message/Mark/Mark",                    "<shift>asterisk"},
+               {"<Main>/Message/Mark/Unmark",                  "U"},
+               {"<Main>/Message/Mark/Mark as unread",          "<shift>exclam"},
+               {"<Main>/Message/Mark/Mark as read",            "<shift>R"},
+
+               {"<Main>/Tools/Address book",                   "<shift><control>A"},
+               {"<Main>/Tools/Execute",                        "X"},
+               {"<Main>/Tools/Log window",                     "<shift><control>L"},
+
+               {"<Compose>/Message/Close",                             "<alt>W"},
+               {"<Compose>/Edit/Select all",                           ""},
+               {"<Compose>/Edit/Advanced/Move a word backward,"        "<alt>B"},
+               {"<Compose>/Edit/Advanced/Move a word forward",         "<alt>F"},
+               {"<Compose>/Edit/Advanced/Move to beginning of line",   "<control>A"},
+               {"<Compose>/Edit/Advanced/Delete a word backward",      "<control>W"},
+               {"<Compose>/Edit/Advanced/Delete a word forward",       "<alt>D"},
+       };
+
+       static struct KeyBind mutt_menurc[] = {
+               {"<Main>/File/Empty all Trash folders",         ""},
+               {"<Main>/File/Save as...",                      "S"},
+               {"<Main>/File/Print...",                        "P"},
+               {"<Main>/File/Exit",                            "Q"},
+
+               {"<Main>/Edit/Copy",                            "<control>C"},
+               {"<Main>/Edit/Select all",                      "<control>A"},
+               {"<Main>/Edit/Find in current message...",      "<control>F"},
+               {"<Main>/Edit/Search messages...",              "slash"},
+
+               {"<Main>/View/Show or hide/Message view",       "V"},
+               {"<Main>/View/Thread view",                     "<control>T"},
+               {"<Main>/View/Go to/Prev message",              ""},
+               {"<Main>/View/Go to/Next message",              ""},
+               {"<Main>/View/Go to/Prev unread message",       ""},
+               {"<Main>/View/Go to/Next unread message",       ""},
+               {"<Main>/View/Go to/Other folder...",           "C"},
+               {"<Main>/View/Open in new window",              "<control><alt>N"},
+               {"<Main>/View/Message source",                  "<control>U"},
+               {"<Main>/View/Show all headers",                "<control>H"},
+               {"<Main>/View/Update summary",                          "<control><alt>U"},
+
+               {"<Main>/Message/Receive/Get from current account",
+                                                               "<control>I"},
+               {"<Main>/Message/Receive/Get from all accounts","<shift><control>I"},
+               {"<Main>/Message/Compose an email message",             "M"},
+               {"<Main>/Message/Reply",                        "R"},
+               {"<Main>/Message/Reply to/all",                 "G"},
+               {"<Main>/Message/Reply to/sender",              ""},
+               {"<Main>/Message/Reply to/mailing list",        "<control>L"},
+               {"<Main>/Message/Forward",                      "F"},
+               {"<Main>/Message/Forward as attachment",        ""},
+               {"<Main>/Message/Move...",                      "<control>O"},
+               {"<Main>/Message/Copy...",                      "<shift>C"},
+               {"<Main>/Message/Delete",                       "D"},
+               {"<Main>/Message/Mark/Mark",                    "<shift>F"},
+               {"<Main>/Message/Mark/Unmark",                  "U"},
+               {"<Main>/Message/Mark/Mark as unread",          "<shift>N"},
+               {"<Main>/Message/Mark/Mark as read",            ""},
+
+               {"<Main>/Tools/Address book",                   "<shift><control>A"},
+               {"<Main>/Tools/Execute",                        "X"},
+               {"<Main>/Tools/Log window",                     "<shift><control>L"},
+
+               {"<Compose>/Message/Close",                             "<alt>W"},
+               {"<Compose>/Edit/Select all",                           ""},
+               {"<Compose>/Edit/Advanced/Move a word backward",        "<alt>B"},
+               {"<Compose>/Edit/Advanced/Move a word forward",         "<alt>F"},
+               {"<Compose>/Edit/Advanced/Move to beginning of line",   "<control>A"},
+               {"<Compose>/Edit/Advanced/Delete a word backward",      "<control>W"},
+               {"<Compose>/Edit/Advanced/Delete a word forward",       "<alt>D"},
+       };
+
+       static struct KeyBind old_sylpheed_menurc[] = {
+               {"<Main>/File/Empty all Trash folders",         ""},
+               {"<Main>/File/Save as...",                      ""},
+               {"<Main>/File/Print...",                        "<alt>P"},
+               {"<Main>/File/Exit",                            "<alt>Q"},
+
+               {"<Main>/Edit/Copy",                            "<control>C"},
+               {"<Main>/Edit/Select all",                      "<control>A"},
+               {"<Main>/Edit/Find in current message...",      "<control>F"},
+               {"<Main>/Edit/Search folder...",                "<control>S"},
+
+               {"<Main>/View/Show or hide/Message View",       ""},
+               {"<Main>/View/Thread view",                     "<control>T"},
+               {"<Main>/View/Go to/Prev message",              "P"},
+               {"<Main>/View/Go to/Next message",              "N"},
+               {"<Main>/View/Go to/Prev unread message",       "<shift>P"},
+               {"<Main>/View/Go to/Next unread message",       "<shift>N"},
+               {"<Main>/View/Go to/Other folder...",           "<alt>G"},
+               {"<Main>/View/Open in new window",              "<shift><control>N"},
+               {"<Main>/View/Message source",                  "<control>U"},
+               {"<Main>/View/Show all headers",                "<control>H"},
+               {"<Main>/View/Update summary",                  "<alt>U"},
+
+               {"<Main>/Message/Receive/Get from current account",
+                                                               "<alt>I"},
+               {"<Main>/Message/Receive/Get from all accounts","<shift><alt>I"},
+               {"<Main>/Message/Compose an email message",     "<alt>N"},
+               {"<Main>/Message/Reply",                        "<alt>R"},
+               {"<Main>/Message/Reply to/all",                 "<shift><alt>R"},
+               {"<Main>/Message/Reply to/sender",              "<control><alt>R"},
+               {"<Main>/Message/Reply to/mailing list",        "<control>L"},
+               {"<Main>/Message/Forward",                       "<shift><alt>F"},
+               /* "(menu-path \"<Main>/Message/Forward as attachment", "<shift><control>F"}, */
+               {"<Main>/Message/Move...",                      "<alt>O"},
+               {"<Main>/Message/Copy...",                      ""},
+               {"<Main>/Message/Delete",                       "<alt>D"},
+               {"<Main>/Message/Mark/Mark",                    "<shift>asterisk"},
+               {"<Main>/Message/Mark/Unmark",                  "U"},
+               {"<Main>/Message/Mark/Mark as unread",          "<shift>exclam"},
+               {"<Main>/Message/Mark/Mark as read",            ""},
+
+               {"<Main>/Tools/Address book",                   "<alt>A"},
+               {"<Main>/Tools/Execute",                        "<alt>X"},
+               {"<Main>/Tools/Log window",                     "<alt>L"},
+
+               {"<Compose>/Message/Close",                             "<alt>W"},
+               {"<Compose>/Edit/Select all",                           ""},
+               {"<Compose>/Edit/Advanced/Move a word backward",        "<alt>B"},
+               {"<Compose>/Edit/Advanced/Move a word forward",         "<alt>F"},
+               {"<Compose>/Edit/Advanced/Move to beginning of line",   "<control>A"},
+               {"<Compose>/Edit/Advanced/Delete a word backward",      "<control>W"},
+               {"<Compose>/Edit/Advanced/Delete a word forward",       "<alt>D"},
+       };
+  
+       text = gtk_entry_get_text(entry);
+  
+       if (!strcmp(text, _("Default"))) {
+               menurc = default_menurc;
+               n_menurc = G_N_ELEMENTS(default_menurc);
+       } else if (!strcmp(text, "Mew / Wanderlust")) {
+               menurc = mew_wl_menurc;
+               n_menurc = G_N_ELEMENTS(mew_wl_menurc);
+       } else if (!strcmp(text, "Mutt")) {
+               menurc = mutt_menurc;
+               n_menurc = G_N_ELEMENTS(mutt_menurc);
+       } else if (!strcmp(text, _("Old Sylpheed"))) {
+               menurc = old_sylpheed_menurc;
+               n_menurc = G_N_ELEMENTS(old_sylpheed_menurc);
+       } else {
+               return;
+       }
+
+       /* prefs_keybind_apply(empty_menurc, G_N_ELEMENTS(empty_menurc)); */
+       prefs_keybind_apply(menurc, n_menurc);
+
+       gtk_widget_destroy(keybind.window);
+       keybind.window = NULL;
+       keybind.combo = NULL;
+}
+
 void prefs_summaries_create_widget(PrefsPage *_page, GtkWindow *window, 
                                  gpointer data)
 {
@@ -311,6 +706,19 @@ void prefs_summaries_create_widget(PrefsPage *_page, GtkWindow *window,
        GtkWidget *entry_datefmt;
        GtkWidget *button_dispitem;
 
+       GtkWidget *checkbtn_always_show_msg;
+       GtkWidget *checkbtn_openunread;
+       GtkWidget *checkbtn_mark_as_read_on_newwin;
+       GtkWidget *checkbtn_openinbox;
+       GtkWidget *checkbtn_immedexec;
+       GtkTooltips *immedexec_tooltip;
+       GtkWidget *label;
+       GtkWidget *menu;
+       GtkWidget *menuitem;
+       GtkWidget *button_keybind;
+       GtkWidget *hbox_nextunreadmsgdialog;
+       GtkWidget *optmenu_nextunreadmsgdialog;
+
        vbox1 = gtk_vbox_new (FALSE, VSPACING);
        gtk_widget_show (vbox1);
        gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
@@ -406,6 +814,83 @@ void prefs_summaries_create_widget(PrefsPage *_page, GtkWindow *window,
                          G_CALLBACK (prefs_summary_column_open),
                          NULL);
 
+       vbox2 = gtk_vbox_new (FALSE, 0);
+       gtk_widget_show (vbox2);
+       gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
+
+       /* PACK_CHECK_BUTTON (vbox2, checkbtn_emacs,
+                          _("Emulate the behavior of mouse operation of\n"
+                            "Emacs-based mailer"));
+       gtk_label_set_justify (GTK_LABEL (GTK_BIN (checkbtn_emacs)->child),
+                              GTK_JUSTIFY_LEFT);   */
+
+       PACK_CHECK_BUTTON
+               (vbox2, checkbtn_always_show_msg,
+                _("Always open messages in summary when selected"));
+
+       PACK_CHECK_BUTTON
+               (vbox2, checkbtn_openunread,
+                _("Open first unread message when entering a folder"));
+
+       PACK_CHECK_BUTTON
+               (vbox2, checkbtn_mark_as_read_on_newwin,
+                _("Only mark message as read when opened in new window"));
+
+       PACK_CHECK_BUTTON
+               (vbox2, checkbtn_openinbox,
+                _("Go to inbox after receiving new mail"));
+
+       vbox3 = gtk_vbox_new (FALSE, 0);
+       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);
+
+       /* Next Unread Message Dialog */
+       hbox_nextunreadmsgdialog = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox_nextunreadmsgdialog);
+       gtk_box_pack_start (GTK_BOX (vbox1), hbox_nextunreadmsgdialog, FALSE, FALSE, 0);
+
+       label = gtk_label_new (_("Show no-unread-message dialog"));
+       gtk_widget_show (label);
+       gtk_box_pack_start (GTK_BOX (hbox_nextunreadmsgdialog), label, FALSE, FALSE, 8);
+
+       optmenu_nextunreadmsgdialog = gtk_option_menu_new ();
+       gtk_widget_show (optmenu_nextunreadmsgdialog);
+       gtk_box_pack_start (GTK_BOX (hbox_nextunreadmsgdialog), optmenu_nextunreadmsgdialog, FALSE, FALSE, 8);
+       
+       menu = gtk_menu_new ();
+       MENUITEM_ADD (menu, menuitem, _("Always"), NEXTUNREADMSGDIALOG_ALWAYS);
+       MENUITEM_ADD (menu, menuitem, _("Assume 'Yes'"), 
+                     NEXTUNREADMSGDIALOG_ASSUME_YES);
+       MENUITEM_ADD (menu, menuitem, _("Assume 'No'"), 
+                     NEXTUNREADMSGDIALOG_ASSUME_NO);
+
+       gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_nextunreadmsgdialog), menu);
+
+       hbox1 = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox1);
+       gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
+
+       button_keybind = gtk_button_new_with_label (_(" Set key bindings... "));
+       gtk_widget_show (button_keybind);
+       gtk_box_pack_start (GTK_BOX (hbox1), button_keybind, FALSE, FALSE, 0);
+       g_signal_connect (G_OBJECT (button_keybind), "clicked",
+                         G_CALLBACK (prefs_keybind_select), NULL);
+
+
        prefs_summaries->window                 = GTK_WIDGET(window);
        
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chkbtn_transhdr),
@@ -423,6 +908,20 @@ void prefs_summaries_create_widget(PrefsPage *_page, GtkWindow *window,
        gtk_entry_set_text(GTK_ENTRY(entry_datefmt), 
                        prefs_common.date_format?prefs_common.date_format:"");  
 
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_always_show_msg),
+                       prefs_common.always_show_msg);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_openunread),
+                       prefs_common.open_unread_on_enter);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_mark_as_read_on_newwin),
+                       prefs_common.mark_as_read_on_new_window);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_openinbox),
+                       prefs_common.open_inbox_on_inc);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_immedexec),
+                       prefs_common.immediate_exec);
+
+       gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu_nextunreadmsgdialog),
+                       prefs_common.next_unread_msg_dialog);
+
        prefs_summaries->chkbtn_transhdr = chkbtn_transhdr;
        prefs_summaries->chkbtn_folder_unread = chkbtn_folder_unread;
        prefs_summaries->spinbtn_ng_abbrev_len = spinbtn_ng_abbrev_len;
@@ -431,12 +930,21 @@ void prefs_summaries_create_widget(PrefsPage *_page, GtkWindow *window,
        prefs_summaries->chkbtn_threadsubj = chkbtn_threadsubj;
        prefs_summaries->entry_datefmt = entry_datefmt;
 
+       prefs_summaries->checkbtn_always_show_msg = checkbtn_always_show_msg;
+       prefs_summaries->checkbtn_openunread = checkbtn_openunread;
+       prefs_summaries->checkbtn_mark_as_read_on_newwin = checkbtn_mark_as_read_on_newwin;
+       prefs_summaries->checkbtn_openinbox = checkbtn_openinbox;
+       prefs_summaries->checkbtn_immedexec = checkbtn_immedexec;
+       prefs_summaries->optmenu_nextunreadmsgdialog = optmenu_nextunreadmsgdialog;
+
        prefs_summaries->page.widget = vbox1;
 }
 
 void prefs_summaries_save(PrefsPage *_page)
 {
        SummariesPage *page = (SummariesPage *) _page;
+       GtkWidget *menu;
+       GtkWidget *menuitem;
 
        prefs_common.trans_hdr = gtk_toggle_button_get_active(
                        GTK_TOGGLE_BUTTON(page->chkbtn_transhdr));
@@ -454,6 +962,22 @@ void prefs_summaries_save(PrefsPage *_page)
        g_free(prefs_common.date_format); 
        prefs_common.date_format = gtk_editable_get_chars(
                        GTK_EDITABLE(page->entry_datefmt), 0, -1);      
+
+       prefs_common.always_show_msg = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->checkbtn_always_show_msg));
+       prefs_common.open_unread_on_enter = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->checkbtn_openunread));
+       prefs_common.mark_as_read_on_new_window = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->checkbtn_mark_as_read_on_newwin));
+       prefs_common.open_inbox_on_inc = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->checkbtn_openinbox));
+       prefs_common.immediate_exec = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->checkbtn_immedexec));
+
+       menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(page->optmenu_nextunreadmsgdialog));
+       menuitem = gtk_menu_get_active(GTK_MENU(menu));
+       prefs_common.next_unread_msg_dialog = GPOINTER_TO_INT
+               (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID));
 }
 
 static void prefs_summaries_destroy_widget(PrefsPage *_page)
@@ -476,7 +1000,7 @@ void prefs_summaries_init(void)
        page->page.create_widget = prefs_summaries_create_widget;
        page->page.destroy_widget = prefs_summaries_destroy_widget;
        page->page.save_page = prefs_summaries_save;
-       page->page.weight = 60.0;
+       page->page.weight = 140.0;
        prefs_gtk_register_page((PrefsPage *) page);
        prefs_summaries = page;
 }
index 61d6801..4acc27c 100644 (file)
@@ -127,7 +127,7 @@ static gboolean prefs_summary_column_key_pressed(GtkWidget  *widget,
 
 static GtkListStore *prefs_summary_column_create_store (void);
 
-static gint prefs_summary_column_insert_column (GtkListStore *store,
+static void prefs_summary_column_insert_column (GtkListStore *store,
                                                 gint row,
                                                 const gchar *name,
                                                 SummaryColumnType type);
@@ -421,7 +421,6 @@ static void prefs_summary_column_set_dialog(SummaryColumnState *state)
                state = prefs_summary_column_get_config();
 
        for (pos = 0; pos < N_SUMMARY_COLS; pos++) {
-               gint row;
                type = state[pos].type;
                name = gettext(col_name[type]);
 
@@ -668,7 +667,7 @@ static GtkListStore *prefs_summary_column_create_store(void)
                                  -1);
 }
 
-static gint prefs_summary_column_insert_column(GtkListStore *store,
+static void prefs_summary_column_insert_column(GtkListStore *store,
                                               gint row,
                                               const gchar *name,
                                               SummaryColumnType type)
@@ -687,8 +686,7 @@ static gint prefs_summary_column_insert_column(GtkListStore *store,
                                   SUMCOL_NAME, name,
                                   SUMCOL_TYPE, type,
                                   -1);
-               return -1 + gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store),
-                                                          NULL);
+               return;
        } else {
                /* change existing */
                gtk_list_store_set(store, &iter, 
@@ -774,7 +772,6 @@ static void drag_data_get(GtkTreeView *tree_view, GdkDragContext *context,
                          GtkSelectionData *data, guint info, 
                          guint time, GtkTreeModel *model)
 {
-       GtkWidget *source;
        GtkTreeIter iter;
        SummaryColumnType type;
        GtkTreeModel *source_model;
@@ -803,7 +800,6 @@ static void drag_data_received(GtkTreeView *tree_view, GdkDragContext *context,
        GtkTreePath *dst = NULL, *sel = NULL;
        GtkTreeIter isel, idst;
        GtkTreeViewDropPosition pos;
-       gboolean before;
        SummaryColumnType type;
        GtkTreeModel *sel_model;
        gchar *name;
index 2983122..2aee389 100644 (file)
@@ -304,8 +304,6 @@ static void prefs_template_window_setup(void)
 {
        GSList *tmpl_list;
        GSList *cur;
-       gchar *title[1];
-       gint row;
        Template *tmpl;
        GtkListStore *store;
 
@@ -448,7 +446,6 @@ static GSList *prefs_template_get_list(void)
 static void prefs_template_list_view_set_row(GtkTreeIter *row)
 {
        Template *tmpl;
-       Template *tmp_tmpl;
        gchar *name;
        gchar *subject;
        gchar *to;
index cd65b6b..b90979f 100644 (file)
@@ -347,7 +347,7 @@ void prefs_themes_init(void)
        page->page.create_widget = prefs_themes_create_widget;
        page->page.destroy_widget = prefs_themes_destroy_widget;
        page->page.save_page = prefs_themes_save;
-       page->page.weight = 15.0;
+       page->page.weight = 130.0;
        prefs_gtk_register_page((PrefsPage *) page);
 
        tdata->page = page;
index 7629245..8decc8a 100644 (file)
@@ -879,6 +879,7 @@ void prefs_toolbar_init(void)
        page->page.destroy_widget = prefs_toolbar_destroy_widget;
        page->page.save_page = prefs_toolbar_save;
        page->source = TOOLBAR_MAIN;
+       page->page.weight = 50.0;
        prefs_gtk_register_page((PrefsPage *) page);
        prefs_toolbar_mainwindow = page;
 
@@ -892,6 +893,7 @@ void prefs_toolbar_init(void)
        page->page.destroy_widget = prefs_toolbar_destroy_widget;
        page->page.save_page = prefs_toolbar_save;
        page->source = TOOLBAR_MSGVIEW;
+       page->page.weight = 45.0;
        prefs_gtk_register_page((PrefsPage *) page);
        prefs_toolbar_messageview = page;
 
@@ -905,6 +907,7 @@ void prefs_toolbar_init(void)
        page->page.destroy_widget = prefs_toolbar_destroy_widget;
        page->page.save_page = prefs_toolbar_save;
        page->source = TOOLBAR_COMPOSE;
+       page->page.weight = 40.0;
        prefs_gtk_register_page((PrefsPage *) page);
        prefs_toolbar_composewindow = page;
 }
@@ -1099,7 +1102,6 @@ static gboolean icon_list_selected(GtkTreeSelection *selector,
                                   ToolbarPage *prefs_toolbar)
 {
        GtkTreeIter iter;
-       GtkTreeView *list_ico = gtk_tree_selection_get_tree_view(selector);
        gchar *text;
        
        if (currently_selected ||!gtk_tree_model_get_iter(model, &iter, path))
@@ -1135,7 +1137,6 @@ static gboolean set_list_selected(GtkTreeSelection *selector,
 {
        GtkTreeIter iter;
        GtkTreeView *list_ico = GTK_TREE_VIEW(prefs_toolbar->list_view_icons);
-       GtkTreeView *list_set = GTK_TREE_VIEW(prefs_toolbar->list_view_set);
        gchar *syl_act = toolbar_ret_descr_from_val(A_SYL_ACTIONS);
        gchar *file, *icon_text, *descr;
        GList *cur;
index cbf7578..3ef5026 100644 (file)
@@ -161,7 +161,7 @@ void prefs_wrapping_init(void)
        page->page.create_widget = prefs_wrapping_create_widget;
        page->page.destroy_widget = prefs_wrapping_destroy_widget;
        page->page.save_page = prefs_wrapping_save;
-       page->page.weight = 60.0;
+       page->page.weight = 182.0;
        prefs_gtk_register_page((PrefsPage *) page);
        prefs_wrapping = page;
 }
index c6e855d..1341bc4 100644 (file)
@@ -340,10 +340,6 @@ gboolean procmime_decode_content(MimeInfo *mimeinfo)
                                        tmpfp);
                                got_error = TRUE;
                                continue;
-                       } else if (len >= 0) {
-                               /* print out the error message only once 
-                                * per block */
-                               got_error = FALSE;
                        }
                        fwrite(outbuf, sizeof(gchar), len, tmpfp);
                }
@@ -404,7 +400,7 @@ gboolean procmime_decode_content(MimeInfo *mimeinfo)
 
 gboolean procmime_encode_content(MimeInfo *mimeinfo, EncodingType encoding)
 {
-       FILE *infp, *outfp;
+       FILE *infp = NULL, *outfp;
        gint len;
        gchar *tmpfilename;
        struct stat statbuf;
@@ -745,7 +741,6 @@ FILE *procmime_get_text_content(MimeInfo *mimeinfo)
                }
                
                dup2(oldout, 1);
-#warning FIXME_GTK2 HTML/RTF not yet utf8
 /* CodeConverter seems to have no effect here */
        } else if (mimeinfo->type == MIMETYPE_TEXT && !g_ascii_strcasecmp(mimeinfo->subtype, "html")) {
                HTMLParser *parser;
@@ -921,7 +916,7 @@ gchar *procmime_get_mime_type(const gchar *filename)
        static GHashTable *mime_type_table = NULL;
        MimeType *mime_type;
        const gchar *p;
-       gchar *ext;
+       gchar *ext = NULL;
        gchar *base;
 
        if (!mime_type_table) {
@@ -2081,7 +2076,6 @@ gint procmime_write_mimeinfo(MimeInfo *mimeinfo, FILE *fp)
 gchar *procmime_get_part_file_name(MimeInfo *mimeinfo)
 {
        gchar *base;
-       const gchar *base_;
 
        if ((mimeinfo->type == MIMETYPE_TEXT) && !g_ascii_strcasecmp(mimeinfo->subtype, "html"))
                base = g_strdup("mimetmp.html");
index 4ec171b..fecb0c0 100644 (file)
@@ -726,7 +726,7 @@ parse_again:
        nothing_to_sort = TRUE;
        cur = orig;
        while (cur) {
-               gchar *file;
+               gchar *file = NULL;
                PrefsAccount *ac = procmsg_get_account_from_file(file);
                msg = (MsgInfo *)cur->data;
                file = folder_item_fetch_msg(queue, msg->msgnum);
@@ -774,7 +774,6 @@ static gboolean procmsg_is_last_for_account(FolderItem *queue, MsgInfo *msginfo,
        g_free(file);
        for (cur = elem; cur; cur = cur->next) {
                MsgInfo *cur_msginfo = (MsgInfo *)cur->data;
-               PrefsAccount *cur_ac = NULL;
                file = folder_item_fetch_msg(queue, cur_msginfo->msgnum);
                
                if (cur_msginfo != msginfo && !MSG_IS_LOCKED(cur_msginfo->flags)) {
@@ -1154,6 +1153,7 @@ void procmsg_msginfo_free(MsgInfo *msginfo)
 guint procmsg_msginfo_memusage(MsgInfo *msginfo)
 {
        guint memusage = 0;
+       GSList *refs;
        
        memusage += sizeof(MsgInfo);
        if (msginfo->fromname)
@@ -1180,11 +1180,10 @@ guint procmsg_msginfo_memusage(MsgInfo *msginfo)
                memusage += strlen(msginfo->dispositionnotificationto);
        if (msginfo->returnreceiptto)
                memusage += strlen(msginfo->returnreceiptto);
-#warning FIXME: Calculate size of references list                
-#if 0
-       if (msginfo->references)
-               memusage += strlen(msginfo->references);
-#endif                
+       for (refs = msginfo->references; refs; refs=refs->next) {
+               gchar *r = (gchar *)refs->data;
+               memusage += r?strlen(r):0;
+       }
        if (msginfo->fromspace)
                memusage += strlen(msginfo->fromspace);
 
@@ -1835,7 +1834,7 @@ MsgInfo *procmsg_msginfo_new_from_mimeinfo(MsgInfo *src_msginfo, MimeInfo *mimei
                gchar *tmpfile = get_tmp_file();
                str_write_to_file(mimeinfo->data.mem, tmpfile);
                g_free(mimeinfo->data.mem);
-               mimeinfo->content == MIMECONTENT_FILE;
+               mimeinfo->content = MIMECONTENT_FILE;
                mimeinfo->data.filename = g_strdup(tmpfile);
                g_free(tmpfile);
        }
index 5bb4bef..c7077af 100644 (file)
@@ -40,5 +40,9 @@ gint send_message_local               (const gchar *command,
 gint send_message_smtp         (PrefsAccount *ac_prefs,
                                 GSList *to_list,
                                 FILE *fp);
+gint send_message_smtp_full    (PrefsAccount *ac_prefs, 
+                                GSList *to_list, 
+                                FILE *fp, 
+                                gboolean keep_session);
 
 #endif /* __SEND_H__ */
index 9024080..4185528 100644 (file)
@@ -329,9 +329,7 @@ static void ssl_manager_double_clicked(GtkTreeView          *list_view,
                                        gpointer                 data)
 {
        SSLCertificate *cert;
-       gchar *cmd;
        GtkTreeIter iter;
-       gboolean is_valid;
        GtkTreeModel *model = gtk_tree_view_get_model(list_view);
 
        if (!gtk_tree_model_get_iter(model, &iter, path))
@@ -355,11 +353,9 @@ static void ssl_manager_delete_cb(GtkWidget *widget,
                              gpointer data) 
 {
        SSLCertificate *cert;
-       GList *rowlist;
        int val;
        GtkTreeIter sel;
        GtkTreeModel *model;
-       gchar *action;
 
        if (!gtk_tree_selection_get_selected(gtk_tree_view_get_selection
                                (GTK_TREE_VIEW(manager.certlist)),
@@ -387,11 +383,8 @@ static void ssl_manager_view_cb(GtkWidget *widget,
                                gpointer data) 
 {
        SSLCertificate *cert;
-       GList *rowlist;
-       int val;
        GtkTreeIter sel;
        GtkTreeModel *model;
-       gchar *action;
 
        if (!gtk_tree_selection_get_selected(gtk_tree_view_get_selection
                                (GTK_TREE_VIEW(manager.certlist)),
index eacead6..5652a9e 100644 (file)
@@ -316,7 +316,6 @@ static void summary_search_execute(gboolean backward, gboolean search_all)
        gboolean body_matched;
        const gchar *from_str, *to_str, *subject_str, *body_str;
        StrFindFunc str_find_func;
-       gboolean valid;
 
        if (summary_is_locked(summaryview)) return;
        summary_lock(summaryview);
index bf8c3d1..1fcec04 100644 (file)
@@ -48,6 +48,7 @@
 
 #include "main.h"
 #include "menu.h"
+#include "mbox.h"
 #include "mainwindow.h"
 #include "folderview.h"
 #include "summaryview.h"
index 86b49b2..a75e5d0 100644 (file)
@@ -444,8 +444,6 @@ void textview_show_message(TextView *textview, MimeInfo *mimeinfo,
 
 void textview_show_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp)
 {
-       GtkTextView *text;
-
        g_return_if_fail(mimeinfo != NULL);
        g_return_if_fail(fp != NULL);
 
@@ -2091,8 +2089,6 @@ static gboolean textview_uri_button_pressed(GtkTextTag *tag, GObject *obj,
 {
        GdkEventButton *bevent;
        RemoteURI *uri = NULL;
-       GSList *cur;
-       gchar *trimmed_uri;
 
        if (!event)
                return FALSE;
index 84b7763..7575556 100644 (file)
@@ -181,20 +181,6 @@ static GtkWidget* create_page (WizardWindow *wizard, const char * title)
        return vbox;
 }
 
-static GtkWidget*
-create_page_with_text (WizardWindow *wizard, const char * title, 
-                       const char * text)
-{
-       GtkWidget *label;
-       GtkWidget *page;
-       
-       page = create_page (wizard, title);
-       label = gtk_label_new (text);
-       gtk_box_pack_start (GTK_BOX(page), label, TRUE, TRUE, 0);
-
-       return page;
-}
-
 #define GTK_TABLE_ADD_ROW_AT(table,text,entry,i) {                           \
        GtkWidget *label = gtk_label_new(text);                               \
        gtk_table_attach(GTK_TABLE(table), label,                             \