Fixed bugs:
[claws.git] / src / prefs_common.c
index 60e9ab296da5a4c8dc5ea0fdcf95ffa3d266d19a..1dbba1d58d44cb140b961897cb7e3e48b744e4a7 100644 (file)
@@ -121,17 +121,19 @@ static struct Compose {
        GtkWidget *checkbtn_smart_wrapping;
        GtkWidget *checkbtn_block_cursor;
        GtkWidget *checkbtn_reply_with_quote;
+} compose;
 
        /* spelling */
 #if USE_PSPELL
+static struct Spelling {
        GtkWidget *checkbtn_enable_pspell;
        GtkWidget *entry_pspell_path;
        GtkWidget *btn_pspell_path;
        GtkWidget *optmenu_dictionary;
+       GtkWidget *optmenu_sugmode;
+} spelling;
 #endif
 
-} compose;
-
 static struct Quote {
        GtkWidget *entry_quotemark;
        GtkWidget *text_quotefmt;
@@ -218,6 +220,7 @@ static struct MessageColorButtons {
        GtkWidget *quote_level3_btn;
        GtkWidget *uri_btn;
        GtkWidget *tgt_folder_btn;
+       GtkWidget *misspelled_btn;
 } color_buttons;
 
 static GtkWidget *quote_desc_win;
@@ -241,8 +244,10 @@ static void prefs_nextunreadmsgdialog_set_data_from_optmenu(PrefParam *pparam);
 static void prefs_nextunreadmsgdialog_set_optmenu(PrefParam *pparam);
 
 #if USE_PSPELL
-static void prefs_dictionary_set_data_from_optmenu(PrefParam *param);
-static void prefs_dictionary_set_optmenu(PrefParam *pparam);
+static void prefs_dictionary_set_data_from_optmenu     (PrefParam *param);
+static void prefs_dictionary_set_optmenu               (PrefParam *pparam);
+static void prefs_speller_sugmode_set_data_from_optmenu        (PrefParam *pparam);
+static void prefs_speller_sugmode_set_optmenu          (PrefParam *pparam);
 #endif
 
 
@@ -325,8 +330,8 @@ static PrefParam param[] = {
         &compose.spinbtn_undolevel,
         prefs_set_data_from_spinbtn, prefs_set_spinbtn},
 
-       {"linewrap_length", "74", &prefs_common.linewrap_len, P_INT,
-       &compose.spinbtn_linewrap,
+       {"linewrap_length", "72", &prefs_common.linewrap_len, P_INT,
+        &compose.spinbtn_linewrap,
         prefs_set_data_from_spinbtn, prefs_set_spinbtn},
        {"linewrap_quotation", "FALSE", &prefs_common.linewrap_quote, P_BOOL,
         &compose.checkbtn_wrapquote,
@@ -346,14 +351,19 @@ static PrefParam param[] = {
         prefs_set_data_from_toggle, prefs_set_toggle},
 #if USE_PSPELL
        {"enable_pspell", "TRUE", &prefs_common.enable_pspell,
-        P_BOOL, &compose.checkbtn_enable_pspell,
+        P_BOOL, &spelling.checkbtn_enable_pspell,
         prefs_set_data_from_toggle, prefs_set_toggle},
        {"pspell_path", "/usr/local/share/pspell/", &prefs_common.pspell_path, 
-        P_STRING, &compose.entry_pspell_path, 
+        P_STRING, &spelling.entry_pspell_path, 
         prefs_set_data_from_entry, prefs_set_entry},
        {"dictionary",  "", &prefs_common.dictionary,
-        P_STRING, &compose.optmenu_dictionary, 
+        P_STRING, &spelling.optmenu_dictionary, 
         prefs_dictionary_set_data_from_optmenu, prefs_dictionary_set_optmenu },
+       {"pspell_sugmode",  "1", &prefs_common.pspell_sugmode,
+        P_INT, &spelling.optmenu_sugmode, 
+        prefs_speller_sugmode_set_data_from_optmenu, prefs_speller_sugmode_set_optmenu },
+       {"misspelled_color", "16711680", &prefs_common.misspelled_col, P_INT,
+        NULL, NULL, NULL},
 #endif
        {"reply_with_quote", "TRUE", &prefs_common.reply_with_quote, P_BOOL,
         &compose.checkbtn_reply_with_quote, prefs_set_data_from_toggle, prefs_set_toggle},
@@ -717,6 +727,7 @@ static void prefs_common_create             (void);
 static void prefs_receive_create       (void);
 static void prefs_send_create          (void);
 static void prefs_compose_create       (void);
+static void prefs_spelling_create      (void);
 static void prefs_quote_create         (void);
 static void prefs_display_create       (void);
 static void prefs_message_create       (void);
@@ -898,6 +909,10 @@ static void prefs_common_create(void)
        SET_NOTEBOOK_LABEL(dialog.notebook, _("Send"),      page++);
        prefs_compose_create();
        SET_NOTEBOOK_LABEL(dialog.notebook, _("Compose"),   page++);
+#if USE_PSPELL
+       prefs_spelling_create();
+       SET_NOTEBOOK_LABEL(dialog.notebook, _("Spell Checker"),   page++);
+#endif 
        prefs_quote_create();
        SET_NOTEBOOK_LABEL(dialog.notebook, _("Quote"),   page++);
        prefs_display_create();
@@ -1291,19 +1306,50 @@ static void prefs_dictionary_set_optmenu(PrefParam *pparam)
        prefs_dictionary_set_data_from_optmenu(pparam);
 }
 
-static void prefs_compose_checkbtn_enable_pspell_toggle_cb
+static void prefs_speller_sugmode_set_data_from_optmenu(PrefParam *param)
+{
+       gint sugmode;
+       g_return_if_fail(param);
+       g_return_if_fail(param->data);
+       g_return_if_fail(param->widget);
+       g_return_if_fail(*(param->widget));
+
+       sugmode = gtkpspell_get_sugmode_from_option_menu
+               (GTK_OPTION_MENU(*(param->widget)));
+       *((gint *) param->data) = sugmode;
+}
+
+static void prefs_speller_sugmode_set_optmenu(PrefParam *pparam)
+{
+       GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
+       GtkWidget *menu;
+       GtkWidget *menuitem;
+       gint sugmode;
+
+       g_return_if_fail(optmenu != NULL);
+       g_return_if_fail(pparam->data != NULL);
+
+       sugmode = *(gint *) pparam->data;
+       gtkpspell_sugmode_option_menu_set(optmenu, sugmode);
+}
+       
+       
+static void prefs_spelling_checkbtn_enable_pspell_toggle_cb
        (GtkWidget *widget,
         gpointer data)
 {
        gboolean toggled;
 
        toggled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
-       gtk_widget_set_sensitive(compose.entry_pspell_path, toggled);
-       gtk_widget_set_sensitive(compose.optmenu_dictionary, toggled);
-       gtk_widget_set_sensitive(compose.btn_pspell_path, toggled);
+
+       gtk_widget_set_sensitive(spelling.entry_pspell_path,   toggled);
+       gtk_widget_set_sensitive(spelling.optmenu_dictionary,  toggled);
+       gtk_widget_set_sensitive(spelling.optmenu_sugmode,     toggled);
+       gtk_widget_set_sensitive(spelling.btn_pspell_path,     toggled);
+       gtk_widget_set_sensitive(color_buttons.misspelled_btn, toggled);
 }
 
-static void prefs_compose_btn_pspell_path_clicked_cb(GtkWidget *widget,
+static void prefs_spelling_btn_pspell_path_clicked_cb(GtkWidget *widget,
                                                     gpointer data)
 {
        gchar *file_path, *tmp;
@@ -1322,22 +1368,156 @@ static void prefs_compose_btn_pspell_path_clicked_cb(GtkWidget *widget,
                prefs_common.pspell_path = g_strdup_printf("%s%s",tmp,G_DIR_SEPARATOR_S);
 
                new_menu = gtkpspell_dictionary_option_menu_new(prefs_common.pspell_path);
-               gtk_option_menu_set_menu(GTK_OPTION_MENU(compose.optmenu_dictionary),
+               gtk_option_menu_set_menu(GTK_OPTION_MENU(spelling.optmenu_dictionary),
                                         new_menu);
 
-               gtk_entry_set_text(GTK_ENTRY(compose.entry_pspell_path), prefs_common.pspell_path);                                      
+               gtk_entry_set_text(GTK_ENTRY(spelling.entry_pspell_path), prefs_common.pspell_path);                                     
                /* select first one */
-               gtk_option_menu_set_history(GTK_OPTION_MENU(compose.optmenu_dictionary), 0);
+               gtk_option_menu_set_history(GTK_OPTION_MENU(spelling.optmenu_dictionary), 0);
                
                prefs_common.dictionary = gtkpspell_get_dictionary_menu_active_item(
-                               gtk_option_menu_get_menu(GTK_OPTION_MENU(compose.optmenu_dictionary)));
+                               gtk_option_menu_get_menu(GTK_OPTION_MENU(spelling.optmenu_dictionary)));
                g_free(tmp);
        
 
        }
 }
+
+static void prefs_spelling_create()
+{
+       GtkWidget *vbox1;
+       GtkWidget *frame_spell;
+       GtkWidget *hbox_spell;
+       GtkWidget *vbox_spell;
+       GtkWidget *hbox_pspell_path;
+       GtkWidget *checkbtn_enable_pspell;
+       GtkWidget *label_pspell_path;
+       GtkWidget *entry_pspell_path;
+       GtkWidget *btn_pspell_path;
+       GtkWidget *spell_table;
+       GtkWidget *label_dictionary;
+       GtkWidget *optmenu_dictionary;
+       GtkWidget *sugmode_label;
+       GtkWidget *sugmode_optmenu;
+       GtkWidget *color_label;
+       GtkWidget *hbox_col;
+       GtkWidget *col_align;
+
+
+       vbox1 = gtk_vbox_new (FALSE, VSPACING);
+       gtk_widget_show (vbox1);
+       gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
+       gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
+
+       /* spell checker defaults */                       
+       PACK_FRAME(vbox1, frame_spell, _("Global spelling checker settings"));
+       vbox_spell = gtk_vbox_new(FALSE, VSPACING_NARROW);
+       gtk_widget_show (vbox_spell);
+       gtk_container_add(GTK_CONTAINER(frame_spell), vbox_spell);
+       gtk_container_set_border_width(GTK_CONTAINER(vbox_spell), 8);
+
+       PACK_CHECK_BUTTON(vbox_spell, checkbtn_enable_pspell, 
+                         _("Enable spell checker (EXPERIMENTAL)"));
+
+       gtk_signal_connect(GTK_OBJECT(checkbtn_enable_pspell), "toggled",
+                          GTK_SIGNAL_FUNC(prefs_spelling_checkbtn_enable_pspell_toggle_cb),
+                          NULL);
+
+       spell_table = gtk_table_new(4, 3, FALSE);
+       gtk_container_set_border_width (GTK_CONTAINER (spell_table), 0);
+       gtk_table_set_row_spacings(GTK_TABLE(spell_table), 8);
+       gtk_table_set_col_spacings(GTK_TABLE(spell_table), 8);
+
+       gtk_box_pack_start(GTK_BOX(vbox_spell), spell_table, TRUE, TRUE, 0);
+
+       
+       label_pspell_path = gtk_label_new (_("Dictionaries path:"));
+       gtk_misc_set_alignment(GTK_MISC(label_pspell_path), 1.0, 0.5);
+       gtk_widget_show(label_pspell_path);
+       gtk_table_attach (GTK_TABLE (spell_table), label_pspell_path, 0, 1, 0, 1,
+                         GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
+       
+       hbox_pspell_path = gtk_hbox_new (FALSE, 8);
+       gtk_table_attach (GTK_TABLE (spell_table), hbox_pspell_path, 1, 2, 0, 1,
+                         GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
+       gtk_widget_show(hbox_pspell_path);
+
+       entry_pspell_path = gtk_entry_new();
+       gtk_widget_show(entry_pspell_path);
+       gtk_box_pack_start(GTK_BOX(hbox_pspell_path), entry_pspell_path, TRUE, TRUE, 0);        
+       
+       gtk_widget_set_sensitive(entry_pspell_path, prefs_common.enable_pspell);
+
+       btn_pspell_path = gtk_button_new_with_label(" ... ");
+       gtk_widget_show(btn_pspell_path);
+       gtk_box_pack_start(GTK_BOX(hbox_pspell_path), btn_pspell_path, FALSE, FALSE, 0);
+       gtk_widget_set_sensitive(btn_pspell_path, prefs_common.enable_pspell);
+
+       gtk_signal_connect(GTK_OBJECT(btn_pspell_path), "clicked", 
+                          GTK_SIGNAL_FUNC(prefs_spelling_btn_pspell_path_clicked_cb),
+                          NULL);
+
+       label_dictionary = gtk_label_new(_("Default dictionary:"));
+       gtk_misc_set_alignment(GTK_MISC(label_dictionary), 1.0, 0.5);
+       gtk_widget_show(label_dictionary);
+       gtk_table_attach (GTK_TABLE (spell_table), label_dictionary, 0, 1, 1, 2,
+                         GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
+
+       optmenu_dictionary = gtk_option_menu_new();
+       gtk_widget_show(optmenu_dictionary);
+       gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu_dictionary), 
+                                gtkpspell_dictionary_option_menu_new(prefs_common.pspell_path));
+       gtk_table_attach (GTK_TABLE (spell_table), optmenu_dictionary, 1, 2, 1, 2,
+                         GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
+       gtk_widget_set_sensitive(optmenu_dictionary, prefs_common.enable_pspell);
+
+       /* Suggestion mode */
+       sugmode_label = gtk_label_new(_("Default suggestion mode"));
+       gtk_misc_set_alignment(GTK_MISC(sugmode_label), 1.0, 0.5);
+       gtk_widget_show(sugmode_label);
+       gtk_table_attach(GTK_TABLE (spell_table), sugmode_label, 0, 1, 2, 3,
+                        GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
+
+       sugmode_optmenu = gtk_option_menu_new();
+       gtk_widget_show(sugmode_optmenu);
+       gtk_option_menu_set_menu(GTK_OPTION_MENU(sugmode_optmenu),
+                           gtkpspell_sugmode_option_menu_new(prefs_common.pspell_sugmode));
+       gtk_table_attach(GTK_TABLE(spell_table), sugmode_optmenu, 1, 2, 2, 3,
+                        GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
+       gtk_widget_set_sensitive(sugmode_optmenu, prefs_common.enable_pspell);
+
+       /* Color */
+       color_label = gtk_label_new(_("Misspelled word color:"));
+       gtk_misc_set_alignment(GTK_MISC(color_label), 1.0, 0.5);
+       gtk_table_attach (GTK_TABLE (spell_table), color_label, 0, 1, 3, 4,
+                         GTK_FILL, GTK_SHRINK, 0, 0);
+       gtk_widget_show(color_label);
+       
+       col_align = gtk_alignment_new(0.0, 0.5, 0, 0);
+       gtk_widget_show(col_align);
+       gtk_table_attach (GTK_TABLE (spell_table), col_align, 1, 2, 3, 4,
+                         GTK_FILL, GTK_SHRINK, 0, 0);
+
+       color_buttons.misspelled_btn = gtk_button_new_with_label ("");
+       set_button_bg_color(color_buttons.misspelled_btn,
+                           prefs_common.misspelled_col);
+       gtk_widget_set_usize (color_buttons.misspelled_btn, 30, 20);
+       gtk_widget_set_sensitive(color_buttons.misspelled_btn, prefs_common.enable_pspell);
+       gtk_signal_connect (GTK_OBJECT (color_buttons.misspelled_btn), "clicked",
+                           GTK_SIGNAL_FUNC(quote_color_set_dialog), "Misspelled word");
+       gtk_container_add(GTK_CONTAINER(col_align), color_buttons.misspelled_btn);
+
+
+       spelling.checkbtn_enable_pspell = checkbtn_enable_pspell;
+       spelling.entry_pspell_path      = entry_pspell_path;
+       spelling.btn_pspell_path        = btn_pspell_path;
+       spelling.optmenu_dictionary     = optmenu_dictionary;
+       spelling.optmenu_sugmode        = sugmode_optmenu;
+}
+
 #endif
 
+
 static void prefs_compose_create(void)
 {
        GtkWidget *vbox1;
@@ -1386,19 +1566,6 @@ static void prefs_compose_create(void)
        GtkWidget *checkbtn_smart_wrapping;
        GtkWidget *checkbtn_block_cursor;
 
-#if USE_PSPELL
-       GtkWidget *frame_spell;
-       GtkWidget *hbox_spell;
-       GtkWidget *vbox_spell;
-       GtkWidget *hbox_pspell_path;
-       GtkWidget *checkbtn_enable_pspell;
-       GtkWidget *label_pspell_path;
-       GtkWidget *entry_pspell_path;
-       GtkWidget *btn_pspell_path;
-       GtkWidget *hbox_dictionary;
-       GtkWidget *label_dictionary;
-       GtkWidget *optmenu_dictionary;
-#endif
        vbox1 = gtk_vbox_new (FALSE, VSPACING);
        gtk_widget_show (vbox1);
        gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
@@ -1528,60 +1695,6 @@ static void prefs_compose_create(void)
        gtk_widget_set_usize (spinbtn_undolevel, 64, -1);
        gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_undolevel), TRUE);
 
-#if USE_PSPELL
-       /* spell checker defaults */                       
-       PACK_FRAME(vbox1, frame_spell, _("Global spelling checker settings"));
-       vbox_spell = gtk_vbox_new(FALSE, VSPACING_NARROW);
-       gtk_widget_show (vbox_spell);
-       gtk_container_add(GTK_CONTAINER(frame_spell), vbox_spell);
-       gtk_container_set_border_width(GTK_CONTAINER(vbox_spell), 8);
-
-       PACK_CHECK_BUTTON(vbox_spell, checkbtn_enable_pspell, 
-                         _("Enable spell checker (EXPERIMENTAL)"));
-
-       gtk_signal_connect(GTK_OBJECT(checkbtn_enable_pspell), "toggled",
-                          GTK_SIGNAL_FUNC(prefs_compose_checkbtn_enable_pspell_toggle_cb),
-                          NULL);
-
-       hbox_pspell_path = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show(hbox_pspell_path);
-       gtk_box_pack_start(GTK_BOX(vbox_spell), hbox_pspell_path, TRUE, TRUE, 0);
-
-       label_pspell_path = gtk_label_new (_("Dictionaries path"));
-       gtk_widget_show(label_pspell_path);
-       gtk_box_pack_start(GTK_BOX(hbox_pspell_path), label_pspell_path, FALSE, FALSE, 0);
-       
-       entry_pspell_path = gtk_entry_new();
-       gtk_widget_show(entry_pspell_path);
-       gtk_box_pack_start(GTK_BOX(hbox_pspell_path), entry_pspell_path, FALSE, FALSE, 0);
-       gtk_widget_set_usize(entry_pspell_path, 150, -1);
-       gtk_widget_set_sensitive(entry_pspell_path, prefs_common.enable_pspell);
-
-       btn_pspell_path = gtk_button_new_with_label(_("..."));
-       gtk_widget_show(btn_pspell_path);
-       gtk_box_pack_start(GTK_BOX(hbox_pspell_path), btn_pspell_path, FALSE, FALSE, 0);
-       gtk_widget_set_sensitive(btn_pspell_path, prefs_common.enable_pspell);
-
-       gtk_signal_connect(GTK_OBJECT(btn_pspell_path), "clicked", 
-                          GTK_SIGNAL_FUNC(prefs_compose_btn_pspell_path_clicked_cb),
-                          NULL);
-
-       hbox_dictionary = gtk_hbox_new(FALSE, 8);
-       gtk_widget_show(hbox_dictionary);
-       gtk_box_pack_start(GTK_BOX(vbox_spell), hbox_dictionary, TRUE, TRUE, 0);
-
-       label_dictionary = gtk_label_new(_("Dictionary"));
-       gtk_widget_show(label_dictionary);
-       gtk_box_pack_start(GTK_BOX(hbox_dictionary), label_dictionary, FALSE, FALSE, 0);
-
-       optmenu_dictionary = gtk_option_menu_new();
-       gtk_widget_show(optmenu_dictionary);
-       gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu_dictionary), 
-                                gtkpspell_dictionary_option_menu_new(prefs_common.pspell_path));
-       gtk_box_pack_start(GTK_BOX(hbox_dictionary), optmenu_dictionary, FALSE, FALSE, 0);
-       gtk_widget_set_sensitive(optmenu_dictionary, prefs_common.enable_pspell);
-#endif
-
        /*
        compose.checkbtn_quote   = checkbtn_quote;
        compose.entry_quotemark  = entry_quotemark;
@@ -1611,12 +1724,6 @@ static void prefs_compose_create(void)
        compose.checkbtn_block_cursor   =
                checkbtn_block_cursor;
 
-#if USE_PSPELL
-       compose.checkbtn_enable_pspell = checkbtn_enable_pspell;
-       compose.entry_pspell_path      = entry_pspell_path;
-       compose.btn_pspell_path        = btn_pspell_path;
-       compose.optmenu_dictionary     = optmenu_dictionary;
-#endif
 }
 
 static void prefs_quote_create(void)
@@ -1794,7 +1901,7 @@ static void prefs_display_create(void)
        gtk_table_attach (GTK_TABLE (table1), entry_textfont, 1, 2, 0, 1,
                          (GTK_EXPAND | GTK_FILL), 0, 0, 0);
 
-       button_textfont = gtk_button_new_with_label ("... ");
+       button_textfont = gtk_button_new_with_label (" ... ");
 
        gtk_widget_show (button_textfont);
        gtk_table_attach (GTK_TABLE (table1), button_textfont, 2, 3, 0, 1,
@@ -1907,7 +2014,7 @@ static void prefs_display_create(void)
        gtk_widget_show (entry_datefmt);
        gtk_box_pack_start (GTK_BOX (hbox1), entry_datefmt, TRUE, TRUE, 0);
 
-       button_datefmt = gtk_button_new_with_label ("... ");
+       button_datefmt = gtk_button_new_with_label (" ... ");
 
        gtk_widget_show (button_datefmt);
        gtk_box_pack_start (GTK_BOX (hbox1), button_datefmt, FALSE, FALSE, 0);
@@ -2712,8 +2819,7 @@ static GtkWidget *date_format_create(GtkButton *button, void *data)
        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_column_width(GTK_CLIST(datefmt_clist), 0, 80); */
        gtk_clist_set_selection_mode(GTK_CLIST(datefmt_clist),
                                     GTK_SELECTION_BROWSE);
 
@@ -2831,7 +2937,6 @@ static void prefs_quote_colors_dialog_create(void)
        GtkWidget *tgt_folder_label;
        GtkWidget *hbbox;
        GtkWidget *ok_btn;
-       //GtkWidget *cancel_btn;
        GtkWidget *recycle_colors_btn;
        GtkWidget *frame_colors;
 
@@ -2997,6 +3102,11 @@ static void quote_color_set_dialog(GtkWidget *widget, gpointer data)
        } else if(g_strcasecmp(type, "TGTFLD") == 0) {
                title = _("Pick color for target folder");
                rgbvalue = prefs_common.tgt_folder_col;
+#if USE_PSPELL         
+       } else if(g_strcasecmp(type, "Misspelled word") == 0) {
+               title = _("Pick color for misspelled word");
+               rgbvalue = prefs_common.misspelled_col;
+#endif         
        } else {   /* Should never be called */
                g_warning("Unrecognized datatype '%s' in quote_color_set_dialog\n", type);
                return;
@@ -3064,6 +3174,11 @@ static void quote_colors_set_dialog_ok(GtkWidget *widget, gpointer data)
                prefs_common.tgt_folder_col = rgbvalue;
                set_button_bg_color(color_buttons.tgt_folder_btn, rgbvalue);
                folderview_set_target_folder_color(prefs_common.tgt_folder_col);
+#if USE_PSPELL         
+       } else if (g_strcasecmp(type, "Misspelled word") == 0) {
+               prefs_common.misspelled_col = rgbvalue;
+               set_button_bg_color(color_buttons.misspelled_btn, rgbvalue);
+#endif         
        } else
                fprintf( stderr, "Unrecognized datatype '%s' in quote_color_set_dialog_ok\n", type );