Skip to content

Commit

Permalink
CsvTransExp - fix info message to match state of simple format button
Browse files Browse the repository at this point in the history
  • Loading branch information
gjanssens committed Feb 14, 2023
1 parent dae07fb commit 6993fed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
32 changes: 14 additions & 18 deletions gnucash/import-export/csv-exp/assistant-csv-export.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,16 @@ csv_export_simple_cb (GtkToggleButton *button, gpointer user_data)
{
CsvExportInfo *info = user_data;

if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(button)))
info->simple_layout = TRUE;
info->simple_layout = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(button));

gchar *msg = NULL;
if (info->simple_layout)
msg = g_strdup_printf (_(start_trans_common_string), _(start_trans_simple_string));
else
info->simple_layout = FALSE;
msg = g_strdup_printf (_(start_trans_common_string), _(start_trans_multi_string));

gtk_label_set_text (GTK_LABEL(info->start_label), msg);
g_free (msg);
}

/*******************************************************
Expand Down Expand Up @@ -659,25 +665,15 @@ csv_export_assistant_start_page_prepare (GtkAssistant *assistant,
gpointer user_data)
{
CsvExportInfo *info = user_data;
gchar *msg = NULL;



/* Set Start page text */
if (info->export_type == XML_EXPORT_TREE)
gtk_label_set_text (GTK_LABEL(info->start_label), gettext (start_tree_string));
msg = g_strdup (_(start_tree_string));
else
{
gchar *label_string = NULL;
/* General Journal and search registers are always multi-line exported */
if ((info->export_type == XML_EXPORT_REGISTER) &&
(g_list_length (info->csva.account_list) == 0))
label_string = g_strdup_printf (_(start_trans_common_string), _(start_trans_multi_string));
else
label_string = g_strdup_printf (_(start_trans_common_string), _(start_trans_simple_string));
msg = g_strdup_printf (_(start_trans_common_string), _(start_trans_multi_string));

gtk_label_set_text (GTK_LABEL(info->start_label), label_string);
g_free (label_string);
}
gtk_label_set_text (GTK_LABEL(info->start_label), msg);
g_free (msg);

/* Enable the Assistant Buttons */
gtk_assistant_set_page_complete (assistant, info->start_page, TRUE);
Expand Down
1 change: 0 additions & 1 deletion gnucash/import-export/csv-exp/assistant-csv-export.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ typedef struct
CsvExportAcc csva;

Query *query;
Account *account;

GtkWidget *start_page;
GtkWidget *account_page;
Expand Down

0 comments on commit 6993fed

Please sign in to comment.