From f6858e7a5b9cea34e37f72a758b0aed427cfc706 Mon Sep 17 00:00:00 2001 From: David Hampton Date: Mon, 11 Nov 2002 00:51:06 +0000 Subject: [PATCH] The reinitialize transaction code should mark the transaction as pending so that the right checks are done when leaving the transaction. Fix spelling errors in function names. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7459 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 24 +++++++++++++++++++++++ src/gnome/gnc-split-reg.c | 5 ++--- src/register/ledger-core/split-register.c | 15 +++++--------- src/register/ledger-core/split-register.h | 4 ++-- 4 files changed, 33 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8c4eab634c..4726dcf776 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +2002-11-10 David Hampton + + * src/scm/price-quotes.scm ((gnc:book-add-quotes book)): Don't get + stock quotes for accounts where all the shares have all been + sold. #95547 + + * src/register/ledger-core/split-register.c + (gnc_split_register_empty_current_trans_except_split): After + modifying the transaction, leave it in "open" state and mark it as + the currently pending transaction. This insures that the register + does the right thing when leaving this transaction. Also fix + spelling error in function name. + (gnc_split_register_empty_current_trans): Fix spelling error in + function name. + + * src/register/ledger-core/split-register.c: Fix spelling error in + function names. + + * src/gnome/gnc-split-reg.c (gsr_default_reinit_handler): Fix + spelling error in function name. + (gnc_split_reg_reinitialize_trans_cb): Emit the right signal. + (gnc_split_reg_jump_to_split_amount): Remove uninitialized + variable. + 2002-11-09 Herbert Thoma * /src/report/standard-reports/cash-flow.scm: bug fix for cash flow diff --git a/src/gnome/gnc-split-reg.c b/src/gnome/gnc-split-reg.c index 00680ec621..4e06e66d78 100644 --- a/src/gnome/gnc-split-reg.c +++ b/src/gnome/gnc-split-reg.c @@ -981,7 +981,7 @@ gsr_default_reinit_handler( GNCSplitReg *gsr, gpointer data ) if (!gnc_split_register_get_split_virt_loc(reg, split, &vcell_loc)) return; split = gnc_split_register_get_current_trans_split (reg, &vcell_loc); - gnc_split_register_emtpy_current_trans_except_split (reg, split); + gnc_split_register_empty_current_trans_except_split (reg, split); } /** @@ -991,7 +991,7 @@ void gnc_split_reg_reinitialize_trans_cb(GtkWidget *widget, gpointer data) { GNCSplitReg *gsr = data; - gsr_emit_signal( gsr, "reinit" ); + gsr_emit_signal( gsr, "reinit_ent" ); } void @@ -1295,7 +1295,6 @@ gnc_split_reg_jump_to_split(GNCSplitReg *gsr, Split *split) void gnc_split_reg_jump_to_split_amount(GNCSplitReg *gsr, Split *split) { - Transaction *trans; VirtualLocation virt_loc; SplitRegister *reg; diff --git a/src/register/ledger-core/split-register.c b/src/register/ledger-core/split-register.c index 89ed17d4fe..ac9e2045ad 100644 --- a/src/register/ledger-core/split-register.c +++ b/src/register/ledger-core/split-register.c @@ -1018,7 +1018,7 @@ gnc_split_register_delete_current_trans (SplitRegister *reg) } void -gnc_split_register_emtpy_current_trans_except_split (SplitRegister *reg, Split *split) +gnc_split_register_empty_current_trans_except_split (SplitRegister *reg, Split *split) { SRInfo *info = gnc_split_register_get_info (reg); Transaction *pending_trans; @@ -1077,14 +1077,9 @@ gnc_split_register_emtpy_current_trans_except_split (SplitRegister *reg, Split * for (node = splits; node; node = node->next) if (node->data != split) xaccSplitDestroy (node->data); - xaccTransCommitEdit (trans); - /* Check pending transaction */ - if (trans == pending_trans) - { - info->pending_trans_guid = *xaccGUIDNULL (); - pending_trans = NULL; - } + /* This is now the pending transaction */ + info->pending_trans_guid = *xaccTransGetGUID(trans); gnc_resume_gui_refresh (); @@ -1092,13 +1087,13 @@ gnc_split_register_emtpy_current_trans_except_split (SplitRegister *reg, Split * } void -gnc_split_register_emtpy_current_trans (SplitRegister *reg) +gnc_split_register_empty_current_trans (SplitRegister *reg) { Split *split; /* get the current split based on cursor position */ split = gnc_split_register_get_current_split (reg); - gnc_split_register_emtpy_current_trans_except_split (reg, split); + gnc_split_register_empty_current_trans_except_split (reg, split); } void diff --git a/src/register/ledger-core/split-register.h b/src/register/ledger-core/split-register.h index c0dc7bd1ad..ad6013cf78 100644 --- a/src/register/ledger-core/split-register.h +++ b/src/register/ledger-core/split-register.h @@ -241,8 +241,8 @@ void gnc_split_register_delete_current_trans (SplitRegister *reg); /* Deletes the non-transaction splits associated wih the current * cursor, if both are non-NULL. */ -void gnc_split_register_emtpy_current_trans_except_split (SplitRegister *reg, Split *split); -void gnc_split_register_emtpy_current_trans (SplitRegister *reg); +void gnc_split_register_empty_current_trans_except_split (SplitRegister *reg, Split *split); +void gnc_split_register_empty_current_trans (SplitRegister *reg); /* Cancels any changes made to the current cursor, reloads the cursor * from the engine, reloads the table from the cursor, and updates