From 29063fc9d27703d0c60e6019fdf031590d5b87c9 Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Tue, 7 May 2019 15:48:32 +0100 Subject: [PATCH] With no files in the Qif importer it is possible to proceed On the page 'Qif files you have loaded' it is possible to unload files and if all files are unloaded it was still possible to proceed so disable the next button if no files are in the list. --- .../import-export/qif-imp/assistant-qif-import.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gnucash/import-export/qif-imp/assistant-qif-import.c b/gnucash/import-export/qif-imp/assistant-qif-import.c index 6f71ac594a8..1fd99afbc97 100644 --- a/gnucash/import-export/qif-imp/assistant-qif-import.c +++ b/gnucash/import-export/qif-imp/assistant-qif-import.c @@ -2101,6 +2101,7 @@ gnc_ui_qif_import_account_prepare (GtkAssistant *assistant, gpointer user_data) gint num = gtk_assistant_get_current_page (assistant); SCM check_from_acct = scm_c_eval_string ("qif-file:check-from-acct"); + if (wind->ask_date_format && wind->date_format) qif_import_reparse_dates (wind); /* Determine the next page to display. */ @@ -2251,12 +2252,19 @@ update_file_page (QIFImportWindow * wind) GtkTreePath *path; GtkTreeRowReference *reference = NULL; + GtkAssistant *assistant = GTK_ASSISTANT(wind->window); + gint num = gtk_assistant_get_current_page (assistant); + GtkWidget *page = gtk_assistant_get_nth_page (assistant, num); + gint num_of_files = 0; + /* clear the list */ view = GTK_TREE_VIEW(wind->selected_file_view); store = GTK_LIST_STORE(gtk_tree_view_get_model (view)); gtk_list_store_clear (store); qif_file_path = scm_c_eval_string ("qif-file:path"); + gtk_assistant_set_page_complete (assistant, page, FALSE); + while (!scm_is_null (loaded_file_list)) { gchar *row_text = NULL; @@ -2292,6 +2300,12 @@ update_file_page (QIFImportWindow * wind) } gtk_tree_row_reference_free (reference); } + + /* get the number of files in the list */ + num_of_files = gtk_tree_model_iter_n_children (GTK_TREE_MODEL(store), NULL); + + if (num_of_files > 0) + gtk_assistant_set_page_complete (assistant, page, TRUE); }