diff --git a/ChangeLog b/ChangeLog index 80752c0174..8846656c7a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,10 @@ 2000-06-13 Dave Peticolas - * src/engine/Account.c (xaccAccountRemoveSplit): recompute the - balance after removal. + * src/SplitLedger.c: refresh the main window before refreshing the + register. This makes sure balances are recomputed first. + + * src/engine/Transaction.c (xaccSplitSetBaseValue): mark the split + as having changed. * src/gnome/gnc-currency-edit.c: loosen the restrictions on what can be typed in. The 'currency' could potentially be a stock diff --git a/src/SplitLedger.c b/src/SplitLedger.c index 17747a3430..50c58af3d1 100644 --- a/src/SplitLedger.c +++ b/src/SplitLedger.c @@ -921,8 +921,8 @@ LedgerAutoCompletion(SplitRegister *reg, gncTableTraversalDir dir, refresh_accounts = gnc_trans_prepend_account_list(trans, refresh_accounts); - gnc_account_glist_ui_refresh(refresh_accounts); gnc_refresh_main_window(); + gnc_account_glist_ui_refresh(refresh_accounts); g_list_free(refresh_accounts); @@ -1652,8 +1652,8 @@ xaccSRDuplicateCurrent (SplitRegister *reg) } /* Refresh the GUI. */ - gnc_transaction_ui_refresh(trans); gnc_refresh_main_window(); + gnc_transaction_ui_refresh(trans); return return_split; } @@ -1887,8 +1887,8 @@ xaccSRPasteCurrent (SplitRegister *reg) accounts = gnc_trans_prepend_account_list(trans, accounts); /* Refresh the GUI. */ - gnc_account_glist_ui_refresh(accounts); gnc_refresh_main_window(); + gnc_account_glist_ui_refresh(accounts); g_list_free(accounts); } @@ -1942,11 +1942,10 @@ xaccSRDeleteCurrentSplit (SplitRegister *reg) pending_trans = NULL; } + gnc_refresh_main_window (); gnc_account_glist_ui_refresh(accounts); g_list_free(accounts); - - gnc_refresh_main_window (); } /* ======================================================== */ @@ -2011,11 +2010,10 @@ xaccSRDeleteCurrentTrans (SplitRegister *reg) pending_trans = NULL; } + gnc_refresh_main_window (); gnc_account_glist_ui_refresh(accounts); g_list_free(accounts); - - gnc_refresh_main_window (); } /* ======================================================== */ @@ -2085,12 +2083,11 @@ xaccSREmptyCurrentTrans (SplitRegister *reg) pending_trans = NULL; } + gnc_refresh_main_window (); gnc_account_glist_ui_refresh(accounts); g_list_free(accounts); g_list_free(splits); - - gnc_refresh_main_window (); } /* ======================================================== */ @@ -2171,8 +2168,8 @@ xaccSRRedrawRegEntry (SplitRegister *reg) * to affect any account windows associated with the other splits * in this transaction. So basically, send redraw events to all * of the splits. */ - gnc_transaction_ui_refresh(trans); gnc_refresh_main_window(); + gnc_transaction_ui_refresh(trans); } /* ======================================================== */ @@ -2474,8 +2471,8 @@ xaccSRSaveRegEntry (SplitRegister *reg, gncBoolean do_commit) xaccSplitRegisterClearChangeFlag(reg); if (refresh_accounts != NULL) { - gnc_account_glist_ui_refresh(refresh_accounts); gnc_refresh_main_window(); + gnc_account_glist_ui_refresh(refresh_accounts); g_list_free(refresh_accounts); } diff --git a/src/engine/Account.c b/src/engine/Account.c index a70159c65e..99bbefec99 100644 --- a/src/engine/Account.c +++ b/src/engine/Account.c @@ -488,8 +488,6 @@ xaccAccountRemoveSplit ( Account *acc, Split *split ) /* make sure the array is NULL terminated */ acc->splits[acc->numSplits] = NULL; - - xaccAccountRecomputeBalance (acc); } diff --git a/src/engine/Transaction.c b/src/engine/Transaction.c index a71f5adc92..0663fa7229 100644 --- a/src/engine/Transaction.c +++ b/src/engine/Transaction.c @@ -282,6 +282,8 @@ xaccCountSplits (Split **tarray) void xaccSplitSetSharePriceAndAmount (Split *s, double price, double amt) { + if (!s) return; + MARK_SPLIT(s); s -> share_price = price; s -> damount = amt; @@ -292,6 +294,8 @@ void xaccSplitSetSharePriceAndAmount (Split *s, double price, double amt) void xaccSplitSetSharePrice (Split *s, double amt) { + if (!s) return; + MARK_SPLIT(s); s -> share_price = amt; @@ -301,6 +305,8 @@ void xaccSplitSetSharePrice (Split *s, double amt) void xaccSplitSetShareAmount (Split *s, double amt) { + if (!s) return; + MARK_SPLIT(s); s -> damount = amt; @@ -310,6 +316,8 @@ void xaccSplitSetShareAmount (Split *s, double amt) void xaccSplitSetValue (Split *s, double amt) { + if (!s) return; + MARK_SPLIT(s); /* remember, damount is actually share price */ s -> damount = amt / (s->share_price); @@ -570,6 +578,8 @@ xaccSplitSetBaseValue (Split *s, double value, const char * base_currency) { if (!s) return; + MARK_SPLIT(s); + /* Novice/casual users may not want or use the double entry * features of this engine. So, in particular, there * may be the occasional split without a parent account. diff --git a/src/optional/swig/Makefile.am b/src/optional/swig/Makefile.am index bb5b829936..1b2647c03b 100644 --- a/src/optional/swig/Makefile.am +++ b/src/optional/swig/Makefile.am @@ -20,7 +20,7 @@ EXTRA_DIST = \ examples/scan-acct.pl \ perl5_swig_annotations.i -CFLAGS += ${GNOME_CFLAGS} -Dbool=char +CFLAGS = @CFLAGS@ ${GNOME_CFLAGS} -Dbool=char INCLUDES = \ -I@PERLINCL@/CORE \ @@ -68,7 +68,13 @@ SWIG_INPUT_HDRS := \ ## aren't named lib*.so... install-data-local: libgncswig.la cd ${perllibdir} && rm -f gnucash.so - cd ${perllibdir} && ln -s libgncswig.so gnucash.so + if [ -f ${perllibdir}/libgncswig.so ]; then \ + cd ${perllibdir} && ln -s libgncswig.so gnucash.so; \ + elif [ -f ${perllibdir}/libgncswig.so.1.1 ]; then \ + cd ${perllibdir} && ln -s libgncswig.so.1.1 gnucash.so; \ + else \ + echo "Can't find libgncswig shared library!"; \ + fi uninstall-local: rm -f ${perllibdir}/gnucash.so diff --git a/src/optional/swig/Makefile.in b/src/optional/swig/Makefile.in index 6e9f10bc54..3bbb8c32d6 100644 --- a/src/optional/swig/Makefile.in +++ b/src/optional/swig/Makefile.in @@ -134,7 +134,7 @@ noinst_HEADERS = helperfuncs.h EXTRA_DIST = .cvsignore examples/scan-acct.pl perl5_swig_annotations.i -CFLAGS = ${GNOME_CFLAGS} -Dbool=char +CFLAGS = @CFLAGS@ ${GNOME_CFLAGS} -Dbool=char INCLUDES = -I@PERLINCL@/CORE -I${top_srcdir}/src/engine @@ -450,7 +450,13 @@ maintainer-clean-generic clean mostlyclean distclean maintainer-clean install-data-local: libgncswig.la cd ${perllibdir} && rm -f gnucash.so - cd ${perllibdir} && ln -s libgncswig.so gnucash.so + if [ -f ${perllibdir}/libgncswig.so ]; then \ + cd ${perllibdir} && ln -s libgncswig.so gnucash.so; \ + elif [ -f ${perllibdir}/libgncswig.so.1.1 ]; then \ + cd ${perllibdir} && ln -s libgncswig.so.1.1 gnucash.so; \ + else \ + echo "Can't find libgncswig shared library!"; \ + fi uninstall-local: rm -f ${perllibdir}/gnucash.so