Fixed log clipping bug #616795
[claws.git] / src / prefs_common.c
index f4e39cdbd1aac6f3a36c2329ec9999dd485ba23b..fb47a04d5def58ec3277ecc525909ef93b30151b 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;
@@ -433,6 +434,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},
 
@@ -795,7 +800,7 @@ static PrefParam param[] = {
        {"work_offline", "FALSE", &prefs_common.work_offline, P_BOOL,
         NULL, NULL, NULL},
 
-       {"kill_score", "-9999", &prefs_common.kill_score, P_INT,
+       {"hide_score", "-9999", &prefs_common.kill_score, P_INT,
         NULL, NULL, NULL},
        {"important_score", "1", &prefs_common.important_score, P_INT,
         NULL, NULL, NULL},
@@ -818,8 +823,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 +903,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 +1739,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 +1799,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 +1928,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)
@@ -2287,7 +2298,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",
@@ -2946,6 +2957,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,15 +3818,16 @@ 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"
                "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><control>I\")\n"
                "(menu-path \"<Main>/Message/Compose an email message\" \"<control>M\")\n"
                "(menu-path \"<Main>/Message/Reply\" \"<control>R\")\n"
-               "(menu-path \"<Main>/Message/Reply to sender\" \"\")\n"
-               "(menu-path \"<Main>/Message/Reply to all\" \"<shift><control>R\")\n"
+               "(menu-path \"<Main>/Message/Reply to/all\" \"<shift><control>R\")\n"
+               "(menu-path \"<Main>/Message/Reply to/sender\" \"\")\n"
+               "(menu-path \"<Main>/Message/Reply to/mailing list\" \"<control>L\")\n"
                "(menu-path \"<Main>/Message/Forward\" \"<control><alt>F\")\n"
                /* "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n" */
                "(menu-path \"<Main>/Message/Move...\" \"<control>O\")\n"
@@ -3825,7 +3840,7 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
 
                "(menu-path \"<Main>/Tools/Address book\" \"<shift><control>A\")\n"
                "(menu-path \"<Main>/Tools/Execute\" \"X\")\n"
-               "(menu-path \"<Main>/Tools/Log window\" \"<control>L\")\n"
+               "(menu-path \"<Main>/Tools/Log window\" \"<shift><control>L\")\n"
 
                "(menu-path \"<Compose>/File/Close\" \"<control>W\")\n"
                "(menu-path \"<Compose>/Edit/Select all\" \"<control>A\")\n"
@@ -3856,15 +3871,16 @@ 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"
                "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><control>I\")\n"
                "(menu-path \"<Main>/Message/Compose an email message\" \"W\")\n"
                "(menu-path \"<Main>/Message/Reply\" \"<control>R\")\n"
-               "(menu-path \"<Main>/Message/Reply to sender\" \"\")\n"
-               "(menu-path \"<Main>/Message/Reply to all\" \"<shift>A\")\n"
+               "(menu-path \"<Main>/Message/Reply to/all\" \"<shift>A\")\n"
+               "(menu-path \"<Main>/Message/Reply to/sender\" \"\")\n"
+               "(menu-path \"<Main>/Message/Reply to/mailing list\" \"<control>L\")\n"
                "(menu-path \"<Main>/Message/Forward\" \"F\")\n"
                /* "(menu-path \"<Main>/Message/Forward as attachment\" \"<shift>F\")\n" */
                "(menu-path \"<Main>/Message/Move...\" \"O\")\n"
@@ -3877,7 +3893,7 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
 
                "(menu-path \"<Main>/Tools/Address book\" \"<shift><control>A\")\n"
                "(menu-path \"<Main>/Tools/Execute\" \"X\")\n"
-               "(menu-path \"<Main>/Tools/Log window\" \"<control>L\")\n"
+               "(menu-path \"<Main>/Tools/Log window\" \"<shift><control>L\")\n"
 
                "(menu-path \"<Compose>/File/Close\" \"<alt>W\")\n"
                "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
@@ -3907,15 +3923,16 @@ 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"
                "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><control>I\")\n"
                "(menu-path \"<Main>/Message/Compose new message\" \"M\")\n"
                "(menu-path \"<Main>/Message/Reply\" \"R\")\n"
-               "(menu-path \"<Main>/Message/Reply to all\" \"G\")\n"
-               "(menu-path \"<Main>/Message/Reply to sender\" \"\")\n"
+               "(menu-path \"<Main>/Message/Reply to/all\" \"G\")\n"
+               "(menu-path \"<Main>/Message/Reply to/sender\" \"\")\n"
+               "(menu-path \"<Main>/Message/Reply to/mailing list\" \"<control>L\")\n"
                "(menu-path \"<Main>/Message/Forward\" \"F\")\n"
                "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n"
                "(menu-path \"<Main>/Message/Move...\" \"<control>O\")\n"
@@ -3928,7 +3945,7 @@ static void prefs_keybind_apply_clicked(GtkWidget *widget)
 
                "(menu-path \"<Main>/Tools/Address book\" \"<shift><control>A\")\n"
                "(menu-path \"<Main>/Tools/Execute\" \"X\")\n"
-               "(menu-path \"<Main>/Tools/Log window\" \"<control>L\")\n"
+               "(menu-path \"<Main>/Tools/Log window\" \"<shift><control>L\")\n"
 
                "(menu-path \"<Compose>/File/Close\" \"<alt>W\")\n"
                "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
@@ -3959,15 +3976,16 @@ 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"
                "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><alt>I\")\n"
                "(menu-path \"<Main>/Message/Compose an email message\" \"<alt>N\")\n"
                "(menu-path \"<Main>/Message/Reply\" \"<alt>R\")\n"
-               "(menu-path \"<Main>/Message/Reply to sender\" \"<control><alt>R\")\n"
-               "(menu-path \"<Main>/Message/Reply to all\" \"<shift><alt>R\")\n"
+               "(menu-path \"<Main>/Message/Reply to/all\" \"<shift><alt>R\")\n"
+               "(menu-path \"<Main>/Message/Reply to/sender\" \"<control><alt>R\")\n"
+               "(menu-path \"<Main>/Message/Reply to/mailing list\" \"<control>L\")\n"
                "(menu-path \"<Main>/Message/Forward\" \"<shift><alt>F\")\n"
                /* "(menu-path \"<Main>/Message/Forward as attachment\" \"<shift><control>F\")\n" */
                "(menu-path \"<Main>/Message/Move...\" \"<alt>O\")\n"
@@ -4011,15 +4029,16 @@ 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"
                "(menu-path \"<Main>/Message/Get from all accounts\" \"\")\n"
                "(menu-path \"<Main>/Message/Compose an email message\" \"\")\n"
                "(menu-path \"<Main>/Message/Reply\" \"\")\n"
-               "(menu-path \"<Main>/Message/Reply to sender\" \"\")\n"
-               "(menu-path \"<Main>/Message/Reply to all\" \"\")\n"
+               "(menu-path \"<Main>/Message/Reply to/all\" \"\")\n"
+               "(menu-path \"<Main>/Message/Reply to/sender\" \"\")\n"
+               "(menu-path \"<Main>/Message/Reply to/mailing list\" \"\")\n"
                "(menu-path \"<Main>/Message/Forward\" \"\")\n"
                /* "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n" */
                "(menu-path \"<Main>/Message/Move...\" \"\")\n"
@@ -4078,30 +4097,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)