summaryrefslogtreecommitdiff
path: root/noncore/apps/checkbook/transaction.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/checkbook/transaction.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/checkbook/transaction.cpp34
1 files changed, 15 insertions, 19 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
@@ -25,12 +25,13 @@
Boston, MA 02111-1307, USA.
*/
#include "transaction.h"
#include "traninfo.h"
+#include "cfg.h"
#include <qpe/datebookmonth.h>
#include <qbuttongroup.h>
#include <qcombobox.h>
#include <qlabel.h>
@@ -38,21 +39,21 @@
#include <qlineedit.h>
#include <qmultilineedit.h>
#include <qradiobutton.h>
#include <qwhatsthis.h>
Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *info,
- const QString &symbol )
+ Cfg *pCfg )
: QDialog( parent, 0, TRUE, WStyle_ContextHelp )
{
QString tempstr = tr( "Transaction for " );
tempstr.append( acctname );
setCaption( tempstr );
tran = info;
- currencySymbol = symbol;
+ _pCfg=pCfg;
QVBoxLayout *vb = new QVBoxLayout( this );
QScrollView *sv = new QScrollView( this );
vb->addWidget( sv, 0, 0 );
sv->setResizePolicy( QScrollView::AutoOneFit );
@@ -227,41 +228,36 @@ void Transaction::accept()
QDialog::accept();
}
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" ) );
+ 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" ) );
typeList->insertItem( tr( "Written Check" ) );
typeList->insertItem( tr( "Transfer" ) );
typeList->insertItem( tr( "Credit Card" ) );
}
void Transaction::slotDepositClicked()
{
catList->clear();
- catList->insertItem( tr( "Work" ) );
- catList->insertItem( tr( "Family Member" ) );
- catList->insertItem( tr( "Misc. Credit" ) );
+ 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" ) );
typeList->insertItem( tr( "Automatic Payment" ) );
typeList->insertItem( tr( "Transfer" ) );
typeList->insertItem( tr( "Cash" ) );
}