sync with 0.8.6cvs5
[claws.git] / src / prefs_common.c
index 37f7c203d3e5bd944d1c516af289fe9419e8d917..74f0dc9c8528b8d771d4b9e58bd9fb65dd348c4e 100644 (file)
@@ -121,6 +121,7 @@ static struct Compose {
        GtkWidget *checkbtn_forward_account_autosel;
        GtkWidget *checkbtn_reedit_account_autosel;
        GtkWidget *checkbtn_quote;
+       GtkWidget *checkbtn_default_reply_list;
        GtkWidget *checkbtn_forward_as_attachment;
        GtkWidget *checkbtn_redirect_keep_from;
        GtkWidget *checkbtn_smart_wrapping;
@@ -164,7 +165,6 @@ static struct Display {
        GtkWidget *entry_boldfont;
 
        GtkWidget *chkbtn_folder_unread;
-       GtkWidget *chkbtn_display_img;
        GtkWidget *entry_ng_abbrev_len;
        GtkWidget *spinbtn_ng_abbrev_len;
        GtkObject *spinbtn_ng_abbrev_len_adj;
@@ -193,6 +193,9 @@ static struct Message {
        GtkWidget *spinbtn_scrollstep;
        GtkObject *spinbtn_scrollstep_adj;
        GtkWidget *chkbtn_halfpage;
+
+       GtkWidget *chkbtn_display_img;
+       GtkWidget *chkbtn_resize_image;
 } message;
 
 #if USE_GPGME
@@ -433,6 +436,10 @@ static PrefParam param[] = {
         &compose.checkbtn_reedit_account_autosel,
         prefs_set_data_from_toggle, prefs_set_toggle},
 
+       {"default_reply_list", "TRUE", &prefs_common.default_reply_list, P_BOOL,
+        &compose.checkbtn_default_reply_list,
+        prefs_set_data_from_toggle, prefs_set_toggle},
+
        {"show_ruler", "TRUE", &prefs_common.show_ruler, P_BOOL,
         NULL, NULL, NULL},
 
@@ -481,10 +488,6 @@ static PrefParam param[] = {
         &display.chkbtn_folder_unread,
         prefs_set_data_from_toggle, prefs_set_toggle},
 
-       {"display_img", "TRUE",
-        &prefs_common.display_img, P_BOOL,
-        &display.chkbtn_display_img,
-        prefs_set_data_from_toggle, prefs_set_toggle},
        {"newsgroup_abbrev_len", "16",
         &prefs_common.ng_abbrev_len, P_INT,
         &display.spinbtn_ng_abbrev_len,
@@ -681,6 +684,13 @@ static PrefParam param[] = {
         &message.chkbtn_halfpage,
         prefs_set_data_from_toggle, prefs_set_toggle},
 
+       {"display_img", "TRUE", &prefs_common.display_img, P_BOOL,
+        &message.chkbtn_display_img,
+        prefs_set_data_from_toggle, prefs_set_toggle},
+       {"resize_image", "TRUE", &prefs_common.resize_image, P_BOOL,
+        &message.chkbtn_resize_image,
+        prefs_set_data_from_toggle, prefs_set_toggle},
+
        {"show_other_header", "FALSE", &prefs_common.show_other_header, P_BOOL,
         NULL, NULL, NULL},
 
@@ -818,8 +828,10 @@ static PrefParam param[] = {
 static void prefs_common_create                (void);
 static void prefs_receive_create       (void);
 static void prefs_send_create          (void);
-static void prefs_compose_create       (void);
+#ifdef USE_ASPELL
 static void prefs_spelling_create      (void);
+#endif
+static void prefs_compose_create       (void);
 static void prefs_quote_create         (void);
 static void prefs_display_create       (void);
 static void prefs_message_create       (void);
@@ -896,7 +908,6 @@ static void prefs_common_apply              (void);
 static void prefs_common_cancel                (void);
 
 void prefs_common_init() {
-       prefs_common.fltlist = NULL;
        prefs_common.disphdr_list = NULL;
 }
 
@@ -1733,6 +1744,8 @@ static void prefs_compose_create(void)
        GtkWidget *checkbtn_autowrap;
        GtkWidget *checkbtn_wrapatsend;
 
+       GtkWidget *checkbtn_default_reply_list;
+
        GtkWidget *checkbtn_forward_as_attachment;
        GtkWidget *checkbtn_redirect_keep_from;
        GtkWidget *checkbtn_smart_wrapping;
@@ -1791,6 +1804,9 @@ static void prefs_compose_create(void)
        gtk_widget_show (vbox2);
        gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
 
+       PACK_CHECK_BUTTON (vbox2, checkbtn_default_reply_list,
+                          _("Reply button invokes mailing list reply"));
+
        PACK_CHECK_BUTTON (vbox2, checkbtn_autoextedit,
                           _("Automatically launch the external editor"));
 
@@ -1917,7 +1933,7 @@ static void prefs_compose_create(void)
                checkbtn_smart_wrapping;
        compose.checkbtn_block_cursor   =
                checkbtn_block_cursor;
-
+       compose.checkbtn_default_reply_list = checkbtn_default_reply_list;
 }
 
 static void prefs_quote_create(void)
@@ -2084,7 +2100,6 @@ static void prefs_display_create(void)
        GtkWidget *label_textfont;
        GtkWidget *entry_textfont;
        GtkWidget *button_textfont;
-       GtkWidget *chkbtn_display_img;
        GtkWidget *chkbtn_transhdr;
        GtkWidget *chkbtn_folder_unread;
        GtkWidget *hbox1;
@@ -2207,9 +2222,6 @@ static void prefs_display_create(void)
        PACK_CHECK_BUTTON (vbox2, chkbtn_folder_unread,
                           _("Display unread number next to folder name"));
 
-       PACK_CHECK_BUTTON (vbox2, chkbtn_display_img,
-                          _("Automatically display images"));
-
        PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
 
        hbox1 = gtk_hbox_new (FALSE, 8);
@@ -2287,7 +2299,7 @@ static void prefs_display_create(void)
        gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
 
        button_dispitem = gtk_button_new_with_label
-               (_(" Set display item of summary... "));
+               (_(" Set displayed items of summary... "));
        gtk_widget_show (button_dispitem);
        gtk_box_pack_start (GTK_BOX (hbox1), button_dispitem, FALSE, TRUE, 0);
        gtk_signal_connect (GTK_OBJECT (button_dispitem), "clicked",
@@ -2297,7 +2309,6 @@ static void prefs_display_create(void)
        display.entry_textfont  = entry_textfont;
        display.button_textfont = button_textfont;
 
-       display.chkbtn_display_img   = chkbtn_display_img;
        display.chkbtn_transhdr           = chkbtn_transhdr;
        display.chkbtn_folder_unread      = chkbtn_folder_unread;
        display.spinbtn_ng_abbrev_len     = spinbtn_ng_abbrev_len;
@@ -2338,6 +2349,9 @@ static void prefs_message_create(void)
        GtkWidget *spinbtn_scrollstep;
        GtkWidget *chkbtn_halfpage;
 
+       GtkWidget *chkbtn_display_img;
+       GtkWidget *chkbtn_resize_image;
+
        vbox1 = gtk_vbox_new (FALSE, VSPACING);
        gtk_widget_show (vbox1);
        gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
@@ -2458,6 +2472,16 @@ static void prefs_message_create(void)
 
        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_display_img,
+                          _("Automatically display attached images"));
+
+       PACK_CHECK_BUTTON(vbox3, chkbtn_resize_image,
+                         _("Resize attached images"));
+
        message.chkbtn_enablecol   = chkbtn_enablecol;
        message.button_edit_col    = button_edit_col;
        message.chkbtn_mbalnum     = chkbtn_mbalnum;
@@ -2470,6 +2494,9 @@ static void prefs_message_create(void)
        message.spinbtn_scrollstep     = spinbtn_scrollstep;
        message.spinbtn_scrollstep_adj = spinbtn_scrollstep_adj;
        message.chkbtn_halfpage        = chkbtn_halfpage;
+
+       message.chkbtn_display_img  = chkbtn_display_img;
+       message.chkbtn_resize_image = chkbtn_resize_image;
 }
 
 #if USE_GPGME
@@ -2946,6 +2973,9 @@ static void prefs_other_create(void)
        gtk_box_pack_start (GTK_BOX (hbox_cliplog), loglength_entry,
                            FALSE, TRUE, 0);
        gtk_widget_show (GTK_WIDGET (loglength_entry));
+       loglength_label = gtk_label_new (_("(0 to stop logging in the log window)"));
+       gtk_box_pack_start (GTK_BOX (hbox_cliplog), loglength_label,
+                           FALSE, TRUE, 0);
        SET_TOGGLE_SENSITIVITY(checkbtn_cliplog, loglength_entry);
 
        /* On Exit */
@@ -3804,7 +3834,7 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                "(menu-path \"<Main>/View/Go to/Other folder...\" \"G\")\n"
                "(menu-path \"<Main>/View/Open in new window\" \"<control><alt>N\")\n"
                "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
-               "(menu-path \"<Main>/View/Show all header\" \"<control>H\")\n"
+               "(menu-path \"<Main>/View/Show all headers\" \"<control>H\")\n"
                "(menu-path \"<Main>/View/Update\" \"<control><alt>U\")\n"
 
                "(menu-path \"<Main>/Message/Get new mail\" \"<control>I\")\n"
@@ -3857,7 +3887,7 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                "(menu-path \"<Main>/View/Go to/Other folder...\" \"G\")\n"
                "(menu-path \"<Main>/View/Open in new window\" \"<control><alt>N\")\n"
                "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
-               "(menu-path \"<Main>/View/Show all header\" \"<shift>H\")\n"
+               "(menu-path \"<Main>/View/Show all headers\" \"<shift>H\")\n"
                "(menu-path \"<Main>/View/Update\" \"<shift>S\")\n"
 
                "(menu-path \"<Main>/Message/Get new mail\" \"<control>I\")\n"
@@ -3909,7 +3939,7 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                "(menu-path \"<Main>/View/Go to/Other folder...\" \"C\")\n"
                "(menu-path \"<Main>/View/Open in new window\" \"<control><alt>N\")\n"
                "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
-               "(menu-path \"<Main>/View/Show all header\" \"<control>H\")\n"
+               "(menu-path \"<Main>/View/Show all headers\" \"<control>H\")\n"
                "(menu-path \"<Main>/View/Update\" \"<control><alt>U\")\n"
 
                "(menu-path \"<Main>/Message/Get new mail\" \"<control>I\")\n"
@@ -3962,7 +3992,7 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                "(menu-path \"<Main>/View/Go to/Other folder...\" \"<alt>G\")\n"
                "(menu-path \"<Main>/View/Open in new window\" \"<shift><control>N\")\n"
                "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
-               "(menu-path \"<Main>/View/Show all header\" \"<control>H\")\n"
+               "(menu-path \"<Main>/View/Show all headers\" \"<control>H\")\n"
                "(menu-path \"<Main>/View/Update\" \"<alt>U\")\n"
 
                "(menu-path \"<Main>/Message/Get new mail\" \"<alt>I\")\n"
@@ -4015,7 +4045,7 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
                "(menu-path \"<Main>/View/Go to/Other folder...\" \"\")\n"
                "(menu-path \"<Main>/View/Open in new window\" \"\")\n"
                "(menu-path \"<Main>/View/View source\" \"\")\n"
-               "(menu-path \"<Main>/View/Show all header\" \"\")\n"
+               "(menu-path \"<Main>/View/Show all headers\" \"\")\n"
                "(menu-path \"<Main>/View/Update\" \"\")\n"
 
                "(menu-path \"<Main>/Message/Get new mail\" \"\")\n"
@@ -4083,30 +4113,20 @@ static void prefs_common_charset_set_data_from_optmenu(PrefParam *pparam)
 
 static void prefs_common_charset_set_optmenu(PrefParam *pparam)
 {
-       GList *cur;
        GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
-       GtkWidget *menu;
-       GtkWidget *menuitem;
-       gchar *charset;
-       gint n = 0;
+       gint index;
 
        g_return_if_fail(optmenu != NULL);
        g_return_if_fail(*((gchar **)pparam->data) != NULL);
 
-       menu = gtk_option_menu_get_menu(optmenu);
-       for (cur = GTK_MENU_SHELL(menu)->children;
-            cur != NULL; cur = cur->next) {
-               menuitem = GTK_WIDGET(cur->data);
-               charset = gtk_object_get_user_data(GTK_OBJECT(menuitem));
-               if (!strcmp(charset, *((gchar **)pparam->data))) {
-                       gtk_option_menu_set_history(optmenu, n);
-                       return;
-               }
-               n++;
+       index = menu_find_option_menu_index(optmenu, *((gchar **)pparam->data),
+                                           (GCompareFunc)strcmp);
+       if (index >= 0)
+               gtk_option_menu_set_history(optmenu, index);
+       else {
+               gtk_option_menu_set_history(optmenu, 0);
+               prefs_common_charset_set_data_from_optmenu(pparam);
        }
-
-       gtk_option_menu_set_history(optmenu, 0);
-       prefs_common_charset_set_data_from_optmenu(pparam);
 }
 
 static void prefs_common_recv_dialog_set_data_from_optmenu(PrefParam *pparam)