[latexila/gnome-3] Reactivate GtkSpell



commit 6811c37ca1411c12a708e096245a8add13904665
Author: SÃbastien Wilmet <swilmet src gnome org>
Date:   Tue Apr 3 03:49:27 2012 +0200

    Reactivate GtkSpell
    
    It works well! But it requires GtkSpell 3.0, which is not yet released.
    But it's available as a package on Debian testing.

 CMakeLists.txt         |    6 +++---
 INSTALL                |    2 +-
 src/document_view.vala |   25 ++++++++++++-------------
 3 files changed, 16 insertions(+), 17 deletions(-)
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 80d6089..3487489 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,7 +51,7 @@ pkg_check_modules (GTK REQUIRED "gtk+-3.0 >= 3.4")
 pkg_check_modules (GTKSOURCEVIEW REQUIRED "gtksourceview-3.0")
 pkg_check_modules (GEE REQUIRED "gee-1.0")
 pkg_check_modules (GIO REQUIRED "gio-2.0 >= 2.32")
-#pkg_check_modules (GTKSPELL REQUIRED "gtkspell-2.0")
+pkg_check_modules (GTKSPELL REQUIRED "gtkspell-3.0")
 
 if (WITH_GNOME)
 	pkg_check_modules (DESKTOP-SCHEMAS REQUIRED "gsettings-desktop-schemas")
@@ -69,7 +69,7 @@ add_definitions (
 	${GTKSOURCEVIEW_CFLAGS}
 	${GEE_CFLAGS}
 	${GIO_CFLAGS}
-# 	${GTKSPELL_CFLAGS}
+	${GTKSPELL_CFLAGS}
 )
 
 link_libraries (
@@ -77,7 +77,7 @@ link_libraries (
 	${GTKSOURCEVIEW_LIBRARIES}
 	${GEE_LIBRARIES}
 	${GIO_LIBRARIES}
-# 	${GTKSPELL_LIBRARIES}
+	${GTKSPELL_LIBRARIES}
 )
 
 include ("${latexila_SOURCE_DIR}/cmake/itstool.cmake")
diff --git a/INSTALL b/INSTALL
index b8b5071..9f82c07 100644
--- a/INSTALL
+++ b/INSTALL
@@ -5,7 +5,7 @@ GTK+ >= 3.4
 GtkSourceView >= 3.0
 GLib >= 2.32
 libgee
-GtkSpell
+GtkSpell >= 3.0 (not yet released)
 CMake >= 2.6.4
 gettext
 ITS Tool
diff --git a/src/document_view.vala b/src/document_view.vala
index 67e3953..46fc866 100644
--- a/src/document_view.vala
+++ b/src/document_view.vala
@@ -174,22 +174,22 @@ public class DocumentView : Gtk.SourceView
     {
         disable_spell_checking ();
 
-//        try
-//        {
-//            // Will try the best language depending on the LANG environment variable.
-//            new GtkSpell.attach (this, null);
-//        }
-//        catch (GtkspellError e)
-//        {
-//            warning ("Spell error: %s", e.message);
-//        }
+        try
+        {
+            // Will try the best language depending on the LANG environment variable.
+            new GtkSpell.attach (this, null);
+        }
+        catch (GtkspellError e)
+        {
+            warning ("Spell error: %s", e.message);
+        }
     }
 
     public void disable_spell_checking ()
     {
-//        GtkSpell? spell = GtkSpell.get_from_text_view (this);
-//        if (spell != null)
-//            spell.detach ();
+        GtkSpell? spell = GtkSpell.get_from_text_view (this);
+        if (spell != null)
+            spell.detach ();
     }
 
     private bool on_backspace (Gdk.EventKey event)
@@ -197,7 +197,6 @@ public class DocumentView : Gtk.SourceView
         // See GDK_KEY_BackSpace in gdk/gdkkeysyms.h (not available in Vala)
 
         // TODO~ connect/disconnect the signal when settings in gsettings change
-        // note: this function will be removed when latexila will become a Gedit plugin...
         if (! _editor_settings.get_boolean ("insert-spaces")
             || ! _editor_settings.get_boolean ("forget-no-tabs")
             || event.keyval != 0xff08



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