- activate spell checking support
patch from SVN via Fedora thanks to J.C. Roberts for spotting the issue
This commit is contained in:
parent
da62d86b3c
commit
ab0ffb5ec7
@ -1,29 +1,31 @@
|
||||
# $OpenBSD: Makefile,v 1.81 2008/10/30 18:23:50 landry Exp $
|
||||
# $OpenBSD: Makefile,v 1.82 2008/11/15 10:41:14 ajacoutot Exp $
|
||||
|
||||
COMMENT= mail/news client in gtk+
|
||||
|
||||
MAJOR= 2.5
|
||||
VERSION= ${MAJOR}.0
|
||||
DISTNAME= sylpheed-${VERSION}
|
||||
PKGNAME= ${DISTNAME}p0
|
||||
PKGNAME= ${DISTNAME}p1
|
||||
CATEGORIES= mail news x11
|
||||
HOMEPAGE= http://sylpheed.sraoss.jp/en
|
||||
|
||||
# GPL
|
||||
# GPLv2 - LGPLv2
|
||||
PERMIT_PACKAGE_CDROM= Yes
|
||||
PERMIT_PACKAGE_FTP= Yes
|
||||
PERMIT_DISTFILES_CDROM= Yes
|
||||
PERMIT_DISTFILES_FTP= Yes
|
||||
|
||||
MODULES= devel/gettext
|
||||
LIB_DEPENDS= gtk-x11-2.0.>=0.9,gdk_pixbuf-2.0.>=0.9,gdk-x11-2.0.>=0.9::x11/gtk+2
|
||||
LIB_DEPENDS= gtk-x11-2.0.>=0.9,gdk_pixbuf-2.0.>=0.9,gdk-x11-2.0.>=0.9::x11/gtk+2 \
|
||||
gtkspell.>=1::textproc/gtkspell
|
||||
|
||||
WANTLIB= X11 Xau Xcomposite Xdamage Xdmcp Xrender \
|
||||
Xcursor Xext Xfixes Xi Xinerama Xrandr \
|
||||
atk-1.0 c cairo crypto expat fontconfig \
|
||||
freetype glib-2.0 glitz gdk-x11-2.0 gdk_pixbuf-2.0 \
|
||||
gmodule-2.0 gobject-2.0 gtk-x11-2.0 m pcre \
|
||||
pthread pango-1.0 pangocairo-1.0 pangoft2-1.0 \
|
||||
pixman-1 png ssl z
|
||||
pixman-1 png ssl z enchant stdc++
|
||||
|
||||
RUN_DEPENDS= ::devel/desktop-file-utils
|
||||
MASTER_SITES= http://sylpheed.sraoss.jp/sylpheed/v${MAJOR}/
|
||||
@ -32,8 +34,11 @@ MASTER_SITES0= ${MASTER_SITE_SOURCEFORGE:=sylpheed-claws/}
|
||||
USE_X11= Yes
|
||||
USE_LIBTOOL= Yes
|
||||
CONFIGURE_STYLE= gnu
|
||||
CONFIGURE_ARGS= --enable-ssl --enable-ipv6 \
|
||||
--disable-gtkspell --disable-imlib
|
||||
CONFIGURE_ARGS= ${CONFIGURE_SHARED} \
|
||||
--enable-ssl \
|
||||
--enable-ipv6 \
|
||||
--enable-gtkspell \
|
||||
--disable-imlib
|
||||
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
|
||||
LDFLAGS="-L${LOCALBASE}/lib -pthread"
|
||||
|
||||
@ -56,4 +61,7 @@ WANTLIB+= gpg-error
|
||||
CONFIGURE_ARGS+= --disable-gpgme
|
||||
.endif
|
||||
|
||||
post-configure:
|
||||
echo "#define USE_ENCHANT 1" >> ${WRKBUILD}/config.h
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
120
mail/sylpheed/patches/patch-src_compose_c
Normal file
120
mail/sylpheed/patches/patch-src_compose_c
Normal file
@ -0,0 +1,120 @@
|
||||
$OpenBSD: patch-src_compose_c,v 1.1 2008/11/15 10:41:15 ajacoutot Exp $
|
||||
--- src/compose.c.orig Fri May 16 11:23:12 2008
|
||||
+++ src/compose.c Thu Nov 13 18:35:10 2008
|
||||
@@ -69,8 +69,12 @@
|
||||
#if USE_GTKSPELL
|
||||
# include <gtk/gtkradiomenuitem.h>
|
||||
# include <gtkspell/gtkspell.h>
|
||||
+#if USE_ENCHANT
|
||||
+# include <enchant/enchant.h>
|
||||
+#else
|
||||
# include <aspell.h>
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -5296,6 +5300,7 @@ static Compose *compose_create(PrefsAccount *account,
|
||||
compose->check_spell = prefs_common.check_spell;
|
||||
compose->spell_lang = g_strdup(prefs_common.spell_lang);
|
||||
compose->spell_menu = spell_menu;
|
||||
+ compose->dict_list = NULL;
|
||||
#endif /* USE_GTKSPELL */
|
||||
|
||||
compose->focused_editable = NULL;
|
||||
@@ -5732,8 +5737,37 @@ static void compose_set_out_encoding(Compose *compose)
|
||||
}
|
||||
|
||||
#if USE_GTKSPELL
|
||||
+#if USE_ENCHANT
|
||||
+static void ench_dict_desc_cb(const char *const lang_tag,
|
||||
+ const char *const provider_name,
|
||||
+ const char *const provider_desc,
|
||||
+ const char *const provider_file,
|
||||
+ void *user_data)
|
||||
+{
|
||||
+ GSList **dict_list = (GSList **)user_data;
|
||||
+ *dict_list = g_slist_append(*dict_list, g_strdup((gchar*)lang_tag));
|
||||
+}
|
||||
+
|
||||
static void compose_set_spell_lang_menu(Compose *compose)
|
||||
{
|
||||
+ EnchantBroker *eb;
|
||||
+ GSList *dict_list = NULL, *menu_list = NULL, *cur;
|
||||
+ GtkWidget *menu;
|
||||
+ gboolean lang_set = FALSE;
|
||||
+
|
||||
+ eb = enchant_broker_init();
|
||||
+ enchant_broker_list_dicts(eb, ench_dict_desc_cb, &dict_list);
|
||||
+ enchant_broker_free(eb);
|
||||
+
|
||||
+ for (cur = dict_list; cur != NULL; cur = cur->next) {
|
||||
+ if (compose->spell_lang != NULL &&
|
||||
+ g_ascii_strcasecmp(compose->spell_lang,
|
||||
+ (gchar *)cur->data) == 0)
|
||||
+ lang_set = TRUE;
|
||||
+ }
|
||||
+#else /* !USE_ENCHANT */
|
||||
+static void compose_set_spell_lang_menu(Compose *compose)
|
||||
+{
|
||||
AspellConfig *config;
|
||||
AspellDictInfoList *dlist;
|
||||
AspellDictInfoEnumeration *dels;
|
||||
@@ -5748,13 +5782,16 @@ static void compose_set_spell_lang_menu(Compose *compo
|
||||
|
||||
dels = aspell_dict_info_list_elements(dlist);
|
||||
while ((entry = aspell_dict_info_enumeration_next(dels)) != 0) {
|
||||
- dict_list = g_slist_append(dict_list, (gchar *)entry->name);
|
||||
+ dict_list = g_slist_append(dict_list, g_strdup(entry->name));
|
||||
if (compose->spell_lang != NULL &&
|
||||
g_ascii_strcasecmp(compose->spell_lang, entry->name) == 0)
|
||||
lang_set = TRUE;
|
||||
}
|
||||
delete_aspell_dict_info_enumeration(dels);
|
||||
+#endif /* USE_ENCHANT */
|
||||
|
||||
+ compose->dict_list = dict_list;
|
||||
+
|
||||
menu = gtk_menu_new();
|
||||
|
||||
for (cur = dict_list; cur != NULL; cur = cur->next) {
|
||||
@@ -5777,15 +5814,18 @@ static void compose_set_spell_lang_menu(Compose *compo
|
||||
g_object_set_data(G_OBJECT(item), "spell-lang", dict);
|
||||
gtk_widget_show(item);
|
||||
|
||||
- if (!lang_set && g_ascii_strcasecmp("en", dict) == 0)
|
||||
+ if (!lang_set && g_ascii_strcasecmp("en", dict) == 0) {
|
||||
+ g_free(compose->spell_lang);
|
||||
+ compose->spell_lang = g_strdup("en");
|
||||
gtk_check_menu_item_set_active
|
||||
(GTK_CHECK_MENU_ITEM(item), TRUE);
|
||||
+ }
|
||||
}
|
||||
|
||||
gtk_widget_show(menu);
|
||||
gtk_menu_item_set_submenu(GTK_MENU_ITEM(compose->spell_menu), menu);
|
||||
}
|
||||
-#endif
|
||||
+#endif /* USE_GTKSPELL */
|
||||
|
||||
static void compose_set_template_menu(Compose *compose)
|
||||
{
|
||||
@@ -5924,6 +5964,8 @@ static void compose_destroy(Compose *compose)
|
||||
address_completion_end(compose->window);
|
||||
|
||||
#if USE_GTKSPELL
|
||||
+ slist_free_strings(compose->dict_list);
|
||||
+ g_slist_free(compose->dict_list);
|
||||
g_free(compose->spell_lang);
|
||||
#endif
|
||||
|
||||
@@ -7505,7 +7547,8 @@ static void compose_toggle_spell_cb(gpointer data, gui
|
||||
GtkSpell *speller;
|
||||
|
||||
if (GTK_CHECK_MENU_ITEM(widget)->active) {
|
||||
- debug_print("Spell checking enabled\n");
|
||||
+ debug_print("Spell checking enabled: %s\n",
|
||||
+ compose->spell_lang ? compose->spell_lang : "(none)");
|
||||
speller = gtkspell_new_attach(GTK_TEXT_VIEW(compose->text),
|
||||
compose->spell_lang, NULL);
|
||||
compose->check_spell = TRUE;
|
25
mail/sylpheed/patches/patch-src_compose_h
Normal file
25
mail/sylpheed/patches/patch-src_compose_h
Normal file
@ -0,0 +1,25 @@
|
||||
$OpenBSD: patch-src_compose_h,v 1.1 2008/11/15 10:41:15 ajacoutot Exp $
|
||||
--- src/compose.h.orig Thu May 8 10:37:28 2008
|
||||
+++ src/compose.h Thu Nov 13 18:35:10 2008
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
|
||||
- * Copyright (C) 1999-2007 Hiroyuki Yamamoto
|
||||
+ * Copyright (C) 1999-2008 Hiroyuki Yamamoto
|
||||
*
|
||||
* 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
|
||||
@@ -133,9 +133,10 @@ struct _Compose
|
||||
GtkWidget *tmpl_menu;
|
||||
|
||||
#if USE_GTKSPELL
|
||||
- GtkWidget *spell_menu;
|
||||
- gchar *spell_lang;
|
||||
- gboolean check_spell;
|
||||
+ GtkWidget *spell_menu;
|
||||
+ gchar *spell_lang;
|
||||
+ gboolean check_spell;
|
||||
+ GSList *dict_list;
|
||||
#endif
|
||||
|
||||
ComposeMode mode;
|
Loading…
x
Reference in New Issue
Block a user