From 3985541f48aa2e27740b449cc6e4dae86c6a6a6d Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Mon, 22 Apr 2019 12:01:25 +0100 Subject: [PATCH] Add a select all Accounts button for CSV Transaction export. --- gnucash/gtkbuilder/assistant-csv-export.glade | 30 ++++++++++++++----- .../csv-exp/assistant-csv-export.c | 26 +++++++++++++++- 2 files changed, 47 insertions(+), 9 deletions(-) diff --git a/gnucash/gtkbuilder/assistant-csv-export.glade b/gnucash/gtkbuilder/assistant-csv-export.glade index 6a1da83ade..88359e7201 100644 --- a/gnucash/gtkbuilder/assistant-csv-export.glade +++ b/gnucash/gtkbuilder/assistant-csv-export.glade @@ -1,5 +1,5 @@ - + @@ -12,6 +12,9 @@ + + + True @@ -275,7 +278,7 @@ Select the type of Export required and the separator that will be used. True False start - <b>_Accounts</b> + <b>Accounts</b> True True @@ -372,6 +375,7 @@ Select the type of Export required and the separator that will be used. True False + vertical _Select Subaccounts @@ -387,6 +391,21 @@ Select the type of Export required and the separator that will be used. 0 + + + Select _All + True + True + True + 3 + True + + + False + False + 1 + + False @@ -420,7 +439,7 @@ Select the type of Export required and the separator that will be used. True False start - <b>_Dates</b> + <b>Dates</b> True True @@ -735,10 +754,5 @@ Cancel to abort. False - - - False - - diff --git a/gnucash/import-export/csv-exp/assistant-csv-export.c b/gnucash/import-export/csv-exp/assistant-csv-export.c index 8a8d3aa4b7..75ab2f479b 100644 --- a/gnucash/import-export/csv-exp/assistant-csv-export.c +++ b/gnucash/import-export/csv-exp/assistant-csv-export.c @@ -430,6 +430,25 @@ csv_export_account_changed_cb (GtkTreeSelection *selection, } +/******************************************************* + * csv_export_select_all_clicked_cb + * + * select all the accounts + *******************************************************/ +static void +csv_export_select_all_clicked_cb (GtkWidget *widget, gpointer user_data) +{ + CsvExportInfo *info = user_data; + GtkTreeSelection *selection = gtk_tree_view_get_selection + (GTK_TREE_VIEW (info->csva.account_treeview)); + + gtk_tree_view_expand_all (GTK_TREE_VIEW (info->csva.account_treeview)); + gtk_tree_selection_select_all (selection); + + gtk_widget_grab_focus (info->csva.account_treeview); +} + + /******************************************************* * csv_export_select_subaccounts_clicked_cb * @@ -886,9 +905,14 @@ csv_export_assistant_create (CsvExportInfo *info) /* select subaccounts button */ button = GTK_WIDGET(gtk_builder_get_object (builder, "select_subaccounts_button")); info->csva.select_button = button; - g_signal_connect (G_OBJECT(button), "clicked", G_CALLBACK(csv_export_select_subaccounts_clicked_cb), info); + + button = GTK_WIDGET(gtk_builder_get_object (builder, "select_all_button")); + info->csva.select_button = button; + g_signal_connect (G_OBJECT(button), "clicked", + G_CALLBACK(csv_export_select_all_clicked_cb), info); + g_signal_connect (G_OBJECT(info->csva.account_treeview), "cursor_changed", G_CALLBACK(csv_export_cursor_changed_cb), info);