diff --git a/src/MultiLedger.c b/src/MultiLedger.c index ee91868662..1038c5321c 100644 --- a/src/MultiLedger.c +++ b/src/MultiLedger.c @@ -44,7 +44,12 @@ static xaccLedgerDisplay **fullList = NULL; /* all registers */ /********************************************************************\ * Ledger utilities * - * should replace with glib calls, as per g* style guides. * + * Although these seem like they might be replacable with stock * + * list handling calls, I want to leave them like this for now, * + * since they manipulate global variables. If this code ever * + * gets multi-threaded, access and edit of these globals will have * + * to be controlled with mutexes, and these utility routines * + * present a rather natural place for the locks to be placed. * \********************************************************************/ int @@ -397,6 +402,28 @@ xaccLedgerDisplayRefresh (xaccLedgerDisplay *regData) } +/********************************************************************\ + * refresh only the indicated register window * +\********************************************************************/ + +void +xaccRegisterRefresh (SplitRegister *splitreg) +{ + xaccLedgerDisplay *regData; + int n; + + /* find the ledger which contains this register */ + n = 0; regData = fullList[n]; + while (regData) { + if (splitreg == regData->ledger) { + regData->dirty = 1; + xaccLedgerDisplayRefresh (regData); + return; + } + n++; regData = fullList[n]; + } +} + /********************************************************************\ * mark dirty *all* register windows which contain this account * \********************************************************************/ diff --git a/src/MultiLedger.h b/src/MultiLedger.h index b944222306..ffe52c1b89 100644 --- a/src/MultiLedger.h +++ b/src/MultiLedger.h @@ -91,8 +91,11 @@ extern void xaccTransDisplayRefresh (Transaction *trans); /* * redisplay/redraw only the indicated window. + * both routines do same thing, they differ only by the argument they + * take. */ extern void xaccLedgerDisplayRefresh (xaccLedgerDisplay *); +extern void xaccRegisterRefresh (SplitRegister *); /* * close the window