/* Create widgets to represent the options made available by the backend */
void
xkb_options_load_options (GtkBuilder * dialog)
{
	GtkWidget *opts_vbox = WID ("options_vbox");
	GSList *expanders_list;
	GtkWidget *expander;

	current1st_level_id = NULL;
	current_none_radio = NULL;
	current_multi_select = FALSE;
	current_radio_group = NULL;

	/* fill the list */
	xkl_config_registry_foreach_option_group (config_registry,
						  (ConfigItemProcessFunc)
						  xkb_options_add_group,
						  dialog);
	/* sort it */
	expanders_list =
	    g_object_get_data (G_OBJECT (dialog), EXPANDERS_PROP);
	expanders_list =
	    g_slist_sort (expanders_list,
			  (GCompareFunc) xkb_options_expanders_compare);
	g_object_set_data (G_OBJECT (dialog), EXPANDERS_PROP,
			   expanders_list);
	while (expanders_list) {
		expander = GTK_WIDGET (expanders_list->data);
		gtk_box_pack_start (GTK_BOX (opts_vbox), expander, FALSE,
				    FALSE, 0);
		expanders_list = expanders_list->next;
	}

	gtk_widget_show_all (opts_vbox);
}
/* Create widgets to represent the options made available by the backend */
void
xkb_options_load_options (GtkBuilder * dialog)
{
	GtkWidget *opts_vbox = WID ("options_vbox");
	GtkWidget *dialog_vbox = WID ("dialog_vbox");
	GtkWidget *options_scroll = WID ("options_scroll");
	GtkWidget *expander;
	GSList *expanders_list;

	current1st_level_id = NULL;
	current_none_radio = NULL;
	current_multi_select = FALSE;
	current_radio_group = NULL;

	/* fill the list */
	xkl_config_registry_foreach_option_group (config_registry,
						  (ConfigItemProcessFunc)
						  xkb_options_add_group,
						  dialog);
	/* sort it */
	expanders_list =
	    g_object_get_data (G_OBJECT (dialog), EXPANDERS_PROP);
	expanders_list =
	    g_slist_sort (expanders_list,
			  (GCompareFunc) xkb_options_expanders_compare);
	g_object_set_data (G_OBJECT (dialog), EXPANDERS_PROP,
			   expanders_list);
	while (expanders_list) {
		expander = GTK_WIDGET (expanders_list->data);
		gtk_box_pack_start (GTK_BOX (opts_vbox), expander, FALSE,
				    FALSE, 0);
		expanders_list = expanders_list->next;
	}

	/* Somewhere in gtk3 the top vbox in dialog is made non-expandable */
	gtk_box_set_child_packing (GTK_BOX (dialog_vbox), options_scroll,
				   TRUE, TRUE, 0, GTK_PACK_START);
	gtk_widget_show_all (dialog_vbox);
}