/*
- * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2002-2007 Hiroyuki Yamamoto & the Claws Mail team
+ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 2002-2017 Hiroyuki Yamamoto & the Claws Mail team
*
* 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
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
+#include "claws-features.h"
#endif
#if USE_ENCHANT
GtkWidget *default_alt_dict_label;
GtkWidget *default_alt_dict_combo;
-
GtkWidget *both_dict_check;
+#ifdef WIN32
+ GtkWidget *get_dictionaries_btn;
+#endif
+
GtkWidget *misspelled_label;
GtkWidget *misspelled_hbox;
GtkWidget *misspelled_colorbtn;
- CLAWS_TIP_DECL();
vbox1 = gtk_vbox_new (FALSE, VSPACING);
gtk_widget_show (vbox1);
table = gtk_table_new(6, 4, FALSE);
gtk_widget_show(table);
- gtk_container_set_border_width(GTK_CONTAINER(table), 8);
+ gtk_container_set_border_width(GTK_CONTAINER(table), 0);
gtk_table_set_row_spacings(GTK_TABLE(table), 4);
gtk_table_set_col_spacings(GTK_TABLE(table), 8);
gtk_misc_set_alignment(GTK_MISC(default_dict_label), 1, 0.5);
default_dict_combo = gtkaspell_dictionary_combo_new(TRUE);
- gtk_widget_set_size_request(default_dict_combo, 180, -1);
gtk_table_attach (GTK_TABLE (table), default_dict_combo, 1, 2, 0, 1,
- GTK_SHRINK, 0, 0, 0);
+ GTK_EXPAND | GTK_FILL, 0, 0, 0);
default_alt_dict_label = gtk_label_new(_("Default alternate dictionary"));
gtk_widget_show(default_alt_dict_label);
gtk_misc_set_alignment(GTK_MISC(default_alt_dict_label), 1, 0.5);
default_alt_dict_combo = gtkaspell_dictionary_combo_new(FALSE);
- gtk_widget_set_size_request(default_alt_dict_combo, 180, -1);
gtk_table_attach (GTK_TABLE (table), default_alt_dict_combo, 1, 2, 1, 2,
- GTK_SHRINK, 0, 0, 0);
+ GTK_EXPAND | GTK_FILL, 0, 0, 0);
both_dict_check = gtk_check_button_new_with_label(
_("Check with both dictionaries"));
gtk_widget_show(both_dict_check);
gtk_table_attach (GTK_TABLE (table), both_dict_check, 1, 2, 2, 3,
- GTK_SHRINK, 0, 0, 0);
+ GTK_EXPAND | GTK_FILL, 0, 0, 0);
+#ifdef WIN32
+ get_dictionaries_btn = gtkut_get_link_btn(GTK_WIDGET(window),
+ DICTS_URI, _("Get more dictionaries..."));
+
+ gtk_widget_show(get_dictionaries_btn);
+ gtk_table_attach (GTK_TABLE (table), get_dictionaries_btn, 1, 2, 3, 4,
+ GTK_SHRINK, 0, 0, 0);
+#endif
misspelled_hbox = gtk_hbox_new(FALSE, 10);
gtk_widget_show(misspelled_hbox);
gtk_box_pack_start(GTK_BOX(vbox1), misspelled_hbox, FALSE, FALSE, 0);
gtk_label_set_justify(GTK_LABEL(misspelled_label), GTK_JUSTIFY_RIGHT);
gtk_misc_set_alignment(GTK_MISC(misspelled_label), 1, 0.5);
- misspelled_colorbtn = gtk_button_new_with_label("");
+ misspelled_colorbtn = GTKUT_COLOR_BUTTON();
gtk_widget_show(misspelled_colorbtn);
gtk_box_pack_start(GTK_BOX(misspelled_hbox), misspelled_colorbtn,
FALSE, FALSE, 0);
- gtk_widget_set_size_request(misspelled_colorbtn, 30, 20);
CLAWS_SET_TIP(misspelled_colorbtn,
_("Pick color for misspelled word. "
"Use black to underline"));
prefs_common.recheck_when_changing_dict);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(use_alternate_checkbtn),
prefs_common.use_alternate);
- if (strrchr(prefs_common.dictionary, '/')) {
+ if (prefs_common.dictionary &&
+ strrchr(prefs_common.dictionary, '/')) {
gchar *tmp = g_strdup(strrchr(prefs_common.dictionary, '/')+1);
g_free(prefs_common.dictionary);
prefs_common.dictionary = tmp;
}
- if (strrchr(prefs_common.alt_dictionary, '/')) {
+ if (prefs_common.alt_dictionary &&
+ strrchr(prefs_common.alt_dictionary, '/')) {
gchar *tmp = g_strdup(strrchr(prefs_common.alt_dictionary, '/')+1);
g_free(prefs_common.alt_dictionary);
prefs_common.alt_dictionary = tmp;
}
+ if (prefs_common.dictionary &&
+ strchr(prefs_common.dictionary, '-')) {
+ *(strchr(prefs_common.dictionary, '-')) = '\0';
+ }
+ if (prefs_common.alt_dictionary &&
+ strchr(prefs_common.alt_dictionary, '-')) {
+ *(strchr(prefs_common.alt_dictionary, '-')) = '\0';
+ }
gtkaspell_set_dictionary_menu_active_item(GTK_COMBO_BOX(default_dict_combo),
prefs_common.dictionary);
g_signal_connect(G_OBJECT(misspelled_colorbtn), "clicked",
G_CALLBACK(prefs_spelling_colorsel), prefs_spelling);
- prefs_spelling->misspell_col = prefs_common.misspelled_col;
+ prefs_spelling->misspell_col = prefs_common.color[COL_MISSPELLED];
gtkut_set_widget_bgcolor_rgb(misspelled_colorbtn, prefs_spelling->misspell_col);
prefs_spelling->window = GTK_WIDGET(window);
gtkaspell_get_dictionary_menu_active_item(
GTK_COMBO_BOX(spelling->default_alt_dict_combo));
- prefs_common.misspelled_col = spelling->misspell_col;
+ prefs_common.color[COL_MISSPELLED] = spelling->misspell_col;
}
static void prefs_spelling_destroy_widget(PrefsPage *_page)