gnucash stable: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Mon Jun 12 18:55:29 EDT 2023


Updated	 via  https://github.com/Gnucash/gnucash/commit/75fb523c (commit)
	 via  https://github.com/Gnucash/gnucash/commit/57b8006a (commit)
	 via  https://github.com/Gnucash/gnucash/commit/5923a59c (commit)
	 via  https://github.com/Gnucash/gnucash/commit/2555c5b0 (commit)
	from  https://github.com/Gnucash/gnucash/commit/2e20b37d (commit)



commit 75fb523c36ce604bf688159d549352138bcbb7d8
Merge: 57b8006a66 2555c5b0b9
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Jun 12 15:48:50 2023 -0700

    Merge Simon Arlott's 'bug-798695' into stable.


commit 57b8006a66e5c66bdce0fce3b341a100259688e5
Merge: 2e20b37d04 5923a59cfc
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Jun 12 15:45:41 2023 -0700

    Merge Simon Arlott's 'bug-777472' into stable.


commit 5923a59cfce2d56a31471a717a87746bb41abad3
Author: Simon Arlott <sa.me.uk>
Date:   Wed Jun 7 20:12:53 2023 +0100

    Bug 777472 - reconcile does not work if transaction selected
    
    If there's an existing transaction with pending edits when starting
    reconciliation, that transaction can appear in the list of transactions and
    be modified by the reconciliation but as soon as navigation to another
    transaction occurs the pending edit will be saved, overwriting the change
    to mark it as reconciled. The result is that reconciliation appears to have
    failed or not marked the transaction as reconciled.
    
    This commonly happens when marking several transactions as cleared before
    performing reconciliation. If the last transaction is still being edited
    it will typically be saved after the reconciliation finishes and overwrite
    any change made.
    
    Check that there's no outstanding activity in the current register page
    before starting a reconciliation.
    
    It is still possible to start modifying a transaction after the
    reconciliation window is open but this will stop the most common issue with
    the process.
    
    Starting a reconciliation from the account tree is left unprotected.

diff --git a/gnucash/gnome/gnc-plugin-page-account-tree.c b/gnucash/gnome/gnc-plugin-page-account-tree.c
index 9c12fc85c6..b271ba3f90 100644
--- a/gnucash/gnome/gnc-plugin-page-account-tree.c
+++ b/gnucash/gnome/gnc-plugin-page-account-tree.c
@@ -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);
diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index 2f7f09815c..0007542e3f 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -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 (

commit 2555c5b0b95c4157ea382357becb7a350f16a815
Author: Simon Arlott <sa.me.uk>
Date:   Mon May 29 21:14:00 2023 +0100

    Bug 798695 - Deleting everything from the "Transfer" cell after suggestions pop-up restricts search to the first 30 accounts
    
    The combo box list is capable of displaying all accounts if expanded
    without starting searching, so changing the search string to "" shouldn't
    only return a small subset of accounts with no way to fix it.
    
    Skip the search and return all accounts in the combo box as it normally
    does if the account list is opened without searching for something.

diff --git a/gnucash/register/register-gnome/combocell-gnome.c b/gnucash/register/register-gnome/combocell-gnome.c
index fd6c039d0b..c7d430f6cf 100644
--- a/gnucash/register/register-gnome/combocell-gnome.c
+++ b/gnucash/register/register-gnome/combocell-gnome.c
@@ -633,6 +633,20 @@ gnc_combo_cell_type_ahead_search (const gchar* newval,
     gtk_list_store_clear (box->tmp_store);
     unblock_list_signals (cell);
 
+    if (strlen (newval) == 0) {
+        /* Deleting everything in the cell shouldn't provide a search result for
+         * "" because that will just be the first MAX_NUM_MATCHES accounts which
+         * isn't very useful.
+         *
+         * Skip the search show the popup again with all accounts. Clear the
+         * temp store or the cell will be pre-filled with the first account.
+         */
+        gnc_item_list_set_temp_store (box->item_list, NULL);
+        gnc_item_edit_show_popup (box->item_edit);
+        box->list_popped = TRUE;
+        goto cleanup;
+    }
+
     while (valid && num_found < MAX_NUM_MATCHES)
     {
         gchar* str_data = NULL;
@@ -659,6 +673,8 @@ gnc_combo_cell_type_ahead_search (const gchar* newval,
         gnc_item_edit_show_popup (box->item_edit);
         box->list_popped = TRUE;
     }
+
+cleanup:
     g_regex_unref (regex);
     return match_str;
 }
@@ -1213,4 +1229,3 @@ gnc_combo_cell_set_autosize (ComboCell* cell, gboolean autosize)
 
     box->autosize = autosize;
 }
-



Summary of changes:
 gnucash/gnome/gnc-plugin-page-account-tree.c      | 11 +++++++++++
 gnucash/gnome/gnc-plugin-page-register.c          | 11 +++++++++++
 gnucash/register/register-gnome/combocell-gnome.c | 17 ++++++++++++++++-
 3 files changed, 38 insertions(+), 1 deletion(-)



More information about the gnucash-changes mailing list