commit 4ff94391be71a002daf57a60fb67e63af7d6feaf
Author: Jan-Michael Brummer <jan.brummer@tabos.org>
Date:   Tue Nov 19 15:46:33 2013 +0100

    Spell checking: Add gtkspell requirement and allow spell-checking of OOO messages

diff --git a/configure.ac b/configure.ac
index b2d3b4f..988add1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -270,6 +270,31 @@ AC_ARG_WITH([internal-lzx],
 AM_CONDITIONAL(HAVE_MSPACK, [test "$have_mspack" = "yes"])
 
 dnl ****************************
+dnl gtkspell is optional
+dnl ****************************
+AC_ARG_ENABLE([gtkspell],
+	[AS_HELP_STRING([--enable-gtkspell],
+	[Enable gtkspell @<:@default=no@:>@])],
+	[enable_gtkspell="$enableval"], [enable_gtkspell="no"])
+
+if test "x$enable_gtkspell" = "xyes"; then
+	PKG_CHECK_MODULES(
+		[GTKSPELL],
+		[gtkspell-2.0],,
+		[AC_MSG_ERROR([
+
+	gtkspell-2.0 not found
+
+	If you want to disable the gtkspell feature,
+	please append --disable-gtkspell to configure.
+
+	])])
+
+	AC_DEFINE(WITH_GTKSPELL, 1, [When defined spell checking is enabled])
+fi
+
+
+dnl ****************************
 dnl Check for libsoup's SOUP_MESSAGE_IDEMPOTENT SoupMessage flag
 dnl ****************************
 AC_MSG_CHECKING([libsoup SOUP_MESSAGE_IDEMPOTENT flag])
diff --git a/src/configuration/Makefile.am b/src/configuration/Makefile.am
index bf07287..5d8344f 100644
--- a/src/configuration/Makefile.am
+++ b/src/configuration/Makefile.am
@@ -9,6 +9,7 @@ module_ews_configuration_la_CPPFLAGS = \
 	-I$(top_srcdir)/src \
 	$(EVOLUTION_MAIL_CFLAGS) \
 	$(EVOLUTION_SHELL_CFLAGS) \
+	$(GTKSPELL_CFLAGS) \
 	$(NULL)
 
 module_ews_configuration_la_SOURCES = \
@@ -53,6 +54,7 @@ module_ews_configuration_la_LIBADD = \
 	$(top_builddir)/src/utils/libewsutils.la \
 	$(EVOLUTION_MAIL_LIBS) \
 	$(EVOLUTION_SHELL_LIBS) \
+	$(GTKSPELL_LIBS) \
 	$(NULL)
 
 module_ews_configuration_la_LDFLAGS = \
diff --git a/src/configuration/e-mail-config-ews-ooo-page.c b/src/configuration/e-mail-config-ews-ooo-page.c
index db99434..0058917 100644
--- a/src/configuration/e-mail-config-ews-ooo-page.c
+++ b/src/configuration/e-mail-config-ews-ooo-page.c
@@ -28,6 +28,10 @@
 #include <gtk/gtk.h>
 #include <glib/gi18n-lib.h>
 
+#ifdef WITH_GTKSPELL
+#include <gtkspell/gtkspell.h>
+#endif
+
 #include <e-util/e-util.h>
 
 #include "server/camel-ews-settings.h"
@@ -568,6 +572,10 @@ mail_config_ews_ooo_page_constructed (GObject *object)
 	container = widget;
 
 	widget = gtk_text_view_new ();
+#ifdef WITH_GTKSPELL
+	gtkspell_new_attach (GTK_TEXT_VIEW (widget), NULL, NULL);
+#endif
+
 	gtk_label_set_mnemonic_widget (label, widget);
 	gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (widget), GTK_WRAP_WORD);
 	gtk_container_add (GTK_CONTAINER (container), widget);
@@ -619,6 +627,9 @@ mail_config_ews_ooo_page_constructed (GObject *object)
 	container = widget;
 
 	widget = gtk_text_view_new ();
+#ifdef WITH_GTKSPELL
+	gtkspell_new_attach (GTK_TEXT_VIEW (widget), NULL, NULL);
+#endif
 	gtk_label_set_mnemonic_widget (label, widget);
 	gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (widget), GTK_WRAP_WORD);
 	gtk_container_add (GTK_CONTAINER (container), widget);
