[recipes] edit: Set up spell checking for some fields



commit 1728ffdc881c666fd6712b89afe06615e46e0812
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Dec 25 14:45:56 2016 -0500

    edit: Set up spell checking for some fields
    
    This add spell checking using gspell to the description
    and instruction fields.

 src/gr-edit-page.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/gr-edit-page.c b/src/gr-edit-page.c
index 88957c6..f4c18f3 100644
--- a/src/gr-edit-page.c
+++ b/src/gr-edit-page.c
@@ -23,6 +23,8 @@
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 
+#include <gspell/gspell.h>
+
 #include "gr-edit-page.h"
 #include "gr-recipe-store.h"
 #include "gr-recipe.h"
@@ -827,6 +829,8 @@ populate_units_list (GrEditPage *self)
 static void
 gr_edit_page_init (GrEditPage *page)
 {
+        GspellTextView *gspell_view;
+
         gtk_widget_set_has_window (GTK_WIDGET (page), FALSE);
         gtk_widget_init_template (GTK_WIDGET (page));
 
@@ -837,6 +841,12 @@ gr_edit_page_init (GrEditPage *page)
         populate_season_combo (page);
         populate_ingredients_list (page);
         populate_units_list (page);
+
+        gspell_view = gspell_text_view_get_from_gtk_text_view (GTK_TEXT_VIEW (page->description_field));
+        gspell_text_view_basic_setup (gspell_view);
+
+        gspell_view = gspell_text_view_get_from_gtk_text_view (GTK_TEXT_VIEW (page->instructions_field));
+        gspell_text_view_basic_setup (gspell_view);
 }
 
 static void


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