[gnote] Return spell check support with GtkSpell3



commit 01fcc4ee95438c97dcdeaa6cd6a1df32038df979
Author: Aurimas Äernius <aurisc4 gmail com>
Date:   Sun Jan 27 15:42:07 2013 +0200

    Return spell check support with GtkSpell3
    
    Use GtkSpell3 for spell checking.
    Correct API changes.

 configure.ac              |   14 ++++----------
 src/preferencesdialog.cpp |    2 +-
 src/watchers.cpp          |    7 +++----
 src/watchers.hpp          |    4 ++--
 4 files changed, 10 insertions(+), 17 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 4546d5a..ff7a957 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,7 +27,7 @@ dnl if one is harcoded elsewhere, it is a bug
 GTK_VERSION=3.6
 LIBGLIBMM_VERSION=2.28
 LIBGTKMM_VERSION=3.6
-GTKSPELL_VERSION=2.0.9
+GTKSPELL_VERSION=3.0.0
 BOOST_VERSION=1.34
 LIBSECRET_VERSION=0.8
 
@@ -75,15 +75,9 @@ PKG_CHECK_MODULES(LIBXML, [libxml-2.0])
 PKG_CHECK_MODULES(LIBXSLT, [libxslt])
 PKG_CHECK_MODULES(UUID, [uuid])
 
-#GtkSpell disabled until GTK 3.0 is supported
-#
-# Check for recent GtkSpell here.  Prior versions require bug workarounds.
-# http://gtkspell.sourceforge.net/
-#
-#PKG_CHECK_MODULES(GTKSPELL, gtkspell-2.0 >= $GTKSPELL_VERSION,
-#			    [FIXED_GTKSPELL="yes";AC_DEFINE([FIXED_GTKSPELL], [1], [Set if the GtkSpell library is recent enough.])
-#			    ], FIXED_GTKSPELL="no")
-FIXED_GTKSPELL="no"
+PKG_CHECK_MODULES(GTKSPELL, gtkspell3-3.0 >= $GTKSPELL_VERSION,
+			    [FIXED_GTKSPELL="yes";AC_DEFINE([FIXED_GTKSPELL], [1], [Set if the GtkSpell library is recent enough.])
+			    ], FIXED_GTKSPELL="no")
 AC_SUBST(GTKSPELL_CFLAGS)
 AC_SUBST(GTKSPELL_LIBS)
 AM_CONDITIONAL(FIXED_GTKSPELL, test "$FIXED_GTKSPELL" = "yes")
diff --git a/src/preferencesdialog.cpp b/src/preferencesdialog.cpp
index bdd5f65..bdcafb6 100644
--- a/src/preferencesdialog.cpp
+++ b/src/preferencesdialog.cpp
@@ -253,7 +253,7 @@ namespace gnote {
         check = manage(make_check_button (
                          _("_Spell check while typing")));
         options_list->pack_start (*check, false, false, 0);
-        peditor = new sharp::PropertyEditorBool(Preferences::ENABLE_SPELLCHECKING, *check);
+        peditor = new sharp::PropertyEditorBool(settings, Preferences::ENABLE_SPELLCHECKING, *check);
         peditor->setup();
 
         label = manage(make_tip_label (
diff --git a/src/watchers.cpp b/src/watchers.cpp
index 9f370c2..d1b6929 100644
--- a/src/watchers.cpp
+++ b/src/watchers.cpp
@@ -317,9 +317,8 @@ namespace gnote {
       sigc::mem_fun(*this, &NoteSpellChecker::tag_applied));
 
     if (!m_obj_ptr) {
-      m_obj_ptr = gtkspell_new_attach (get_window()->editor()->gobj(),
-                                     NULL,
-                                     NULL);
+      m_obj_ptr = gtk_spell_checker_new();
+      gtk_spell_checker_attach(m_obj_ptr, get_window()->editor()->gobj());
     }
   }
 
@@ -329,7 +328,7 @@ namespace gnote {
     m_tag_applied_cid.disconnect();
     
     if(m_obj_ptr) {
-      gtkspell_detach(m_obj_ptr);
+      gtk_spell_checker_detach(m_obj_ptr);
       m_obj_ptr = NULL;
     }
   }
diff --git a/src/watchers.hpp b/src/watchers.hpp
index a8a9353..22608ee 100644
--- a/src/watchers.hpp
+++ b/src/watchers.hpp
@@ -1,7 +1,7 @@
 /*
  * gnote
  *
- * Copyright (C) 2010-2012 Aurimas Cernius
+ * Copyright (C) 2010-2013 Aurimas Cernius
  * Copyright (C) 2009 Hubert Figuiere
  *
  * This program is free software: you can redistribute it and/or modify
@@ -106,7 +106,7 @@ namespace gnote {
     void tag_applied(const Glib::RefPtr<const Gtk::TextTag> &,
                      const Gtk::TextIter &, const Gtk::TextIter &);
 
-    GtkSpell *m_obj_ptr;
+    GtkSpellChecker *m_obj_ptr;
     sigc::connection  m_tag_applied_cid;
   };
 #else



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