diary r85 - in trunk: . src



Author: pwithnall
Date: Fri Oct 10 23:13:02 2008
New Revision: 85
URL: http://svn.gnome.org/viewvc/diary?rev=85&view=rev

Log:
2008-10-11  Philip Withnall  <philip tecnocode co uk>

	* Makefile.am:
	* configure.ac:
	* src/Makefile.am:
	* src/main-window.c (almanah_main_window_new),
	(mw_calendar_day_selected_cb): Make spell checking optional at
	compile time.



Modified:
   trunk/ChangeLog
   trunk/Makefile.am
   trunk/configure.ac
   trunk/src/Makefile.am
   trunk/src/main-window.c

Modified: trunk/Makefile.am
==============================================================================
--- trunk/Makefile.am	(original)
+++ trunk/Makefile.am	Fri Oct 10 23:13:02 2008
@@ -16,7 +16,7 @@
 	intltool-merge		\
 	intltool-update
 
-# Copy all the spec files. Of cource, only one is actually used.
+# Copy all the spec files. Of course, only one is actually used.
 dist-hook:
 	for specfile in *.spec; do \
 		if test -f $$specfile; then \

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Fri Oct 10 23:13:02 2008
@@ -41,6 +41,20 @@
 
 AM_CONDITIONAL([ENCRYPTION], [test x$encryption = xtrue])
 
+AC_ARG_ENABLE([spell-checking],
+	[  --enable-spell-checking	Enable spell checking support],
+	[case "${enableval}" in
+		yes) spell_checking=true ;;
+		no)  spell_checking=false ;;
+		*) AC_MSG_ERROR([bad value ${enableval} for --enable-spell-checking]) ;;
+	esac],[spell_checking=true])
+
+if test $spell_checking = "true"; then
+	AC_DEFINE([ENABLE_SPELL_CHECKING],[1],[Define if you want spell checking support])
+fi
+
+AM_CONDITIONAL([SPELL_CHECKING], [test x$spell_checking = xtrue])
+
 dnl ***************************************************************************
 dnl Internationalisation
 dnl ***************************************************************************
@@ -53,10 +67,16 @@
 
 AM_PROG_LIBTOOL
 
-PKG_CHECK_MODULES(STANDARD, glib-2.0 gtk+-2.0 >= 2.12 gmodule-2.0 gio-2.0 sqlite3 gtkspell-2.0 cairo)
+PKG_CHECK_MODULES(STANDARD, glib-2.0 gtk+-2.0 >= 2.12 gmodule-2.0 gio-2.0 sqlite3 cairo)
 AC_SUBST(STANDARD_CFLAGS)
 AC_SUBST(STANDARD_LIBS)
 
+if test $spell_checking = "true"; then
+	PKG_CHECK_MODULES(SPELL_CHECKING, gtkspell-2.0)
+	AC_SUBST(SPELL_CHECKING_CFLAGS)
+	AC_SUBST(SPELL_CHECKING_LIBS)
+fi
+
 if test $encryption = "true"; then
 	PKG_CHECK_MODULES(ENCRYPTION, gconf-2.0)
 

Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am	(original)
+++ trunk/src/Makefile.am	Fri Oct 10 23:13:02 2008
@@ -3,7 +3,8 @@
 	-DPACKAGE_SRC_DIR=\""$(srcdir)"\"				\
 	-DPACKAGE_DATA_DIR=\""$(datadir)"\"				\
 	$(STANDARD_CFLAGS)						\
-	$(ENCRYPTION_CFLAGS)
+	$(ENCRYPTION_CFLAGS)						\
+	$(SPELL_CHECKING_CFLAGS)
 
 AM_CFLAGS = \
 	-Wall		\
@@ -43,4 +44,5 @@
 almanah_LDFLAGS = 
 almanah_LDADD = \
 	$(STANDARD_LIBS)	\
-	$(ENCRYPTION_LIBS)
+	$(ENCRYPTION_LIBS)	\
+	$(SPELL_CHECKING_LIBS)

Modified: trunk/src/main-window.c
==============================================================================
--- trunk/src/main-window.c	(original)
+++ trunk/src/main-window.c	Fri Oct 10 23:13:02 2008
@@ -17,10 +17,13 @@
  * along with Almanah.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <config.h>
 #include <glib.h>
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
+#ifdef ENABLE_SPELL_CHECKING
 #include <gtkspell/gtkspell.h>
+#endif /* ENABLE_SPELL_CHECKING */
 
 #include "main-window.h"
 #include "main.h"
@@ -174,12 +177,14 @@
 				    "underline", PANGO_UNDERLINE_SINGLE,
 				    NULL);
 
+#ifdef ENABLE_SPELL_CHECKING
 	/* Set up spell checking */
 	if (gtkspell_new_attach (priv->entry_view, NULL, &error) == FALSE) {
 		gchar *error_message = g_strdup_printf (_("The spelling checker could not be initialized: %s"), error->message);
 		diary_interface_error (error_message, NULL);
 		g_free (error_message);
 	}
+#endif /* ENABLE_SPELL_CHECKING */
 
 	/* Make sure we're notified if the cursor moves position so we can check the tag stack */
 	g_signal_connect (priv->entry_buffer, "notify::cursor-position", G_CALLBACK (mw_entry_buffer_cursor_position_changed_cb), main_window);
@@ -639,7 +644,9 @@
 	AlmanahLink **links;
 	guint i;
 	GtkTreeIter iter;
+#ifdef ENABLE_SPELL_CHECKING
 	GtkSpell *gtkspell;
+#endif /* ENABLE_SPELL_CHECKING */
 	AlmanahMainWindowPrivate *priv = main_window->priv;
 
 	/* Update the date label */
@@ -679,10 +686,12 @@
 	gtk_action_set_sensitive (priv->remove_action, FALSE);
 	gtk_widget_set_sensitive (GTK_WIDGET (priv->view_button), FALSE);
 
+#ifdef ENABLE_SPELL_CHECKING
 	/* Ensure the spell-checking is updated */
 	gtkspell = gtkspell_get_from_text_view (priv->entry_view);
 	if (gtkspell)
 		gtkspell_recheck_all (gtkspell);
+#endif /* ENABLE_SPELL_CHECKING */
 
 	/* List the entry's links */
 	gtk_list_store_clear (priv->link_store);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]