+/* Create a paged submenu with choice of available dictionaries */
+static GtkWidget *make_dictionary_list_submenu(GtkAspell *gtkaspell)
+{
+ GtkWidget *menu, *curmenu, *moremenu, *item;
+ int count = 2;
+ Dictionary *dict;
+ GSList *tmp;
+
+ /* Dict list */
+ if (gtkaspellcheckers->dictionary_list == NULL)
+ gtkaspell_get_dictionary_list(FALSE);
+
+ tmp = gtkaspellcheckers->dictionary_list;
+
+ menu = gtk_menu_new();
+ curmenu = menu;
+
+ item = gtk_menu_item_new_with_label(_("Change to..."));
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+
+ item = gtk_separator_menu_item_new();
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+
+ for (tmp = gtkaspellcheckers->dictionary_list; tmp != NULL;
+ tmp = g_slist_next(tmp)) {
+ if (count == MENUCOUNT) {
+
+ moremenu = gtk_menu_new();
+ item = gtk_menu_item_new_with_label(_("More..."));
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(item),
+ moremenu);
+
+ gtk_menu_shell_append(GTK_MENU_SHELL(curmenu), item);
+ curmenu = moremenu;
+ count = 0;
+ }
+ dict = (Dictionary *) tmp->data;
+ item = gtk_check_menu_item_new_with_label(dict->fullname);
+ g_object_set_data(G_OBJECT(item), "dict_name",
+ dict->dictname);
+ if (strcmp2(dict->fullname,
+ gtkaspell->gtkaspeller->dictionary->fullname))
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), FALSE);
+ else {
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), TRUE);
+ gtk_widget_set_sensitive(GTK_WIDGET(item),
+ FALSE);
+ }
+ g_signal_connect(G_OBJECT(item), "activate",
+ G_CALLBACK(change_dict_cb),
+ gtkaspell);
+ gtk_menu_shell_append(GTK_MENU_SHELL(curmenu), item);
+
+ count++;
+ }
+
+ gtk_widget_show_all(menu);
+ return menu;
+}
+