[latexila] spell: show message about no languages available only once



commit 6ad79b08ee4d35bb922bf410a5e8a4fc48b8915a
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Wed Sep 30 20:30:41 2015 +0200

    spell: show message about no languages available only once
    
    If the setting is changed in the preferences dialog with several tabs
    opened, the dialog was shown at least once for each tab.

 src/document_view.vala |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/document_view.vala b/src/document_view.vala
index 60cb377..a161332 100644
--- a/src/document_view.vala
+++ b/src/document_view.vala
@@ -32,8 +32,10 @@ public class DocumentView : Gtk.SourceView
 
     private GLib.Settings _editor_settings;
     private Pango.FontDescription _font_desc;
+
     private Gspell.Checker? _spell_checker = null;
     private Gspell.InlineCheckerGtv? _inline_spell_checker = null;
+    private static bool _no_spell_language_dialog_shown = false;
 
     public bool highlight_misspelled_words
     {
@@ -356,6 +358,11 @@ public class DocumentView : Gtk.SourceView
             return;
         }
 
+        if (_no_spell_language_dialog_shown)
+            return;
+
+        _no_spell_language_dialog_shown = true;
+
         MessageDialog dialog = new MessageDialog (this.get_toplevel () as Window,
             DialogFlags.DESTROY_WITH_PARENT,
             MessageType.ERROR,


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