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;
+} spelling;
#endif
-} compose;
-
static struct Quote {
GtkWidget *entry_quotemark;
GtkWidget *text_quotefmt;
GtkWidget *quote_level3_btn;
GtkWidget *uri_btn;
GtkWidget *tgt_folder_btn;
+ GtkWidget *misspelled_btn;
} color_buttons;
static GtkWidget *quote_desc_win;
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 },
+ {"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},
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);
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();
prefs_dictionary_set_data_from_optmenu(pparam);
}
-static void prefs_compose_checkbtn_enable_pspell_toggle_cb
+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.btn_pspell_path, 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;
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 *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(3, 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);
+
+ /* 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, 2, 3,
+ 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, 2, 3,
+ 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;
+}
+
#endif
+
static void prefs_compose_create(void)
{
GtkWidget *vbox1;
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);
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;
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)
} 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;
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 );