mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
action cell contents depend on register type
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@1279 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
811d752a12
commit
d45a5894bd
@ -173,6 +173,88 @@ configLabels (SplitRegister *reg)
|
|||||||
LABEL (NCRED, hc->value);
|
LABEL (NCRED, hc->value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ============================================== */
|
||||||
|
/* configAction strings into the action cell */
|
||||||
|
/* hack alert -- this stuf really, really should be in a config file ... */
|
||||||
|
|
||||||
|
static void
|
||||||
|
configAction (SplitRegister *reg)
|
||||||
|
{
|
||||||
|
BasicCell *hc;
|
||||||
|
int type = (reg->type) & REG_TYPE_MASK;
|
||||||
|
|
||||||
|
/* setup custom labels for the debit/credit columns */
|
||||||
|
switch (type) {
|
||||||
|
case BANK_REGISTER:
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, DEPOSIT_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, WITHDRAW_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, CHECK_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, INT_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, ATM_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, TELLER_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, POS_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, ARU_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, ONLINE_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, ACH_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, WIRE_STR);
|
||||||
|
break;
|
||||||
|
case CASH_REGISTER:
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, BUY_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, SELL_STR);
|
||||||
|
break;
|
||||||
|
case ASSET_REGISTER:
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, BUY_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, SELL_STR);
|
||||||
|
break;
|
||||||
|
case CREDIT_REGISTER:
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, BUY_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, SELL_STR);
|
||||||
|
break;
|
||||||
|
case LIABILITY_REGISTER:
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, BUY_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, SELL_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, LOAN_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, INT_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, PAYMENT_STR);
|
||||||
|
break;
|
||||||
|
case INCOME_LEDGER:
|
||||||
|
case INCOME_REGISTER:
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, BUY_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, SELL_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, INT_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, PAYMENT_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, REBATE_STR);
|
||||||
|
break;
|
||||||
|
case EXPENSE_REGISTER:
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, BUY_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, SELL_STR);
|
||||||
|
break;
|
||||||
|
case GENERAL_LEDGER:
|
||||||
|
case EQUITY_REGISTER:
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, BUY_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, SELL_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, EQUITY_STR);
|
||||||
|
break;
|
||||||
|
case STOCK_REGISTER:
|
||||||
|
case PORTFOLIO:
|
||||||
|
case CURRENCY_REGISTER:
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, BUY_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, SELL_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, PRICE_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, DIV_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, INT_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, LTCG_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, STCG_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, DIST_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, SPLIT_STR);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, BUY_STR);
|
||||||
|
xaccAddComboCellMenuItem ( reg->actionCell, SELL_STR);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* ============================================== */
|
/* ============================================== */
|
||||||
|
|
||||||
#define SET(NAME,col,row,handler) \
|
#define SET(NAME,col,row,handler) \
|
||||||
@ -688,28 +770,8 @@ xaccInitSplitRegister (SplitRegister *reg, int type)
|
|||||||
*/
|
*/
|
||||||
configTraverse (reg);
|
configTraverse (reg);
|
||||||
|
|
||||||
/* -------------------------------- */
|
|
||||||
/* add menu items for the action cell */
|
/* add menu items for the action cell */
|
||||||
|
configAction (reg);
|
||||||
xaccAddComboCellMenuItem ( reg->actionCell, ATM_STR);
|
|
||||||
xaccAddComboCellMenuItem ( reg->actionCell, TELLER_STR);
|
|
||||||
xaccAddComboCellMenuItem ( reg->actionCell, CHECK_STR);
|
|
||||||
xaccAddComboCellMenuItem ( reg->actionCell, POS_STR);
|
|
||||||
xaccAddComboCellMenuItem ( reg->actionCell, ARU_STR);
|
|
||||||
xaccAddComboCellMenuItem ( reg->actionCell, ONLINE_STR);
|
|
||||||
xaccAddComboCellMenuItem ( reg->actionCell, ACH_STR);
|
|
||||||
xaccAddComboCellMenuItem ( reg->actionCell, WIRE_STR);
|
|
||||||
xaccAddComboCellMenuItem ( reg->actionCell, BUY_STR);
|
|
||||||
xaccAddComboCellMenuItem ( reg->actionCell, SELL_STR);
|
|
||||||
xaccAddComboCellMenuItem ( reg->actionCell, PRICE_STR);
|
|
||||||
xaccAddComboCellMenuItem ( reg->actionCell, DIV_STR);
|
|
||||||
xaccAddComboCellMenuItem ( reg->actionCell, INT_STR);
|
|
||||||
xaccAddComboCellMenuItem ( reg->actionCell, LTCG_STR);
|
|
||||||
xaccAddComboCellMenuItem ( reg->actionCell, STCG_STR);
|
|
||||||
xaccAddComboCellMenuItem ( reg->actionCell, DIST_STR);
|
|
||||||
xaccAddComboCellMenuItem ( reg->actionCell, SPLIT_STR);
|
|
||||||
xaccAddComboCellMenuItem ( reg->actionCell, DEPOSIT_STR);
|
|
||||||
xaccAddComboCellMenuItem ( reg->actionCell, WITHDRAW_STR);
|
|
||||||
|
|
||||||
/* -------------------------------- */
|
/* -------------------------------- */
|
||||||
phys_r = header->numRows;
|
phys_r = header->numRows;
|
||||||
|
Loading…
Reference in New Issue
Block a user