SF.net SVN: geany-plugins:[257] trunk/spellcheck
eht16 at users.sourceforge.net
eht16 at xxxxx
Wed Oct 29 18:56:41 UTC 2008
Revision: 257
http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=257&view=rev
Author: eht16
Date: 2008-10-29 18:56:41 +0000 (Wed, 29 Oct 2008)
Log Message:
-----------
Add 'Ignore All' menu item to the suggestions menu.
Modified Paths:
--------------
trunk/spellcheck/ChangeLog
trunk/spellcheck/src/gui.c
Modified: trunk/spellcheck/ChangeLog
===================================================================
--- trunk/spellcheck/ChangeLog 2008-10-29 18:48:17 UTC (rev 256)
+++ trunk/spellcheck/ChangeLog 2008-10-29 18:56:41 UTC (rev 257)
@@ -3,6 +3,8 @@
* src/speller.c, src/speller.h, src/scplugin.c:
Improve the auto-detection of the user's language (handle locales
like 'de_DE.UTF-8' correctly).
+ * src/gui.c:
+ Add 'Ignore All' menu item to the suggestions menu.
2008-10-25 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/spellcheck/src/gui.c
===================================================================
--- trunk/spellcheck/src/gui.c 2008-10-29 18:48:17 UTC (rev 256)
+++ trunk/spellcheck/src/gui.c 2008-10-29 18:56:41 UTC (rev 257)
@@ -167,11 +167,15 @@
gint startword, endword, i, doc_len;
ScintillaObject *sci;
GString *str;
+ gboolean ignore = GPOINTER_TO_INT(gdata);
if (clickinfo.doc == NULL || clickinfo.word == NULL || clickinfo.pos == -1)
return;
- speller_add_word(clickinfo.word);
+ /* we either ignore the word, so we only remove all indicators or
+ * we add the word to the personal dictionary */
+ if (! ignore)
+ speller_add_word(clickinfo.word);
/* Remove all indicators on the added word */
sci = clickinfo.doc->editor->sci;
@@ -257,8 +261,15 @@
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_item), image);
gtk_container_add(GTK_CONTAINER(sc->edit_menu_sub), menu_item);
g_signal_connect((gpointer) menu_item, "activate",
- G_CALLBACK(on_menu_addword_item_activate), NULL);
+ G_CALLBACK(on_menu_addword_item_activate), GPOINTER_TO_INT(0));
+ image = gtk_image_new_from_stock(GTK_STOCK_REMOVE, GTK_ICON_SIZE_MENU);
+ menu_item = gtk_image_menu_item_new_with_label(_("Ignore All"));
+ gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_item), image);
+ gtk_container_add(GTK_CONTAINER(sc->edit_menu_sub), menu_item);
+ g_signal_connect((gpointer) menu_item, "activate",
+ G_CALLBACK(on_menu_addword_item_activate), GPOINTER_TO_INT(1));
+
gtk_widget_show(sc->edit_menu);
gtk_widget_show(sc->edit_menu_sep);
gtk_widget_show_all(sc->edit_menu_sub);
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