+static void
+intro_on_leave (PsppireImportAssistant *ia)
+{
+ gint lc = 0;
+ g_object_get (ia->text_file, "line-count", &lc, NULL);
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (ia->n_cases_button)))
+ {
+ gint max_lines = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (ia->n_cases_spin));
+ g_object_set (ia->text_file, "maximum-lines", max_lines, NULL);
+ }
+ else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (ia->percent_button)))
+ {
+ gdouble percent = gtk_spin_button_get_value (GTK_SPIN_BUTTON (ia->percent_spin));
+ g_object_set (ia->text_file, "maximum-lines", (gint) (lc * percent / 100.0), NULL);
+ }
+ else
+ {
+ g_object_set (ia->text_file, "maximum-lines", lc, NULL);
+ }
+}