gnucash maint: Multiple changes pushed

Christopher Lam clam at code.gnucash.org
Fri Oct 8 05:18:08 EDT 2021


Updated	 via  https://github.com/Gnucash/gnucash/commit/c321eae7 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/7b9ad513 (commit)
	from  https://github.com/Gnucash/gnucash/commit/4c5b3658 (commit)



commit c321eae7cda36e7dff51432dcafbdf2f0072fd4d
Merge: 4c5b3658d 7b9ad5139
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Fri Oct 8 17:17:48 2021 +0800

    Merge branch 'maint-import' into maint #1160


commit 7b9ad5139064f64aa27f3709d7a58c2b5186692b
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Mon Oct 4 21:34:33 2021 +0800

    [import-main-matcher] show destination acct for auto-match

diff --git a/gnucash/import-export/import-main-matcher.c b/gnucash/import-export/import-main-matcher.c
index e6c9df361..0c532b9fc 100644
--- a/gnucash/import-export/import-main-matcher.c
+++ b/gnucash/import-export/import-main-matcher.c
@@ -40,6 +40,7 @@
 #include "import-main-matcher.h"
 
 #include "dialog-utils.h"
+#include "gnc-glib-utils.h"
 #include "gnc-ui.h"
 #include "gnc-ui-util.h"
 #include "gnc-engine.h"
@@ -1421,6 +1422,29 @@ update_child_row (GNCImportMatchInfo *sel_match, GtkTreeModel *model, GtkTreeIte
     g_free (text);
 }
 
+static gchar *
+get_peer_acct_names (Split *split)
+{
+    GList *names = NULL, *accounts_seen = NULL;
+    gchar *retval, *name;
+    for (GList *n = xaccTransGetSplitList (xaccSplitGetParent (split)); n; n = n->next)
+    {
+        Account *account = xaccSplitGetAccount (n->data);
+        if ((n->data == split) ||
+            (xaccAccountGetType (account) == ACCT_TYPE_TRADING) ||
+            (g_list_find (accounts_seen, account)))
+            continue;
+        name = gnc_account_get_full_name (account);
+        names = g_list_prepend (names, g_strdup_printf ("\"%s\"", name));
+        accounts_seen = g_list_prepend (accounts_seen, account);
+        g_free (name);
+    }
+    retval = gnc_g_list_stringjoin (names, ", ");
+    g_list_free_full (names, g_free);
+    g_list_free (accounts_seen);
+    return retval;
+}
+
 static void
 refresh_model_row (GNCImportMainMatcher *gui,
                    GtkTreeModel *model,
@@ -1550,15 +1574,19 @@ refresh_model_row (GNCImportMainMatcher *gui,
 
             if (sel_match)
             {
+                gchar *full_names = get_peer_acct_names (sel_match->split);
                 color = get_required_color (int_not_required_class);
                 if (gnc_import_TransInfo_get_match_selected_manually (info))
                 {
-                    ro_text = _("Reconcile (manual) match");
+                    text = g_strdup_printf (_("Reconcile (manual) match to %s"),
+                                            full_names);
                 }
                 else
                 {
-                    ro_text = _("Reconcile (auto) match");
+                    text = g_strdup_printf (_("Reconcile (auto) match to %s"),
+                                            full_names);
                 }
+                g_free (full_names);
                 update_child_row (sel_match, model, iter);
             }
             else
@@ -1576,15 +1604,19 @@ refresh_model_row (GNCImportMainMatcher *gui,
 
             if (sel_match)
             {
+                gchar *full_names = get_peer_acct_names (sel_match->split);
                 color = get_required_color (int_not_required_class);
                 if (gnc_import_TransInfo_get_match_selected_manually (info))
                 {
-                    ro_text = _("Update and reconcile (manual) match");
+                    text = g_strdup_printf (_("Update and reconcile (manual) match to %s"),
+                                            full_names);
                 }
                 else
                 {
-                    ro_text = _("Update and reconcile (auto) match");
+                    text = g_strdup_printf (_("Update and reconcile (auto) match to %s"),
+                                            full_names);
                 }
+                g_free (full_names);
                 update_child_row (sel_match, model, iter);
             }
             else



Summary of changes:
 gnucash/import-export/import-main-matcher.c | 40 ++++++++++++++++++++++++++---
 1 file changed, 36 insertions(+), 4 deletions(-)



More information about the gnucash-changes mailing list