--- a/ChangeLog Wed Nov 05 03:58:53 2008 -0500
+++ b/ChangeLog Wed Nov 05 04:00:16 2008 -0500
@@ -1,4 +1,4 @@
* Fixed some crashes in autprofile related to old preference paths
* ListHandler now handles "FriendlyName" lines in .blt files generated by
--- a/switchspell/switchspell.c Wed Nov 05 03:58:53 2008 -0500
+++ b/switchspell/switchspell.c Wed Nov 05 04:00:16 2008 -0500
@@ -98,20 +98,48 @@
purple_blist_node_set_string(node, "switchspell", lang);
+enchant_dict_desc_cb(const char * const lang_tag, const char * const provider_name, + const char * const provider_desc, const char * const provider_file, + GtkWidget *menu = ((struct nufan *)user_data)->menu; + PidginWindow *win = ((struct nufan *)user_data)->win; + GtkWidget *menuitem = gtk_radio_menu_item_new_with_label(group, lang_tag); + ((struct nufan *)user_data)->group = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(menuitem)); + g_object_set_data(G_OBJECT(menuitem), "user_data", win); + g_object_set_data_full(G_OBJECT(menuitem), "lang", g_strdup(lang_tag), g_free); + g_signal_connect(G_OBJECT(menuitem), "activate", + G_CALLBACK(menu_conv_use_dict_cb), NULL); + gtk_widget_show(menuitem); + gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem); regenerate_switchspell_menu(PidginConversation *gtkconv)
+ struct nufan user_data;
- AspellDictInfoList * dlist;
- AspellDictInfoEnumeration * dels;
- const AspellDictInfo * entry;
+ AspellDictInfoList *dlist; + AspellDictInfoEnumeration *dels; + const AspellDictInfo *entry; @@ -135,11 +163,12 @@
gtk_menu_item_set_submenu(GTK_MENU_ITEM(mitem), menu);
- void enchant_dict_desc_cb(const char * const lang_tag, const char * const provider_name,
- const char * const provider_desc, const char * const provider_file,
- GtkWidget *menuitem = gtk_radio_menu_item_new_with_label(group, lang_tag);
+ user_data.group = NULL; + eb = enchant_broker_init(); + enchant_broker_list_dicts(eb, enchant_dict_desc_cb, &user_data); + enchant_broker_free(eb); config = new_aspell_config();
dlist = get_aspell_dict_info_list(config);
@@ -149,25 +178,14 @@
aspell_dict_info_list_empty(dlist);
while ((entry = aspell_dict_info_enumeration_next(dels)) != 0) {
GtkWidget *menuitem = gtk_radio_menu_item_new_with_label(group, entry->name);
group = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(menuitem));
g_object_set_data(G_OBJECT(menuitem), "user_data", win);
- g_object_set_data_full(G_OBJECT(menuitem), "lang", g_strdup(lang_tag), g_free);
g_object_set_data_full(G_OBJECT(menuitem), "lang", g_strdup((gchar *)entry->name), g_free);
g_signal_connect(G_OBJECT(menuitem), "activate",
G_CALLBACK(menu_conv_use_dict_cb), NULL);
gtk_widget_show(menuitem);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
- eb = enchant_broker_init();
- enchant_broker_list_dicts(eb, enchant_dict_desc_cb, NULL);
- enchant_broker_free(eb);
delete_aspell_dict_info_enumeration(dels);
gtk_widget_show_all(menu);