[balsa/gtk3] Use Gspell-1.2 API



commit a23ef4c2d80073f39af57206fac50088466df212
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Thu Jun 30 15:57:01 2016 -0400

    Use Gspell-1.2 API
    
        * configure.ac: check whether we can use the Gspell-1.2 API;
        * src/sendmsg-window.c (create_text_area): if so, set the
          enable-language-menu property, to allow the user to change the
          spell-checker language from the context menu as well as from
          Balsa's menubar menu.

 ChangeLog            |   10 ++++++++++
 configure.ac         |    3 +++
 src/sendmsg-window.c |    8 ++++++++
 3 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 910e8fe..71f294b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2016-06-30  Peter Bloomfield  <pbloomfield bellsouth net>
+
+       Use Gspell-1.2 API
+
+       * configure.ac: check whether we can use the Gspell-1.2 API;
+       * src/sendmsg-window.c (create_text_area): if so, set the
+       enable-language-menu property, to allow the user to change the
+       spell-checker language from the context menu as well as from
+       Balsa's menubar menu.
+
 2016-06-28  Peter Bloomfield  <pbloomfield bellsouth net>
 
        Support Gspell as an alternative to GtkSpell
diff --git a/configure.ac b/configure.ac
index 4712bdb..63ad46c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -705,6 +705,9 @@ case "$use_spell_checker" in
     AC_MSG_RESULT([configure gspell])
     PKG_CHECK_MODULES(SPELL, [ gspell-1 ])
     AC_DEFINE(HAVE_GSPELL,1,[Defined when Gspell can be used.])
+    if $PKG_CONFIG --atleast-version=1.1.2 gspell-1; then
+        AC_DEFINE(HAVE_GSPELL_1_2,1,[Defined when Gspell API is version 1.2.])
+    fi
     ;;
     gtkspell)
     if $PKG_CONFIG --atleast-version=3.0.3 gtkspell3-3.0; then
diff --git a/src/sendmsg-window.c b/src/sendmsg-window.c
index a32dc14..ac4815b 100644
--- a/src/sendmsg-window.c
+++ b/src/sendmsg-window.c
@@ -2887,6 +2887,9 @@ create_text_area(BalsaSendmsg * bsmsg)
 #if HAVE_GSPELL
     GspellTextBuffer *gspell_buffer;
     GspellChecker *checker;
+#if HAVE_GSPELL_1_2
+    GspellTextView *gspell_view;
+#endif                          /* HAVE_GSPELL_1_2 */
 #endif                          /* HAVE_GSPELL */
     GtkWidget *scroll;
 
@@ -2938,6 +2941,11 @@ create_text_area(BalsaSendmsg * bsmsg)
     checker = gspell_checker_new(NULL);
     gspell_text_buffer_set_spell_checker(gspell_buffer, checker);
     g_object_unref(checker);
+
+#if HAVE_GSPELL_1_2
+    gspell_view = gspell_text_view_get_from_gtk_text_view(text_view);
+    gspell_text_view_set_enable_language_menu(gspell_view, TRUE);
+#endif                          /* HAVE_GSPELL_1_2 */
 #endif                          /* HAVE_GSPELL */
 
     scroll = gtk_scrolled_window_new(NULL, NULL);


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