From 3422380ce63425b98e862081889fc65db9ec66cc Mon Sep 17 00:00:00 2001 From: David Hampton Date: Sun, 24 Nov 2002 06:56:45 +0000 Subject: [PATCH] If there is a current split, then ensure that the transaction containing that split stays in the register. This will make the transaction being edited stay in the register until you move to another transaction, even though the accounts may have been changes. #92158 git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7535 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 26 +++++++++++++++++++ src/engine/Account.c | 5 +++- src/register/ledger-core/gnc-ledger-display.c | 12 +++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 71289cffc3..5e8167592b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,16 @@ (sxed_close_event): Check for a valid SX before proceeding; fixes Bugs#99350 and dupes [99348,99356,99397]. +2002-11-23 Matthew Vanecek + * src/engine/Account.c (xaccAccountCommitEdit): Internationalize + the PWARN_GUI() string argument. + + * src/backend/postgres/PostgresBackend.c: Added messages.h to support + string internationalization. + + * src/backend/postgres/PostgresBackend.c (pgend_session_begin): + an xaccBackendSetMessage() call was missing the Backend argument. + 2002-11-23 Christian Stimming * src/import-export/hbci/gnc-hbci-gettrans.c: Use the new generic @@ -42,6 +52,22 @@ 2002-11-23 David Hampton + * src/register/ledger-core/gnc-ledger-display.c (refresh_handler): + If there is a current split, then ensure that the transaction + containing that split stays in the register. This will make the + transaction being edited stay in the register until you move to + another transaction, even though the accounts may have been + changes. #92158 + + * src/register/ledger-core/split-register-control.c + (gnc_split_register_move_cursor): If all the entries of the + current split have been cleared, then delete this split. #98139 + (gnc_split_register_old_split_empty_p): New function. + + * src/engine/Account.c (xaccTransFixSplitDateOrder): + (xaccTransFixSplitDateOrder): Prevent this routine from causing a + recursive call to itself. + * src/gnome-utils/commodity.glade: Change the title of the 'New Currency/Security' dialog to 'New Security' to match its actual function. #95596 diff --git a/src/engine/Account.c b/src/engine/Account.c index ddf95ed780..bb1f7e94ef 100644 --- a/src/engine/Account.c +++ b/src/engine/Account.c @@ -1248,15 +1248,18 @@ xaccAccountFixSplitDateOrder (Account * acc, Split *split) void xaccTransFixSplitDateOrder (Transaction *trans) { - GList *node; + GList *node, *next; + static int level = 0; if (trans == NULL) return; + gnc_engine_suspend_events(); for (node = trans->splits; node; node = node->next) { Split *s = node->data; xaccAccountFixSplitDateOrder (xaccSplitGetAccount(s), s); } + gnc_engine_resume_events(); } /********************************************************************\ diff --git a/src/register/ledger-core/gnc-ledger-display.c b/src/register/ledger-core/gnc-ledger-display.c index 7ac7180a12..b28b83cd3d 100644 --- a/src/register/ledger-core/gnc-ledger-display.c +++ b/src/register/ledger-core/gnc-ledger-display.c @@ -549,6 +549,7 @@ refresh_handler (GHashTable *changes, gpointer user_data) const EventInfo *info; gboolean has_leader; GList *splits; + Split *current_split; if (ld->loading) return; @@ -577,6 +578,17 @@ refresh_handler (GHashTable *changes, gpointer user_data) splits = xaccQueryGetSplits (ld->query); + /* + * If the user is in the middle of editing a transaction, make sure + * that transaction stays in the register instead of ripping it out + * from underneath them. + */ + current_split = gnc_split_register_get_current_split (ld->reg); + if (current_split && + (g_list_find(splits, current_split) == NULL)) { + g_list_append(splits, current_split); + } + gnc_ledger_display_set_watches (ld, splits); gnc_ledger_display_refresh_internal (ld, splits);