+2008-09-12 [colin] 3.5.0cvs103
+
+ * claws-mail.pc.in
+ * src/Makefile.am
+ * src/compose.c
+ * src/compose.h
+ * src/crash.c
+ * src/folder_item_prefs.c
+ * src/folder_item_prefs.h
+ * src/main.c
+ * src/prefs_account.c
+ * src/prefs_common.c
+ * src/prefs_common.h
+ * src/prefs_folder_item.c
+ * src/prefs_spelling.c
+ * src/prefs_template.c
+ * src/quote_fmt.h
+ * src/quote_fmt_parse.y
+ * src/toolbar.c
+ * src/toolbar.h
+ * src/gtk/Makefile.am
+ * src/gtk/about.c
+ * src/gtk/filesel.c
+ * src/gtk/gtkaspell.c
+ * src/gtk/gtkaspell.h
+ * src/plugins/bogofilter/Makefile.am
+ * src/plugins/dillo_viewer/Makefile.am
+ * src/plugins/spamassassin/Makefile.am
+ * src/plugins/trayicon/Makefile.am
+ Switch spellchecker to Enchant
+
2008-09-12 [paul] 3.5.0cvs102
* tools/README
( cvs diff -u -r 1.654.2.3573 -r 1.654.2.3574 configure.ac; ) > 3.5.0cvs100.patchset
( cvs diff -u -r 1.382.2.473 -r 1.382.2.474 src/compose.c; cvs diff -u -r 1.1.2.17 -r 1.1.2.18 src/prefs_wrapping.c; ) > 3.5.0cvs101.patchset
( cvs diff -u -r 1.30.2.31 -r 1.30.2.32 tools/README; cvs diff -u -r 1.1.2.3 -r 1.1.2.4 tools/csv2addressbook.pl; ) > 3.5.0cvs102.patchset
+( cvs diff -u -r 1.1.2.1 -r 1.1.2.2 claws-mail.pc.in; cvs diff -u -r 1.155.2.90 -r 1.155.2.91 src/Makefile.am; cvs diff -u -r 1.382.2.474 -r 1.382.2.475 src/compose.c; cvs diff -u -r 1.50.2.50 -r 1.50.2.51 src/compose.h; cvs diff -u -r 1.23.2.29 -r 1.23.2.30 src/crash.c; cvs diff -u -r 1.2.2.30 -r 1.2.2.31 src/folder_item_prefs.c; cvs diff -u -r 1.2.2.17 -r 1.2.2.18 src/folder_item_prefs.h; cvs diff -u -r 1.115.2.204 -r 1.115.2.205 src/main.c; cvs diff -u -r 1.105.2.144 -r 1.105.2.145 src/prefs_account.c; cvs diff -u -r 1.204.2.177 -r 1.204.2.178 src/prefs_common.c; cvs diff -u -r 1.103.2.112 -r 1.103.2.113 src/prefs_common.h; cvs diff -u -r 1.52.2.66 -r 1.52.2.67 src/prefs_folder_item.c; cvs diff -u -r 1.5.2.36 -r 1.5.2.37 src/prefs_spelling.c; cvs diff -u -r 1.12.2.66 -r 1.12.2.67 src/prefs_template.c; cvs diff -u -r 1.5.12.18 -r 1.5.12.19 src/quote_fmt.h; cvs diff -u -r 1.22.2.39 -r 1.22.2.40 src/quote_fmt_parse.y; cvs diff -u -r 1.43.2.104 -r 1.43.2.105 src/toolbar.c; cvs diff -u -r 1.19.2.28 -r 1.19.2.29 src/toolbar.h; cvs diff -u -r 1.20.2.17 -r 1.20.2.18 src/gtk/Makefile.am; cvs diff -u -r 1.4.2.66 -r 1.4.2.67 src/gtk/about.c; cvs diff -u -r 1.2.2.37 -r 1.2.2.38 src/gtk/filesel.c; cvs diff -u -r 1.9.2.60 -r 1.9.2.61 src/gtk/gtkaspell.c; cvs diff -u -r 1.5.2.15 -r 1.5.2.16 src/gtk/gtkaspell.h; cvs diff -u -r 1.1.2.5 -r 1.1.2.6 src/plugins/bogofilter/Makefile.am; cvs diff -u -r 1.4.2.7 -r 1.4.2.8 src/plugins/dillo_viewer/Makefile.am; cvs diff -u -r 1.5.2.8 -r 1.5.2.9 src/plugins/spamassassin/Makefile.am; cvs diff -u -r 1.4.2.11 -r 1.4.2.12 src/plugins/trayicon/Makefile.am; ) > 3.5.0cvs103.patchset
Description: Claws Mail
Version: @MAJOR_VERSION@.@MINOR_VERSION@.@MICRO_VERSION@.@EXTRA_VERSION@
-Cflags: @ASPELL_CFLAGS@ @GPGME_CFLAGS@ @OPENSSL_CFLAGS@ -I${pkgincludedir} -I${pkgincludedir}/common -I${pkgincludedir}/gtk
+Cflags: @ENCHANT_CFLAGS@ @GPGME_CFLAGS@ @OPENSSL_CFLAGS@ -I${pkgincludedir} -I${pkgincludedir}/common -I${pkgincludedir}/gtk
MICRO_VERSION=0
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=102
+EXTRA_VERSION=103
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
-dnl GNU/Aspell is used for spell checking
-AC_ARG_ENABLE(aspell,
- [ --disable-aspell disable GNU/aspell support],
- [ac_cv_enable_aspell=$enableval], [ac_cv_enable_aspell=yes])
-AC_MSG_CHECKING([whether to use GNU/aspell])
-if test $ac_cv_enable_aspell = yes; then
- AC_MSG_RESULT(yes)
- AM_PATH_ASPELL(0.50, AC_DEFINE(USE_ASPELL, 1, Define if you use ASPELL to support spell checking),
- [use_aspell=no ac_cv_enable_aspell=no])
-else
- AC_MSG_RESULT(no)
+dnl enchant is used for spell checking
+AC_ARG_ENABLE(enchant,
+ [ --disable-enchant disable enchant support],
+ [ac_cv_enable_enchant=$enableval], [ac_cv_enable_enchant=yes])
+AC_MSG_CHECKING([whether to use enchant])
+if test $ac_cv_enable_enchant = yes; then
+ PKG_CHECK_MODULES(ENCHANT, enchant >= 1.0.0,
+ [
+ AC_DEFINE(USE_ENCHANT, 1, enchant)
+ echo "Building with enchant"
+ ac_cv_enable_enchant=yes
+ ],
+ [
+ echo "Building without enchant-notification"
+ ac_cv_enable_enchant=no
+ ])
+ AC_SUBST(ENCHANT_CFLAGS)
+ AC_SUBST(ENCHANT_LIBS)
fi
dnl want crash dialog
echo "iconv : $am_cv_func_iconv"
echo "compface : $ac_cv_enable_compface"
echo "IPv6 : $ac_cv_enable_ipv6"
-echo "GNU/aspell : $ac_cv_enable_aspell"
+echo "enchant : $ac_cv_enable_enchant"
echo "IMAP4 : $ac_cv_enable_libetpan"
echo "NNTP : $ac_cv_enable_libetpan"
echo "Crash dialog : $ac_cv_enable_crash_dialog"
claws_mail_LDADD = \
$(etpan_library) \
gtk/libclawsgtk.la \
- $(ASPELL_LIBS) \
+ $(ENCHANT_LIBS) \
$(INTLLIBS) \
$(GTK_LIBS) \
$(GPGME_LIBS) \
-DTARGET_ALIAS=\""$(target_triplet)"\" \
-DSYSCONFDIR=\""$(sysconfdir)"\" \
-DDATAROOTDIR=\""$(datarootdir)"\" \
- $(ASPELL_CFLAGS) \
+ $(ENCHANT_CFLAGS) \
$(GTK_CFLAGS) \
$(GPGME_CFLAGS) \
$(OPENSSL_CFLAGS) \
static void compose_remove_header_entries(Compose *compose);
static void compose_update_priority_menu_item(Compose * compose);
-#if USE_ASPELL
+#if USE_ENCHANT
static void compose_spell_menu_changed (void *data);
#endif
static void compose_add_field_list ( Compose *compose,
}
-#if USE_ASPELL
+#if USE_ENCHANT
static void compose_check_all (GtkAction *action, gpointer data);
static void compose_highlight_all (GtkAction *action, gpointer data);
static void compose_check_backwards (GtkAction *action, gpointer data);
static MsgInfo *compose_msginfo_new_from_compose(Compose *compose);
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
static void compose_set_dictionaries_from_folder_prefs(Compose *compose,
FolderItem *folder_item);
#endif
/* menus */
{"Message", NULL, N_("_Message") },
{"Edit", NULL, N_("_Edit") },
-#if USE_ASPELL
+#if USE_ENCHANT
{"Spelling", NULL, N_("_Spelling") },
#endif
{"Options", NULL, N_("_Options") },
{"Edit/WrapAllLines", NULL, N_("Wrap all long _lines"), "<control><alt>L", NULL, G_CALLBACK(compose_wrap_all_cb) }, /* 1 */
/* {"Edit/---", NULL, "---" }, */
{"Edit/ExtEditor", NULL, N_("Edit with e_xternal editor"), "<shift><control>X", NULL, G_CALLBACK(compose_ext_editor_cb) },
-#if USE_ASPELL
+#if USE_ENCHANT
/* Spelling menu */
{"Spelling/CheckAllSel", NULL, N_("_Check all or check selection"), NULL, NULL, G_CALLBACK(compose_check_all) },
{"Spelling/HighlightAll", NULL, N_("_Highlight all misspelled words"), NULL, NULL, G_CALLBACK(compose_highlight_all) },
tmp = malloc(strlen(item->prefs->compose_override_from_format)+1);
pref_get_unescaped_pref(tmp, item->prefs->compose_override_from_format);
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
quote_fmt_init(dummyinfo, NULL, NULL, FALSE, compose->account, FALSE,
compose->gtkaspell);
#else
compose_create_tags(textview, compose);
undo_block(compose->undostruct);
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
compose_set_dictionaries_from_folder_prefs(compose, item);
#endif
pref_get_unescaped_pref(tmp, subject_format);
subject = gtk_editable_get_chars(GTK_EDITABLE(compose->subject_entry), 0, -1);
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
quote_fmt_init(dummyinfo, NULL, subject, FALSE, compose->account, FALSE,
compose->gtkaspell);
#else
tmp = malloc(strlen(msginfo->folder->prefs->reply_override_from_format)+1);
pref_get_unescaped_pref(tmp, msginfo->folder->prefs->reply_override_from_format);
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
quote_fmt_init(compose->replyinfo, NULL, NULL, FALSE, compose->account, FALSE,
compose->gtkaspell);
#else
compose_create_tags(textview, compose);
undo_block(compose->undostruct);
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
compose_set_dictionaries_from_folder_prefs(compose, msginfo->folder);
#endif
tmp = malloc(strlen(msginfo->folder->prefs->forward_override_from_format)+1);
pref_get_unescaped_pref(tmp, msginfo->folder->prefs->forward_override_from_format);
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
quote_fmt_init(full_msginfo, NULL, NULL, FALSE, compose->account, FALSE,
compose->gtkaspell);
#else
tmp = malloc(strlen(msginfo->folder->prefs->forward_override_from_format)+1);
pref_get_unescaped_pref(tmp, msginfo->folder->prefs->forward_override_from_format);
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
quote_fmt_init(msginfo, NULL, NULL, FALSE, compose->account, FALSE,
compose->gtkaspell);
#else
case A_ADDRBOOK:
compose_address_cb(NULL, compose);
break;
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
case A_CHECK_SPELLING:
compose_check_all(NULL, compose);
break;
}
if (qmark != NULL) {
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
quote_fmt_init(msginfo, NULL, NULL, FALSE, compose->account, FALSE,
compose->gtkaspell);
#else
while (*trimmed_body == '\n')
trimmed_body++;
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
quote_fmt_init(msginfo, quote_str, trimmed_body, FALSE, compose->account, FALSE,
compose->gtkaspell);
#else
undo_unblock(compose->undostruct);
}
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
/* use account's dict info if set */
if (compose->gtkaspell) {
if (account->enable_default_dictionary)
{
gint prev_autowrap;
GtkTextBuffer *buffer = GTK_TEXT_VIEW(text)->buffer;
-#if USE_ASPELL
+#if USE_ENCHANT
if (event->button == 3) {
GtkTextIter iter;
GtkTextIter sel_start, sel_end;
return FALSE;
}
-#if USE_ASPELL
+#if USE_ENCHANT
static void compose_spell_menu_changed(void *data)
{
Compose *compose = (Compose *)data;
GtkWidget *tmpl_menu;
GtkActionGroup *action_group = NULL;
-#if USE_ASPELL
+#if USE_ENCHANT
GtkAspell * gtkaspell = NULL;
#endif
MENUITEM_ADDUI_MANAGER(compose->ui_manager, "/Menu", "Message", "Message", GTK_UI_MANAGER_MENU)
MENUITEM_ADDUI_MANAGER(compose->ui_manager, "/Menu", "Edit", "Edit", GTK_UI_MANAGER_MENU)
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
MENUITEM_ADDUI_MANAGER(compose->ui_manager, "/Menu", "Spelling", "Spelling", GTK_UI_MANAGER_MENU)
#endif
MENUITEM_ADDUI_MANAGER(compose->ui_manager, "/Menu", "Options", "Options", GTK_UI_MANAGER_MENU)
MENUITEM_ADDUI_MANAGER(compose->ui_manager, "/Menu/Edit", "ExtEditor", "Edit/ExtEditor", GTK_UI_MANAGER_MENUITEM)
-#if USE_ASPELL
+#if USE_ENCHANT
/* Spelling menu */
MENUITEM_ADDUI_MANAGER(compose->ui_manager, "/Menu/Spelling", "CheckAllSel", "Spelling/CheckAllSel", GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(compose->ui_manager, "/Menu/Spelling", "HighlightAll", "Spelling/HighlightAll", GTK_UI_MANAGER_MENUITEM)
compose->exteditor_tag = -1;
compose->draft_timeout_tag = -2; /* inhibit auto-drafting while loading */
-#if USE_ASPELL
+#if USE_ENCHANT
cm_menu_set_sensitive_full(compose->ui_manager, "Menu/Spelling", FALSE);
if (mode != COMPOSE_REDIRECT) {
if (prefs_common.enable_aspell && prefs_common.dictionary &&
strcmp(prefs_common.dictionary, "")) {
- gtkaspell = gtkaspell_new(prefs_common.aspell_path,
- prefs_common.dictionary,
+ gtkaspell = gtkaspell_new(prefs_common.dictionary,
prefs_common.alt_dictionary,
conv_get_locale_charset_str(),
prefs_common.misspelled_col,
gtkaspell_checkers_strerror());
gtkaspell_checkers_reset_error();
} else {
- if (!gtkaspell_set_sug_mode(gtkaspell,
- prefs_common.aspell_sugmode)) {
- debug_print("Aspell: could not set "
- "suggestion mode %s\n",
- gtkaspell_checkers_strerror());
- gtkaspell_checkers_reset_error();
- }
-
cm_menu_set_sensitive_full(compose->ui_manager, "Menu/Spelling", TRUE);
}
}
}
if (tmpl->from && *tmpl->from != '\0') {
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
quote_fmt_init(msginfo, NULL, NULL, FALSE, compose->account, FALSE,
compose->gtkaspell);
#else
}
if (tmpl->to && *tmpl->to != '\0') {
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
quote_fmt_init(msginfo, NULL, NULL, FALSE, compose->account, FALSE,
compose->gtkaspell);
#else
}
if (tmpl->cc && *tmpl->cc != '\0') {
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
quote_fmt_init(msginfo, NULL, NULL, FALSE, compose->account, FALSE,
compose->gtkaspell);
#else
}
if (tmpl->bcc && *tmpl->bcc != '\0') {
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
quote_fmt_init(msginfo, NULL, NULL, FALSE, compose->account, FALSE,
compose->gtkaspell);
#else
/* process the subject */
if (tmpl->subject && *tmpl->subject != '\0') {
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
quote_fmt_init(msginfo, NULL, NULL, FALSE, compose->account, FALSE,
compose->gtkaspell);
#else
if (addressbook_get_target_compose() == compose)
addressbook_set_target_compose(NULL);
-#if USE_ASPELL
+#if USE_ENCHANT
if (compose->gtkaspell) {
gtkaspell_delete(compose->gtkaspell);
compose->gtkaspell = NULL;
toolbar_comp_set_sensitive(compose, allow);
cm_menu_set_sensitive_full(compose->ui_manager, "Menu/Message", allow);
cm_menu_set_sensitive_full(compose->ui_manager, "Menu/Edit", allow);
-#if USE_ASPELL
+#if USE_ENCHANT
cm_menu_set_sensitive_full(compose->ui_manager, "Menu/Spelling", allow);
#endif
cm_menu_set_sensitive_full(compose->ui_manager, "Menu/Options", allow);
return FALSE;
}
-#if USE_ASPELL
+#if USE_ENCHANT
static void compose_check_all(GtkAction *action, gpointer data)
{
Compose *compose = (Compose *)data;
return newmsginfo;
}
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
/* update compose's dictionaries from folder dict settings */
static void compose_set_dictionaries_from_folder_prefs(Compose *compose,
FolderItem *folder_item)
#include "textview.h"
#include "folder.h"
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
#include "gtkaspell.h"
#endif
GIOChannel *exteditor_ch;
gint exteditor_tag;
-#if USE_ASPELL
+#if USE_ENCHANT
/* GNU/aspell spell checker */
GtkAspell *gtkaspell;
GtkWidget *aspell_options_menu;
#if USE_JPILOT
" JPilot"
#endif
-#if USE_ASPELL
+#if USE_ENCHANT
" GNU/aspell"
#endif
#if HAVE_LIBETPAN
NULL, NULL, NULL},
{"default_account", NULL, &tmp_prefs.default_account, P_INT,
NULL, NULL, NULL},
-#if USE_ASPELL
+#if USE_ENCHANT
{"enable_default_dictionary", "", &tmp_prefs.enable_default_dictionary, P_BOOL,
NULL, NULL, NULL},
{"default_dictionary", NULL, &tmp_prefs.default_dictionary, P_STRING,
prefs->folder_chmod = 0;
prefs->enable_default_account = FALSE;
prefs->default_account = 0;
-#if USE_ASPELL
+#if USE_ENCHANT
prefs->enable_default_dictionary = FALSE;
prefs->default_dictionary = NULL;
prefs->enable_default_alt_dictionary = FALSE;
tmp_prefs.folder_chmod = src->prefs->folder_chmod;
tmp_prefs.enable_default_account = src->prefs->enable_default_account;
tmp_prefs.default_account = src->prefs->default_account;
-#if USE_ASPELL
+#if USE_ENCHANT
tmp_prefs.enable_default_dictionary = src->prefs->enable_default_dictionary;
tmp_prefs.default_dictionary = g_strdup(src->prefs->default_dictionary);
tmp_prefs.enable_default_alt_dictionary = src->prefs->enable_default_alt_dictionary;
gint folder_chmod;
gboolean enable_default_account;
gint default_account;
-#if USE_ASPELL
+#if USE_ENCHANT
gboolean enable_default_dictionary;
gchar *default_dictionary;
gboolean enable_default_alt_dictionary;
-I$(builddir)/.. \
$(GTK_CFLAGS) \
$(OPENSSL_CFLAGS) \
- $(ASPELL_CFLAGS) \
$(GNOMEPRINT_CFLAGS) \
$(MAEMO_CFLAGS) \
+ $(ENCHANT_CFLAGS) \
-DPLUGINDIR=\"$(PLUGINDIR)\" \
-DDOCDIR=\"$(DOCDIR)\"
libclawsgtk_la_LIBADD = \
../common/libclawscommon.la \
$(GTK_LIBS) \
- $(ASPELL_LIBS) \
+ $(ENCHANT_LIBS) \
$(GNOMEPRINT_LIBS) \
$(MAEMO_LIBS)
gtk_text_buffer_insert(buffer, &iter,
(gchar *)Q_("compface|adds support for the X-Face header\n"), -1);
-#if USE_ASPELL
+#if USE_ENCHANT
gtk_text_buffer_insert_pixbuf(buffer, &iter, active_pixbuf);
#else
gtk_text_buffer_insert_pixbuf(buffer, &iter, inactive_pixbuf);
#endif
- gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (" GNU/aspell "), -1,
+ gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, (" Enchant "), -1,
"bold", NULL);
gtk_text_buffer_insert(buffer, &iter,
- (gchar *)Q_("GNU/aspell|adds support for spell checking\n"), -1);
+ (gchar *)Q_("Enchant|adds support for spell checking\n"), -1);
#if USE_GNUTLS
gtk_text_buffer_insert_pixbuf(buffer, &iter, active_pixbuf);
chooser = hildon_file_chooser_dialog_new (NULL, action);
}
#else
+#if !GTK_CHECK_VERSION(2,14,0)
GtkWidget *chooser = gtk_file_chooser_dialog_new_with_backend
(title, NULL, action, "gtk+",
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
action_btn, GTK_RESPONSE_ACCEPT,
NULL);
+#else
+ GtkWidget *chooser = gtk_file_chooser_dialog_new
+ (title, NULL, action,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ action_btn, GTK_RESPONSE_ACCEPT,
+ NULL);
+#endif
#endif
if (filter != NULL) {
GtkFileFilter *file_filter = gtk_file_filter_new();
# include "config.h"
#endif
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
#include <stdio.h>
#include <stdlib.h>
#include <gdk/gdk.h>
#include <gdk/gdkkeysyms.h>
-#include <aspell.h>
+#include <enchant.h>
#include "utils.h"
-#include "codeconv.h"
#include "alertpanel.h"
#include "gtkaspell.h"
#include "gtk/gtkutils.h"
/* number of suggestions to display on each menu. */
#define MENUCOUNT 15
-/* 'config' must be defined as a 'AspellConfig *' */
-#define RETURN_FALSE_IF_CONFIG_ERROR() \
-{ \
- if (aspell_config_error_number(config) != 0) { \
- gtkaspellcheckers->error_message = g_strdup(aspell_config_error_message(config)); \
- return FALSE; \
- } \
-}
-
-#define CONFIG_REPLACE_RETURN_FALSE_IF_FAIL(option, value) { \
- aspell_config_replace(config, option, value); \
- RETURN_FALSE_IF_CONFIG_ERROR(); \
- }
-
enum {
SET_GTKASPELL_NAME = 0,
SET_GTKASPELL_FULLNAME = 1,
typedef struct _Dictionary {
gchar *fullname;
gchar *dictname;
- gchar *encoding;
} Dictionary;
typedef struct _GtkAspeller {
Dictionary *dictionary;
- gint sug_mode;
- AspellConfig *config;
- AspellSpeller *checker;
+ EnchantBroker *broker;
+ EnchantDict *speller;
} GtkAspeller;
typedef void (*ContCheckFunc) (gpointer *gtkaspell);
{
GtkAspeller *gtkaspeller;
GtkAspeller *alternate_speller;
- gchar *dictionary_path;
gchar theword[GTKASPELLWORDSIZE];
gint start_pos;
gint end_pos;
GtkWidget *replace_entry;
GtkWidget *parent_window;
- gint default_sug_mode;
gint max_sug;
GList *suggestions_list;
void *menu_changed_data;
};
-typedef AspellConfig GtkAspellConfig;
-
/******************************************************************************/
static GtkAspellCheckers *gtkaspellcheckers;
/* Error message storage */
-static void gtkaspell_checkers_error_message (gchar *message);
+static void gtkaspell_checkers_error_message (gchar *message);
/* Callbacks */
static void entry_insert_cb (GtkTextBuffer *textbuf,
static GtkAspeller* gtkaspeller_real_delete (GtkAspeller *gtkaspeller);
/* Checker configuration */
-static gint set_dictionary (AspellConfig *config,
+static EnchantDict *set_dictionary (EnchantBroker *broker,
Dictionary *dict);
-static void set_sug_mode_cb (GtkMenuItem *w,
- GtkAspell *gtkaspell);
static void set_use_both_cb (GtkMenuItem *w,
GtkAspell *gtkaspell);
-static void set_real_sug_mode (GtkAspell *gtkaspell,
- const char *themode);
/* Checker actions */
static gboolean check_at (GtkAspell *gtkaspell,
static void replace_word_cb (GtkWidget *w,
gpointer data);
static void replace_real_word (GtkAspell *gtkaspell,
- gchar *newword);
+ const gchar *newword);
static void check_with_alternate_cb (GtkWidget *w,
gpointer data);
static void use_alternate_dict (GtkAspell *gtkaspell);
int pos);
static gboolean get_word_from_pos (GtkAspell *gtkaspell,
gint pos,
- unsigned char* buf,
+ char* buf,
gint buflen,
gint *pstart,
gint *pend);
gint end,
gchar *newtext,
GdkColor *color);
-static gchar* convert_to_aspell_encoding (const gchar *encoding);
static gint compare_dict (Dictionary *a,
Dictionary *b);
static void dictionary_delete (Dictionary *dict);
gpointer data);
static gint find_gtkaspeller (gconstpointer aa,
gconstpointer bb);
-/* gtkspellconfig - only one config per session */
-GtkAspellConfig * gtkaspellconfig;
+
static void destroy_menu(GtkWidget *widget, gpointer user_data);
/******************************************************************************/
static gint get_textview_buffer_charcount(GtkTextView *view);
static void gtkaspell_free_dictionary_list (GSList *list);
-static GSList* gtkaspell_get_dictionary_list (const char *aspell_path,
- gint refresh);
+static GSList* gtkaspell_get_dictionary_list (gint refresh);
static void gtkaspell_uncheck_all (GtkAspell *gtkaspell);
gtkaspellcheckers->error_message = tmp;
} else
gtkaspellcheckers->error_message = message;
+
+
}
const char *gtkaspell_checkers_strerror(void)
gtkaspellcheckers->error_message = NULL;
}
-GtkAspell *gtkaspell_new(const gchar *dictionary_path,
- const gchar *dictionary,
+GtkAspell *gtkaspell_new(const gchar *dictionary,
const gchar *alt_dictionary,
- const gchar *encoding,
+ const gchar *encoding, /* unused */
gint misspelled_color,
gboolean check_while_typing,
gboolean recheck_when_changing_dict,
GtkTextBuffer *buffer;
g_return_val_if_fail(gtktext, NULL);
- g_return_val_if_fail(dictionary && strlen(dictionary) > 0,
- NULL);
-
- g_return_val_if_fail(dictionary_path && strlen(dictionary_path) > 0,
- NULL);
+ if (!dictionary || !*dictionary) {
+ gtkaspell_checkers_error_message(
+ g_strdup(_("No dictionary selected.")));
+ return NULL;
+ }
buffer = gtk_text_view_get_buffer(gtktext);
dict = g_new0(Dictionary, 1);
- dict->fullname = g_strdup(dictionary);
- dict->encoding = g_strdup(encoding);
+ if (strrchr(dictionary, '/')) {
+ dict->fullname = g_strdup(strrchr(dictionary, '/')+1);
+ dict->dictname = g_strdup(strrchr(dictionary, '/')+1);
+ } else {
+ dict->fullname = g_strdup(dictionary);
+ dict->dictname = g_strdup(dictionary);
+ }
gtkaspeller = gtkaspeller_new(dict);
dictionary_delete(dict);
- if (!gtkaspeller)
+ if (!gtkaspeller) {
+ gtkaspell_checkers_error_message(
+ g_strdup_printf(_("Couldn't initialize %s speller."), dictionary));
return NULL;
+ }
gtkaspell = g_new0(GtkAspell, 1);
- gtkaspell->dictionary_path = g_strdup(dictionary_path);
-
gtkaspell->gtkaspeller = gtkaspeller;
if (use_alternate && alt_dictionary && *alt_dictionary) {
GtkAspeller *alt_gtkaspeller;
alt_dict = g_new0(Dictionary, 1);
- alt_dict->fullname = g_strdup(alt_dictionary);
- alt_dict->encoding = g_strdup(encoding);
+ if (strrchr(alt_dictionary, '/')) {
+ alt_dict->fullname = g_strdup(strrchr(alt_dictionary, '/')+1);
+ alt_dict->dictname = g_strdup(strrchr(alt_dictionary, '/')+1);
+ } else {
+ alt_dict->fullname = g_strdup(alt_dictionary);
+ alt_dict->dictname = g_strdup(alt_dictionary);
+ }
alt_gtkaspeller = gtkaspeller_new(alt_dict);
dictionary_delete(alt_dict);
- if (!alt_gtkaspeller)
+ if (!alt_gtkaspeller) {
+ gtkaspell_checkers_error_message(
+ g_strdup_printf(_("Couldn't initialize %s speller."), dictionary));
return NULL;
+ }
gtkaspell->alternate_speller = alt_gtkaspeller;
} else {
gtkaspell->continue_check = NULL;
gtkaspell->replace_entry = NULL;
gtkaspell->gtktext = gtktext;
- gtkaspell->default_sug_mode = ASPELL_FASTMODE;
gtkaspell->max_sug = -1;
gtkaspell->suggestions_list = NULL;
gtkaspell->use_alternate = use_alternate;
if (gtkaspell->suggestions_list)
free_suggestions_list(gtkaspell);
- g_free((gchar *)gtkaspell->dictionary_path);
- gtkaspell->dictionary_path = NULL;
-
debug_print("Aspell: deleting gtkaspell %p\n", gtkaspell);
g_free(gtkaspell);
{
guint pos;
- g_return_if_fail(gtkaspell->gtkaspeller->checker);
+ g_return_if_fail(gtkaspell->gtkaspeller->speller);
if (!gtkaspell->check_while_typing)
return;
int origpos;
gint start, end;
- g_return_if_fail(gtkaspell->gtkaspeller->checker);
+ g_return_if_fail(gtkaspell->gtkaspeller->speller);
if (!gtkaspell->check_while_typing)
return;
g_return_val_if_fail(dictionary, NULL);
- if (dictionary->fullname == NULL)
+ if (dictionary->dictname == NULL)
gtkaspell_checkers_error_message(
g_strdup(_("No dictionary selected.")));
g_return_val_if_fail(dictionary->fullname, NULL);
-
- if (dictionary->dictname == NULL) {
- gchar *tmp;
-
- tmp = strrchr(dictionary->fullname, G_DIR_SEPARATOR);
-
- if (tmp == NULL)
- dictionary->dictname = dictionary->fullname;
- else
- dictionary->dictname = tmp + 1;
- }
dict = dictionary_dup(dictionary);
static GtkAspeller *gtkaspeller_real_new(Dictionary *dict)
{
GtkAspeller *gtkaspeller;
- AspellConfig *config;
- AspellCanHaveError *ret;
+ EnchantBroker *broker;
+ EnchantDict *speller;
g_return_val_if_fail(gtkaspellcheckers, NULL);
g_return_val_if_fail(dict, NULL);
gtkaspeller = g_new(GtkAspeller, 1);
gtkaspeller->dictionary = dict;
- gtkaspeller->sug_mode = ASPELL_FASTMODE;
- config = new_aspell_config();
+ broker = enchant_broker_init();
- if (!set_dictionary(config, dict))
+ if (!broker) {
+ gtkaspell_checkers_error_message(
+ g_strdup(_("Couldn't initialize Enchant broker.")));
return NULL;
-
- ret = new_aspell_speller(config);
- delete_aspell_config(config);
-
- if (aspell_error_number(ret) != 0) {
- gtkaspellcheckers->error_message
- = g_strdup(aspell_error_message(ret));
-
- delete_aspell_can_have_error(ret);
-
+ }
+ if ((speller = set_dictionary(broker, dict)) == NULL) {
+ gtkaspell_checkers_error_message(
+ g_strdup_printf(_("Couldn't initialize %s dictionary:"), dict->fullname));
+ gtkaspell_checkers_error_message(
+ g_strdup(enchant_broker_get_error(broker)));
return NULL;
}
-
- gtkaspeller->checker = to_aspell_speller(ret);
- gtkaspeller->config = aspell_speller_config(gtkaspeller->checker);
+ gtkaspeller->speller = speller;
+ gtkaspeller->broker = broker;
return gtkaspeller;
}
static GtkAspeller *gtkaspeller_real_delete(GtkAspeller *gtkaspeller)
{
g_return_val_if_fail(gtkaspeller, NULL);
- g_return_val_if_fail(gtkaspeller->checker, NULL);
+ g_return_val_if_fail(gtkaspeller->speller, NULL);
- aspell_speller_save_all_word_lists(gtkaspeller->checker);
-
- delete_aspell_speller(gtkaspeller->checker);
+ enchant_broker_free_dict(gtkaspeller->broker, gtkaspeller->speller);
+ enchant_broker_free(gtkaspeller->broker);
dictionary_delete(gtkaspeller->dictionary);
/*****************************************************************************/
/* Checker configuration */
-static gboolean set_dictionary(AspellConfig *config, Dictionary *dict)
+static EnchantDict *set_dictionary(EnchantBroker *broker, Dictionary *dict)
{
- gchar *language = NULL;
- gchar *jargon = NULL;
- gchar *size = NULL;
- gchar buf[BUFSIZE];
-
- g_return_val_if_fail(config, FALSE);
+ g_return_val_if_fail(broker, FALSE);
g_return_val_if_fail(dict, FALSE);
- strncpy(buf, dict->fullname, BUFSIZE-1);
- buf[BUFSIZE-1] = 0x00;
-
- buf[dict->dictname - dict->fullname] = 0x00;
-
- CONFIG_REPLACE_RETURN_FALSE_IF_FAIL("dict-dir", buf);
- debug_print("Aspell: looking for dictionaries in path %s.\n", buf);
-
- strncpy(buf, dict->dictname, BUFSIZE-1);
- language = buf;
-
- if ((size = strrchr(buf, '-')) && isdigit((int) size[1]))
- *size++ = 0x00;
- else
- size = NULL;
-
- if ((jargon = strchr(language, '-')) != NULL)
- *jargon++ = 0x00;
-
- if (size != NULL && jargon == size)
- jargon = NULL;
-
- debug_print("Aspell: language: %s, jargon: %s, size: %s\n",
- language, jargon ? jargon : "",
- size ? size : "");
-
- if (language)
- CONFIG_REPLACE_RETURN_FALSE_IF_FAIL("lang", language);
- if (jargon)
- CONFIG_REPLACE_RETURN_FALSE_IF_FAIL("jargon", jargon);
- if (size)
- CONFIG_REPLACE_RETURN_FALSE_IF_FAIL("size", size);
- if (dict->encoding) {
- gchar *aspell_enc;
-
- aspell_enc = convert_to_aspell_encoding (dict->encoding);
- aspell_config_replace(config, "encoding",
- (const char *) aspell_enc);
- g_free(aspell_enc);
-
- RETURN_FALSE_IF_CONFIG_ERROR();
- }
-
- return TRUE;
+ return enchant_broker_request_dict(broker, dict->dictname );
}
-/* set_sug_mode_cb() - Menu callback: Set the suggestion mode */
-static void set_sug_mode_cb(GtkMenuItem *w, GtkAspell *gtkaspell)
-{
- char *themode;
-
- themode = (char *) gtk_label_get_text(GTK_LABEL(gtk_bin_get_child(GTK_BIN((w)))));
- themode = g_strdup(themode);
-
- set_real_sug_mode(gtkaspell, themode);
- g_free(themode);
- if (gtkaspell->menu_changed_cb)
- gtkaspell->menu_changed_cb(gtkaspell->menu_changed_data);
-}
-
-/* set_sug_mode_cb() - Menu callback: Set the suggestion mode */
static void set_use_both_cb(GtkMenuItem *w, GtkAspell *gtkaspell)
{
gtkaspell->use_both_dicts = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
if (gtkaspell->menu_changed_cb)
gtkaspell->menu_changed_cb(gtkaspell->menu_changed_data);
}
-
-static void set_real_sug_mode(GtkAspell *gtkaspell, const char *themode)
-{
- gint result;
- gint mode = ASPELL_FASTMODE;
- g_return_if_fail(gtkaspell);
- g_return_if_fail(gtkaspell->gtkaspeller);
- g_return_if_fail(themode);
-
- if (!strcmp(themode,_("Normal Mode")))
- mode = ASPELL_NORMALMODE;
- else if (!strcmp( themode,_("Bad Spellers Mode")))
- mode = ASPELL_BADSPELLERMODE;
-
- result = gtkaspell_set_sug_mode(gtkaspell, mode);
-
- if(!result) {
- debug_print("Aspell: error while changing suggestion mode:%s\n",
- gtkaspellcheckers->error_message);
- gtkaspell_checkers_reset_error();
- }
-}
-/* gtkaspell_set_sug_mode() - Set the suggestion mode */
-gboolean gtkaspell_set_sug_mode(GtkAspell *gtkaspell, gint themode)
-{
- AspellConfig *config;
-
- g_return_val_if_fail(gtkaspell, FALSE);
- g_return_val_if_fail(gtkaspell->gtkaspeller, FALSE);
- g_return_val_if_fail(gtkaspell->gtkaspeller->config, FALSE);
-
- debug_print("Aspell: setting sug mode of gtkaspeller %p to %d\n",
- gtkaspell->gtkaspeller, themode);
-
- config = gtkaspell->gtkaspeller->config;
-
- switch (themode) {
- case ASPELL_FASTMODE:
- CONFIG_REPLACE_RETURN_FALSE_IF_FAIL("sug-mode", "fast");
- break;
- case ASPELL_NORMALMODE:
- CONFIG_REPLACE_RETURN_FALSE_IF_FAIL("sug-mode", "normal");
- break;
- case ASPELL_BADSPELLERMODE:
- CONFIG_REPLACE_RETURN_FALSE_IF_FAIL("sug-mode",
- "bad-spellers");
- break;
- default:
- gtkaspellcheckers->error_message =
- g_strdup(_("Unknown suggestion mode."));
- return FALSE;
- }
-
- gtkaspell->gtkaspeller->sug_mode = themode;
- gtkaspell->default_sug_mode = themode;
-
- return TRUE;
-}
-
/* misspelled_suggest() - Create a suggestion list for word */
static GList *misspelled_suggest(GtkAspell *gtkaspell, gchar *word)
{
- const guchar *newword;
GList *list = NULL;
- const AspellWordList *suggestions;
- AspellStringEnumeration *elements;
-
+ char **suggestions;
+ size_t num_sug, i;
g_return_val_if_fail(word, NULL);
- if (!aspell_speller_check(gtkaspell->gtkaspeller->checker, word, -1)) {
- free_suggestions_list(gtkaspell);
-
- suggestions = aspell_speller_suggest(
- gtkaspell->gtkaspeller->checker,
- (const char *)word, -1);
- elements = aspell_word_list_elements(suggestions);
- list = g_list_append(list, g_strdup(word));
-
- while ((newword = (guchar *)aspell_string_enumeration_next(elements)) != NULL)
- list = g_list_append(list, g_strdup((gchar *)newword));
+ if (*word == 0)
+ return NULL;
- gtkaspell->max_sug = g_list_length(list) - 1;
- gtkaspell->suggestions_list = list;
+ free_suggestions_list(gtkaspell);
- return list;
+ suggestions = enchant_dict_suggest(gtkaspell->gtkaspeller->speller, word, strlen(word), &num_sug);
+ if (suggestions == NULL || num_sug == 0) {
+ gtkaspell->max_sug = - 1;
+ gtkaspell->suggestions_list = NULL;
+ return NULL;
}
+ list = g_list_append(list, g_strdup(word));
+ for (i = 0; i < num_sug; i++)
+ list = g_list_append(list, g_strdup((gchar *)suggestions[i]));
- free_suggestions_list(gtkaspell);
-
- return NULL;
+ gtkaspell->max_sug = num_sug - 1;
+ gtkaspell->suggestions_list = list;
+ enchant_dict_free_string_list(gtkaspell->gtkaspeller->speller, suggestions);
+ return list;
}
/* misspelled_test() - Just test if word is correctly spelled */
-static int misspelled_test(GtkAspell *gtkaspell, unsigned char *word)
+static int misspelled_test(GtkAspell *gtkaspell, char *word)
{
- gint result = aspell_speller_check(gtkaspell->gtkaspeller->checker, (char *)word, -1)
- ? 0 : 1;
+ gint result = 0;
+ g_return_val_if_fail(word, 0);
+
+ if (*word == 0)
+ return 0;
+
+ result = enchant_dict_check(gtkaspell->gtkaspeller->speller, word, strlen(word));
+
if (result && gtkaspell->use_both_dicts && gtkaspell->alternate_speller) {
use_alternate_dict(gtkaspell);
- result = aspell_speller_check(gtkaspell->gtkaspeller->checker, (char *)word, -1)
- ? 0 : 1;
+ result = enchant_dict_check(gtkaspell->gtkaspeller->speller, word, strlen(word));
use_alternate_dict(gtkaspell);
}
return result;
gtk_text_buffer_get_iter_at_offset(buffer, &end, pos+1);
utf8chars = gtk_text_iter_get_text(&start, &end);
- if (is_ascii_str(utf8chars)) {
- a = utf8chars ? (gunichar)utf8chars[0] : '\0' ;
- } else {
- gchar *tr = conv_iconv_strdup(utf8chars, CS_UTF_8,
- gtkaspell->gtkaspeller->dictionary->encoding);
- if (tr) {
- a = g_utf8_get_char(tr);
- g_free(tr);
- }
- }
+ a = g_utf8_get_char(utf8chars);
g_free(utf8chars);
return a;
/* get_word_from_pos () - return the word pointed to. */
/* Handles correctly the quotes. */
static gboolean get_word_from_pos(GtkAspell *gtkaspell, gint pos,
- unsigned char* buf, gint buflen,
+ char* buf, gint buflen,
gint *pstart, gint *pend)
{
if (buf) {
if (end - start < buflen) {
GtkTextIter iterstart, iterend;
- gchar *tmp, *conv;
+ gchar *tmp;
GtkTextBuffer *buffer = gtk_text_view_get_buffer(gtktext);
gtk_text_buffer_get_iter_at_offset(buffer, &iterstart, start);
gtk_text_buffer_get_iter_at_offset(buffer, &iterend, end);
tmp = gtk_text_buffer_get_text(buffer, &iterstart, &iterend, FALSE);
- conv = conv_iconv_strdup(tmp, CS_UTF_8,
- gtkaspell->gtkaspeller->dictionary->encoding);
- g_free(tmp);
- strncpy((char *)buf, conv, buflen-1);
+ strncpy(buf, tmp, buflen-1);
buf[buflen-1]='\0';
- g_free(conv);
+ g_free(tmp);
} else
return FALSE;
}
static gboolean check_at(GtkAspell *gtkaspell, gint from_pos)
{
gint start, end;
- unsigned char buf[GTKASPELLWORDSIZE];
+ char buf[GTKASPELLWORDSIZE];
GtkTextView *gtktext;
g_return_val_if_fail(from_pos >= 0, FALSE);
return FALSE;
if (misspelled_test(gtkaspell, buf)
- && strcasecmp((char *)buf, "sylpheed") && strcasecmp((char *)buf, "claws-mail")) {
+ && strcasecmp(buf, "sylpheed") && strcasecmp(buf, "claws-mail")) {
strncpy(gtkaspell->theword, (gchar *)buf, GTKASPELLWORDSIZE - 1);
gtkaspell->theword[GTKASPELLWORDSIZE - 1] = 0;
gtkaspell->start_pos = start;
guint len;
GtkTextView *gtktext;
- g_return_if_fail(gtkaspell->gtkaspeller->checker);
+ g_return_if_fail(gtkaspell->gtkaspeller->speller);
gtktext = gtkaspell->gtktext;
static void replace_with_supplied_word_cb(GtkWidget *w, GtkAspell *gtkaspell)
{
- unsigned char *newword;
+ char *newword;
GdkEvent *e= (GdkEvent *) gtk_get_current_event();
- newword = (unsigned char *)gtk_editable_get_chars(GTK_EDITABLE(gtkaspell->replace_entry),
+ newword = gtk_editable_get_chars(GTK_EDITABLE(gtkaspell->replace_entry),
0, -1);
- if (strcmp((char *)newword, gtkaspell->theword)) {
- replace_real_word(gtkaspell, (char *)newword);
+ if (strcmp(newword, gtkaspell->theword)) {
+ replace_real_word(gtkaspell, newword);
if ((e->type == GDK_KEY_PRESS &&
((GdkEventKey *) e)->state & GDK_CONTROL_MASK)) {
- aspell_speller_store_replacement(
- gtkaspell->gtkaspeller->checker,
- gtkaspell->theword, -1,
- (char *)newword, -1);
+ enchant_dict_store_replacement(gtkaspell->gtkaspeller->speller,
+ gtkaspell->theword, strlen(gtkaspell->theword),
+ newword, strlen(newword));
}
gtkaspell->replace_entry = NULL;
}
static void replace_word_cb(GtkWidget *w, gpointer data)
{
- unsigned char *newword;
+ const char *newword;
GtkAspell *gtkaspell = (GtkAspell *) data;
GdkEvent *e= (GdkEvent *) gtk_get_current_event();
- newword = (unsigned char *) gtk_label_get_text(GTK_LABEL(gtk_bin_get_child(GTK_BIN((w)))));
- newword = (unsigned char *)g_strdup((char *)newword);
+ newword = gtk_label_get_text(GTK_LABEL(gtk_bin_get_child(GTK_BIN((w)))));
- replace_real_word(gtkaspell, (char *)newword);
+ replace_real_word(gtkaspell, newword);
if ((e->type == GDK_KEY_PRESS &&
((GdkEventKey *) e)->state & GDK_CONTROL_MASK) ||
(e->type == GDK_BUTTON_RELEASE &&
((GdkEventButton *) e)->state & GDK_CONTROL_MASK)) {
- aspell_speller_store_replacement(
- gtkaspell->gtkaspeller->checker,
- gtkaspell->theword, -1,
- (char *)newword, -1);
+ enchant_dict_store_replacement(gtkaspell->gtkaspeller->speller,
+ gtkaspell->theword, strlen(gtkaspell->theword),
+ newword, strlen(newword));
}
gtk_menu_shell_deactivate(GTK_MENU_SHELL(w->parent));
set_point_continue(gtkaspell);
- g_free(newword);
}
-static void replace_real_word(GtkAspell *gtkaspell, gchar *newword)
+static void replace_real_word(GtkAspell *gtkaspell, const gchar *newword)
{
int oldlen, newlen, wordlen;
gint origpos;
pos = get_textview_buffer_offset(gtktext);
- aspell_speller_add_to_session(gtkaspell->gtkaspeller->checker,
- gtkaspell->theword,
- strlen(gtkaspell->theword));
+ enchant_dict_add_to_session(gtkaspell->gtkaspeller->speller, gtkaspell->theword, strlen(gtkaspell->theword));
check_at(gtkaspell, gtkaspell->start_pos);
{
GtkAspell *gtkaspell = (GtkAspell *) data;
- aspell_speller_add_to_personal(gtkaspell->gtkaspeller->checker,
- gtkaspell->theword,
- strlen(gtkaspell->theword));
+ enchant_dict_add_to_pwl(gtkaspell->gtkaspeller->speller, gtkaspell->theword, strlen(gtkaspell->theword));
check_at(gtkaspell, gtkaspell->start_pos);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox,
FALSE, FALSE, 0);
- utf8buf = conv_codeset_strdup(gtkaspell->theword,
- conv_get_locale_charset_str(),
- CS_UTF_8);
+ utf8buf = g_strdup(gtkaspell->theword);
thelabel = g_strdup_printf(_("<span weight=\"bold\" "
"size=\"larger\">Replace \"%s\" with: </span>"),
dict = g_new0(Dictionary, 1);
dict->fullname = g_strdup(_("None"));
- dict->dictname = dict->fullname;
- dict->encoding = NULL;
+ dict->dictname = NULL;
return g_slist_append(list, dict);
}
+static void list_dict_cb(const char * const lang_tag,
+ const char * const provider_name,
+ const char * const provider_desc,
+ const char * const provider_file,
+ void * data)
+{
+ GSList **list = (GSList **)data;
+ Dictionary *dict = g_new0(Dictionary, 1);
+ dict->fullname = g_strdup(lang_tag);
+ dict->dictname = g_strdup(lang_tag);
+
+ if (g_slist_find_custom(*list, dict,
+ (GCompareFunc) compare_dict) == NULL) {
+ debug_print("Aspell: found dictionary %s %s\n", dict->fullname,
+ dict->dictname);
+ *list = g_slist_insert_sorted(*list, dict,
+ (GCompareFunc) compare_dict);
+ } else {
+ dictionary_delete(dict);
+ }
+}
+
/* gtkaspell_get_dictionary_list() - returns list of dictionary names */
-static GSList *gtkaspell_get_dictionary_list(const gchar *aspell_path, gint refresh)
+static GSList *gtkaspell_get_dictionary_list(gint refresh)
{
GSList *list;
- Dictionary *dict;
- AspellConfig *config;
- AspellDictInfoList *dlist;
- AspellDictInfoEnumeration *dels;
- const AspellDictInfo *entry;
+ EnchantBroker *broker;
if (!gtkaspellcheckers)
gtkaspell_checkers_init();
gtkaspellcheckers->dictionary_list);
list = NULL;
- config = new_aspell_config();
+ broker = enchant_broker_init();
- aspell_config_replace(config, "dict-dir", aspell_path);
- if (aspell_config_error_number(config) != 0) {
- gtkaspellcheckers->error_message = g_strdup(
- aspell_config_error_message(config));
- gtkaspellcheckers->dictionary_list =
- create_empty_dictionary_list();
+ enchant_broker_list_dicts(broker, list_dict_cb, &list);
- return gtkaspellcheckers->dictionary_list;
- }
+ enchant_broker_free(broker);
- dlist = get_aspell_dict_info_list(config);
- delete_aspell_config(config);
-
- debug_print("Aspell: checking for dictionaries in %s\n", aspell_path?aspell_path:"(null)");
- dels = aspell_dict_info_list_elements(dlist);
- while ( (entry = aspell_dict_info_enumeration_next(dels)) != 0)
- {
- dict = g_new0(Dictionary, 1);
- dict->fullname = g_strdup_printf("%s%s", aspell_path,
- entry->name);
- dict->dictname = dict->fullname + strlen(aspell_path);
- dict->encoding = g_strdup(entry->code);
-
- if (g_slist_find_custom(list, dict,
- (GCompareFunc) compare_dict) != NULL) {
- dictionary_delete(dict);
- continue;
- }
-
- debug_print("Aspell: found dictionary %s %s %s\n", dict->fullname,
- dict->dictname, dict->encoding);
- list = g_slist_insert_sorted(list, dict,
- (GCompareFunc) compare_dict);
- }
-
- delete_aspell_dict_info_enumeration(dels);
-
- if(list==NULL){
+ if (list == NULL){
debug_print("Aspell: error when searching for dictionaries: "
"No dictionary found.\n");
g_slist_free(list);
}
-GtkTreeModel *gtkaspell_dictionary_store_new_with_refresh(const gchar *aspell_path,
- gboolean refresh)
+GtkTreeModel *gtkaspell_dictionary_store_new_with_refresh(gboolean refresh)
{
GSList *dict_list, *tmp;
GtkListStore *store;
GtkTreeIter iter;
Dictionary *dict;
- dict_list = gtkaspell_get_dictionary_list(aspell_path, refresh);
+ dict_list = gtkaspell_get_dictionary_list(refresh);
g_return_val_if_fail(dict_list, NULL);
store = gtk_list_store_new(SET_GTKASPELL_SIZE,
return GTK_TREE_MODEL(store);
}
-GtkTreeModel *gtkaspell_dictionary_store_new(const gchar *aspell_path)
+GtkTreeModel *gtkaspell_dictionary_store_new(void)
{
return gtkaspell_dictionary_store_new_with_refresh
- (aspell_path, TRUE);
+ (TRUE);
}
-GtkWidget *gtkaspell_dictionary_combo_new(const gchar *aspell_path,
- const gboolean refresh)
+GtkWidget *gtkaspell_dictionary_combo_new(const gboolean refresh)
{
GtkWidget *combo;
GtkCellRenderer *renderer;
combo = gtk_combo_box_new_with_model(
- gtkaspell_dictionary_store_new_with_refresh(aspell_path, refresh));
+ gtkaspell_dictionary_store_new_with_refresh(refresh));
gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 0);
gtk_widget_show(combo);
return 0;
}
-GtkWidget *gtkaspell_sugmode_combo_new(gint sugmode)
-{
- GtkWidget *combo = gtkut_sc_combobox_create(NULL, FALSE);
- GtkListStore *store = GTK_LIST_STORE(gtk_combo_box_get_model(
- GTK_COMBO_BOX(combo)));
- GtkTreeIter iter;
-
- g_return_val_if_fail(store != NULL, NULL);
-
- COMBOBOX_ADD(store, _("Fast Mode"), ASPELL_FASTMODE);
- COMBOBOX_ADD(store, _("Normal Mode"), ASPELL_NORMALMODE);
- COMBOBOX_ADD(store, _("Bad Spellers Mode"), ASPELL_BADSPELLERMODE);
-
- gtk_combo_box_set_active(GTK_COMBO_BOX(combo), sugmode - 1);
- gtk_widget_show(combo);
-
- return combo;
-}
-
static void use_alternate_dict(GtkAspell *gtkaspell)
{
GtkAspeller *tmp;
GSList *list = NULL;
gtktext = gtkaspell->gtktext;
+ if (l == NULL)
+ return NULL;
+
accel = gtk_accel_group_new();
if (gtkaspell->accel_group) {
gtkaspell->accel_group = NULL;
}
- utf8buf = conv_codeset_strdup((char*)l->data,
- conv_get_locale_charset_str(),
- CS_UTF_8);
+ utf8buf = g_strdup(l->data);
caption = g_strdup_printf(_("\"%s\" unknown in %s"),
utf8buf,
gtkaspell->gtkaspeller->dictionary->dictname);
curmenu);
}
- utf8buf = conv_codeset_strdup((char*)l->data,
- conv_get_locale_charset_str(),
- CS_UTF_8);
+ utf8buf = g_strdup(l->data);
+
item = gtk_menu_item_new_with_label(utf8buf);
g_free(utf8buf);
gtk_widget_show(item);
gtk_widget_show(item);
list = g_slist_append(list, item);
- item = gtk_check_menu_item_new_with_label(_("Fast Mode"));
- gtk_check_menu_item_set_draw_as_radio(GTK_CHECK_MENU_ITEM(item), TRUE);
- if (gtkaspell->gtkaspeller->sug_mode == ASPELL_FASTMODE) {
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item),TRUE);
- gtk_widget_set_sensitive(GTK_WIDGET(item),FALSE);
- } else
- g_signal_connect(G_OBJECT(item), "activate",
- G_CALLBACK(set_sug_mode_cb),
- gtkaspell);
- gtk_widget_show(item);
- list = g_slist_append(list, item);
-
- item = gtk_check_menu_item_new_with_label(_("Normal Mode"));
- gtk_check_menu_item_set_draw_as_radio(GTK_CHECK_MENU_ITEM(item), TRUE);
- if (gtkaspell->gtkaspeller->sug_mode == ASPELL_NORMALMODE) {
- gtk_widget_set_sensitive(GTK_WIDGET(item), FALSE);
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), TRUE);
- } else
- g_signal_connect(G_OBJECT(item), "activate",
- G_CALLBACK(set_sug_mode_cb),
- gtkaspell);
- gtk_widget_show(item);
- list = g_slist_append(list, item);
-
- item = gtk_check_menu_item_new_with_label(_("Bad Spellers Mode"));
- gtk_check_menu_item_set_draw_as_radio(GTK_CHECK_MENU_ITEM(item), TRUE);
- if (gtkaspell->gtkaspeller->sug_mode == ASPELL_BADSPELLERMODE) {
- gtk_widget_set_sensitive(GTK_WIDGET(item), FALSE);
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), TRUE);
- } else
- g_signal_connect(G_OBJECT(item), "activate",
- G_CALLBACK(set_sug_mode_cb),
- gtkaspell);
- gtk_widget_show(item);
- list = g_slist_append(list, item);
-
- item = gtk_menu_item_new();
- gtk_widget_show(item);
- list = g_slist_append(list, item);
-
item = gtk_check_menu_item_new_with_label(_("Check while typing"));
if (gtkaspell->check_while_typing)
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), TRUE);
/* Dict list */
if (gtkaspellcheckers->dictionary_list == NULL)
- gtkaspell_get_dictionary_list(gtkaspell->dictionary_path, FALSE);
+ gtkaspell_get_dictionary_list(FALSE);
{
GtkWidget * curmenu = submenu;
int count = 0;
{
Dictionary *dict;
GtkAspeller *gtkaspeller;
- gint sug_mode;
g_return_val_if_fail(gtkaspell, FALSE);
g_return_val_if_fail(dictionary, FALSE);
- sug_mode = gtkaspell->default_sug_mode;
-
dict = g_new0(Dictionary, 1);
- dict->fullname = g_strdup(dictionary);
- dict->encoding = g_strdup(gtkaspell->gtkaspeller->dictionary->encoding);
+
+ if (strrchr(dictionary, '/')) {
+ dict->fullname = g_strdup(strrchr(dictionary, '/')+1);
+ dict->dictname = g_strdup(strrchr(dictionary, '/')+1);
+ } else {
+ dict->fullname = g_strdup(dictionary);
+ dict->dictname = g_strdup(dictionary);
+ }
gtkaspeller = gtkaspeller_new(dict);
gtkaspeller_delete(gtkaspell->gtkaspeller);
gtkaspell->gtkaspeller = gtkaspeller;
- gtkaspell_set_sug_mode(gtkaspell, sug_mode);
}
dictionary_delete(dict);
g_return_val_if_fail(alt_dictionary, FALSE);
dict = g_new0(Dictionary, 1);
- dict->fullname = g_strdup(alt_dictionary);
- dict->encoding = g_strdup(gtkaspell->gtkaspeller->dictionary->encoding);
+ if (strrchr(alt_dictionary, '/')) {
+ dict->fullname = g_strdup(strrchr(alt_dictionary, '/')+1);
+ dict->dictname = g_strdup(strrchr(alt_dictionary, '/')+1);
+ } else {
+ dict->fullname = g_strdup(alt_dictionary);
+ dict->dictname = g_strdup(alt_dictionary);
+ }
gtkaspeller = gtkaspeller_new(dict);
}
}
-/* convert_to_aspell_encoding () - converts ISO-8859-* strings to iso8859-*
- * as needed by aspell. Returns an allocated string.
- */
-
-static gchar *convert_to_aspell_encoding (const gchar *encoding)
-{
- gchar * aspell_encoding;
-
- if (strstr2(encoding, "ISO-8859-")) {
- aspell_encoding = g_strdup_printf("iso8859%s", encoding+8);
- }
- else {
- if (!strcmp2(encoding, "US-ASCII"))
- aspell_encoding = g_strdup("iso8859-1");
- else
- aspell_encoding = g_strdup(encoding);
- }
-
- return aspell_encoding;
-}
-
/* compare_dict () - compare 2 dict names */
static gint compare_dict(Dictionary *a, Dictionary *b)
{
static void dictionary_delete(Dictionary *dict)
{
g_free(dict->fullname);
- g_free(dict->encoding);
+ g_free(dict->dictname);
g_free(dict);
}
dict2 = g_new(Dictionary, 1);
dict2->fullname = g_strdup(dict->fullname);
- dict2->dictname = dict->dictname - dict->fullname + dict2->fullname;
- dict2->encoding = g_strdup(dict->encoding);
+ dict2->dictname = g_strdup(dict->dictname);
return dict2;
}
Dictionary *a = ((GtkAspeller *) aa)->dictionary;
Dictionary *b = ((GtkAspeller *) bb)->dictionary;
- if (a && b && a->fullname && b->fullname &&
- strcmp(a->fullname, b->fullname) == 0 &&
- a->encoding && b->encoding)
- return strcmp(a->encoding, b->encoding);
+ if (a && b && a->fullname && b->fullname)
+ return strcmp(a->fullname, b->fullname);
return 1;
}
*
*/
-#ifndef __GTKASPELL_H__
-#define __GTKASPELL_H__
+#ifndef __GTKENCHANT_H__
+#define __GTKENCHANT_H__
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
#include <gtk/gtk.h>
void gtkaspell_checkers_reset_error (void);
-GtkAspell* gtkaspell_new (const gchar *dictionary_path,
- const gchar *dictionary,
+GtkAspell* gtkaspell_new (const gchar *dictionary,
const gchar *alt_dictionary,
const gchar *encoding,
gint misspelled_color,
const gchar* alt_dictionary);
-gboolean gtkaspell_set_sug_mode (GtkAspell *gtkaspell,
- gint themode);
-
void gtkaspell_check_forwards_go (GtkAspell *gtkaspell);
void gtkaspell_check_backwards (GtkAspell *gtkaspell);
void gtkaspell_check_all (GtkAspell *gtkaspell);
void gtkaspell_highlight_all (GtkAspell *gtkaspell);
-GtkWidget* gtkaspell_dictionary_combo_new (const gchar *aspell_path,
- const gboolean refresh);
+GtkWidget* gtkaspell_dictionary_combo_new (const gboolean refresh);
-GtkTreeModel* gtkaspell_dictionary_store_new (const gchar *aspell_path);
+GtkTreeModel* gtkaspell_dictionary_store_new (void);
GtkTreeModel* gtkaspell_dictionary_store_new_with_refresh
- (const gchar *aspell_path,
- gboolean refresh);
+ (gboolean refresh);
gchar* gtkaspell_get_dictionary_menu_active_item
(GtkComboBox *combo);
(GtkComboBox *combo,
const gchar *dictionary);
-GtkWidget* gtkaspell_sugmode_combo_new (gint sugmode);
-
GSList* gtkaspell_make_config_menu (GtkAspell *gtkaspell);
gchar *gtkaspell_get_default_dictionary(GtkAspell *gtkaspell);
-#endif /* USE_ASPELL */
-#endif /* __GTKASPELL_H__ */
+#endif /* USE_ENCHANT */
+#endif /* __GTKENCHANT_H__ */
else
g_print(" compface\n");
#endif
-#if USE_ASPELL
+#if USE_ENCHANT
if (show_debug_only)
debug_print(" aspell\n");
else
"claws-mail", G_TYPE_INVALID, G_TYPE_INVALID);
}
if (error) {
- debug_print(error->message);
+ debug_print("%s", error->message);
g_error_free(error);
}
}
gboolean asked_for_migration = FALSE;
gboolean start_done = TRUE;
GtkUIManager *gui_manager = NULL;
-
+ GSList *plug_list = NULL;
+
START_TIMING("startup");
sc_starting = TRUE;
prefs_receive_init();
prefs_send_init();
tags_read_tags();
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
gtkaspell_checkers_init();
prefs_spelling_init();
#endif
prefs_matcher_read_config();
}
- if (plugin_get_unloaded_list() != NULL) {
+ if ((plug_list = plugin_get_unloaded_list()) != NULL) {
+ GSList *cur;
+ gchar *list = NULL;
+ gint num_plugins = 0;
+ for (cur = plug_list; cur; cur = cur->next) {
+ Plugin *plugin = (Plugin *)cur->data;
+ gchar *tmp = g_strdup_printf("%s\n%s",
+ list? list:"",
+ plugin_get_name(plugin));
+ g_free(list);
+ list = tmp;
+ num_plugins++;
+ }
main_window_cursor_normal(mainwin);
- alertpanel_warning(_("Some plugin(s) failed to load. "
+ alertpanel_warning(ngettext(
+ "The following plugin failed to load. "
+ "Check the Plugins configuration "
+ "for more information:\n%s",
+ "The following plugins failed to load. "
"Check the Plugins configuration "
- "for more information."));
+ "for more information:\n%s",
+ num_plugins),
+ list);
main_window_cursor_wait(mainwin);
+ g_free(list);
+ g_slist_free(plug_list);
}
plugin_load_standard_plugins ();
prefs_logging_done();
prefs_send_done();
tags_write_tags();
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
prefs_spelling_done();
gtkaspell_checkers_quit();
#endif
-I$(top_srcdir)/src/gtk
AM_CPPFLAGS = \
- $(ASPELL_CFLAGS) \
+ $(ENCHANT_CFLAGS) \
$(GLIB_CFLAGS) \
$(GTK_CFLAGS) \
$(OPENSSL_CFLAGS) \
-I$(top_srcdir)/src/gtk
AM_CPPFLAGS = \
- $(ASPELL_CFLAGS) \
+ $(ENCHANT_CFLAGS) \
$(GLIB_CFLAGS) \
$(GTK_CFLAGS) \
$(OPENSSL_CFLAGS) \
-I$(top_srcdir)/src/gtk
AM_CPPFLAGS = \
- $(ASPELL_CFLAGS) \
+ $(ENCHANT_CFLAGS) \
$(GLIB_CFLAGS) \
$(GTK_CFLAGS) \
$(OPENSSL_CFLAGS) \
AM_CPPFLAGS = \
$(GLIB_CFLAGS) \
$(GTK_CFLAGS) \
- $(ASPELL_CFLAGS) \
+ $(ENCHANT_CFLAGS) \
$(OPENSSL_CFLAGS) \
$(MAEMO_CFLAGS)
GtkWidget *autobcc_entry;
GtkWidget *autoreplyto_checkbtn;
GtkWidget *autoreplyto_entry;
-#if USE_ASPELL
+#if USE_ENCHANT
GtkWidget *checkbtn_enable_default_dictionary;
GtkWidget *combo_default_dictionary;
GtkWidget *checkbtn_enable_default_alt_dictionary;
static void prefs_account_filter_on_recv_toggled(GtkToggleButton *button,
gpointer user_data);
-#if USE_ASPELL
+#if USE_ENCHANT
static void prefs_account_compose_default_dictionary_set_string_from_optmenu
(PrefParam *pparam);
static void prefs_account_compose_default_dictionary_set_optmenu_from_string
&compose_page.autoreplyto_entry,
prefs_set_data_from_entry, prefs_set_entry},
-#if USE_ASPELL
+#if USE_ENCHANT
{"enable_default_dictionary", "", &tmp_ac_prefs.enable_default_dictionary, P_BOOL,
&compose_page.checkbtn_enable_default_dictionary,
prefs_set_data_from_toggle, prefs_set_toggle},
GtkWidget *autobcc_entry;
GtkWidget *autoreplyto_checkbtn;
GtkWidget *autoreplyto_entry;
-#if USE_ASPELL
+#if USE_ENCHANT
GtkWidget *frame_dict;
GtkWidget *table_dict;
GtkWidget *checkbtn_enable_default_dictionary = NULL;
SET_TOGGLE_SENSITIVITY (autoreplyto_checkbtn, autoreplyto_entry);
-#if USE_ASPELL
+#if USE_ENCHANT
PACK_FRAME (vbox1, frame_dict, _("Spell check dictionaries"));
table_dict = gtk_table_new (2, 2, FALSE);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_enable_default_dictionary),
tmp_ac_prefs.enable_default_dictionary);
- combo_default_dictionary = gtkaspell_dictionary_combo_new(
- prefs_common.aspell_path, TRUE);
+ combo_default_dictionary = gtkaspell_dictionary_combo_new(TRUE);
gtk_table_attach(GTK_TABLE(table_dict), combo_default_dictionary, 1, 2,
0, 1, GTK_EXPAND | GTK_FILL, GTK_SHRINK, 0, 0);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_enable_default_alt_dictionary),
tmp_ac_prefs.enable_default_alt_dictionary);
- combo_default_alt_dictionary = gtkaspell_dictionary_combo_new(
- prefs_common.aspell_path, FALSE);
+ combo_default_alt_dictionary = gtkaspell_dictionary_combo_new(FALSE);
gtk_table_attach(GTK_TABLE(table_dict), combo_default_alt_dictionary, 1, 2,
1, 2, GTK_EXPAND | GTK_FILL, GTK_SHRINK, 0, 0);
page->autobcc_entry = autobcc_entry;
page->autoreplyto_checkbtn = autoreplyto_checkbtn;
page->autoreplyto_entry = autoreplyto_entry;
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
page->checkbtn_enable_default_dictionary = checkbtn_enable_default_dictionary;
page->combo_default_dictionary = combo_default_dictionary;
page->checkbtn_enable_default_alt_dictionary = checkbtn_enable_default_alt_dictionary;
page->combo_default_alt_dictionary = combo_default_alt_dictionary;
#endif
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
/* reset gtkaspell menus */
if (compose_page.combo_default_dictionary != NULL) {
gtk_combo_box_set_model(GTK_COMBO_BOX(compose_page.combo_default_dictionary),
- gtkaspell_dictionary_store_new(prefs_common.aspell_path));
+ gtkaspell_dictionary_store_new());
gtk_combo_box_set_model(GTK_COMBO_BOX(compose_page.combo_default_alt_dictionary),
gtkaspell_dictionary_store_new_with_refresh(
- prefs_common.aspell_path, FALSE));
+ FALSE));
}
#endif
gtk_widget_set_sensitive(receive_page.filterhook_on_recv_checkbtn, do_filter);
}
-#if USE_ASPELL
+#if USE_ENCHANT
static void prefs_account_compose_default_dictionary_set_string_from_optmenu
(PrefParam *pparam)
{
if (dictionary == NULL)
return;
+ if (strrchr(dictionary, '/')) {
+ dictionary = g_strdup(strrchr(dictionary, '/')+1);
+ }
+
combo = *pparam->widget;
if (dictionary)
gtkaspell_set_dictionary_menu_active_item(GTK_COMBO_BOX(combo),
P_BOOL, NULL, NULL, NULL},
{"autosave_length", "50", &prefs_common.autosave_length, P_INT,
NULL, NULL, NULL},
-#if USE_ASPELL
+#if USE_ENCHANT
{"enable_aspell", "TRUE", &prefs_common.enable_aspell, P_BOOL,
NULL, NULL, NULL},
- {"aspell_path", ASPELL_PATH, &prefs_common.aspell_path, P_STRING,
- NULL, NULL, NULL},
{"dictionary", "", &prefs_common.dictionary, P_STRING,
NULL, NULL, NULL},
{"alt_dictionary", "", &prefs_common.alt_dictionary, P_STRING,
NULL, NULL, NULL},
- {"aspell_sugmode", "1", &prefs_common.aspell_sugmode, P_INT,
- NULL, NULL, NULL},
{"use_alternate_dict", "FALSE", &prefs_common.use_alternate, P_BOOL,
NULL, NULL, NULL},
{"check_while_typing", "TRUE", &prefs_common.check_while_typing, P_BOOL,
gboolean block_cursor;
gchar *quote_chars;
-#if USE_ASPELL
+#if USE_ENCHANT
gboolean enable_aspell;
- gchar *aspell_path;
gchar *dictionary;
gchar *alt_dictionary;
gulong misspelled_col;
- gint aspell_sugmode;
gboolean check_while_typing;
gboolean recheck_when_changing_dict;
gboolean use_alternate;
#include "quote_fmt.h"
#include "combobox.h"
-#if USE_ASPELL
+#if USE_ENCHANT
#include "gtkaspell.h"
#endif
GtkWidget *entry_default_reply_to;
GtkWidget *checkbtn_enable_default_account;
GtkWidget *optmenu_default_account;
-#if USE_ASPELL
+#if USE_ENCHANT
GtkWidget *checkbtn_enable_default_dictionary;
GtkWidget *checkbtn_enable_default_alt_dictionary;
GtkWidget *combo_default_dictionary;
GtkWidget *default_to_rec_checkbtn;
GtkWidget *default_reply_to_rec_checkbtn;
GtkWidget *default_account_rec_checkbtn;
-#if USE_ASPELL
+#if USE_ENCHANT
GtkWidget *default_dictionary_rec_checkbtn;
GtkWidget *default_alt_dictionary_rec_checkbtn;
#endif
GtkWidget *optmenu_default_account = NULL;
GtkListStore *optmenu_default_account_menu = NULL;
GtkTreeIter iter;
-#if USE_ASPELL
+#if USE_ENCHANT
GtkWidget *checkbtn_enable_default_dictionary = NULL;
GtkWidget *combo_default_dictionary = NULL;
GtkWidget *checkbtn_enable_default_alt_dictionary = NULL;
page->item = item;
/* Table */
-#if USE_ASPELL
+#if USE_ENCHANT
# define TABLEHEIGHT 7
#else
# define TABLEHEIGHT 6
rowcount, rowcount + 1, GTK_SHRINK, GTK_SHRINK, 0, 0);
rowcount++;
-#if USE_ASPELL
+#if USE_ENCHANT
/* Default dictionary */
checkbtn_enable_default_dictionary = gtk_check_button_new_with_label(_("Default dictionary"));
gtk_table_attach(GTK_TABLE(table), checkbtn_enable_default_dictionary, 0, 1,
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_enable_default_dictionary),
item->prefs->enable_default_dictionary);
- combo_default_dictionary = gtkaspell_dictionary_combo_new(
- prefs_common.aspell_path, TRUE);
+ combo_default_dictionary = gtkaspell_dictionary_combo_new(TRUE);
gtk_table_attach(GTK_TABLE(table), combo_default_dictionary, 1, 2,
rowcount, rowcount + 1, GTK_EXPAND | GTK_FILL, GTK_SHRINK, 0, 0);
dictionary = item->prefs->default_dictionary;
+ if (dictionary && strrchr(dictionary, '/')) {
+ gchar *tmp = g_strdup(strrchr(dictionary, '/')+1);
+ g_free(item->prefs->default_dictionary);
+ item->prefs->default_dictionary = tmp;
+ dictionary = item->prefs->default_dictionary;
+ }
if (dictionary)
gtkaspell_set_dictionary_menu_active_item(
GTK_COMBO_BOX(combo_default_dictionary), dictionary);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_enable_default_alt_dictionary),
item->prefs->enable_default_alt_dictionary);
- combo_default_alt_dictionary = gtkaspell_dictionary_combo_new(
- prefs_common.aspell_path, FALSE);
+ combo_default_alt_dictionary = gtkaspell_dictionary_combo_new(FALSE);
gtk_table_attach(GTK_TABLE(table), combo_default_alt_dictionary, 1, 2,
rowcount, rowcount + 1, GTK_EXPAND | GTK_FILL, GTK_SHRINK, 0, 0);
dictionary = item->prefs->default_alt_dictionary;
+ if (dictionary && strrchr(dictionary, '/')) {
+ gchar *tmp = g_strdup(strrchr(dictionary, '/')+1);
+ g_free(item->prefs->default_alt_dictionary);
+ item->prefs->default_alt_dictionary = tmp;
+ dictionary = item->prefs->default_alt_dictionary;
+ }
if (dictionary)
gtkaspell_set_dictionary_menu_active_item(
GTK_COMBO_BOX(combo_default_alt_dictionary), dictionary);
page->entry_default_reply_to = entry_default_reply_to;
page->checkbtn_enable_default_account = checkbtn_enable_default_account;
page->optmenu_default_account = optmenu_default_account;
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
page->checkbtn_enable_default_dictionary = checkbtn_enable_default_dictionary;
page->combo_default_dictionary = combo_default_dictionary;
page->checkbtn_enable_default_alt_dictionary = checkbtn_enable_default_alt_dictionary;
page->default_to_rec_checkbtn = default_to_rec_checkbtn;
page->default_reply_to_rec_checkbtn = default_reply_to_rec_checkbtn;
page->default_account_rec_checkbtn = default_account_rec_checkbtn;
-#if USE_ASPELL
+#if USE_ENCHANT
page->default_dictionary_rec_checkbtn = default_dictionary_rec_checkbtn;
page->default_alt_dictionary_rec_checkbtn = default_alt_dictionary_rec_checkbtn;
#endif
GTK_COMBO_BOX(page->optmenu_default_account));
}
-#if USE_ASPELL
+#if USE_ENCHANT
if (all || gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->default_dictionary_rec_checkbtn))) {
prefs->enable_default_dictionary =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_enable_default_dictionary));
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->save_copy_to_folder_rec_checkbtn)) ||
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->default_to_rec_checkbtn)) ||
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->default_account_rec_checkbtn)) ||
-#if USE_ASPELL
+#if USE_ENCHANT
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->default_dictionary_rec_checkbtn)) ||
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->default_alt_dictionary_rec_checkbtn)) ||
#endif
return TRUE;
else if ((node == page->item->node) && item_protocol(item) == A_NNTP &&
!(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->default_account_rec_checkbtn))
-#if USE_ASPELL
+#if USE_ENCHANT
|| gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->default_dictionary_rec_checkbtn))
|| gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->default_alt_dictionary_rec_checkbtn))
#endif
# include "config.h"
#endif
-#if USE_ASPELL
+#if USE_ENCHANT
#include "defs.h"
GtkWidget *automatic_frame;
GtkWidget *dictionary_frame;
- GtkWidget *path_frame;
GtkWidget *enable_aspell_checkbtn;
GtkWidget *recheck_when_changing_dict_checkbtn;
GtkWidget *check_while_typing_checkbtn;
GtkWidget *use_alternate_checkbtn;
- GtkWidget *aspell_path_entry;
- GtkWidget *aspell_path_select;
-
GtkWidget *default_dict_label;
GtkWidget *default_dict_combo;
GtkWidget *both_dict_check;
- GtkWidget *sugmode_label;
- GtkWidget *sugmode_combo;
-
GtkWidget *misspelled_label;
GtkWidget *misspelled_colorbtn;
GtkWidget *misspelled_useblack_label;
gint misspell_col;
} SpellingPage;
-static void prefs_spelling_btn_aspell_path_clicked_cb(GtkWidget *widget,
- gpointer data)
-{
- SpellingPage *spelling = (SpellingPage *) data;
- gchar *file_path;
-
- file_path = filesel_select_file_open(_("Select dictionaries location"),
- prefs_common.aspell_path);
- if (file_path != NULL) {
- gchar *tmp_path, *tmp;
-
- tmp_path = g_path_get_dirname(file_path);
- tmp = g_strdup_printf("%s%s", tmp_path, G_DIR_SEPARATOR_S);
- g_free(tmp_path);
-
- gtk_combo_box_set_model(GTK_COMBO_BOX(spelling->default_dict_combo),
- gtkaspell_dictionary_store_new(tmp));
-
- gtk_combo_box_set_model(GTK_COMBO_BOX(spelling->default_alt_dict_combo),
- gtkaspell_dictionary_store_new_with_refresh(tmp, FALSE));
-
- gtk_entry_set_text(GTK_ENTRY(spelling->aspell_path_entry), tmp);
- /* select first one */
- gtk_combo_box_set_active(GTK_COMBO_BOX(
- spelling->default_dict_combo), 0);
- gtk_combo_box_set_active(GTK_COMBO_BOX(
- spelling->default_alt_dict_combo), 0);
-
- g_free(tmp);
-
- }
-}
-
static void prefs_spelling_colorsel(GtkWidget *widget,
gpointer data)
{
GtkWidget *automatic_frame;
GtkWidget *dictionary_frame;
- GtkWidget *path_frame;
-
- GtkWidget *aspell_path_hbox;
- GtkWidget *aspell_path_entry;
- GtkWidget *aspell_path_select;
GtkWidget *table;
GtkWidget *default_alt_dict_label;
GtkWidget *default_alt_dict_combo;
- GtkWidget *sugmode_label;
- GtkWidget *sugmode_combo;
-
GtkWidget *both_dict_check;
GtkWidget *misspelled_label;
GtkWidget *misspelled_hbox;
CLAWS_SET_TIP(use_alternate_checkbtn,
_("Faster switching with last used dictionary"));
- PACK_FRAME(vbox1, path_frame, _("Path to dictionaries"));
- aspell_path_hbox = gtk_hbox_new(FALSE, 8);
- gtk_widget_show(aspell_path_hbox);
- gtk_container_add(GTK_CONTAINER(path_frame), aspell_path_hbox);
- gtk_container_set_border_width(GTK_CONTAINER(aspell_path_hbox), 8);
-
- aspell_path_entry = gtk_entry_new();
- gtk_widget_show(aspell_path_entry);
- gtk_box_pack_start(GTK_BOX(aspell_path_hbox), aspell_path_entry, TRUE, TRUE, 0);
- gtk_widget_set_size_request(aspell_path_entry, 30, 20);
-
- aspell_path_select = gtkut_get_browse_directory_btn(_("_Browse"));
- gtk_widget_show(aspell_path_select);
- gtk_box_pack_start(GTK_BOX(aspell_path_hbox), aspell_path_select, FALSE, FALSE, 0);
-
vbox2 = gtkut_get_options_frame(vbox1, &automatic_frame, _("Automatic spell checking"));
check_while_typing_checkbtn = gtk_check_button_new_with_label(
gtk_label_set_justify(GTK_LABEL(default_dict_label), GTK_JUSTIFY_RIGHT);
gtk_misc_set_alignment(GTK_MISC(default_dict_label), 1, 0.5);
- default_dict_combo = gtkaspell_dictionary_combo_new(
- prefs_common.aspell_path, TRUE);
+ 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_label_set_justify(GTK_LABEL(default_alt_dict_label), GTK_JUSTIFY_RIGHT);
gtk_misc_set_alignment(GTK_MISC(default_alt_dict_label), 1, 0.5);
- default_alt_dict_combo = gtkaspell_dictionary_combo_new(
- prefs_common.aspell_path, FALSE);
+ 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_table_attach (GTK_TABLE (table), both_dict_check, 1, 2, 2, 3,
GTK_SHRINK, 0, 0, 0);
- sugmode_label = gtk_label_new(_("Default suggestion mode"));
- gtk_widget_show(sugmode_label);
- gtk_table_attach(GTK_TABLE (table), sugmode_label, 0, 1, 3, 4,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (0), 0, 2);
- gtk_label_set_justify(GTK_LABEL(sugmode_label), GTK_JUSTIFY_RIGHT);
- gtk_misc_set_alignment(GTK_MISC(sugmode_label), 1, 0.5);
-
- sugmode_combo = gtkaspell_sugmode_combo_new(prefs_common.aspell_sugmode);
- gtk_widget_set_size_request(sugmode_combo, 180, -1);
- gtk_table_attach (GTK_TABLE (table), sugmode_combo, 1, 2, 3, 4,
- GTK_SHRINK, 0, 0, 0);
-
misspelled_hbox = gtk_hbox_new(FALSE, 10);
gtk_widget_show(misspelled_hbox);
gtk_box_pack_start(GTK_BOX(vbox1), misspelled_hbox, FALSE, FALSE, 0);
SET_TOGGLE_SENSITIVITY(enable_aspell_checkbtn, automatic_frame);
SET_TOGGLE_SENSITIVITY(enable_aspell_checkbtn, dictionary_frame);
- SET_TOGGLE_SENSITIVITY(enable_aspell_checkbtn, path_frame);
SET_TOGGLE_SENSITIVITY(enable_aspell_checkbtn, misspelled_label);
SET_TOGGLE_SENSITIVITY(enable_aspell_checkbtn, misspelled_colorbtn);
SET_TOGGLE_SENSITIVITY(enable_aspell_checkbtn, use_alternate_checkbtn);
prefs_common.recheck_when_changing_dict);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(use_alternate_checkbtn),
prefs_common.use_alternate);
- gtk_entry_set_text(GTK_ENTRY(aspell_path_entry),
- SAFE_STRING(prefs_common.aspell_path));
- g_signal_connect(G_OBJECT(aspell_path_select), "clicked",
- G_CALLBACK(prefs_spelling_btn_aspell_path_clicked_cb),
- prefs_spelling);
+ if (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, '/')) {
+ gchar *tmp = g_strdup(strrchr(prefs_common.alt_dictionary, '/')+1);
+ g_free(prefs_common.alt_dictionary);
+ prefs_common.alt_dictionary = tmp;
+ }
gtkaspell_set_dictionary_menu_active_item(GTK_COMBO_BOX(default_dict_combo),
prefs_common.dictionary);
prefs_spelling->window = GTK_WIDGET(window);
prefs_spelling->automatic_frame = automatic_frame;
prefs_spelling->dictionary_frame = dictionary_frame;
- prefs_spelling->path_frame = path_frame;
prefs_spelling->enable_aspell_checkbtn = enable_aspell_checkbtn;
prefs_spelling->check_while_typing_checkbtn
= check_while_typing_checkbtn;
prefs_spelling->recheck_when_changing_dict_checkbtn
= recheck_when_changing_dict_checkbtn;
prefs_spelling->use_alternate_checkbtn = use_alternate_checkbtn;
- prefs_spelling->aspell_path_entry = aspell_path_entry;
- prefs_spelling->aspell_path_select = aspell_path_select;
prefs_spelling->default_dict_label = default_dict_label;
prefs_spelling->default_dict_combo = default_dict_combo;
prefs_spelling->default_alt_dict_label = default_alt_dict_label;
prefs_spelling->default_alt_dict_combo = default_alt_dict_combo;
- prefs_spelling->sugmode_label = sugmode_label;
- prefs_spelling->sugmode_combo = sugmode_combo;
prefs_spelling->misspelled_label = misspelled_label;
prefs_spelling->misspelled_colorbtn = misspelled_colorbtn;
prefs_spelling->both_dict_check = both_dict_check;
prefs_common.use_both_dicts =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(spelling->both_dict_check));
- g_free(prefs_common.aspell_path);
- prefs_common.aspell_path =
- gtk_editable_get_chars(GTK_EDITABLE(spelling->aspell_path_entry), 0, -1);
-
g_free(prefs_common.dictionary);
prefs_common.dictionary =
gtkaspell_get_dictionary_menu_active_item(
gtkaspell_get_dictionary_menu_active_item(
GTK_COMBO_BOX(spelling->default_alt_dict_combo));
- prefs_common.aspell_sugmode =
- combobox_get_active_data(GTK_COMBO_BOX(spelling->sugmode_combo));
-
prefs_common.misspelled_col = spelling->misspell_col;
}
language = "en";
if (!prefs_common.dictionary)
- prefs_common.dictionary = g_strdup_printf("%s%s",
- prefs_common.aspell_path,
+ prefs_common.dictionary = g_strdup_printf("%s",
language);
if (!strlen(prefs_common.dictionary)
|| !strcmp(prefs_common.dictionary,"(None"))
- prefs_common.dictionary = g_strdup_printf("%s%s",
- prefs_common.aspell_path,
+ prefs_common.dictionary = g_strdup_printf("%s",
language);
if (strcasestr(prefs_common.dictionary,".utf"))
*(strcasestr(prefs_common.dictionary,".utf")) = '\0';
g_free(prefs_spelling);
}
-#endif /* USE_ASPELL */
+#endif /* USE_ENCHANT */
tmp = g_strdup(string);
}
memset(&dummyinfo, 0, sizeof(MsgInfo));
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
quote_fmt_init(&dummyinfo, NULL, NULL, TRUE, account, FALSE, NULL);
#else
quote_fmt_init(&dummyinfo, NULL, NULL, TRUE, account, FALSE);
#define __QUOTE_FMT_H__
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
#include "gtkaspell.h"
#endif
gchar *quote_fmt_get_buffer(void);
GList *quote_fmt_get_attachments_list(void);
gint quote_fmt_get_line(void);
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
void quote_fmt_init(MsgInfo *info, const gchar *my_quote_str,
const gchar *my_body, gboolean my_dry_run,
PrefsAccount *account,
static MsgInfo *msginfo = NULL;
static PrefsAccount *account = NULL;
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
static gchar default_dictionary[BUFFSIZE];
#endif
static gboolean *visible = NULL;
}
}
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
void quote_fmt_init(MsgInfo *info, const gchar *my_quote_str,
const gchar *my_body, gboolean my_dry_run,
PrefsAccount *compose_account,
body = my_body;
msginfo = info;
account = compose_account;
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
gchar *dict = gtkaspell_get_default_dictionary(compose_gtkaspell);
if (dict)
strncpy2(default_dictionary, dict, sizeof(default_dictionary));
}
| SHOW_ACCOUNT_DICT
{
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
if (account && account->enable_default_dictionary) {
gchar *dictname = g_path_get_basename(account->default_dictionary);
INSERT(dictname);
}
| SHOW_DICT
{
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
INSERT(default_dictionary);
#endif
}
}
| QUERY_ACCOUNT_DICT
{
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
add_visibility(account != NULL && account->enable_default_dictionary == TRUE &&
account->default_dictionary != NULL && *account->default_dictionary != '\0');
#else
}
| QUERY_DICT
{
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
add_visibility(*default_dictionary != '\0');
#else
add_visibility(FALSE);
}
| QUERY_NOT_ACCOUNT_DICT
{
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
add_visibility(account == NULL || account->enable_default_dictionary == FALSE
|| *account->default_dictionary == '\0');
#else
}
| QUERY_NOT_DICT
{
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
add_visibility(*default_dictionary == '\0');
#else
add_visibility(FALSE);
gpointer data);
static void toolbar_addrbook_cb (GtkWidget *widget,
gpointer data);
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
static void toolbar_check_spelling_cb (GtkWidget *widget,
gpointer data);
#endif
{ "A_LINEWRAP_CURRENT", N_("Wrap long lines of current paragraph") },
{ "A_LINEWRAP_ALL", N_("Wrap all long lines") },
{ "A_ADDRBOOK", N_("Address book") },
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
{ "A_CHECK_SPELLING", N_("Check spelling") },
#endif
{ "A_CLAWS_ACTIONS", N_("Claws Mail Actions Feature") },
A_INSERT, A_ATTACH, A_SIG,
A_EXTEDITOR, A_LINEWRAP_CURRENT,
A_LINEWRAP_ALL, A_ADDRBOOK,
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
A_CHECK_SPELLING,
#endif
A_CLOSE };
case A_ADDRBOOK: return _("Address");
case A_CANCEL_INC: return _("Stop");
case A_EXECUTE: return _("Execute");
- #ifdef USE_ASPELL
+ #ifdef USE_ENCHANT
case A_CHECK_SPELLING: return _("Check spelling");
#endif
default: return "";
case A_ADDRBOOK: return STOCK_PIXMAP_ADDRESS_BOOK;
case A_CANCEL_INC: return STOCK_PIXMAP_CANCEL;
case A_EXECUTE: return STOCK_PIXMAP_EXEC;
- #ifdef USE_ASPELL
+ #ifdef USE_ENCHANT
case A_CHECK_SPELLING: return STOCK_PIXMAP_CHECK_SPELLING;
#endif
default: return -1;
compose_toolbar_cb(A_LINEWRAP_ALL, data);
}
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
static void toolbar_check_spelling_cb(GtkWidget *widget, gpointer data)
{
compose_toolbar_cb(A_CHECK_SPELLING, data);
{ A_LINEWRAP_CURRENT, toolbar_linewrap_current_cb },
{ A_LINEWRAP_ALL, toolbar_linewrap_all_cb },
{ A_ADDRBOOK, toolbar_addrbook_cb },
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
{ A_CHECK_SPELLING, toolbar_check_spelling_cb },
#endif
{ A_CLAWS_ACTIONS, toolbar_actions_execute_cb },
TOOLBAR_ITEM(item,icon_wid,toolbar_item->text,_("Address book"));
toolbar_data->addrbook_btn = item;
break;
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
case A_CHECK_SPELLING:
TOOLBAR_ITEM(item,icon_wid,toolbar_item->text,_("Check spelling"));
toolbar_data->spellcheck_btn = item;
GTK_BUTTON_SET_SENSITIVE(compose->toolbar->linewrap_all_btn, sensitive);
if (compose->toolbar->addrbook_btn)
GTK_BUTTON_SET_SENSITIVE(compose->toolbar->addrbook_btn, sensitive);
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
if (compose->toolbar->spellcheck_btn)
GTK_BUTTON_SET_SENSITIVE(compose->toolbar->spellcheck_btn, sensitive);
#endif
toolbar->linewrap_current_btn = NULL;
toolbar->linewrap_all_btn = NULL;
toolbar->addrbook_btn = NULL;
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
toolbar->spellcheck_btn = NULL;
#endif
GtkWidget *linewrap_current_btn;
GtkWidget *linewrap_all_btn;
GtkWidget *addrbook_btn;
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
GtkWidget *spellcheck_btn;
#endif
A_LINEWRAP_CURRENT,
A_LINEWRAP_ALL,
A_ADDRBOOK,
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
A_CHECK_SPELLING,
#endif