[latexila] spell: update for GspellTextView API change



commit 38024aae9c71a1764870e02506a9fb3439d9560e
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Fri Mar 11 19:05:15 2016 +0100

    spell: update for GspellTextView API change

 src/document_view.vala     |   26 +++++++++++++-------------
 src/main_window_tools.vala |   14 +++++++-------
 2 files changed, 20 insertions(+), 20 deletions(-)
---
diff --git a/src/document_view.vala b/src/document_view.vala
index ab1cd07..7752704 100644
--- a/src/document_view.vala
+++ b/src/document_view.vala
@@ -215,9 +215,9 @@ public class DocumentView : Gtk.SourceView
 
         setup_inline_spell_checker ();
 
-        Gspell.InlineCheckerTextView inline_checker =
-            Gspell.text_view_get_inline_checker (this as TextView);
-        inline_checker.notify["enabled"].connect (inline_checker_enabled_notify_cb);
+        Gspell.TextView gspell_view =
+            Gspell.TextView.get_from_gtk_text_view (this as TextView);
+        gspell_view.notify["inline-spell-checking"].connect (inline_checker_enabled_notify_cb);
 
         Document doc = get_buffer () as Document;
 
@@ -272,9 +272,9 @@ public class DocumentView : Gtk.SourceView
         else
             enabled = _editor_settings.get_boolean ("highlight-misspelled-words");
 
-        Gspell.InlineCheckerTextView inline_checker =
-            Gspell.text_view_get_inline_checker (this as TextView);
-        inline_checker.enabled = enabled;
+        Gspell.TextView gspell_view =
+            Gspell.TextView.get_from_gtk_text_view (this as TextView);
+        gspell_view.inline_spell_checking = enabled;
     }
 
     public void launch_spell_checker_dialog ()
@@ -325,10 +325,10 @@ public class DocumentView : Gtk.SourceView
     {
         Document doc = get_buffer () as Document;
 
-        Gspell.InlineCheckerTextView inline_checker =
-            Gspell.text_view_get_inline_checker (this as TextView);
+        Gspell.TextView gspell_view =
+            Gspell.TextView.get_from_gtk_text_view (this as TextView);
 
-        if (inline_checker.enabled)
+        if (gspell_view.inline_spell_checking)
         {
             doc.set_metadata (METADATA_ATTRIBUTE_INLINE_SPELL,
                 INLINE_SPELL_ENABLED_STR);
@@ -342,9 +342,9 @@ public class DocumentView : Gtk.SourceView
 
     private void inline_checker_enabled_notify_cb ()
     {
-        Gspell.InlineCheckerTextView inline_checker =
-            Gspell.text_view_get_inline_checker (this as TextView);
-        if (! inline_checker.enabled)
+        Gspell.TextView gspell_view =
+            Gspell.TextView.get_from_gtk_text_view (this as TextView);
+        if (! gspell_view.inline_spell_checking)
             return;
 
         Gspell.Checker? spell_checker = get_spell_checker ();
@@ -353,7 +353,7 @@ public class DocumentView : Gtk.SourceView
         if (spell_checker.get_language () != null)
             return;
 
-        inline_checker.enabled = false;
+        gspell_view.inline_spell_checking = false;
 
         if (_no_spell_language_dialog_shown)
             return;
diff --git a/src/main_window_tools.vala b/src/main_window_tools.vala
index 8219633..fa8e174 100644
--- a/src/main_window_tools.vala
+++ b/src/main_window_tools.vala
@@ -79,9 +79,9 @@ public class MainWindowTools
         ToggleAction spell_checking_action =
             _action_group.get_action ("ToolsInlineSpellChecker") as ToggleAction;
 
-        Gspell.InlineCheckerTextView inline_checker =
-            Gspell.text_view_get_inline_checker (_main_window.active_view as TextView);
-        spell_checking_action.active = inline_checker.enabled;
+        Gspell.TextView gspell_view =
+            Gspell.TextView.get_from_gtk_text_view (_main_window.active_view as TextView);
+        spell_checking_action.active = gspell_view.inline_spell_checking;
     }
 
     /* Sensitivity */
@@ -135,15 +135,15 @@ public class MainWindowTools
 
         bool activate = (action as ToggleAction).active;
 
-        Gspell.InlineCheckerTextView inline_checker =
-            Gspell.text_view_get_inline_checker (view as TextView);
+        Gspell.TextView gspell_view =
+            Gspell.TextView.get_from_gtk_text_view (view as TextView);
 
         // Save metadata only if property changes, because this function is
         // also called when update_inline_spell_checker_action_state() is
         // called.
-        if (inline_checker.enabled != activate)
+        if (gspell_view.inline_spell_checking != activate)
         {
-            inline_checker.enabled = activate;
+            gspell_view.inline_spell_checking = activate;
 
             update_inline_spell_checker_action_state ();
 


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