soc.2008.finch: ae371578: Put spelling suggestions in a submenu.

queueram at soc.pidgin.im queueram at soc.pidgin.im
Tue Jun 10 23:10:47 EDT 2008


-----------------------------------------------------------------
Revision: ae37157835a93112dda1fa3fed349dfaf4f59008
Ancestor: deda50db33d9cf0ff7f20257926694d9867ed5a8
Author: queueram at soc.pidgin.im
Date: 2008-06-11T03:09:00
Branch: im.pidgin.soc.2008.finch
URL: http://d.pidgin.im/viewmtn/revision/info/ae37157835a93112dda1fa3fed349dfaf4f59008

Modified files:
        finch/libgnt/gntentry.c

ChangeLog: 

Put spelling suggestions in a submenu.

-------------- next part --------------
============================================================
--- finch/libgnt/gntentry.c	abca76959f76e923954735076c91cd99a376a2ae
+++ finch/libgnt/gntentry.c	eac3670f83af1e7c897b4fed29d0e167f340892d
@@ -1296,6 +1296,7 @@ create_spell_suggestions_menu(GntMenu *m
 create_spell_suggestions_menu(GntMenu *menu, GntEntry *entry, char *start, char *end)
 {
 	GntMenuItem *item;
+	GntWidget *sub;
 	char **suggs;
     size_t n_suggs = 0;
 	int i;
@@ -1303,10 +1304,14 @@ create_spell_suggestions_menu(GntMenu *m
 	if (entry->spell && entry->spell->broker) {
 		suggs = enchant_dict_suggest(entry->spell->dict, start, end - start + 1, &n_suggs);
 		if (suggs && n_suggs) {
+			item = gnt_menuitem_new("Suggestions");
+			gnt_menu_add_item(menu, item);
+			sub = gnt_menu_new(GNT_MENU_POPUP);
+			gnt_menuitem_set_submenu(item, GNT_MENU(sub));
 			for (i = 0; i < n_suggs; i++) {
 				SpellLangInfo *spell_info = g_new(SpellLangInfo, 1);
 				item = gnt_menuitem_new(suggs[i]);
-				gnt_menu_add_item(menu, item);
+				gnt_menu_add_item(GNT_MENU(sub), item);
 				gnt_menuitem_set_callback(item, spell_suggest_menu_callback, (void *) entry);
 			}
 			enchant_dict_free_string_list(entry->spell->dict, suggs);


More information about the Commits mailing list