-rw-r--r-- | noncore/apps/checkbook/transaction.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/apps/checkbook/transaction.cpp b/noncore/apps/checkbook/transaction.cpp index 07d5ae1..c94b989 100644 --- a/noncore/apps/checkbook/transaction.cpp +++ b/noncore/apps/checkbook/transaction.cpp | |||
@@ -1,274 +1,274 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | =. | 3 | =. |
4 | .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org> | 4 | .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org> |
5 | .>+-= | 5 | .>+-= |
6 | _;:, .> :=|. This file is free software; you can | 6 | _;:, .> :=|. This file is free software; you can |
7 | .> <`_, > . <= redistribute it and/or modify it under | 7 | .> <`_, > . <= redistribute it and/or modify it under |
8 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 8 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
9 | .="- .-=="i, .._ License as published by the Free Software | 9 | .="- .-=="i, .._ License as published by the Free Software |
10 | - . .-<_> .<> Foundation; either version 2 of the License, | 10 | - . .-<_> .<> Foundation; either version 2 of the License, |
11 | ._= =} : or (at your option) any later version. | 11 | ._= =} : or (at your option) any later version. |
12 | .%`+i> _;_. | 12 | .%`+i> _;_. |
13 | .i_,=:_. -<s. This file is distributed in the hope that | 13 | .i_,=:_. -<s. This file is distributed in the hope that |
14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
15 | : .. .:, . . . without even the implied warranty of | 15 | : .. .:, . . . without even the implied warranty of |
16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
18 | ..}^=.= = ; Public License for more details. | 18 | ..}^=.= = ; Public License for more details. |
19 | ++= -. .` .: | 19 | ++= -. .` .: |
20 | : = ...= . :.=- You should have received a copy of the GNU | 20 | : = ...= . :.=- You should have received a copy of the GNU |
21 | -. .:....=;==+<; General Public License along with this file; | 21 | -. .:....=;==+<; General Public License along with this file; |
22 | -_. . . )=. = see the file COPYING. If not, write to the | 22 | -_. . . )=. = see the file COPYING. If not, write to the |
23 | -- :-=` Free Software Foundation, Inc., | 23 | -- :-=` Free Software Foundation, Inc., |
24 | 59 Temple Place - Suite 330, | 24 | 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include "transaction.h" | 29 | #include "transaction.h" |
30 | #include "traninfo.h" | 30 | #include "traninfo.h" |
31 | 31 | ||
32 | #include <qpe/datebookmonth.h> | 32 | #include <qpe/datebookmonth.h> |
33 | 33 | ||
34 | #include <qbuttongroup.h> | 34 | #include <qbuttongroup.h> |
35 | #include <qcombobox.h> | 35 | #include <qcombobox.h> |
36 | #include <qlabel.h> | 36 | #include <qlabel.h> |
37 | #include <qlayout.h> | 37 | #include <qlayout.h> |
38 | #include <qlineedit.h> | 38 | #include <qlineedit.h> |
39 | #include <qmultilineedit.h> | 39 | #include <qmultilineedit.h> |
40 | #include <qradiobutton.h> | 40 | #include <qradiobutton.h> |
41 | #include <qwhatsthis.h> | 41 | #include <qwhatsthis.h> |
42 | 42 | ||
43 | Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *info, | 43 | Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *info, |
44 | const QString &symbol ) | 44 | const QString &symbol ) |
45 | : QDialog( parent, 0, TRUE, WStyle_ContextHelp ) | 45 | : QDialog( parent, 0, TRUE, WStyle_ContextHelp ) |
46 | { | 46 | { |
47 | QString tempstr = tr( "Transaction for " ); | 47 | QString tempstr = tr( "Transaction for " ); |
48 | tempstr.append( acctname ); | 48 | tempstr.append( acctname ); |
49 | setCaption( tempstr ); | 49 | setCaption( tempstr ); |
50 | 50 | ||
51 | tran = info; | 51 | tran = info; |
52 | currencySymbol = symbol; | 52 | currencySymbol = symbol; |
53 | 53 | ||
54 | QVBoxLayout *vb = new QVBoxLayout( this ); | 54 | QVBoxLayout *vb = new QVBoxLayout( this ); |
55 | 55 | ||
56 | QScrollView *sv = new QScrollView( this ); | 56 | QScrollView *sv = new QScrollView( this ); |
57 | vb->addWidget( sv, 0, 0 ); | 57 | vb->addWidget( sv, 0, 0 ); |
58 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 58 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
59 | sv->setFrameStyle( QFrame::NoFrame ); | 59 | sv->setFrameStyle( QFrame::NoFrame ); |
60 | 60 | ||
61 | QWidget *container = new QWidget( sv->viewport() ); | 61 | QWidget *container = new QWidget( sv->viewport() ); |
62 | sv->addChild( container ); | 62 | sv->addChild( container ); |
63 | 63 | ||
64 | QGridLayout *layout = new QGridLayout( container ); | 64 | QGridLayout *layout = new QGridLayout( container ); |
65 | layout->setSpacing( 2 ); | 65 | layout->setSpacing( 2 ); |
66 | layout->setMargin( 4 ); | 66 | layout->setMargin( 4 ); |
67 | 67 | ||
68 | // Withdrawal/Deposit | 68 | // Withdrawal/Deposit |
69 | QButtonGroup *btngrp = new QButtonGroup( container ); | 69 | QButtonGroup *btngrp = new QButtonGroup( container ); |
70 | btngrp->setColumnLayout(0, Qt::Vertical ); | 70 | btngrp->setColumnLayout(0, Qt::Vertical ); |
71 | btngrp->layout()->setSpacing( 0 ); | 71 | btngrp->layout()->setSpacing( 0 ); |
72 | btngrp->layout()->setMargin( 0 ); | 72 | btngrp->layout()->setMargin( 0 ); |
73 | btngrp->setMaximumWidth( 220 ); | 73 | btngrp->setMaximumWidth( 220 ); |
74 | QGridLayout *layout2 = new QGridLayout( btngrp->layout() ); | 74 | QGridLayout *layout2 = new QGridLayout( btngrp->layout() ); |
75 | layout2->setSpacing( 2 ); | 75 | layout2->setSpacing( 2 ); |
76 | layout2->setMargin( 2 ); | 76 | layout2->setMargin( 2 ); |
77 | withBtn = new QRadioButton( tr( "Withdrawal" ), btngrp ); | 77 | withBtn = new QRadioButton( tr( "Withdrawal" ), btngrp ); |
78 | QWhatsThis::add( withBtn, tr( "Select whether the transaction is a withdrawal or deposit here." ) ); | 78 | QWhatsThis::add( withBtn, tr( "Select whether the transaction is a withdrawal or deposit here." ) ); |
79 | layout2->addWidget( withBtn, 0, 0 ); | 79 | layout2->addWidget( withBtn, 0, 0 ); |
80 | connect( withBtn, SIGNAL( clicked() ), this, SLOT( slotWithdrawalClicked() ) ); | 80 | connect( withBtn, SIGNAL( clicked() ), this, SLOT( slotWithdrawalClicked() ) ); |
81 | depBtn = new QRadioButton( tr( "Deposit" ), btngrp ); | 81 | depBtn = new QRadioButton( tr( "Deposit" ), btngrp ); |
82 | QWhatsThis::add( depBtn, tr( "Select whether the transaction is a withdrawal or deposit here." ) ); | 82 | QWhatsThis::add( depBtn, tr( "Select whether the transaction is a withdrawal or deposit here." ) ); |
83 | layout2->addWidget( depBtn, 0, 1 ); | 83 | layout2->addWidget( depBtn, 0, 1 ); |
84 | btngrp->setMaximumSize( 320, withBtn->height() ); | 84 | btngrp->setMaximumSize( 320, withBtn->height() ); |
85 | connect( depBtn, SIGNAL( clicked() ), this, SLOT( slotDepositClicked() ) ); | 85 | connect( depBtn, SIGNAL( clicked() ), this, SLOT( slotDepositClicked() ) ); |
86 | layout->addMultiCellWidget( btngrp, 0, 0, 0, 3 ); | 86 | layout->addMultiCellWidget( btngrp, 0, 0, 0, 3 ); |
87 | 87 | ||
88 | // Date | 88 | // Date |
89 | QLabel *label = new QLabel( tr( "Date:" ), container ); | 89 | QLabel *label = new QLabel( tr( "Date:" ), container ); |
90 | QWhatsThis::add( label, tr( "Select date of transaction here." ) ); | 90 | QWhatsThis::add( label, tr( "Select date of transaction here." ) ); |
91 | layout->addWidget( label, 1, 0 ); | 91 | layout->addWidget( label, 1, 0 ); |
92 | dateBtn = new QPushButton( TimeString::shortDate( QDate::currentDate() ), | 92 | dateBtn = new QPushButton( TimeString::shortDate( QDate::currentDate() ), |
93 | container ); | 93 | container ); |
94 | QWhatsThis::add( dateBtn, tr( "Select date of transaction here." ) ); | 94 | QWhatsThis::add( dateBtn, tr( "Select date of transaction here." ) ); |
95 | QPopupMenu *m1 = new QPopupMenu( container ); | 95 | QPopupMenu *m1 = new QPopupMenu( container ); |
96 | datePicker = new DateBookMonth( m1, 0, TRUE ); | 96 | datePicker = new DateBookMonth( m1, 0, TRUE ); |
97 | m1->insertItem( datePicker ); | 97 | m1->insertItem( datePicker ); |
98 | dateBtn->setPopup( m1 ); | 98 | dateBtn->setPopup( m1 ); |
99 | connect( datePicker, SIGNAL( dateClicked( int, int, int ) ), | 99 | connect( datePicker, SIGNAL( dateClicked( int, int, int ) ), |
100 | this, SLOT( slotDateChanged( int, int, int ) ) ); | 100 | this, SLOT( slotDateChanged( int, int, int ) ) ); |
101 | layout->addWidget( dateBtn, 1, 1 ); | 101 | layout->addWidget( dateBtn, 1, 1 ); |
102 | 102 | ||
103 | // Check number | 103 | // Check number |
104 | label = new QLabel( tr( "Number:" ), container ); | 104 | label = new QLabel( tr( "Number:" ), container ); |
105 | QWhatsThis::add( label, tr( "Enter check number here." ) ); | 105 | QWhatsThis::add( label, tr( "Enter check number here." ) ); |
106 | layout->addWidget( label, 1, 2 ); | 106 | layout->addWidget( label, 1, 2 ); |
107 | numEdit = new QLineEdit( container ); | 107 | numEdit = new QLineEdit( container ); |
108 | QWhatsThis::add( numEdit, tr( "Enter check number here." ) ); | 108 | QWhatsThis::add( numEdit, tr( "Enter check number here." ) ); |
109 | numEdit->setMaximumWidth( 40 ); | 109 | numEdit->setMaximumWidth( 40 ); |
110 | layout->addWidget( numEdit, 1, 3 ); | 110 | layout->addWidget( numEdit, 1, 3 ); |
111 | 111 | ||
112 | // Description | 112 | // Description |
113 | label = new QLabel( tr( "Description:" ), container ); | 113 | label = new QLabel( tr( "Description:" ), container ); |
114 | QWhatsThis::add( label, tr( "Enter description of transaction here." ) ); | 114 | QWhatsThis::add( label, tr( "Enter description of transaction here." ) ); |
115 | layout->addWidget( label, 2, 0 ); | 115 | layout->addWidget( label, 2, 0 ); |
116 | descEdit = new QLineEdit( container ); | 116 | descEdit = new QLineEdit( container ); |
117 | QWhatsThis::add( descEdit, tr( "Enter description of transaction here." ) ); | 117 | QWhatsThis::add( descEdit, tr( "Enter description of transaction here." ) ); |
118 | layout->addMultiCellWidget( descEdit, 2, 2, 1, 3 ); | 118 | layout->addMultiCellWidget( descEdit, 2, 2, 1, 3 ); |
119 | 119 | ||
120 | // Category | 120 | // Category |
121 | label = new QLabel( tr( "Category:" ), container ); | 121 | label = new QLabel( tr( "Category:" ), container ); |
122 | QWhatsThis::add( label, tr( "Select transaction category here." ) ); | 122 | QWhatsThis::add( label, tr( "Select transaction category here." ) ); |
123 | layout->addWidget( label, 3, 0 ); | 123 | layout->addWidget( label, 3, 0 ); |
124 | catList = new QComboBox( container ); | 124 | catList = new QComboBox( container ); |
125 | QWhatsThis::add( catList, tr( "Select transaction category here." ) ); | 125 | QWhatsThis::add( catList, tr( "Select transaction category here." ) ); |
126 | layout->addMultiCellWidget( catList, 3, 3, 1, 3 ); | 126 | layout->addMultiCellWidget( catList, 3, 3, 1, 3 ); |
127 | 127 | ||
128 | // Type | 128 | // Type |
129 | label = new QLabel( tr( "Type:" ), container ); | 129 | label = new QLabel( tr( "Type:" ), container ); |
130 | QWhatsThis::add( label, tr( "Select transaction type here.\n\nThe options available vary based on whether the transaction is a deposit or withdrawal." ) ); | 130 | QWhatsThis::add( label, tr( "Select transaction type here.\n\nThe options available vary based on whether the transaction is a deposit or withdrawal." ) ); |
131 | layout->addWidget( label, 4, 0 ); | 131 | layout->addWidget( label, 4, 0 ); |
132 | typeList = new QComboBox( container ); | 132 | typeList = new QComboBox( container ); |
133 | QWhatsThis::add( typeList, tr( "Select transaction type here.\n\nThe options available vary based on whether the transaction is a deposit or withdrawal." ) ); | 133 | QWhatsThis::add( typeList, tr( "Select transaction type here.\n\nThe options available vary based on whether the transaction is a deposit or withdrawal." ) ); |
134 | layout->addMultiCellWidget( typeList, 4, 4, 1, 3 ); | 134 | layout->addMultiCellWidget( typeList, 4, 4, 1, 3 ); |
135 | 135 | ||
136 | // Amount | 136 | // Amount |
137 | label = new QLabel( tr( "Amount:" ), container ); | 137 | label = new QLabel( tr( "Amount:" ), container ); |
138 | QWhatsThis::add( label, tr( "Enter the amount of transaction here.\n\nThe value entered should always be positive." ) ); | 138 | QWhatsThis::add( label, tr( "Enter the amount of transaction here.\n\nThe value entered should always be positive." ) ); |
139 | layout->addWidget( label, 5, 0 ); | 139 | layout->addWidget( label, 5, 0 ); |
140 | amtEdit = new QLineEdit( container ); | 140 | amtEdit = new QLineEdit( container ); |
141 | QWhatsThis::add( amtEdit, tr( "Enter the amount of transaction here.\n\nThe value entered should always be positive." ) ); | 141 | QWhatsThis::add( amtEdit, tr( "Enter the amount of transaction here.\n\nThe value entered should always be positive." ) ); |
142 | layout->addMultiCellWidget( amtEdit, 5, 5, 1, 3 ); | 142 | layout->addMultiCellWidget( amtEdit, 5, 5, 1, 3 ); |
143 | 143 | ||
144 | // Fee | 144 | // Fee |
145 | label = new QLabel( tr( "Fee:" ), container ); | 145 | label = new QLabel( tr( "Fee:" ), container ); |
146 | QWhatsThis::add( label, tr( "Enter any fee amount assoiciated with this transaction.\n\nThe value entered should always be positive." ) ); | 146 | QWhatsThis::add( label, tr( "Enter any fee amount assoiciated with this transaction.\n\nThe value entered should always be positive." ) ); |
147 | layout->addWidget( label, 6, 0 ); | 147 | layout->addWidget( label, 6, 0 ); |
148 | feeEdit = new QLineEdit( container ); | 148 | feeEdit = new QLineEdit( container ); |
149 | QWhatsThis::add( feeEdit, tr( "Enter any fee amount assoiciated with this transaction.\n\nThe value entered should always be positive." ) ); | 149 | QWhatsThis::add( feeEdit, tr( "Enter any fee amount assoiciated with this transaction.\n\nThe value entered should always be positive." ) ); |
150 | layout->addMultiCellWidget( feeEdit, 6, 6, 1, 3 ); | 150 | layout->addMultiCellWidget( feeEdit, 6, 6, 1, 3 ); |
151 | 151 | ||
152 | // Notes | 152 | // Notes |
153 | label = new QLabel( tr( "Notes:" ), container ); | 153 | label = new QLabel( tr( "Notes:" ), container ); |
154 | QWhatsThis::add( label, tr( "Enter any additional information for this transaction here." ) ); | 154 | QWhatsThis::add( label, tr( "Enter any additional information for this transaction here." ) ); |
155 | layout->addWidget( label, 7, 0 ); | 155 | layout->addWidget( label, 7, 0 ); |
156 | noteEdit = new QMultiLineEdit( container ); | 156 | noteEdit = new QMultiLineEdit( container ); |
157 | QWhatsThis::add( noteEdit, tr( "Enter any additional information for this transaction here." ) ); | 157 | QWhatsThis::add( noteEdit, tr( "Enter any additional information for this transaction here." ) ); |
158 | layout->addMultiCellWidget( noteEdit, 8, 8, 0, 3 ); | 158 | layout->addMultiCellWidget( noteEdit, 8, 8, 0, 3 ); |
159 | 159 | ||
160 | // Populate current values if provided | 160 | // Populate current values if provided |
161 | if ( info ) | 161 | if ( info ) |
162 | { | 162 | { |
163 | if ( info->withdrawal() ) | 163 | if ( info->withdrawal() ) |
164 | { | 164 | { |
165 | withBtn->setChecked( TRUE ); | 165 | withBtn->setChecked( TRUE ); |
166 | slotWithdrawalClicked(); | 166 | slotWithdrawalClicked(); |
167 | } | 167 | } |
168 | else | 168 | else |
169 | { | 169 | { |
170 | depBtn->setChecked( TRUE ); | 170 | depBtn->setChecked( TRUE ); |
171 | slotDepositClicked(); | 171 | slotDepositClicked(); |
172 | } | 172 | } |
173 | QDate dt = info->date(); | 173 | QDate dt = info->date(); |
174 | slotDateChanged( dt.year(), dt.month(), dt.day() ); | 174 | slotDateChanged( dt.year(), dt.month(), dt.day() ); |
175 | datePicker->setDate( dt ); | 175 | datePicker->setDate( dt ); |
176 | numEdit->setText( info->number() ); | 176 | numEdit->setText( info->number() ); |
177 | descEdit->setText( info->desc() ); | 177 | descEdit->setText( info->desc() ); |
178 | QString temptext = info->category(); | 178 | QString temptext = info->category(); |
179 | int i = catList->count(); | 179 | int i = catList->count(); |
180 | while ( i > 0 ) | 180 | while ( i > 0 ) |
181 | { | 181 | { |
182 | i--; | 182 | i--; |
183 | catList->setCurrentItem( i ); | 183 | catList->setCurrentItem( i ); |
184 | if ( catList->currentText() == temptext ) | 184 | if ( catList->currentText() == temptext ) |
185 | { | 185 | { |
186 | break; | 186 | break; |
187 | } | 187 | } |
188 | } | 188 | } |
189 | temptext = info->type(); | 189 | temptext = info->type(); |
190 | i = typeList->count(); | 190 | i = typeList->count(); |
191 | while ( i > 0 ) | 191 | while ( i > 0 ) |
192 | { | 192 | { |
193 | i--; | 193 | i--; |
194 | typeList->setCurrentItem( i ); | 194 | typeList->setCurrentItem( i ); |
195 | if ( typeList->currentText() == temptext ) | 195 | if ( typeList->currentText() == temptext ) |
196 | { | 196 | { |
197 | break; | 197 | break; |
198 | } | 198 | } |
199 | } | 199 | } |
200 | amtEdit->setText( QString( "%1" ).arg( info->amount(), 0, 'f', 2 ) ); | 200 | amtEdit->setText( QString( "%1" ).arg( info->amount(), 0, 'f', 2 ) ); |
201 | feeEdit->setText( QString( "%1" ).arg( info->fee(), 0, 'f', 2 ) ); | 201 | feeEdit->setText( QString( "%1" ).arg( info->fee(), 0, 'f', 2 ) ); |
202 | noteEdit->setText( info->notes() ); | 202 | noteEdit->setText( info->notes() ); |
203 | } | 203 | } |
204 | else | 204 | else |
205 | { | 205 | { |
206 | withBtn->setChecked( TRUE ); | 206 | withBtn->setChecked( TRUE ); |
207 | } | 207 | } |
208 | } | 208 | } |
209 | 209 | ||
210 | Transaction::~Transaction() | 210 | Transaction::~Transaction() |
211 | { | 211 | { |
212 | } | 212 | } |
213 | 213 | ||
214 | void Transaction::accept() | 214 | void Transaction::accept() |
215 | { | 215 | { |
216 | tran->setDesc( descEdit->text() ); | 216 | tran->setDesc( descEdit->text() ); |
217 | tran->setDate( datePicker->selectedDate() ); | 217 | tran->setDate( datePicker->selectedDate() ); |
218 | tran->setWithdrawal( withBtn->isChecked() ); | 218 | tran->setWithdrawal( withBtn->isChecked() ); |
219 | tran->setType( typeList->currentText() ); | 219 | tran->setType( typeList->currentText() ); |
220 | tran->setCategory( catList->currentText() ); | 220 | tran->setCategory( catList->currentText() ); |
221 | bool ok; | 221 | bool ok; |
222 | tran->setAmount( amtEdit->text().toFloat( &ok ) ); | 222 | tran->setAmount( amtEdit->text().toFloat( &ok ) ); |
223 | tran->setFee( feeEdit->text().toFloat( &ok ) ); | 223 | tran->setFee( feeEdit->text().toFloat( &ok ) ); |
224 | tran->setNumber( numEdit->text() ); | 224 | tran->setNumber( numEdit->text() ); |
225 | tran->setNotes( noteEdit->text() ); | 225 | tran->setNotes( noteEdit->text() ); |
226 | 226 | ||
227 | QDialog::accept(); | 227 | QDialog::accept(); |
228 | } | 228 | } |
229 | 229 | ||
230 | void Transaction::slotWithdrawalClicked() | 230 | void Transaction::slotWithdrawalClicked() |
231 | { | 231 | { |
232 | catList->clear(); | 232 | catList->clear(); |
233 | catList->insertItem( tr( "Automobile" ) ); | 233 | catList->insertItem( tr( "Automobile" ) ); |
234 | catList->insertItem( tr( "Bills" ) ); | 234 | catList->insertItem( tr( "Bills" ) ); |
235 | catList->insertItem( tr( "CDs" ) ); | 235 | catList->insertItem( tr( "CDs" ) ); |
236 | catList->insertItem( tr( "Clothing" ) ); | 236 | catList->insertItem( tr( "Clothing" ) ); |
237 | catList->insertItem( tr( "Computer" ) ); | 237 | catList->insertItem( tr( "Computer" ) ); |
238 | catList->insertItem( tr( "DVDs" ) ); | 238 | catList->insertItem( tr( "DVDs" ) ); |
239 | catList->insertItem( tr( "Eletronics" ) ); | 239 | catList->insertItem( tr( "Electronics" ) ); |
240 | catList->insertItem( tr( "Entertainment" ) ); | 240 | catList->insertItem( tr( "Entertainment" ) ); |
241 | catList->insertItem( tr( "Food" ) ); | 241 | catList->insertItem( tr( "Food" ) ); |
242 | catList->insertItem( tr( "Gasoline" ) ); | 242 | catList->insertItem( tr( "Gasoline" ) ); |
243 | catList->insertItem( tr( "Misc" ) ); | 243 | catList->insertItem( tr( "Misc" ) ); |
244 | catList->insertItem( tr( "Movies" ) ); | 244 | catList->insertItem( tr( "Movies" ) ); |
245 | catList->insertItem( tr( "Rent" ) ); | 245 | catList->insertItem( tr( "Rent" ) ); |
246 | catList->insertItem( tr( "Travel" ) ); | 246 | catList->insertItem( tr( "Travel" ) ); |
247 | catList->setCurrentItem( 0 ); | 247 | catList->setCurrentItem( 0 ); |
248 | typeList->clear(); | 248 | typeList->clear(); |
249 | typeList->insertItem( tr( "Debit Charge" ) ); | 249 | typeList->insertItem( tr( "Debit Charge" ) ); |
250 | typeList->insertItem( tr( "Written Check" ) ); | 250 | typeList->insertItem( tr( "Written Check" ) ); |
251 | typeList->insertItem( tr( "Transfer" ) ); | 251 | typeList->insertItem( tr( "Transfer" ) ); |
252 | typeList->insertItem( tr( "Credit Card" ) ); | 252 | typeList->insertItem( tr( "Credit Card" ) ); |
253 | } | 253 | } |
254 | 254 | ||
255 | void Transaction::slotDepositClicked() | 255 | void Transaction::slotDepositClicked() |
256 | { | 256 | { |
257 | catList->clear(); | 257 | catList->clear(); |
258 | catList->insertItem( tr( "Work" ) ); | 258 | catList->insertItem( tr( "Work" ) ); |
259 | catList->insertItem( tr( "Family Member" ) ); | 259 | catList->insertItem( tr( "Family Member" ) ); |
260 | catList->insertItem( tr( "Misc. Credit" ) ); | 260 | catList->insertItem( tr( "Misc. Credit" ) ); |
261 | catList->setCurrentItem( 0 ); | 261 | catList->setCurrentItem( 0 ); |
262 | typeList->clear(); | 262 | typeList->clear(); |
263 | typeList->insertItem( tr( "Written Check" ) ); | 263 | typeList->insertItem( tr( "Written Check" ) ); |
264 | typeList->insertItem( tr( "Automatic Payment" ) ); | 264 | typeList->insertItem( tr( "Automatic Payment" ) ); |
265 | typeList->insertItem( tr( "Transfer" ) ); | 265 | typeList->insertItem( tr( "Transfer" ) ); |
266 | typeList->insertItem( tr( "Cash" ) ); | 266 | typeList->insertItem( tr( "Cash" ) ); |
267 | } | 267 | } |
268 | 268 | ||
269 | void Transaction::slotDateChanged( int y, int m, int d ) | 269 | void Transaction::slotDateChanged( int y, int m, int d ) |
270 | { | 270 | { |
271 | QDate date; | 271 | QDate date; |
272 | date.setYMD( y, m, d ); | 272 | date.setYMD( y, m, d ); |
273 | dateBtn->setText( TimeString::shortDate( date ) ); | 273 | dateBtn->setText( TimeString::shortDate( date ) ); |
274 | } | 274 | } |