2005-04-29 [colin] 1.9.6cvs46
[claws.git] / src / prefs_common.c
index b877860954293372faf43b98edca3b5a916f12c4..7ab00fb320e14bdf91ebd31c56662e3bace833cb 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2004 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2005 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -24,6 +24,7 @@
 #include "defs.h"
 
 #include <glib.h>
+#include <glib/gi18n.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 #include <stdio.h>
@@ -34,7 +35,6 @@
 #include <sys/stat.h>
 #include <errno.h>
 
-#include "intl.h"
 #include "main.h"
 #include "prefs_gtk.h"
 #include "prefs_common.h"
 #include "quote_fmt.h"
 #include "prefswindow.h"
 
+enum {
+       DATEFMT_FMT,
+       DATEFMT_TXT,
+       N_DATEFMT_COLUMNS
+};
+
 PrefsCommon prefs_common;
 
 GtkWidget *notebook;
@@ -141,9 +147,9 @@ static struct Message {
        GtkWidget *chkbtn_mbalnum;
        GtkWidget *chkbtn_disphdrpane;
        GtkWidget *chkbtn_disphdr;
+       GtkWidget *chkbtn_html;
        GtkWidget *spinbtn_linespc;
        GtkObject *spinbtn_linespc_adj;
-       GtkWidget *chkbtn_headspc;
 
        GtkWidget *chkbtn_smoothscroll;
        GtkWidget *spinbtn_scrollstep;
@@ -374,7 +380,7 @@ static PrefParam param[] = {
        /* new fonts */
        {"widget_font_gtk2",    NULL,
          &prefs_common.widgetfont,             P_STRING, NULL, NULL, NULL},
-       {"message_font_gtk2",   "fixed 9",
+       {"message_font_gtk2",   "Monospace 9",
         &prefs_common.textfont,                P_STRING, NULL, NULL, NULL},
        {"small_font_gtk2",     "Sans 9",
          &prefs_common.smallfont,              P_STRING, NULL, NULL, NULL},
@@ -383,6 +389,14 @@ static PrefParam param[] = {
        {"normal_font_gtk2",    "Sans 9", 
          &prefs_common.normalfont,             P_STRING, NULL, NULL, NULL},
 
+       /* image viewer */
+       {"display_image", "TRUE", &prefs_common.display_img, P_BOOL,
+        NULL, NULL, NULL},
+       {"resize_image", "TRUE", &prefs_common.resize_img, P_BOOL,
+        NULL, NULL, NULL},
+       {"inline_image", "TRUE", &prefs_common.inline_img, P_BOOL,
+        NULL, NULL, NULL},
+
        {"display_folder_unread_num", "TRUE",
         &prefs_common.display_folder_unread, P_BOOL,
         &display.chkbtn_folder_unread,
@@ -590,12 +604,12 @@ static PrefParam param[] = {
        {"display_header", "TRUE", &prefs_common.display_header, P_BOOL,
         &message.chkbtn_disphdr,
         prefs_set_data_from_toggle, prefs_set_toggle},
+       {"render_html", "TRUE", &prefs_common.render_html, P_BOOL,
+        &message.chkbtn_html,
+        prefs_set_data_from_toggle, prefs_set_toggle},
        {"line_space", "2", &prefs_common.line_space, P_INT,
         &message.spinbtn_linespc,
         prefs_set_data_from_spinbtn, prefs_set_spinbtn},
-       {"enable_head_space", "FALSE", &prefs_common.head_space, P_BOOL,
-        &message.chkbtn_headspc,
-        prefs_set_data_from_toggle, prefs_set_toggle},
 
        {"enable_smooth_scroll", "FALSE",
         &prefs_common.enable_smooth_scroll, P_BOOL,
@@ -702,6 +716,8 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"summary_quicksearch_sticky", "1", &prefs_common.summary_quicksearch_sticky, P_INT,
         NULL, NULL, NULL},
+       {"summary_quicksearch_recurse", "1", &prefs_common.summary_quicksearch_recurse, P_INT,
+        NULL, NULL, NULL},
 
        {"io_timeout_secs", "60", &prefs_common.io_timeout_secs,
         P_INT, &other.spinbtn_iotimeout,
@@ -725,6 +741,11 @@ static PrefParam param[] = {
        {"color_new", "179", &prefs_common.color_new, P_COLOR,
         NULL, NULL, NULL},
 
+       {"filteringwin_width", "500", &prefs_common.filteringwin_width, P_INT,
+        NULL, NULL, NULL},
+       {"filteringwin_height", "-1", &prefs_common.filteringwin_height, P_INT,
+        NULL, NULL, NULL},
+
        {NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
 };
 
@@ -751,11 +772,10 @@ static gboolean date_format_on_delete             (GtkWidget      *dialogwidget,
                                                 GtkWidget     **widget);
 static void date_format_entry_on_change                (GtkEditable    *editable,
                                                 GtkLabel       *example);
-static void date_format_select_row             (GtkWidget      *date_format_list,
-                                                gint            row,
-                                                gint            column,
-                                                GdkEventButton *event,
-                                                GtkWidget      *date_format);
+static void date_format_select_row             (GtkTreeView *list_view,
+                                                GtkTreePath *path,
+                                                GtkTreeViewColumn *column,
+                                                GtkWidget *date_format);
 static GtkWidget *date_format_create            (GtkButton      *button,
                                                  void           *data);
 
@@ -793,7 +813,7 @@ static void create_widget_func(PrefsPage * _page,
        if (notebook == NULL)
                prefs_common_create();
        gtk_box_pack_start (GTK_BOX (vbox), notebook, TRUE, TRUE, 0);
-       gtk_notebook_set_page(GTK_NOTEBOOK(notebook), 0);
+       gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook), 0);
 
        prefs_set_dialog(param);
 
@@ -869,8 +889,12 @@ GList *prefs_common_read_history(const gchar *history)
 
 void prefs_common_read_config(void)
 {
-       prefs_read_config(param, "Common", COMMON_RC);
-
+       gchar *rcpath;
+       
+       rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMON_RC, NULL);
+       prefs_read_config(param, "Common", rcpath, NULL);
+       g_free(rcpath);
+       
        prefs_common.mime_open_cmd_history =
                prefs_common_read_history(COMMAND_HISTORY);
        prefs_common.summary_quicksearch_history =
@@ -1204,7 +1228,7 @@ static void prefs_send_create(void)
        gtk_widget_show (hbox1);
        gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
 
-       label_outcharset = gtk_label_new (_("Outgoing codeset"));
+       label_outcharset = gtk_label_new (_("Outgoing encoding"));
        gtk_widget_show (label_outcharset);
        gtk_box_pack_start (GTK_BOX (hbox1), label_outcharset, FALSE, FALSE, 0);
 
@@ -1226,37 +1250,44 @@ static void prefs_send_create(void)
 }
 
        SET_MENUITEM(_("Automatic (Recommended)"),       CS_AUTO);
+       SET_MENUITEM(NULL, NULL);
        SET_MENUITEM(_("7bit ascii (US-ASCII)"),         CS_US_ASCII);
-#if HAVE_ICONV
+       SET_MENUITEM(NULL, NULL);
        SET_MENUITEM(_("Unicode (UTF-8)"),               CS_UTF_8);
-#endif
+       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);
-#if HAVE_ICONV
+       SET_MENUITEM(NULL, NULL);
        SET_MENUITEM(_("Cyrillic (ISO-8859-5)"),          CS_ISO_8859_5);
-#endif
        SET_MENUITEM(_("Cyrillic (KOI8-R)"),             CS_KOI8_R);
-#if HAVE_ICONV
-       SET_MENUITEM(_("Cyrillic (Windows-1251)"),       CS_WINDOWS_1251);
        SET_MENUITEM(_("Cyrillic (KOI8-U)"),             CS_KOI8_U);
-#endif
+       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);
 
@@ -1502,15 +1533,18 @@ static void prefs_quote_create(void)
 
        scrolledwin_quotefmt = gtk_scrolled_window_new (NULL, NULL);
        gtk_widget_show (scrolledwin_quotefmt);
-       gtk_box_pack_start (GTK_BOX (vbox_quote), scrolledwin_quotefmt, TRUE, TRUE, 0);
+       gtk_box_pack_start (GTK_BOX (vbox_quote), scrolledwin_quotefmt,
+                           TRUE, TRUE, 0);
        gtk_scrolled_window_set_policy
                (GTK_SCROLLED_WINDOW (scrolledwin_quotefmt),
                 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+       gtk_scrolled_window_set_shadow_type
+               (GTK_SCROLLED_WINDOW (scrolledwin_quotefmt), GTK_SHADOW_IN);
 
        text_quotefmt = gtk_text_view_new ();
        gtk_widget_show (text_quotefmt);
        gtk_container_add(GTK_CONTAINER(scrolledwin_quotefmt), text_quotefmt);
-       gtk_text_view_set_editable (GTK_TEXT_VIEW(text_quotefmt), TRUE);
+       gtk_text_view_set_editable (GTK_TEXT_VIEW (text_quotefmt), TRUE);
        gtk_widget_set_size_request(text_quotefmt, -1, 60);
 
        /* forward */
@@ -1542,17 +1576,20 @@ static void prefs_quote_create(void)
 
        scrolledwin_quotefmt = gtk_scrolled_window_new (NULL, NULL);
        gtk_widget_show (scrolledwin_quotefmt);
-       gtk_box_pack_start (GTK_BOX (vbox_quote), scrolledwin_quotefmt, TRUE, TRUE, 0);
+       gtk_box_pack_start (GTK_BOX (vbox_quote), scrolledwin_quotefmt,
+                           TRUE, TRUE, 0);
        gtk_scrolled_window_set_policy
                (GTK_SCROLLED_WINDOW (scrolledwin_quotefmt),
                 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+       gtk_scrolled_window_set_shadow_type
+               (GTK_SCROLLED_WINDOW (scrolledwin_quotefmt), GTK_SHADOW_IN);
 
        text_fw_quotefmt = gtk_text_view_new ();
        gtk_widget_show (text_fw_quotefmt);
        gtk_container_add(GTK_CONTAINER(scrolledwin_quotefmt),
                          text_fw_quotefmt);
        gtk_text_view_set_editable (GTK_TEXT_VIEW (text_fw_quotefmt), TRUE);
-       gtk_widget_set_size_request(text_fw_quotefmt, -1, 60);
+       gtk_widget_set_size_request (text_fw_quotefmt, -1, 60);
 
        hbox1 = gtk_hbox_new (FALSE, 32);
        gtk_widget_show (hbox1);
@@ -1738,11 +1775,11 @@ static void prefs_message_create(void)
        GtkWidget *chkbtn_disphdrpane;
        GtkWidget *chkbtn_disphdr;
        GtkWidget *button_edit_disphdr;
+       GtkWidget *chkbtn_html;
        GtkWidget *hbox_linespc;
        GtkWidget *label_linespc;
        GtkObject *spinbtn_linespc_adj;
        GtkWidget *spinbtn_linespc;
-       GtkWidget *chkbtn_headspc;
 
        GtkWidget *frame_scr;
        GtkWidget *vbox_scr;
@@ -1791,6 +1828,9 @@ static void prefs_message_create(void)
 
        SET_TOGGLE_SENSITIVITY(chkbtn_disphdr, button_edit_disphdr);
 
+       PACK_CHECK_BUTTON(vbox2, chkbtn_html,
+                         _("Render HTML messages as text"));
+
        PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
 
        hbox1 = gtk_hbox_new (FALSE, 32);
@@ -1820,8 +1860,6 @@ static void prefs_message_create(void)
        gtk_box_pack_start (GTK_BOX (hbox_linespc), label_linespc,
                            FALSE, FALSE, 0);
 
-       PACK_CHECK_BUTTON(hbox1, chkbtn_headspc, _("Indent text"));
-
        PACK_FRAME(vbox1, frame_scr, _("Scroll"));
 
        vbox_scr = gtk_vbox_new (FALSE, 0);
@@ -1871,8 +1909,8 @@ static void prefs_message_create(void)
        message.chkbtn_mbalnum     = chkbtn_mbalnum;
        message.chkbtn_disphdrpane = chkbtn_disphdrpane;
        message.chkbtn_disphdr     = chkbtn_disphdr;
+       message.chkbtn_html        = chkbtn_html;
        message.spinbtn_linespc    = spinbtn_linespc;
-       message.chkbtn_headspc     = chkbtn_headspc;
 
        message.chkbtn_smoothscroll    = chkbtn_smoothscroll;
        message.spinbtn_scrollstep     = spinbtn_scrollstep;
@@ -2226,7 +2264,7 @@ static void date_format_entry_on_change(GtkEditable *editable,
        g_free(text);
 
        text = conv_codeset_strdup(buffer,
-                                  conv_get_current_charset_str(),
+                                  conv_get_locale_charset_str(),
                                   CS_UTF_8);
        if (!text)
                text = g_strdup(buffer);
@@ -2236,8 +2274,9 @@ static void date_format_entry_on_change(GtkEditable *editable,
        g_free(text);
 }
 
-static void date_format_select_row(GtkWidget *date_format_list, gint row,
-                                  gint column, GdkEventButton *event,
+static void date_format_select_row(GtkTreeView *list_view,
+                                  GtkTreePath *path,
+                                  GtkTreeViewColumn *column,
                                   GtkWidget *date_format)
 {
        gint cur_pos;
@@ -2245,21 +2284,25 @@ static void date_format_select_row(GtkWidget *date_format_list, gint row,
        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 */
-       if (!event || event->type != GDK_2BUTTON_PRESS) return;
-
-
        datefmt_sample = GTK_WIDGET(g_object_get_data(G_OBJECT(date_format), 
                                                      "datefmt_sample"));
 
-       g_return_if_fail(date_format_list != NULL);
-       g_return_if_fail(date_format != NULL);
        g_return_if_fail(datefmt_sample != NULL);
 
-       /* get format from clist */
-       gtk_clist_get_text(GTK_CLIST(date_format_list), row, 0, &format);
+       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));
 
@@ -2280,9 +2323,10 @@ static void date_format_select_row(GtkWidget *date_format_list, gint row,
 static GtkWidget *date_format_create(GtkButton *button, void *data)
 {
        static GtkWidget *datefmt_win = NULL;
+
        GtkWidget *vbox1;
        GtkWidget *scrolledwindow1;
-       GtkWidget *datefmt_clist;
+       GtkWidget *datefmt_list_view;
        GtkWidget *table;
        GtkWidget *label1;
        GtkWidget *label2;
@@ -2291,6 +2335,7 @@ static GtkWidget *date_format_create(GtkButton *button, void *data)
        GtkWidget *ok_btn;
        GtkWidget *cancel_btn;
        GtkWidget *datefmt_entry;
+       GtkListStore *store;
 
        struct {
                gchar *fmt;
@@ -2322,6 +2367,10 @@ static GtkWidget *date_format_create(GtkButton *button, void *data)
        const gint TIME_FORMAT_ELEMS =
                sizeof time_format / sizeof time_format[0];
 
+       GtkCellRenderer *renderer;
+       GtkTreeViewColumn *column;
+       GtkTreeSelection *selection;
+
        time_format[0].txt  = _("the full abbreviated weekday name");
        time_format[1].txt  = _("the full weekday name");
        time_format[2].txt  = _("the abbreviated month name");
@@ -2344,6 +2393,21 @@ static GtkWidget *date_format_create(GtkButton *button, void *data)
 
        if (datefmt_win) return datefmt_win;
 
+       store = gtk_list_store_new(N_DATEFMT_COLUMNS,
+                                  G_TYPE_STRING,
+                                  G_TYPE_STRING,
+                                  -1);
+
+       for (i = 0; i < TIME_FORMAT_ELEMS; i++) {
+               GtkTreeIter iter;
+
+               gtk_list_store_append(store, &iter);
+               gtk_list_store_set(store, &iter,
+                                  DATEFMT_FMT, time_format[i].fmt,
+                                  DATEFMT_TXT, time_format[i].txt,
+                                  -1);
+       }
+
        datefmt_win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
        gtk_container_set_border_width(GTK_CONTAINER(datefmt_win), 8);
        gtk_window_set_title(GTK_WINDOW(datefmt_win), _("Date format"));
@@ -2361,23 +2425,32 @@ static GtkWidget *date_format_create(GtkButton *button, void *data)
        gtk_widget_show(scrolledwindow1);
        gtk_box_pack_start(GTK_BOX(vbox1), scrolledwindow1, TRUE, TRUE, 0);
 
-       titles[0] = _("Specifier");
-       titles[1] = _("Description");
-       datefmt_clist = gtk_clist_new_with_titles(2, titles);
-       gtk_widget_show(datefmt_clist);
-       gtk_container_add(GTK_CONTAINER(scrolledwindow1), datefmt_clist);
-       /* gtk_clist_set_column_width(GTK_CLIST(datefmt_clist), 0, 80); */
-       gtk_clist_set_selection_mode(GTK_CLIST(datefmt_clist),
-                                    GTK_SELECTION_BROWSE);
+       datefmt_list_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
+       g_object_unref(G_OBJECT(store));
+       gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(datefmt_list_view), TRUE);
+       gtk_widget_show(datefmt_list_view);
+       gtk_container_add(GTK_CONTAINER(scrolledwindow1), datefmt_list_view);
 
-       for (i = 0; i < TIME_FORMAT_ELEMS; i++) {
-               gchar *text[2];
-               /* phoney casting necessary because of gtk... */
-               text[0] = (gchar *)time_format[i].fmt;
-               text[1] = (gchar *)time_format[i].txt;
-               gtk_clist_append(GTK_CLIST(datefmt_clist), text);
-       }
+       renderer = gtk_cell_renderer_text_new();
+       column = gtk_tree_view_column_new_with_attributes
+                       (_("Specifier"), renderer, "text", DATEFMT_FMT,
+                        NULL);
+       gtk_tree_view_append_column(GTK_TREE_VIEW(datefmt_list_view), column);
+       
+       renderer = gtk_cell_renderer_text_new();
+       column = gtk_tree_view_column_new_with_attributes
+                       (_("Description"), renderer, "text", DATEFMT_TXT,
+                        NULL);
+       gtk_tree_view_append_column(GTK_TREE_VIEW(datefmt_list_view), column);
+       
+       /* gtk_clist_set_column_width(GTK_CLIST(datefmt_clist), 0, 80); */
+       selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(datefmt_list_view));
+       gtk_tree_selection_set_mode(selection, GTK_SELECTION_BROWSE);
 
+       g_signal_connect(G_OBJECT(datefmt_list_view), "row_activated", 
+                        G_CALLBACK(date_format_select_row),
+                        datefmt_win);
+       
        table = gtk_table_new(2, 2, FALSE);
        gtk_widget_show(table);
        gtk_box_pack_start(GTK_BOX(vbox1), table, FALSE, FALSE, 0);
@@ -2416,12 +2489,12 @@ static GtkWidget *date_format_create(GtkButton *button, void *data)
        gtk_label_set_justify(GTK_LABEL(label3), GTK_JUSTIFY_LEFT);
        gtk_misc_set_alignment(GTK_MISC(label3), 0, 0.5);
 
-       gtkut_button_set_create(&confirm_area, &ok_btn, _("OK"),
-                               &cancel_btn, _("Cancel"), NULL, NULL);
-       gtk_widget_grab_default(ok_btn);
-       gtk_widget_show(confirm_area);
+       gtkut_stock_button_set_create(&confirm_area, &ok_btn, GTK_STOCK_OK,
+                               &cancel_btn, GTK_STOCK_CANCEL, NULL, NULL);
 
        gtk_box_pack_start(GTK_BOX(vbox1), confirm_area, FALSE, FALSE, 0);
+       gtk_widget_show(confirm_area);
+       gtk_widget_grab_default(ok_btn);
 
        /* set the current format */
        gtk_entry_set_text(GTK_ENTRY(datefmt_entry), prefs_common.date_format);
@@ -2444,10 +2517,6 @@ static GtkWidget *date_format_create(GtkButton *button, void *data)
                         G_CALLBACK(date_format_entry_on_change),
                         label3);
 
-       g_signal_connect(G_OBJECT(datefmt_clist), "select_row",
-                        G_CALLBACK(date_format_select_row),
-                        datefmt_win);
-
        gtk_window_set_position(GTK_WINDOW(datefmt_win), GTK_WIN_POS_CENTER);
        gtk_window_set_modal(GTK_WINDOW(datefmt_win), TRUE);
 
@@ -2515,8 +2584,9 @@ static void prefs_keybind_select(void)
        hbox1 = gtk_hbox_new (FALSE, 8);
        gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
 
-       gtkut_button_set_create (&confirm_area, &ok_btn, _("OK"),
-                                &cancel_btn, _("Cancel"), NULL, NULL);
+       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);
 
@@ -2588,7 +2658,7 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
        gint n_menurc;
 
        static struct KeyBind default_menurc[] = {
-               {"<Main>/File/Empty trash",                     ""},
+               {"<Main>/File/Empty all Trash folders",         ""},
                {"<Main>/File/Save as...",                      "<control>S"},
                {"<Main>/File/Print...",                        ""},
                {"<Main>/File/Exit",                            "<control>Q"},
@@ -2598,8 +2668,7 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                {"<Main>/Edit/Find in current message...",      "<control>F"},
                {"<Main>/Edit/Search folder...",                "<shift><control>F"},
 
-               {"<Main>/View/Expand Summary View",             "V"},
-               {"<Main>/View/Expand Message View",             "<shift>V"},
+               {"<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"},
@@ -2607,12 +2676,13 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                {"<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/View source",                     "<control>U"},
+               {"<Main>/View/Message source",                  "<control>U"},
                {"<Main>/View/Show all headers",                "<control>H"},
-               {"<Main>/View/Update",                          "<control><alt>U"},
+               {"<Main>/View/Update summary",                  "<control><alt>U"},
 
-               {"<Main>/Message/Receive/Get new mail",         "<control>I"},
-               {"<Main>/Message/Receive/Get from all accounts",        "<shift><control>I"},
+               {"<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"},
@@ -2632,7 +2702,7 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                {"<Main>/Tools/Execute",                        "X"},
                {"<Main>/Tools/Log window",                     "<shift><control>L"},
 
-               {"<Compose>/File/Close",                                "<control>W"},
+               {"<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",         ""},
@@ -2642,7 +2712,7 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
        };
 
        static struct KeyBind mew_wl_menurc[] = {
-               {"<Main>/File/Empty trash",                     "<shift>D"},
+               {"<Main>/File/Empty all Trash folders",                 "<shift>D"},
                {"<Main>/File/Save as...",                      "Y"},
                {"<Main>/File/Print...",                        "<shift>numbersign"},
                {"<Main>/File/Exit",                            "<shift>Q"},
@@ -2652,8 +2722,7 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                {"<Main>/Edit/Find in current message...",      "<control>F"},
                {"<Main>/Edit/Search folder...",                "<control>S"},
 
-               {"<Main>/View/Expand Summary View",             ""},
-               {"<Main>/View/Expand Message View",             ""},
+               {"<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"},
@@ -2661,12 +2730,13 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                {"<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/View source",                     "<control>U"},
+               {"<Main>/View/Message source",                  "<control>U"},
                {"<Main>/View/Show all headers",                "<shift>H"},
-               {"<Main>/View/Update",                          "<shift>S"},
+               {"<Main>/View/Update summary",                  "<shift>S"},
 
-               {"<Main>/Message/Receive/Get new mail",         "<control>I"},
-               {"<Main>/Message/Receive/Get from all accounts",        "<shift><control>I"},
+               {"<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"},
@@ -2686,7 +2756,7 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                {"<Main>/Tools/Execute",                        "X"},
                {"<Main>/Tools/Log window",                     "<shift><control>L"},
 
-               {"<Compose>/File/Close",                                "<alt>W"},
+               {"<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"},
@@ -2696,7 +2766,7 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
        };
 
        static struct KeyBind mutt_menurc[] = {
-               {"<Main>/File/Empty trash",                     ""},
+               {"<Main>/File/Empty all Trash folders",         ""},
                {"<Main>/File/Save as...",                      "S"},
                {"<Main>/File/Print...",                        "P"},
                {"<Main>/File/Exit",                            "Q"},
@@ -2706,7 +2776,7 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                {"<Main>/Edit/Find in current message...",      "<control>F"},
                {"<Main>/Edit/Search messages...",              "slash"},
 
-               {"<Main>/View/Toggle summary view",             "V"},
+               {"<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",              ""},
@@ -2714,12 +2784,13 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                {"<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/View source",                     "<control>U"},
+               {"<Main>/View/Message source",                  "<control>U"},
                {"<Main>/View/Show all headers",                "<control>H"},
-               {"<Main>/View/Update",                          "<control><alt>U"},
+               {"<Main>/View/Update summary",                          "<control><alt>U"},
 
-               {"<Main>/Message/Receive/Get new mail",                 "<control>I"},
-               {"<Main>/Message/Receive/Get from all accounts",        "<shift><control>I"},
+               {"<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"},
@@ -2739,7 +2810,7 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                {"<Main>/Tools/Execute",                        "X"},
                {"<Main>/Tools/Log window",                     "<shift><control>L"},
 
-               {"<Compose>/File/Close",                                "<alt>W"},
+               {"<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"},
@@ -2749,7 +2820,7 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
        };
 
        static struct KeyBind old_sylpheed_menurc[] = {
-               {"<Main>/File/Empty trash",                     ""},
+               {"<Main>/File/Empty all Trash folders",         ""},
                {"<Main>/File/Save as...",                      ""},
                {"<Main>/File/Print...",                        "<alt>P"},
                {"<Main>/File/Exit",                            "<alt>Q"},
@@ -2759,8 +2830,7 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                {"<Main>/Edit/Find in current message...",      "<control>F"},
                {"<Main>/Edit/Search folder...",                "<control>S"},
 
-               {"<Main>/View/Expand Summary View",             ""},
-               {"<Main>/View/Expand Message View",             ""},
+               {"<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"},
@@ -2768,12 +2838,13 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                {"<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/View source",                     "<control>U"},
+               {"<Main>/View/Message source",                  "<control>U"},
                {"<Main>/View/Show all headers",                "<control>H"},
-               {"<Main>/View/Update",                          "<alt>U"},
+               {"<Main>/View/Update summary",                  "<alt>U"},
 
-               {"<Main>/Message/Receive/Get new mail",                 "<alt>I"},
-               {"<Main>/Message/Receive/Get from all accounts",        "<shift><alt>I"},
+               {"<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"},
@@ -2793,7 +2864,7 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                {"<Main>/Tools/Execute",                        "<alt>X"},
                {"<Main>/Tools/Log window",                     "<alt>L"},
 
-               {"<Compose>/File/Close",                                "<alt>W"},
+               {"<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"},
@@ -2850,7 +2921,7 @@ static void prefs_common_charset_set_optmenu(PrefParam *pparam)
        g_return_if_fail(*((gchar **)pparam->data) != NULL);
 
        index = menu_find_option_menu_index(optmenu, *((gchar **)pparam->data),
-                                           (GCompareFunc)strcmp);
+                                           (GCompareFunc)strcmp2);
        if (index >= 0)
                gtk_option_menu_set_history(optmenu, index);
        else {