Diffstat (limited to 'noncore/apps/checkbook/transaction.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/checkbook/transaction.cpp | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/noncore/apps/checkbook/transaction.cpp b/noncore/apps/checkbook/transaction.cpp index c94b989..138d0e6 100644 --- a/noncore/apps/checkbook/transaction.cpp +++ b/noncore/apps/checkbook/transaction.cpp @@ -29,4 +29,5 @@ #include "transaction.h" #include "traninfo.h" +#include "cfg.h" #include <qpe/datebookmonth.h> @@ -42,5 +43,5 @@ Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *info, - const QString &symbol ) + Cfg *pCfg ) : QDialog( parent, 0, TRUE, WStyle_ContextHelp ) { @@ -50,5 +51,5 @@ Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *in tran = info; - currencySymbol = symbol; + _pCfg=pCfg; QVBoxLayout *vb = new QVBoxLayout( this ); @@ -224,5 +225,5 @@ void Transaction::accept() tran->setNumber( numEdit->text() ); tran->setNotes( noteEdit->text() ); - + QDialog::accept(); } @@ -231,19 +232,11 @@ void Transaction::slotWithdrawalClicked() { catList->clear(); - catList->insertItem( tr( "Automobile" ) ); - catList->insertItem( tr( "Bills" ) ); - catList->insertItem( tr( "CDs" ) ); - catList->insertItem( tr( "Clothing" ) ); - catList->insertItem( tr( "Computer" ) ); - catList->insertItem( tr( "DVDs" ) ); - catList->insertItem( tr( "Electronics" ) ); - catList->insertItem( tr( "Entertainment" ) ); - catList->insertItem( tr( "Food" ) ); - catList->insertItem( tr( "Gasoline" ) ); - catList->insertItem( tr( "Misc" ) ); - catList->insertItem( tr( "Movies" ) ); - catList->insertItem( tr( "Rent" ) ); - catList->insertItem( tr( "Travel" ) ); - catList->setCurrentItem( 0 ); + CategoryList *pCatList=_pCfg->getCategoryList(); + for(Category *pCat=pCatList->first(); pCat; pCat=pCatList->next()) { + if( !pCat->isIncome() ) + catList->insertItem( pCat->getName() ); + } + catList->setCurrentItem(0); + typeList->clear(); typeList->insertItem( tr( "Debit Charge" ) ); @@ -256,8 +249,11 @@ void Transaction::slotDepositClicked() { catList->clear(); - catList->insertItem( tr( "Work" ) ); - catList->insertItem( tr( "Family Member" ) ); - catList->insertItem( tr( "Misc. Credit" ) ); - catList->setCurrentItem( 0 ); + CategoryList *pCatList=_pCfg->getCategoryList(); + for(Category *pCat=pCatList->first(); pCat; pCat=pCatList->next()) { + if( pCat->isIncome() ) + catList->insertItem( pCat->getName() ); + } + catList->setCurrentItem( 0 ); + typeList->clear(); typeList->insertItem( tr( "Written Check" ) ); |