From 3abd04321d37e7df46b77bfa95b77c4a32ee4555 Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Sat, 1 Dec 2018 10:46:19 +0000 Subject: [PATCH 01/14] okbutton may be used uninitialised in gnc-file.c --- gnucash/gnome-utils/gnc-file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnucash/gnome-utils/gnc-file.c b/gnucash/gnome-utils/gnc-file.c index 0a0f7746b0..2eefc34a69 100644 --- a/gnucash/gnome-utils/gnc-file.c +++ b/gnucash/gnome-utils/gnc-file.c @@ -86,7 +86,7 @@ gnc_file_dialog (GtkWindow *parent, GtkWidget *file_box; const char *internal_name; char *file_name = NULL; - gchar * okbutton; + gchar * okbutton = NULL; const gchar *ok_icon = NULL; GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_OPEN; gint response; From a671e34134304d0478fe7f4882f0180a3bf41f63 Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Sat, 1 Dec 2018 10:53:43 +0000 Subject: [PATCH 02/14] Add some space to a previous alignment change Add some space to the fixed width labels in the price and transaction importer glade files. --- gnucash/gtkbuilder/assistant-csv-price-import.glade | 1 + gnucash/gtkbuilder/assistant-csv-trans-import.glade | 1 + 2 files changed, 2 insertions(+) diff --git a/gnucash/gtkbuilder/assistant-csv-price-import.glade b/gnucash/gtkbuilder/assistant-csv-price-import.glade index 6b01a52594..655d26cdd2 100644 --- a/gnucash/gtkbuilder/assistant-csv-price-import.glade +++ b/gnucash/gtkbuilder/assistant-csv-price-import.glade @@ -433,6 +433,7 @@ Select location and file name for the Import, then click 'OK'... True False + 5 True diff --git a/gnucash/gtkbuilder/assistant-csv-trans-import.glade b/gnucash/gtkbuilder/assistant-csv-trans-import.glade index 8503039cbd..dfeb7f2bd4 100644 --- a/gnucash/gtkbuilder/assistant-csv-trans-import.glade +++ b/gnucash/gtkbuilder/assistant-csv-trans-import.glade @@ -433,6 +433,7 @@ Select location and file name for the Import, then click 'OK'... True False + 5 True From d9d24a90553eb4e6e6eb1a1336bad3f9ae7dfc98 Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Sat, 1 Dec 2018 10:58:15 +0000 Subject: [PATCH 03/14] Missed adding new parent window parameter Added a GtkWindow parameter to csv_import_read_file to pass to the error dialogue but missed actually adding it. --- gnucash/import-export/csv-imp/csv-account-import.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnucash/import-export/csv-imp/csv-account-import.c b/gnucash/import-export/csv-imp/csv-account-import.c index b591cbd642..e0affa39ad 100644 --- a/gnucash/import-export/csv-imp/csv-account-import.c +++ b/gnucash/import-export/csv-imp/csv-account-import.c @@ -78,7 +78,7 @@ fill_model_with_match(GMatchInfo *match_info, * Parse the file for a correctly formatted file *******************************************************/ csv_import_result -csv_import_read_file (GtkWindow *win, const gchar *filename, +csv_import_read_file (GtkWindow *window, const gchar *filename, const gchar *parser_regexp, GtkListStore *store, guint max_rows) { @@ -114,7 +114,7 @@ csv_import_read_file (GtkWindow *win, const gchar *filename, parser_regexp, err->message); g_error_free (err); - dialog = gtk_message_dialog_new (NULL, + dialog = gtk_message_dialog_new (window, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s", errmsg); From 0c58f78bdfe6d93cb58fe1b58821a1732be6e725 Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Sat, 1 Dec 2018 12:23:18 +0000 Subject: [PATCH 04/14] Remove window reference and use assistant instead for csv-export --- .../csv-exp/assistant-csv-export.c | 30 +++++++++---------- .../csv-exp/assistant-csv-export.h | 3 +- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/gnucash/import-export/csv-exp/assistant-csv-export.c b/gnucash/import-export/csv-exp/assistant-csv-export.c index 06b4261f7e..fe5ec4e0f5 100644 --- a/gnucash/import-export/csv-exp/assistant-csv-export.c +++ b/gnucash/import-export/csv-exp/assistant-csv-export.c @@ -128,9 +128,9 @@ static const gchar *start_trans_simple_string = N_( void csv_export_file_chooser_selection_changed_cb (GtkFileChooser *chooser, CsvExportInfo *info) { - GtkAssistant *assistant = GTK_ASSISTANT(info->window); gint num = gtk_assistant_get_current_page (assistant); GtkWidget *page = gtk_assistant_get_nth_page (assistant, num); + GtkAssistant *assistant = GTK_ASSISTANT(info->assistant); gchar *file_name; gtk_assistant_set_page_complete (assistant, page, FALSE); @@ -170,9 +170,9 @@ void csv_export_sep_cb (GtkWidget *radio, gpointer user_data) { CsvExportInfo *info = user_data; + GtkAssistant *assistant = GTK_ASSISTANT(info->assistant); const gchar *name; - GtkAssistant *assistant = GTK_ASSISTANT(info->window); gint num = gtk_assistant_get_current_page (assistant); GtkWidget *page = gtk_assistant_get_nth_page (assistant, num); @@ -246,9 +246,9 @@ void csv_export_custom_entry_cb (GtkWidget *widget, gpointer user_data) { CsvExportInfo *info = user_data; + GtkAssistant *assistant = GTK_ASSISTANT(info->assistant); const gchar *custom_str; - GtkAssistant *assistant = GTK_ASSISTANT(info->window); gint num = gtk_assistant_get_current_page (assistant); GtkWidget *page = gtk_assistant_get_nth_page (assistant, num); @@ -384,10 +384,10 @@ csv_export_account_changed_cb (GtkTreeSelection *selection, gpointer user_data) { CsvExportInfo *info = user_data; - GtkAssistant *assistant = GTK_ASSISTANT(info->window); gint num = gtk_assistant_get_current_page (assistant); GtkWidget *page = gtk_assistant_get_nth_page (assistant, num); + GtkAssistant *assistant = GTK_ASSISTANT(info->assistant); GncTreeViewAccount *view; g_return_if_fail(GTK_IS_TREE_SELECTION(selection)); @@ -793,8 +793,8 @@ csv_export_close_handler (gpointer user_data) if (info->mid_sep) g_free (info->mid_sep); - gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW(info->window)); - gtk_widget_destroy (info->window); + gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW(info->assistant)); + gtk_widget_destroy (info->assistant); } /******************************************************* @@ -804,7 +804,6 @@ static GtkWidget * csv_export_assistant_create (CsvExportInfo *info) { GtkBuilder *builder; - GtkWidget *window; GtkWidget *box, *h_box; GtkWidget *button; GtkWidget *table, *hbox; @@ -812,11 +811,10 @@ csv_export_assistant_create (CsvExportInfo *info) builder = gtk_builder_new(); gnc_builder_add_from_file (builder , "assistant-csv-export.glade", "csv_export_assistant"); - window = GTK_WIDGET(gtk_builder_get_object (builder, "csv_export_assistant")); - info->window = window; + info->assistant = GTK_WIDGET(gtk_builder_get_object (builder, "csv_export_assistant")); // Set the style context for this assistant so it can be easily manipulated with css - gnc_widget_set_style_context (GTK_WIDGET(window), "GncAssistExport"); + gnc_widget_set_style_context (GTK_WIDGET(info->assistant), "GncAssistExport"); /* Load default settings */ load_settings (info); @@ -837,7 +835,7 @@ csv_export_assistant_create (CsvExportInfo *info) // Don't provide simple export layout for search registers and General Journal if ((info->export_type == XML_EXPORT_TREE) || (info->account == NULL)) gtk_widget_destroy (chkbox); - gtk_assistant_remove_page (GTK_ASSISTANT(window), 1); //remove accounts page + gtk_assistant_remove_page (GTK_ASSISTANT(info->assistant), 1); //remove accounts page } else { @@ -932,11 +930,11 @@ csv_export_assistant_create (CsvExportInfo *info) /* Summary Page */ info->summary_label = GTK_WIDGET(gtk_builder_get_object (builder, "summary_page")); - g_signal_connect (G_OBJECT(window), "destroy", + g_signal_connect (G_OBJECT(info->assistant), "destroy", G_CALLBACK(csv_export_assistant_destroy_cb), info); gnc_restore_window_size (GNC_PREFS_GROUP, - GTK_WINDOW(info->window), gnc_ui_get_main_window(NULL)); + GTK_WINDOW(info->assistant), gnc_ui_get_main_window(NULL)); if (gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_SAVE_GEOMETRY)) { GObject *object = gtk_builder_get_object (builder, "paned"); @@ -945,7 +943,7 @@ csv_export_assistant_create (CsvExportInfo *info) gtk_builder_connect_signals (builder, info); g_object_unref (G_OBJECT(builder)); - return window; + return info->assistant; } static void @@ -967,8 +965,8 @@ gnc_file_csv_export_internal (CsvExportType export_type, Query *q, Account *acc) gnc_register_gui_component (ASSISTANT_CSV_EXPORT_CM_CLASS, NULL, csv_export_close_handler, info); - gtk_widget_show_all (info->window); - gnc_window_adjust_for_screen (GTK_WINDOW(info->window)); + gtk_widget_show_all (info->assistant); + gnc_window_adjust_for_screen (GTK_WINDOW(info->assistant)); } diff --git a/gnucash/import-export/csv-exp/assistant-csv-export.h b/gnucash/import-export/csv-exp/assistant-csv-export.h index b9dcc61ac0..78ea0ff5c4 100644 --- a/gnucash/import-export/csv-exp/assistant-csv-export.h +++ b/gnucash/import-export/csv-exp/assistant-csv-export.h @@ -73,12 +73,11 @@ typedef struct Query *query; Account *account; - + GtkWidget *start_page; GtkWidget *account_page; GtkWidget *file_page; - GtkWidget *window; GtkWidget *assistant; GtkWidget *start_label; GtkWidget *custom_entry; From 8c904edc257314c5c025421732066c0aab58fb38 Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Sat, 1 Dec 2018 12:25:11 +0000 Subject: [PATCH 05/14] Use existing page references instead of getting them in csv-export --- .../csv-exp/assistant-csv-export.c | 50 ++++++------------- 1 file changed, 15 insertions(+), 35 deletions(-) diff --git a/gnucash/import-export/csv-exp/assistant-csv-export.c b/gnucash/import-export/csv-exp/assistant-csv-export.c index fe5ec4e0f5..afc7a70f8a 100644 --- a/gnucash/import-export/csv-exp/assistant-csv-export.c +++ b/gnucash/import-export/csv-exp/assistant-csv-export.c @@ -128,12 +128,10 @@ static const gchar *start_trans_simple_string = N_( void csv_export_file_chooser_selection_changed_cb (GtkFileChooser *chooser, CsvExportInfo *info) { - gint num = gtk_assistant_get_current_page (assistant); - GtkWidget *page = gtk_assistant_get_nth_page (assistant, num); GtkAssistant *assistant = GTK_ASSISTANT(info->assistant); gchar *file_name; - gtk_assistant_set_page_complete (assistant, page, FALSE); + gtk_assistant_set_page_complete (assistant, info->file_page, FALSE); file_name = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(info->file_chooser)); @@ -152,7 +150,7 @@ csv_export_file_chooser_selection_changed_cb (GtkFileChooser *chooser, CsvExport g_free (filedir); g_free (filepath); - gtk_assistant_set_page_complete (assistant, page, TRUE); + gtk_assistant_set_page_complete (assistant, info->file_page, TRUE); } g_free (file_name); @@ -173,9 +171,6 @@ csv_export_sep_cb (GtkWidget *radio, gpointer user_data) GtkAssistant *assistant = GTK_ASSISTANT(info->assistant); const gchar *name; - gint num = gtk_assistant_get_current_page (assistant); - GtkWidget *page = gtk_assistant_get_nth_page (assistant, num); - if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(radio))) { LEAVE("1st callback of pair. Defer to 2nd callback."); @@ -186,7 +181,7 @@ csv_export_sep_cb (GtkWidget *radio, gpointer user_data) gtk_widget_set_sensitive (info->custom_entry, FALSE); info->use_custom = FALSE; - gtk_assistant_set_page_complete (assistant, page, TRUE); + gtk_assistant_set_page_complete (assistant, info->start_page, TRUE); if (g_strcmp0 (name, "comma_radio") == 0) info->separator_str = ","; @@ -200,7 +195,7 @@ csv_export_sep_cb (GtkWidget *radio, gpointer user_data) gtk_widget_set_sensitive (info->custom_entry, TRUE); info->use_custom = TRUE; if (gtk_entry_get_text_length (GTK_ENTRY(info->custom_entry)) == 0) - gtk_assistant_set_page_complete (assistant, page, FALSE); + gtk_assistant_set_page_complete (assistant, info->start_page, FALSE); } } @@ -249,16 +244,13 @@ csv_export_custom_entry_cb (GtkWidget *widget, gpointer user_data) GtkAssistant *assistant = GTK_ASSISTANT(info->assistant); const gchar *custom_str; - gint num = gtk_assistant_get_current_page (assistant); - GtkWidget *page = gtk_assistant_get_nth_page (assistant, num); - custom_str = gtk_entry_get_text (GTK_ENTRY(info->custom_entry)); info->separator_str = strdup (custom_str); if (info->use_custom == TRUE && gtk_entry_get_text_length (GTK_ENTRY(info->custom_entry)) == 0) - gtk_assistant_set_page_complete (assistant, page, FALSE); + gtk_assistant_set_page_complete (assistant, info->start_page, FALSE); else - gtk_assistant_set_page_complete (assistant, page, TRUE); + gtk_assistant_set_page_complete (assistant, info->start_page, TRUE); } @@ -384,9 +376,6 @@ csv_export_account_changed_cb (GtkTreeSelection *selection, gpointer user_data) { CsvExportInfo *info = user_data; - gint num = gtk_assistant_get_current_page (assistant); - GtkWidget *page = gtk_assistant_get_nth_page (assistant, num); - GtkAssistant *assistant = GTK_ASSISTANT(info->assistant); GncTreeViewAccount *view; @@ -396,9 +385,9 @@ csv_export_account_changed_cb (GtkTreeSelection *selection, /* Enable the Forward Assistant Button if we have accounts */ if (info->csva.num_accounts > 0) - gtk_assistant_set_page_complete (assistant, page, TRUE); + gtk_assistant_set_page_complete (assistant, info->account_page, TRUE); else - gtk_assistant_set_page_complete (assistant, page, FALSE); + gtk_assistant_set_page_complete (assistant, info->account_page, FALSE); view = GNC_TREE_VIEW_ACCOUNT(info->csva.account_treeview); info->csva.account_list = gnc_tree_view_account_get_selected_accounts (view); @@ -612,8 +601,6 @@ csv_export_assistant_start_page_prepare (GtkAssistant *assistant, gpointer user_data) { CsvExportInfo *info = user_data; - gint num = gtk_assistant_get_current_page (assistant); - GtkWidget *page = gtk_assistant_get_nth_page (assistant, num); /* Set Start page text */ if (info->export_type == XML_EXPORT_TREE) @@ -628,7 +615,7 @@ csv_export_assistant_start_page_prepare (GtkAssistant *assistant, } /* Enable the Assistant Buttons */ - gtk_assistant_set_page_complete (assistant, page, TRUE); + gtk_assistant_set_page_complete (assistant, info->start_page, TRUE); } @@ -637,14 +624,12 @@ csv_export_assistant_account_page_prepare (GtkAssistant *assistant, gpointer user_data) { CsvExportInfo *info = user_data; - gint num = gtk_assistant_get_current_page (assistant); - GtkWidget *page = gtk_assistant_get_nth_page (assistant, num); /* Enable the Forward Assistant Button if we have accounts */ if (info->csva.num_accounts > 0) - gtk_assistant_set_page_complete (assistant, page, TRUE); + gtk_assistant_set_page_complete (assistant, info->account_page, TRUE); else - gtk_assistant_set_page_complete (assistant, page, FALSE); + gtk_assistant_set_page_complete (assistant, info->account_page, FALSE); } @@ -653,8 +638,6 @@ csv_export_assistant_file_page_prepare (GtkAssistant *assistant, gpointer user_data) { CsvExportInfo *info = user_data; - gint num = gtk_assistant_get_current_page (assistant); - GtkWidget *page = gtk_assistant_get_nth_page (assistant, num); /* Set the default directory */ if (info->starting_dir) @@ -662,7 +645,7 @@ csv_export_assistant_file_page_prepare (GtkAssistant *assistant, gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER(info->file_chooser), ""); /* Disable the Forward Assistant Button */ - gtk_assistant_set_page_complete (assistant, page, FALSE); + gtk_assistant_set_page_complete (assistant, info->file_page, FALSE); } @@ -671,8 +654,6 @@ csv_export_assistant_finish_page_prepare (GtkAssistant *assistant, gpointer user_data) { CsvExportInfo *info = user_data; - gint num = gtk_assistant_get_current_page (assistant); - GtkWidget *page = gtk_assistant_get_nth_page (assistant, num); gchar *text; /* Set Finish page text */ @@ -699,7 +680,7 @@ csv_export_assistant_finish_page_prepare (GtkAssistant *assistant, gtk_assistant_previous_page (assistant); } /* Enable the Assistant Buttons */ - gtk_assistant_set_page_complete (assistant, page, TRUE); + gtk_assistant_set_page_complete (assistant, info->finish_label, TRUE); } @@ -804,7 +785,7 @@ static GtkWidget * csv_export_assistant_create (CsvExportInfo *info) { GtkBuilder *builder; - GtkWidget *box, *h_box; + GtkWidget *h_box; GtkWidget *button; GtkWidget *table, *hbox; time64 start_time, end_time; @@ -920,8 +901,7 @@ csv_export_assistant_create (CsvExportInfo *info) g_signal_connect (G_OBJECT(info->file_chooser), "selection-changed", G_CALLBACK(csv_export_file_chooser_selection_changed_cb), info); - box = GTK_WIDGET(gtk_builder_get_object (builder, "file_page")); - gtk_box_pack_start (GTK_BOX (box), info->file_chooser, TRUE, TRUE, 6); + gtk_box_pack_start (GTK_BOX (info->file_page), info->file_chooser, TRUE, TRUE, 6); gtk_widget_show (info->file_chooser); /* Finish Page */ From 31fcb76414e93feefca984c7d060c3b173d43452 Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Sat, 1 Dec 2018 13:20:21 +0000 Subject: [PATCH 06/14] Add ability to double click on file name for csv-export --- .../csv-exp/assistant-csv-export.c | 65 +++++++++++++++---- 1 file changed, 52 insertions(+), 13 deletions(-) diff --git a/gnucash/import-export/csv-exp/assistant-csv-export.c b/gnucash/import-export/csv-exp/assistant-csv-export.c index afc7a70f8a..fdb2c8186b 100644 --- a/gnucash/import-export/csv-exp/assistant-csv-export.c +++ b/gnucash/import-export/csv-exp/assistant-csv-export.c @@ -73,6 +73,7 @@ void csv_export_show_range_cb (GtkRadioButton *button, gpointer user_data); void csv_export_start_date_cb (GtkWidget *radio, gpointer user_data); void csv_export_end_date_cb (GtkWidget *radio, gpointer user_data); +void csv_export_file_chooser_file_activated_cb (GtkFileChooser *chooser, CsvExportInfo *info); void csv_export_file_chooser_selection_changed_cb (GtkFileChooser *chooser, CsvExportInfo *info); static const gchar *finish_tree_string = N_( @@ -121,19 +122,15 @@ static const gchar *start_trans_simple_string = N_( /************************************************** - * csv_export_file_chooser_selection_changed_cb + * csv_export_assistant_check_filename * - * call back for GtkFileChooser widget + * check for a valid filename for GtkFileChooser callbacks **************************************************/ -void -csv_export_file_chooser_selection_changed_cb (GtkFileChooser *chooser, CsvExportInfo *info) +static gboolean +csv_export_assistant_check_filename (GtkFileChooser *chooser, + CsvExportInfo *info) { - GtkAssistant *assistant = GTK_ASSISTANT(info->assistant); - gchar *file_name; - - gtk_assistant_set_page_complete (assistant, info->file_page, FALSE); - - file_name = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(info->file_chooser)); + gchar *file_name = gtk_file_chooser_get_filename (chooser); /* Test for a valid filename and not a directory */ if (file_name && !g_file_test (file_name, G_FILE_TEST_IS_DIR)) @@ -149,13 +146,52 @@ csv_export_file_chooser_selection_changed_cb (GtkFileChooser *chooser, CsvExport g_free (filedir); g_free (filepath); + g_free (file_name); - gtk_assistant_set_page_complete (assistant, info->file_page, TRUE); + DEBUG("file_name selected is %s", info->file_name); + DEBUG("starting directory is %s", info->starting_dir); + return TRUE; } g_free (file_name); + return FALSE; +} - DEBUG("file_name selected is %s", info->file_name); - DEBUG("starting directory is %s", info->starting_dir); + +/************************************************** + * csv_export_file_chooser_file_activated_cb + * + * call back for GtkFileChooser file-activated signal + **************************************************/ +void +csv_export_file_chooser_file_activated_cb (GtkFileChooser *chooser, + CsvExportInfo *info) +{ + GtkAssistant *assistant = GTK_ASSISTANT(info->assistant); + gtk_assistant_set_page_complete (assistant, info->file_page, FALSE); + + /* Test for a valid filename and not a directory */ + if (csv_export_assistant_check_filename (chooser, info)) + { + gtk_assistant_set_page_complete (assistant, info->file_page, TRUE); + gtk_assistant_next_page (assistant); + } +} + + +/************************************************** + * csv_export_file_chooser_selection_changed_cb + * + * call back for GtkFileChooser widget + **************************************************/ +void +csv_export_file_chooser_selection_changed_cb (GtkFileChooser *chooser, + CsvExportInfo *info) +{ + GtkAssistant *assistant = GTK_ASSISTANT(info->assistant); + + /* Enable the forward button based on a valid filename */ + gtk_assistant_set_page_complete (assistant, info->file_page, + csv_export_assistant_check_filename (chooser, info)); } @@ -901,6 +937,9 @@ csv_export_assistant_create (CsvExportInfo *info) g_signal_connect (G_OBJECT(info->file_chooser), "selection-changed", G_CALLBACK(csv_export_file_chooser_selection_changed_cb), info); + g_signal_connect (G_OBJECT(info->file_chooser), "file-activated", + G_CALLBACK(csv_export_file_chooser_file_activated_cb), info); + gtk_box_pack_start (GTK_BOX (info->file_page), info->file_chooser, TRUE, TRUE, 6); gtk_widget_show (info->file_chooser); From 3321462123d2686df3ba9e50426eb2e5b62640be Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Sun, 2 Dec 2018 09:53:46 +0000 Subject: [PATCH 07/14] Add ability to double click on file name for csv-account-import --- .../csv-imp/assistant-csv-account-import.c | 87 ++++++++++++++----- 1 file changed, 65 insertions(+), 22 deletions(-) diff --git a/gnucash/import-export/csv-imp/assistant-csv-account-import.c b/gnucash/import-export/csv-imp/assistant-csv-account-import.c index 494141640a..443c8f5b11 100644 --- a/gnucash/import-export/csv-imp/assistant-csv-account-import.c +++ b/gnucash/import-export/csv-imp/assistant-csv-account-import.c @@ -62,6 +62,7 @@ void csv_import_assistant_summary_page_prepare (GtkAssistant *assistant, gpointe void csv_import_sep_cb (GtkWidget *radio, gpointer user_data ); void csv_import_hrows_cb (GtkWidget *spin, gpointer user_data ); +void csv_import_file_chooser_file_activated_cb (GtkFileChooser *chooser, CsvImportInfo *info); void csv_import_file_chooser_selection_changed_cb (GtkFileChooser *chooser, CsvImportInfo *info); static gchar *gnc_input_dialog (GtkWidget *parent, const gchar *title, const gchar *msg, const gchar *default_input); @@ -135,38 +136,78 @@ void create_regex (GString *regex_str, const gchar *sep) /*************************************************************************/ +/************************************************** + * csv_import_assistant_check_filename + * + * check for a valid filename for GtkFileChooser callbacks + **************************************************/ +static gboolean +csv_import_assistant_check_filename (GtkFileChooser *chooser, + CsvImportInfo *info) +{ + gchar *file_name = gtk_file_chooser_get_filename (chooser); + + /* Test for a valid filename and not a directory */ + if (file_name && !g_file_test (file_name, G_FILE_TEST_IS_DIR)) + { + gchar *filepath = gnc_uri_get_path (file_name); + gchar *filedir = g_path_get_dirname (filepath); + + g_free (info->file_name); + info->file_name = g_strdup (file_name); + + g_free (info->starting_dir); + info->starting_dir = g_strdup (filedir); + + g_free (filedir); + g_free (filepath); + g_free (file_name); + + DEBUG("file_name selected is %s", info->file_name); + DEBUG("starting directory is %s", info->starting_dir); + return TRUE; + } + g_free (file_name); + return FALSE; +} + + +/************************************************** + * csv_import_file_chooser_file_activated_cb + * + * call back for GtkFileChooser file-activated signal + **************************************************/ +void +csv_import_file_chooser_file_activated_cb (GtkFileChooser *chooser, + CsvImportInfo *info) +{ + GtkAssistant *assistant = GTK_ASSISTANT(info->assistant); + gtk_assistant_set_page_complete (assistant, info->file_page, FALSE); + + /* Test for a valid filename and not a directory */ + if (csv_import_assistant_check_filename (chooser, info)) + { + gtk_assistant_set_page_complete (assistant, info->file_page, TRUE); + gtk_assistant_next_page (assistant); + } +} + + /************************************************** * csv_import_file_chooser_selection_changed_cb * * call back for file chooser widget **************************************************/ void -csv_import_file_chooser_selection_changed_cb (GtkFileChooser *chooser, CsvImportInfo *info) +csv_import_file_chooser_selection_changed_cb (GtkFileChooser *chooser, + CsvImportInfo *info) { GtkAssistant *assistant = GTK_ASSISTANT(info->assistant); - gchar *file_name; - - gtk_assistant_set_page_complete (assistant, info->file_page, FALSE); gtk_assistant_set_page_complete (assistant, info->account_page, FALSE); - file_name = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(info->file_chooser)); - - if (file_name && !g_file_test (file_name, G_FILE_TEST_IS_DIR)) - { - gchar *filepath = gnc_uri_get_path (file_name); - gchar *filedir = g_path_get_dirname (filepath); - info->starting_dir = g_strdup (filedir); - g_free (filedir); - g_free (filepath); - - info->file_name = g_strdup (file_name); - - gtk_assistant_set_page_complete (assistant, info->file_page, TRUE); - } - g_free (file_name); - - DEBUG("file_name selected is %s", info->file_name); - DEBUG("starting directory is %s", info->starting_dir); + /* Enable the forward button based on a valid filename */ + gtk_assistant_set_page_complete (assistant, info->file_page, + csv_import_assistant_check_filename (chooser, info)); } @@ -630,6 +671,8 @@ csv_import_assistant_create (CsvImportInfo *info) info->file_chooser = gtk_file_chooser_widget_new (GTK_FILE_CHOOSER_ACTION_OPEN); g_signal_connect (G_OBJECT(info->file_chooser), "selection-changed", G_CALLBACK(csv_import_file_chooser_selection_changed_cb), info); + g_signal_connect (G_OBJECT(info->file_chooser), "file-activated", + G_CALLBACK(csv_import_file_chooser_file_activated_cb), info); gtk_box_pack_start (GTK_BOX(info->file_page), info->file_chooser, TRUE, TRUE, 6); gtk_widget_show (info->file_chooser); From 48b0739942ac811b78e22f48b94ce8bf7447cc44 Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Sun, 2 Dec 2018 10:50:51 +0000 Subject: [PATCH 08/14] Add ability to double click on file name for csv-price-import --- .../csv-imp/assistant-csv-price-import.cpp | 54 +++++++++++++++---- 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/gnucash/import-export/csv-imp/assistant-csv-price-import.cpp b/gnucash/import-export/csv-imp/assistant-csv-price-import.cpp index 175ec7c225..0842257ac0 100644 --- a/gnucash/import-export/csv-imp/assistant-csv-price-import.cpp +++ b/gnucash/import-export/csv-imp/assistant-csv-price-import.cpp @@ -93,6 +93,7 @@ public: void assist_finish (); void assist_compmgr_close (); + void file_activated_cb (); void file_selection_changed_cb (); void preview_settings_delete (); @@ -133,6 +134,8 @@ private: GtkWidget* preview_cbox_factory (GtkTreeModel* model, uint32_t colnum); /* helper function to set rendering parameters for preview data columns */ void preview_style_column (uint32_t col_num, GtkTreeModel* model); + /* helper function to check for a valid filename as opposed to a directory */ + bool check_for_valid_filename (); GtkAssistant *csv_imp_asst; @@ -190,6 +193,7 @@ extern "C" void csv_price_imp_assist_prepare_cb (GtkAssistant *assistant, GtkWidget *page, CsvImpPriceAssist* info); void csv_price_imp_assist_close_cb (GtkAssistant *gtkassistant, CsvImpPriceAssist* info); void csv_price_imp_assist_finish_cb (GtkAssistant *gtkassistant, CsvImpPriceAssist* info); +void csv_price_imp_file_activated_changed_cb (GtkFileChooser *chooser, CsvImpPriceAssist *info); void csv_price_imp_file_selection_changed_cb (GtkFileChooser *chooser, CsvImpPriceAssist *info); void csv_price_imp_preview_del_settings_cb (GtkWidget *button, CsvImpPriceAssist *info); void csv_price_imp_preview_save_settings_cb (GtkWidget *button, CsvImpPriceAssist *info); @@ -228,6 +232,11 @@ csv_price_imp_assist_finish_cb (GtkAssistant *assistant, CsvImpPriceAssist* info info->assist_finish (); } +void csv_price_imp_file_activated_changed_cb (GtkFileChooser *chooser, CsvImpPriceAssist *info) +{ + info->file_activated_cb(); +} + void csv_price_imp_file_selection_changed_cb (GtkFileChooser *chooser, CsvImpPriceAssist *info) { info->file_selection_changed_cb(); @@ -503,6 +512,8 @@ CsvImpPriceAssist::CsvImpPriceAssist () g_signal_connect (G_OBJECT(file_chooser), "selection-changed", G_CALLBACK(csv_price_imp_file_selection_changed_cb), this); + g_signal_connect (G_OBJECT(file_chooser), "file-activated", + G_CALLBACK(csv_price_imp_file_activated_changed_cb), this); auto box = GTK_WIDGET(gtk_builder_get_object (builder, "file_page")); gtk_box_pack_start (GTK_BOX(box), file_chooser, TRUE, TRUE, 6); @@ -667,18 +678,14 @@ CsvImpPriceAssist::~CsvImpPriceAssist () * Code related to the file chooser page **************************************************/ -/* csv_price_imp_file_selection_changed_cb - * - * call back for file chooser widget +/* check_for_valid_filename for a valid file to activate the forward button */ -void -CsvImpPriceAssist::file_selection_changed_cb () +bool +CsvImpPriceAssist::check_for_valid_filename () { - gtk_assistant_set_page_complete (csv_imp_asst, file_page, false); - auto file_name = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(file_chooser)); if (!file_name || g_file_test (file_name, G_FILE_TEST_IS_DIR)) - return; + return false; auto filepath = gnc_uri_get_path (file_name); auto starting_dir = g_path_get_dirname (filepath); @@ -693,7 +700,36 @@ CsvImpPriceAssist::file_selection_changed_cb () g_free (file_name); g_free (starting_dir); - gtk_assistant_set_page_complete (csv_imp_asst, file_page, true); + return true; +} + +/* csv_price_imp_file_activated_cb + * + * call back for file chooser widget + */ +void +CsvImpPriceAssist::file_activated_cb () +{ + gtk_assistant_set_page_complete (csv_imp_asst, file_page, false); + + /* Test for a valid filename and not a directory */ + if (check_for_valid_filename ()) + { + gtk_assistant_set_page_complete (csv_imp_asst, file_page, true); + gtk_assistant_next_page (csv_imp_asst); + } +} + +/* csv_price_imp_file_selection_changed_cb + * + * call back for file chooser widget + */ +void +CsvImpPriceAssist::file_selection_changed_cb () +{ + /* Enable the forward button based on a valid filename */ + gtk_assistant_set_page_complete (csv_imp_asst, file_page, + check_for_valid_filename ()); } From 34e84fda856cf0b302ff4168f695258300b8c502 Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Sun, 2 Dec 2018 11:24:07 +0000 Subject: [PATCH 09/14] Add ability to double click on file name for csv-trans-import --- .../csv-imp/assistant-csv-trans-import.cpp | 59 +++++++++++++++---- 1 file changed, 47 insertions(+), 12 deletions(-) diff --git a/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp b/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp index a0f8b1111b..389f7e3c51 100644 --- a/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp +++ b/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp @@ -159,6 +159,7 @@ public: void assist_finish (); void assist_compmgr_close (); + void file_activated_cb (); void file_selection_changed_cb (); void preview_settings_delete (); @@ -202,6 +203,8 @@ private: GtkWidget* preview_cbox_factory (GtkTreeModel* model, uint32_t colnum); /* helper function to set rendering parameters for preview data columns */ void preview_style_column (uint32_t col_num, GtkTreeModel* model); + /* helper function to check for a valid filename as opposed to a directory */ + bool check_for_valid_filename (); GtkAssistant *csv_imp_asst; @@ -269,6 +272,7 @@ extern "C" void csv_tximp_assist_prepare_cb (GtkAssistant *assistant, GtkWidget *page, CsvImpTransAssist* info); void csv_tximp_assist_close_cb (GtkAssistant *gtkassistant, CsvImpTransAssist* info); void csv_tximp_assist_finish_cb (GtkAssistant *gtkassistant, CsvImpTransAssist* info); +void csv_tximp_file_activated_cb (GtkFileChooser *chooser, CsvImpTransAssist *info); void csv_tximp_file_selection_changed_cb (GtkFileChooser *chooser, CsvImpTransAssist *info); void csv_tximp_preview_del_settings_cb (GtkWidget *button, CsvImpTransAssist *info); void csv_tximp_preview_save_settings_cb (GtkWidget *button, CsvImpTransAssist *info); @@ -309,6 +313,10 @@ csv_tximp_assist_finish_cb (GtkAssistant *assistant, CsvImpTransAssist* info) info->assist_finish (); } +void csv_tximp_file_activated_cb (GtkFileChooser *chooser, CsvImpTransAssist *info) +{ + info->file_activated_cb(); +} void csv_tximp_file_selection_changed_cb (GtkFileChooser *chooser, CsvImpTransAssist *info) { @@ -481,6 +489,8 @@ CsvImpTransAssist::CsvImpTransAssist () file_chooser = gtk_file_chooser_widget_new (GTK_FILE_CHOOSER_ACTION_OPEN); g_signal_connect (G_OBJECT(file_chooser), "selection-changed", G_CALLBACK(csv_tximp_file_selection_changed_cb), this); + g_signal_connect (G_OBJECT(file_chooser), "file-activated", + G_CALLBACK(csv_tximp_file_activated_cb), this); auto box = GTK_WIDGET(gtk_builder_get_object (builder, "file_page")); gtk_box_pack_start (GTK_BOX(box), file_chooser, TRUE, TRUE, 6); @@ -671,18 +681,14 @@ CsvImpTransAssist::~CsvImpTransAssist () * Code related to the file chooser page **************************************************/ -/* csv_tximp_file_selection_changed_cb - * - * call back for ok button in file chooser widget +/* check_for_valid_filename for a valid file to activate the forward button */ -void -CsvImpTransAssist::file_selection_changed_cb () +bool +CsvImpTransAssist::check_for_valid_filename () { - gtk_assistant_set_page_complete (csv_imp_asst, file_page, false); - auto file_name = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(file_chooser)); if (!file_name || g_file_test (file_name, G_FILE_TEST_IS_DIR)) - return; + return false; auto filepath = gnc_uri_get_path (file_name); auto starting_dir = g_path_get_dirname (filepath); @@ -697,7 +703,36 @@ CsvImpTransAssist::file_selection_changed_cb () g_free (file_name); g_free (starting_dir); - gtk_assistant_set_page_complete (csv_imp_asst, file_page, true); + return true; +} + +/* csv_tximp_file_activated_cb + * + * call back for file chooser widget + */ +void +CsvImpTransAssist::file_activated_cb () +{ + gtk_assistant_set_page_complete (csv_imp_asst, file_page, false); + + /* Test for a valid filename and not a directory */ + if (check_for_valid_filename ()) + { + gtk_assistant_set_page_complete (csv_imp_asst, file_page, true); + gtk_assistant_next_page (csv_imp_asst); + } +} + +/* csv_tximp_file_selection_changed_cb + * + * call back for file chooser widget + */ +void +CsvImpTransAssist::file_selection_changed_cb () +{ + /* Enable the forward button based on a valid filename */ + gtk_assistant_set_page_complete (csv_imp_asst, file_page, + check_for_valid_filename ()); } @@ -1846,11 +1881,11 @@ void CsvImpTransAssist::assist_preview_page_prepare () { auto go_back = false; - - /* Load the file into parse_data, reset it if altrady loaded. */ + + /* Load the file into parse_data, reset if already loaded. */ if (tx_imp) tx_imp.reset(); - + tx_imp = std::unique_ptr(new GncTxImport); /* Assume data is CSV. User can later override to Fixed Width if needed */ From 51ab6e78046ae6d681d2627caf66a00503225fe5 Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Sun, 2 Dec 2018 12:24:26 +0000 Subject: [PATCH 10/14] Bug796960 - Incorrect amount sort order in Generic import matcher window The amount column was being sorted by string as opposed to amount value. Added a DOUBLE value to the model store to hold a converted gnc_numeric amount value and use that for sorting the tree view amount column. Also made the amount column right justified so numbers align. --- gnucash/import-export/import-main-matcher.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/gnucash/import-export/import-main-matcher.c b/gnucash/import-export/import-main-matcher.c index 214ce8bdd8..30c29fa4e3 100644 --- a/gnucash/import-export/import-main-matcher.c +++ b/gnucash/import-export/import-main-matcher.c @@ -72,6 +72,7 @@ enum downloaded_cols DOWNLOADED_COL_DATE_INT64, DOWNLOADED_COL_ACCOUNT, DOWNLOADED_COL_AMOUNT, + DOWNLOADED_COL_AMOUNT_DOUBLE, DOWNLOADED_COL_DESCRIPTION, DOWNLOADED_COL_MEMO, DOWNLOADED_COL_ACTION_ADD, @@ -423,6 +424,12 @@ add_text_column(GtkTreeView *view, const gchar *title, int col_num) // If date column, use the time64 value for the sorting. if (col_num == DOWNLOADED_COL_DATE_TXT) gtk_tree_view_column_set_sort_column_id(column, DOWNLOADED_COL_DATE_INT64); + else if (col_num == DOWNLOADED_COL_AMOUNT) // If amount column, use double value + { + gtk_cell_renderer_set_alignment (renderer, 1.0, 0.5); // right align amount column + gtk_cell_renderer_set_padding (renderer, 5, 0); // add padding so its not close to description + gtk_tree_view_column_set_sort_column_id(column, DOWNLOADED_COL_AMOUNT_DOUBLE); + } else gtk_tree_view_column_set_sort_column_id(column, col_num); @@ -468,8 +475,8 @@ gnc_gen_trans_init_view (GNCImportMainMatcher *info, GtkTreeSelection *selection; view = info->view; - store = gtk_list_store_new(NUM_DOWNLOADED_COLS, G_TYPE_STRING, - G_TYPE_INT64, G_TYPE_STRING, G_TYPE_STRING, + store = gtk_list_store_new(NUM_DOWNLOADED_COLS, G_TYPE_STRING, G_TYPE_INT64, + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_DOUBLE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_POINTER, G_TYPE_STRING); @@ -713,6 +720,7 @@ refresh_model_row (GNCImportMainMatcher *gui, gchar *class_extension = NULL; Split *split; time64 date; + gnc_numeric amount; g_assert (gui); g_assert (model); g_assert (info); @@ -742,11 +750,10 @@ refresh_model_row (GNCImportMainMatcher *gui, g_free(text); /*Amount*/ - ro_text = xaccPrintAmount - (xaccSplitGetAmount (split), - gnc_split_amount_print_info(split, TRUE) - ); + amount = xaccSplitGetAmount (split); + ro_text = xaccPrintAmount (amount, gnc_split_amount_print_info(split, TRUE)); gtk_list_store_set(store, iter, DOWNLOADED_COL_AMOUNT, ro_text, -1); + gtk_list_store_set(store, iter, DOWNLOADED_COL_AMOUNT_DOUBLE, gnc_numeric_to_double (amount), -1); /*Description*/ ro_text = xaccTransGetDescription(gnc_import_TransInfo_get_trans(info) ); From 03da6116bf7d92e38545709e8784d0cd5f6cb712 Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Sun, 2 Dec 2018 13:45:41 +0000 Subject: [PATCH 11/14] Bug 796886 - OFX Import does not show source account in the transaction matching window If there is more than one account source in the import it makes it difficult to allocate the transactions so add a toggle button to show or hide the source account column with the default being that of the calling function. --- gnucash/gtkbuilder/dialog-import.glade | 17 +++++++++++++- gnucash/import-export/import-main-matcher.c | 25 ++++++++++++++++++--- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/gnucash/gtkbuilder/dialog-import.glade b/gnucash/gtkbuilder/dialog-import.glade index b8243dc309..59ed257be9 100644 --- a/gnucash/gtkbuilder/dialog-import.glade +++ b/gnucash/gtkbuilder/dialog-import.glade @@ -1,5 +1,5 @@ - + @@ -1122,6 +1122,21 @@ + + + Show the Source Account column + True + True + False + center + True + + + False + True + 3 + + False diff --git a/gnucash/import-export/import-main-matcher.c b/gnucash/import-export/import-main-matcher.c index 30c29fa4e3..7734296022 100644 --- a/gnucash/import-export/import-main-matcher.c +++ b/gnucash/import-export/import-main-matcher.c @@ -64,6 +64,7 @@ struct _main_matcher_info GNCTransactionProcessedCB transaction_processed_cb; gpointer user_data; GNCImportPendingMatches *pending_matches; + GtkTreeViewColumn *account_column; }; enum downloaded_cols @@ -490,8 +491,8 @@ gnc_gen_trans_init_view (GNCImportMainMatcher *info, * (keep the line break below to avoid a translator comment) */ add_text_column(view, _("Date"), DOWNLOADED_COL_DATE_TXT); - column = add_text_column(view, _("Account"), DOWNLOADED_COL_ACCOUNT); - gtk_tree_view_column_set_visible(column, show_account); + info->account_column = add_text_column(view, _("Account"), DOWNLOADED_COL_ACCOUNT); + gtk_tree_view_column_set_visible(info->account_column, show_account); add_text_column(view, _("Amount"), DOWNLOADED_COL_AMOUNT); add_text_column(view, _("Description"), DOWNLOADED_COL_DESCRIPTION); add_text_column(view, _("Memo"), DOWNLOADED_COL_MEMO); @@ -537,7 +538,13 @@ gnc_gen_trans_init_view (GNCImportMainMatcher *info, G_CALLBACK(gnc_gen_trans_row_changed_cb), info); } - +static void +show_account_column_toggled_cb (GtkToggleButton *togglebutton, + GNCImportMainMatcher *info) +{ + gtk_tree_view_column_set_visible (info->account_column, + gtk_toggle_button_get_active (togglebutton)); +} GNCImportMainMatcher *gnc_gen_trans_list_new (GtkWidget *parent, const gchar* heading, @@ -551,6 +558,7 @@ GNCImportMainMatcher *gnc_gen_trans_list_new (GtkWidget *parent, gboolean show_update; GtkStyleContext *stylectxt; GdkRGBA color; + GtkWidget *button; info = g_new0 (GNCImportMainMatcher, 1); info->pending_matches = gnc_import_PendingMatches_new(); @@ -579,6 +587,11 @@ GNCImportMainMatcher *gnc_gen_trans_list_new (GtkWidget *parent, info->view = GTK_TREE_VIEW(gtk_builder_get_object (builder, "downloaded_view")); g_assert (info->view != NULL); + button = GTK_WIDGET(gtk_builder_get_object (builder, "show_source_account_button")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(button), all_from_same_account); + g_signal_connect(G_OBJECT(button), "toggled", + G_CALLBACK(show_account_column_toggled_cb), info); + show_update = gnc_import_Settings_get_action_update_enabled(info->user_settings); gnc_gen_trans_init_view(info, all_from_same_account, show_update); heading_label = GTK_WIDGET(gtk_builder_get_object (builder, "heading_label")); @@ -618,6 +631,7 @@ GNCImportMainMatcher * gnc_gen_trans_assist_new (GtkWidget *parent, gboolean show_update; GtkStyleContext *stylectxt; GdkRGBA color; + GtkWidget *button; info = g_new0 (GNCImportMainMatcher, 1); info->pending_matches = gnc_import_PendingMatches_new(); @@ -646,6 +660,11 @@ GNCImportMainMatcher * gnc_gen_trans_assist_new (GtkWidget *parent, info->view = GTK_TREE_VIEW(gtk_builder_get_object (builder, "downloaded_view")); g_assert (info->view != NULL); + button = GTK_WIDGET(gtk_builder_get_object (builder, "show_source_account_button")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(button), all_from_same_account); + g_signal_connect(G_OBJECT(button), "toggled", + G_CALLBACK(show_account_column_toggled_cb), info); + show_update = gnc_import_Settings_get_action_update_enabled(info->user_settings); gnc_gen_trans_init_view(info, all_from_same_account, show_update); heading_label = GTK_WIDGET(gtk_builder_get_object (builder, "heading_label")); From 9e104ebc4034efdc00d8b673c2cba32413c4cb9e Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Sun, 2 Dec 2018 14:12:44 +0000 Subject: [PATCH 12/14] Bug 796948 - Scheduled Transactions Entered Since Last Run Are not Visible Add a call to gnc_gui_refresh_all after the transactions have been created so the registers are updated. --- gnucash/gnome/dialog-sx-since-last-run.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gnucash/gnome/dialog-sx-since-last-run.c b/gnucash/gnome/dialog-sx-since-last-run.c index 7ed241a6a0..065b1bfbfe 100644 --- a/gnucash/gnome/dialog-sx-since-last-run.c +++ b/gnucash/gnome/dialog-sx-since-last-run.c @@ -1154,6 +1154,7 @@ dialog_response_cb(GtkDialog *dialog, gint response_id, GncSxSinceLastRunDialog gnc_suspend_gui_refresh(); gnc_sx_slr_model_effect_change(app_dialog->editing_model, FALSE, &app_dialog->created_txns, &creation_errors); gnc_resume_gui_refresh(); + gnc_gui_refresh_all (); // force a refresh of all registers if (creation_errors) creation_error_dialog(&creation_errors); From 5bc6922c14d8d0f57ec90355f206a5f648a83207 Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Mon, 3 Dec 2018 10:55:36 +0000 Subject: [PATCH 13/14] Bug 796944 - Tab navigation From Company Address field in New Book Options Disallow the use of tabs in all dialogue options text views. This is mainly used for notes fields and CSS so should not really be an issue. --- gnucash/gnome-utils/dialog-options.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gnucash/gnome-utils/dialog-options.c b/gnucash/gnome-utils/dialog-options.c index 66c0a1e142..d1af0d8c1d 100644 --- a/gnucash/gnome-utils/dialog-options.c +++ b/gnucash/gnome-utils/dialog-options.c @@ -2505,6 +2505,7 @@ gnc_option_set_ui_widget_text (GNCOption *option, GtkBox *page_box, value = gtk_text_view_new(); gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(value), GTK_WRAP_WORD); gtk_text_view_set_editable(GTK_TEXT_VIEW(value), TRUE); + gtk_text_view_set_accepts_tab (GTK_TEXT_VIEW(value), FALSE); gtk_container_add (GTK_CONTAINER (scroll), value); gnc_option_set_widget (option, value); From c3dae07d8355dfc899658135539d9dcae7161490 Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Mon, 3 Dec 2018 11:33:54 +0000 Subject: [PATCH 14/14] Disallow tabs in the account notes field. While using the tab key to navigate the fields of the edit account dialogue, it stops in the notes field as it accepts tabs so by disallowing use keyboard navigation can proceed. --- gnucash/gtkbuilder/dialog-account.glade | 1 + 1 file changed, 1 insertion(+) diff --git a/gnucash/gtkbuilder/dialog-account.glade b/gnucash/gtkbuilder/dialog-account.glade index f53fdc6327..40087671ae 100644 --- a/gnucash/gtkbuilder/dialog-account.glade +++ b/gnucash/gtkbuilder/dialog-account.glade @@ -1253,6 +1253,7 @@ True True word + False