- gint var_index;
- struct variable *variable ;
- gint direction;
- gchar *buf;
- gchar *varname;
- PsppireDict *dict = data;
-
- gtk_tree_model_get (model, iter,
- CRIT_TVM_IDX, &var_index,
- CRIT_TVM_DIR, &direction, -1);
-
- variable = psppire_dict_get_variable (dict, var_index);
-
- varname = pspp_locale_to_utf8 (var_get_name (variable),
- -1, 0);
-
- if ( direction == SRT_ASCEND)
- buf = g_strdup_printf ("%s: %s", varname, _("Ascending"));
- else
- buf = g_strdup_printf ("%s: %s", varname, _("Descending"));
-
- g_free (varname);
-
- g_object_set (renderer, "text", buf, NULL);
-
- g_free (buf);
-}
-
-
-/* Create the dialog */
-struct sort_cases_dialog *
-sort_cases_dialog_create (GladeXML *xml)
-{
- struct sort_cases_dialog *dialog = g_malloc (sizeof (*dialog));
-
- dialog->loop = g_main_loop_new (NULL, FALSE);
-
- dialog->window = get_widget_assert (xml, "sort-cases-dialog");
-
- dialog->dict_view = GTK_TREE_VIEW(get_widget_assert
- (xml, "sort-cases-treeview-dict"));
- dialog->criteria_view = GTK_TREE_VIEW(get_widget_assert
- (xml, "sort-cases-treeview-criteria"));
-
- dialog->arrow = GTK_ARROW(get_widget_assert (xml, "sort-cases-arrow"));
- dialog->button = GTK_BUTTON(get_widget_assert (xml, "sort-cases-button"));
-
- dialog->ascending_button =
- GTK_TOGGLE_BUTTON(get_widget_assert (xml, "sort-cases-button-ascending"));
-
- g_signal_connect (dialog->window, "delete-event",
- G_CALLBACK(delete_event_callback), dialog);
-
- g_signal_connect (get_widget_assert (xml, "sort-cases-cancel"),
- "clicked", G_CALLBACK(sort_cases_cancel_callback), dialog);
-
- g_signal_connect (get_widget_assert (xml, "sort-cases-ok"),
- "clicked", G_CALLBACK(sort_cases_ok_callback), dialog);
-
-
- g_signal_connect (get_widget_assert (xml, "sort-cases-reset"),
- "clicked", G_CALLBACK(sort_cases_reset_callback), dialog);
-