New budgets save state information with no changes

If you create a new budget and do not change any thing when closing the
budget or quitting with new budget open the state information for that
budget is saved but the budget is not. To fix this make a change to the
new budget description to force the save of the new budget.
This commit is contained in:
Robert Fewell 2020-02-13 16:34:25 +00:00
parent 7577afe0a9
commit b23d2445fc

View File

@ -149,11 +149,19 @@ gnc_plugin_budget_cmd_new_budget (GtkAction *action,
{ {
GncBudget *budget; GncBudget *budget;
GncPluginPage *page; GncPluginPage *page;
gchar *description, *date;
g_return_if_fail (user_data != NULL); g_return_if_fail (user_data != NULL);
budget = gnc_budget_new (gnc_get_current_book()); budget = gnc_budget_new (gnc_get_current_book());
page = gnc_plugin_page_budget_new (budget); page = gnc_plugin_page_budget_new (budget);
date = qof_print_date (gnc_time (NULL));
description = g_strdup_printf ("%s: %s", _("Created"), date);
gnc_budget_set_description (budget, description);
g_free (description);
g_free (date);
gnc_main_window_open_page (user_data->window, page); gnc_main_window_open_page (user_data->window, page);
} }