GNCAccountSel with a New button

If the GNCAccountSel widget is set to be modal, using the 'New' button
returns the newly created account so use it for the selection.
This commit is contained in:
Robert Fewell 2020-11-22 10:37:59 +00:00
parent 026856122c
commit faaa580de7

View File

@ -493,10 +493,15 @@ static void
gas_new_account_click( GtkButton *b, gpointer ud )
{
GNCAccountSel *gas = (GNCAccountSel*)ud;
Account *account = NULL;
GtkWindow *parent = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gas)));
if (gas->isModal)
gnc_ui_new_accounts_from_name_window_with_types (parent, NULL,
gas->acctTypeFilters );
{
account = gnc_ui_new_accounts_from_name_window_with_types (parent, NULL,
gas->acctTypeFilters );
if (account)
gnc_account_sel_set_account (gas, account, FALSE);
}
else
gnc_ui_new_account_with_types (parent, gnc_get_current_book(),
gas->acctTypeFilters );