Skip to content

Commit

Permalink
Merge Simon Arlott's 'bug-777472' into stable.
Browse files Browse the repository at this point in the history
  • Loading branch information
jralls committed Jun 12, 2023
2 parents 2e20b37 + 5923a59 commit 57b8006
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions gnucash/gnome/gnc-plugin-page-account-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1782,6 +1782,17 @@ gnc_plugin_page_account_tree_cmd_reconcile (GSimpleAction *simple,
account = gnc_plugin_page_account_tree_get_current_account (page);
g_return_if_fail (account != NULL);

/* To prevent mistakes involving saving an edited transaction after
* finishing a reconciliation (reverting the reconcile state), we could look
* at all open registers and determine if any of them have a transaction
* being edited that involves the account to be reconciled.
*
* However, the reconcile window isn't modal so it's still possible to start
* editing a transaction after opening it. Assume the user knows what
* they're doing if they start a reconciliation from the account tree and
* don't attempt to stop them.
*/

window = GNC_PLUGIN_PAGE (page)->window;
recnData = recnWindow (window, account);
gnc_ui_reconcile_window_raise (recnData);
Expand Down
11 changes: 11 additions & 0 deletions gnucash/gnome/gnc-plugin-page-register.c
Original file line number Diff line number Diff line change
Expand Up @@ -4327,6 +4327,17 @@ gnc_plugin_page_register_cmd_reconcile (GSimpleAction *simple,

g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));

/* To prevent mistakes involving saving an edited transaction after
* finishing a reconciliation (reverting the reconcile state), require
* pending activity on the current register to be finished.
*
* The reconcile window isn't modal so it's still possible to start editing
* a transaction after opening it, but at that point the user should know
* what they're doing is unsafe.
*/
if (!gnc_plugin_page_register_finish_pending (GNC_PLUGIN_PAGE (page)))
return;

account = gnc_plugin_page_register_get_account (page);

window = gnc_window_get_gtk_window (GNC_WINDOW (GNC_PLUGIN_PAGE (
Expand Down

0 comments on commit 57b8006

Please sign in to comment.