gnucash master: Bug 754533 Change finish page text for Search and General Journal register exports
Geert Janssens
gjanssens at code.gnucash.org
Wed Nov 4 14:50:59 EST 2015
Updated via https://github.com/Gnucash/gnucash/commit/d711b64f (commit)
from https://github.com/Gnucash/gnucash/commit/3a0ec89c (commit)
commit d711b64f103cbee0677bb728edb5ae3b3472516f
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Wed Nov 4 15:49:42 2015 +0000
Bug 754533 Change finish page text for Search and General Journal register exports
Additionally, correct an error with add_account_name function.
diff --git a/src/import-export/csv-exp/assistant-csv-export.c b/src/import-export/csv-exp/assistant-csv-export.c
index 32b2b3a..e7e42c5 100644
--- a/src/import-export/csv-exp/assistant-csv-export.c
+++ b/src/import-export/csv-exp/assistant-csv-export.c
@@ -86,6 +86,11 @@ static const gchar *finish_trans_string = N_(
" the number of accounts exported will be %u.\n\n"
"You can also verify your selections by clicking on 'Back' or 'Cancel' to Abort Export.\n");
+static const gchar *finish_trans_search_gl_string = N_(
+ /* Translators: %s is the file name string. */
+ "When you click 'Apply', the transactions will be exported to the file '%s.\n\n"
+ "You can also verify your selections by clicking on 'Back' or 'Cancel' to Abort Export.\n");
+
static const gchar *start_tree_string = N_(
"This assistant will help you export the Account Tree to a file\n"
" with the separator specified below.\n\n"
@@ -687,8 +692,12 @@ csv_export_assistant_finish_page_prepare (GtkAssistant *assistant,
if (info->export_type == XML_EXPORT_TREE)
text = g_strdup_printf (gettext (finish_tree_string), info->file_name);
else
- text = g_strdup_printf (gettext (finish_trans_string), info->file_name, info->csva.num_accounts);
-
+ {
+ if ((info->export_type == XML_EXPORT_REGISTER) && (info->account == NULL))
+ text = g_strdup_printf (gettext (finish_trans_search_gl_string), info->file_name);
+ else
+ text = g_strdup_printf (gettext (finish_trans_string), info->file_name, info->csva.num_accounts);
+ }
gtk_label_set_text (GTK_LABEL(info->finish_label), text);
g_free (text);
diff --git a/src/import-export/csv-exp/csv-transactions-export.c b/src/import-export/csv-exp/csv-transactions-export.c
index 8590425..0b8e9a4 100644
--- a/src/import-export/csv-exp/csv-transactions-export.c
+++ b/src/import-export/csv-exp/csv-transactions-export.c
@@ -210,23 +210,31 @@ add_second_date (gchar *so_far, Transaction *trans, CsvExportInfo *info)
static gchar*
add_account_name (gchar *so_far, Account *acc, Split *split, gboolean full, CsvExportInfo *info)
{
- gchar *name;
+ gchar *name = NULL;
gchar *conv;
gchar *result;
Account *account = NULL;
if (split == NULL)
- account = acc;
+ {
+ if (acc == NULL)
+ name = g_strdup (" ");
+ else
+ account = acc;
+ }
else
account = xaccSplitGetAccount (split);
- if (full)
- name = gnc_account_get_full_name (account);
- else
- name = g_strdup (xaccAccountGetName (account));
-
+ if (account != NULL)
+ {
+ if (full)
+ name = gnc_account_get_full_name (account);
+ else
+ name = g_strdup (xaccAccountGetName (account));
+ }
conv = csv_txn_test_field_string (info, name);
result = g_strconcat (so_far, conv, info->mid_sep, NULL);
+ g_free (name);
g_free (conv);
g_free (so_far);
return result;
Summary of changes:
src/import-export/csv-exp/assistant-csv-export.c | 13 +++++++++++--
.../csv-exp/csv-transactions-export.c | 22 +++++++++++++++-------
2 files changed, 26 insertions(+), 9 deletions(-)
More information about the gnucash-changes
mailing list