From 242691f13c8dc0b0af473c74e1ac1fac9a97089c Mon Sep 17 00:00:00 2001 From: John Darrington Date: Mon, 5 Jun 2017 16:32:05 +0200 Subject: [PATCH] Import Assistant: Don't try to parse non-existant files --- src/ui/gui/psppire-import-assistant.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/ui/gui/psppire-import-assistant.c b/src/ui/gui/psppire-import-assistant.c index ecedef6920..73879a1b51 100644 --- a/src/ui/gui/psppire-import-assistant.c +++ b/src/ui/gui/psppire-import-assistant.c @@ -558,7 +558,7 @@ on_chosen (PsppireImportAssistant *ia, GtkWidget *page) gtk_assistant_set_page_complete (GTK_ASSISTANT(ia), GTK_WIDGET (fc), FALSE); - if (f && !g_file_test (f, G_FILE_TEST_IS_DIR)) + if (f && g_file_test (f, G_FILE_TEST_IS_REGULAR)) { gtk_assistant_set_page_complete (GTK_ASSISTANT(ia), GTK_WIDGET (fc), TRUE); @@ -570,15 +570,15 @@ on_chosen (PsppireImportAssistant *ia, GtkWidget *page) if (!ia->spreadsheet) ia->spreadsheet = ods_probe (f, FALSE); - if (!ia->spreadsheet) + if (ia->spreadsheet) { - intro_page_create (ia); - first_line_page_create (ia); - separators_page_create (ia); + sheet_spec_page_create (ia); } else { - sheet_spec_page_create (ia); + intro_page_create (ia); + first_line_page_create (ia); + separators_page_create (ia); } formats_page_create (ia); @@ -921,7 +921,6 @@ intro_on_enter (PsppireImportAssistant *ia) GtkAdjustment *adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (ia->n_cases_spin)); gtk_adjustment_set_lower (adj, 1.0); - if (gtk_grid_get_child_at (GTK_GRID (table), 1, 2) == NULL) { GtkWidget *hbox_percent = psppire_scanf_new (_("Only the first %3d %% of file (approximately)"), -- 2.30.2