SF.net SVN: geany-plugins:[1063] trunk/geany-plugins/spellcheck/src/gui.c

eht16 at users.sourceforge.net eht16 at xxxxx
Sat Nov 28 16:25:14 UTC 2009


Revision: 1063
          http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1063&view=rev
Author:   eht16
Date:     2009-11-28 16:25:09 +0000 (Sat, 28 Nov 2009)

Log Message:
-----------
Refactor some code.
When performing a Spell Check from the editor menu, also switch to the Messages tab if requested.

Modified Paths:
--------------
    trunk/geany-plugins/spellcheck/src/gui.c

Modified: trunk/geany-plugins/spellcheck/src/gui.c
===================================================================
--- trunk/geany-plugins/spellcheck/src/gui.c	2009-11-28 16:16:16 UTC (rev 1062)
+++ trunk/geany-plugins/spellcheck/src/gui.c	2009-11-28 16:25:09 UTC (rev 1063)
@@ -218,12 +218,26 @@
 }
 
 
-static void perform_spell_check_cb(GtkWidget *menu_item, GeanyDocument *doc)
+static void perform_check(GeanyDocument *doc)
 {
+	editor_indicator_clear(doc->editor, GEANY_INDICATOR_ERROR);
+
+	if (sc_info->use_msgwin)
+	{
+		msgwin_clear_tab(MSG_MESSAGE);
+		msgwin_switch_tab(MSG_MESSAGE, FALSE);
+	}
+
 	sc_speller_check_document(doc);
 }
 
 
+static void perform_spell_check_cb(GtkWidget *menu_item, GeanyDocument *doc)
+{
+	perform_check(doc);
+}
+
+
 void sc_gui_update_editor_menu_cb(GObject *obj, const gchar *word, gint pos,
 								  GeanyDocument *doc, gpointer user_data)
 {
@@ -490,20 +504,13 @@
 		update_labels();
 	}
 
-	editor_indicator_clear(doc->editor, GEANY_INDICATOR_ERROR);
-	if (sc_info->use_msgwin)
-	{
-		msgwin_clear_tab(MSG_MESSAGE);
-		msgwin_switch_tab(MSG_MESSAGE, FALSE);
-	}
-
-	sc_speller_check_document(doc);
+	perform_check(doc);
 }
 
 
 void sc_gui_kb_run_activate_cb(guint key_id)
 {
-	menu_item_toggled_cb(NULL, NULL);
+	perform_check(document_get_current());
 }
 
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Plugins-Commits mailing list