Skip to content

Commit

Permalink
GNCAccountSel with a New button
Browse files Browse the repository at this point in the history
If the GNCAccountSel widget is set to be modal, using the 'New' button
returns the newly created account so use it for the selection.
  • Loading branch information
Bob-IT committed Nov 22, 2020
1 parent 0268561 commit faaa580
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions gnucash/gnome-utils/gnc-account-sel.c
Expand Up @@ -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 );
Expand Down

0 comments on commit faaa580

Please sign in to comment.