[gedit: 6/6] spell-checker-dialog: emit goto-next after change or change-all



commit 43086d262b079f1b920fa8d1cb2ec08df2931e6b
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sat Aug 1 16:22:21 2015 +0200

    spell-checker-dialog: emit goto-next after change or change-all
    
    So that "change" and "change-all" signal handlers do only that.
    "goto-next" is a separate action.

 plugins/spell/gedit-spell-checker-dialog.c |    2 ++
 plugins/spell/gedit-spell-plugin.c         |   10 +++-------
 2 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/plugins/spell/gedit-spell-checker-dialog.c b/plugins/spell/gedit-spell-checker-dialog.c
index 8b3975d..2697495 100644
--- a/plugins/spell/gedit-spell-checker-dialog.c
+++ b/plugins/spell/gedit-spell-checker-dialog.c
@@ -409,6 +409,7 @@ change_button_clicked_handler (GtkButton               *button,
 
        word = g_strdup (dialog->misspelled_word);
        g_signal_emit (G_OBJECT (dialog), signals[SIGNAL_CHANGE], 0, word, change);
+       g_signal_emit (G_OBJECT (dialog), signals[SIGNAL_GOTO_NEXT], 0);
 
        g_free (word);
        g_free (change);
@@ -443,6 +444,7 @@ change_all_button_clicked_handler (GtkButton               *button,
 
        word = g_strdup (dialog->misspelled_word);
        g_signal_emit (G_OBJECT (dialog), signals[SIGNAL_CHANGE_ALL], 0, word, change);
+       g_signal_emit (G_OBJECT (dialog), signals[SIGNAL_GOTO_NEXT], 0);
 
        g_free (word);
        g_free (change);
diff --git a/plugins/spell/gedit-spell-plugin.c b/plugins/spell/gedit-spell-plugin.c
index db82aec..e174ae7 100644
--- a/plugins/spell/gedit-spell-plugin.c
+++ b/plugins/spell/gedit-spell-plugin.c
@@ -645,8 +645,8 @@ select_misspelled_word (GeditView *view,
 }
 
 static void
-goto_next_misspelled_word (GeditSpellCheckerDialog *dialog,
-                          GeditView               *view)
+goto_next_cb (GeditSpellCheckerDialog *dialog,
+             GeditView               *view)
 {
        gchar *word = NULL;
        gint word_start_offset;
@@ -709,8 +709,6 @@ change_cb (GeditSpellCheckerDialog *dialog,
        gtk_text_buffer_end_user_action (GTK_TEXT_BUFFER (doc));
 
        update_current (doc, range->mw_start + g_utf8_strlen (change_to, -1));
-
-       goto_next_misspelled_word (dialog, view);
 }
 
 static void
@@ -762,8 +760,6 @@ change_all_cb (GeditSpellCheckerDialog *dialog,
 
        update_current (doc, range->mw_start + g_utf8_strlen (change_to, -1));
 
-       goto_next_misspelled_word (dialog, view);
-
        g_object_unref (search_settings);
        g_object_unref (search_context);
 }
@@ -922,7 +918,7 @@ spell_cb (GSimpleAction *action,
 
        g_signal_connect (dialog,
                          "goto-next",
-                         G_CALLBACK (goto_next_misspelled_word),
+                         G_CALLBACK (goto_next_cb),
                          view);
 
        gedit_spell_checker_dialog_set_misspelled_word (GEDIT_SPELL_CHECKER_DIALOG (dialog), word);



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