Skip to content

Commit

Permalink
With no files in the Qif importer it is possible to proceed
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Bob-IT committed May 12, 2019
1 parent bb49a17 commit 29063fc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions gnucash/import-export/qif-imp/assistant-qif-import.c
Expand Up @@ -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. */
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}


Expand Down

0 comments on commit 29063fc

Please sign in to comment.