summaryrefslogtreecommitdiff
path: root/noncore/apps/qashmoney/transactiondisplay.cpp
authoralwin <alwin>2004-03-02 12:21:11 (UTC)
committer alwin <alwin>2004-03-02 12:21:11 (UTC)
commitb6b1c97559c0ed9f2e33632272426bf98f289232 (patch) (unidiff)
treed3a9987704770cdf5eb14e1136f6e3ecb2f36a04 /noncore/apps/qashmoney/transactiondisplay.cpp
parent0d59c780513da78033f4d9040475dee9db0256d4 (diff)
downloadopie-b6b1c97559c0ed9f2e33632272426bf98f289232.zip
opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.gz
opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.bz2
applied the patch generated by the optimize_connect script from
TT.
Diffstat (limited to 'noncore/apps/qashmoney/transactiondisplay.cpp') (more/less context) (ignore whitespace changes)
-rwxr-xr-xnoncore/apps/qashmoney/transactiondisplay.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/noncore/apps/qashmoney/transactiondisplay.cpp b/noncore/apps/qashmoney/transactiondisplay.cpp
index 474f11e..0b94d62 100755
--- a/noncore/apps/qashmoney/transactiondisplay.cpp
+++ b/noncore/apps/qashmoney/transactiondisplay.cpp
@@ -8,83 +8,83 @@
8#include "datepicker.h" 8#include "datepicker.h"
9 9
10#include <qmessagebox.h> 10#include <qmessagebox.h>
11#include <qheader.h> 11#include <qheader.h>
12#include <qmultilineedit.h> 12#include <qmultilineedit.h>
13 13
14extern Transaction *transaction; 14extern Transaction *transaction;
15extern Budget *budget; 15extern Budget *budget;
16extern Account *account; 16extern Account *account;
17extern Preferences *preferences; 17extern Preferences *preferences;
18extern Memory *memory; 18extern Memory *memory;
19extern Transfer *transfer; 19extern Transfer *transfer;
20 20
21TransactionDisplay::TransactionDisplay ( QWidget* parent ) : QWidget ( parent ) 21TransactionDisplay::TransactionDisplay ( QWidget* parent ) : QWidget ( parent )
22 { 22 {
23 // set transactiondisplay variables; 23 // set transactiondisplay variables;
24 accountid = 0; 24 accountid = 0;
25 children = TRUE; 25 children = TRUE;
26 26
27 firstline = new QHBox ( this ); 27 firstline = new QHBox ( this );
28 firstline->setSpacing ( 2 ); 28 firstline->setSpacing ( 2 );
29 29
30 newtransaction = new QPushButton ( firstline ); 30 newtransaction = new QPushButton ( firstline );
31 newtransaction->setPixmap ( QPixmap ("/opt/QtPalmtop/pics/new.png") ); 31 newtransaction->setPixmap ( QPixmap ("/opt/QtPalmtop/pics/new.png") );
32 connect ( newtransaction, SIGNAL ( released () ), this, SLOT ( addTransaction () ) ); 32 connect ( newtransaction, SIGNAL ( released() ), this, SLOT ( addTransaction() ) );
33 33
34 edittransaction = new QPushButton ( firstline ); 34 edittransaction = new QPushButton ( firstline );
35 edittransaction->setPixmap( QPixmap ("/opt/QtPalmtop/pics/edit.png") ); 35 edittransaction->setPixmap( QPixmap ("/opt/QtPalmtop/pics/edit.png") );
36 connect ( edittransaction, SIGNAL ( released () ), this, SLOT ( checkListViewEdit () ) ); 36 connect ( edittransaction, SIGNAL ( released() ), this, SLOT ( checkListViewEdit() ) );
37 37
38 deletetransaction = new QPushButton ( firstline ); 38 deletetransaction = new QPushButton ( firstline );
39 deletetransaction->setPixmap( QPixmap ( "/opt/QtPalmtop/pics/delete.png") ); 39 deletetransaction->setPixmap( QPixmap ( "/opt/QtPalmtop/pics/delete.png") );
40 connect ( deletetransaction, SIGNAL ( released () ), this, SLOT ( checkListViewDelete () ) ); 40 connect ( deletetransaction, SIGNAL ( released() ), this, SLOT ( checkListViewDelete() ) );
41 41
42 toggletransaction = new QPushButton ( firstline ); 42 toggletransaction = new QPushButton ( firstline );
43 toggletransaction->setPixmap( QPixmap ( "/opt/QtPalmtop/pics/redo.png") ); 43 toggletransaction->setPixmap( QPixmap ( "/opt/QtPalmtop/pics/redo.png") );
44 connect ( toggletransaction, SIGNAL ( released () ), this, SLOT ( checkListViewToggle () ) ); 44 connect ( toggletransaction, SIGNAL ( released() ), this, SLOT ( checkListViewToggle() ) );
45 45
46 viewtransactionnotes = new QPushButton ( firstline ); 46 viewtransactionnotes = new QPushButton ( firstline );
47 viewtransactionnotes->setPixmap( QPixmap ( "/opt/QtPalmtop/pics/info.png") ); 47 viewtransactionnotes->setPixmap( QPixmap ( "/opt/QtPalmtop/pics/info.png") );
48 connect ( viewtransactionnotes, SIGNAL ( released () ), this, SLOT ( showTransactionNotes () ) ); 48 connect ( viewtransactionnotes, SIGNAL ( released() ), this, SLOT ( showTransactionNotes() ) );
49 49
50 secondline = new QHBox ( this ); 50 secondline = new QHBox ( this );
51 secondline->setSpacing ( 5 ); 51 secondline->setSpacing ( 5 );
52 52
53 name = new QLabel ( secondline ); 53 name = new QLabel ( secondline );
54 balance = new QLabel ( secondline ); 54 balance = new QLabel ( secondline );
55 55
56 QLabel *limit = new QLabel ( "Limit", secondline ); 56 QLabel *limit = new QLabel ( "Limit", secondline );
57 limitbox = new QLineEdit ( secondline ); 57 limitbox = new QLineEdit ( secondline );
58 limitbox->setMinimumWidth ( ( int ) ( this->width() / 6 ) ); 58 limitbox->setMinimumWidth ( ( int ) ( this->width() / 6 ) );
59 connect ( limitbox, SIGNAL ( textChanged ( const QString & ) ), this, SLOT ( limitDisplay ( const QString & ) ) ); 59 connect ( limitbox, SIGNAL ( textChanged(const QString&) ), this, SLOT ( limitDisplay(const QString&) ) );
60 60
61 listview = new QListView ( this ); 61 listview = new QListView ( this );
62 listview->setAllColumnsShowFocus ( TRUE ); 62 listview->setAllColumnsShowFocus ( TRUE );
63 listview->setShowSortIndicator ( TRUE ); 63 listview->setShowSortIndicator ( TRUE );
64 listview->header()->setTracking ( FALSE ); 64 listview->header()->setTracking ( FALSE );
65 connect ( listview->header(), SIGNAL ( sizeChange ( int, int, int ) ), this, SLOT ( saveColumnSize ( int, int, int ) ) ); 65 connect ( listview->header(), SIGNAL ( sizeChange(int,int,int) ), this, SLOT ( saveColumnSize(int,int,int) ) );
66 connect ( listview->header(), SIGNAL ( clicked ( int ) ), this, SLOT ( saveSortingPreference ( int ) ) ); 66 connect ( listview->header(), SIGNAL ( clicked(int) ), this, SLOT ( saveSortingPreference(int) ) );
67 67
68 layout = new QVBoxLayout ( this, 2, 2 ); 68 layout = new QVBoxLayout ( this, 2, 2 );
69 layout->addWidget ( firstline ); 69 layout->addWidget ( firstline );
70 layout->addWidget ( secondline ); 70 layout->addWidget ( secondline );
71 layout->addWidget ( listview ); 71 layout->addWidget ( listview );
72 } 72 }
73 73
74void TransactionDisplay::addTransaction () 74void TransactionDisplay::addTransaction ()
75 { 75 {
76 // create local variables 76 // create local variables
77 int cleared = -1; 77 int cleared = -1;
78 78
79 // create new transaction window 79 // create new transaction window
80 NewTransaction *newtransaction = new NewTransaction ( this ); 80 NewTransaction *newtransaction = new NewTransaction ( this );
81 int width = this->size().width(); 81 int width = this->size().width();
82 newtransaction->transactionname->setMaximumWidth ( ( int ) ( width * 0.45 ) ); 82 newtransaction->transactionname->setMaximumWidth ( ( int ) ( width * 0.45 ) );
83 newtransaction->transactionname->setMinimumWidth ( ( int ) ( width * 0.35 ) ); 83 newtransaction->transactionname->setMinimumWidth ( ( int ) ( width * 0.35 ) );
84 newtransaction->lineitembox->setMaximumWidth ( ( int ) ( width * 0.45 ) ); 84 newtransaction->lineitembox->setMaximumWidth ( ( int ) ( width * 0.45 ) );
85 newtransaction->transactiondatebox->setMaximumWidth ( ( int ) ( width * 0.4 ) ); 85 newtransaction->transactiondatebox->setMaximumWidth ( ( int ) ( width * 0.4 ) );
86 newtransaction->transactionamountbox->setMaximumWidth ( ( int ) ( width * 0.4 ) ); 86 newtransaction->transactionamountbox->setMaximumWidth ( ( int ) ( width * 0.4 ) );
87 newtransaction->transactionnumber->setMaximumWidth ( ( int ) ( width * 0.25 ) ); 87 newtransaction->transactionnumber->setMaximumWidth ( ( int ) ( width * 0.25 ) );
88 88
89 // enter today's date in the date box as defaul 89 // enter today's date in the date box as defaul
90 QDate today = QDate::currentDate (); 90 QDate today = QDate::currentDate ();
@@ -192,49 +192,49 @@ void TransactionDisplay::editTransfer ()
192 QFont f = this->font(); 192 QFont f = this->font();
193 f.setWeight ( QFont::Bold ); 193 f.setWeight ( QFont::Bold );
194 fromaccountlabel->setFont ( f ); 194 fromaccountlabel->setFont ( f );
195 195
196 QComboBox *fromaccountbox = new QComboBox ( editransfer ); 196 QComboBox *fromaccountbox = new QComboBox ( editransfer );
197 fromaccountbox->insertStringList ( accountnames ); 197 fromaccountbox->insertStringList ( accountnames );
198 fromaccountbox->setCurrentItem ( accountids.findIndex ( QString::number ( fromaccount ) ) ); 198 fromaccountbox->setCurrentItem ( accountids.findIndex ( QString::number ( fromaccount ) ) );
199 199
200 QLabel *toaccountlabel = new QLabel ( "To Account:", editransfer ); 200 QLabel *toaccountlabel = new QLabel ( "To Account:", editransfer );
201 toaccountlabel->setFont ( f ); 201 toaccountlabel->setFont ( f );
202 202
203 QComboBox *toaccountbox = new QComboBox ( editransfer ); 203 QComboBox *toaccountbox = new QComboBox ( editransfer );
204 toaccountbox->insertStringList ( accountnames ); 204 toaccountbox->insertStringList ( accountnames );
205 toaccountbox->setCurrentItem ( accountids.findIndex ( QString::number ( toaccount ) ) ); 205 toaccountbox->setCurrentItem ( accountids.findIndex ( QString::number ( toaccount ) ) );
206 206
207 QLabel *datelabel = new QLabel ( "Date", editransfer ); 207 QLabel *datelabel = new QLabel ( "Date", editransfer );
208 QHBox *datebox = new QHBox ( editransfer ); 208 QHBox *datebox = new QHBox ( editransfer );
209 datebox->setSpacing ( 2 ); 209 datebox->setSpacing ( 2 );
210 date = new QLineEdit ( datebox ); 210 date = new QLineEdit ( datebox );
211 date->setAlignment ( Qt::AlignRight ); 211 date->setAlignment ( Qt::AlignRight );
212 date->setDisabled ( TRUE ); 212 date->setDisabled ( TRUE );
213 date->setText ( preferences->getDate ( year, month, day ) ); 213 date->setText ( preferences->getDate ( year, month, day ) );
214 QPushButton *datebutton = new QPushButton ( datebox ); 214 QPushButton *datebutton = new QPushButton ( datebox );
215 datebutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/date.png" ) ); 215 datebutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/date.png" ) );
216 connect ( datebutton, SIGNAL ( released () ), this, SLOT ( showCalendar () ) ); 216 connect ( datebutton, SIGNAL ( released() ), this, SLOT ( showCalendar() ) );
217 217
218 QLabel *amounttlabel = new QLabel ( "Amount", editransfer ); 218 QLabel *amounttlabel = new QLabel ( "Amount", editransfer );
219 219
220 QHBox *amountbox = new QHBox ( editransfer ); 220 QHBox *amountbox = new QHBox ( editransfer );
221 amountbox->setSpacing ( 2 ); 221 amountbox->setSpacing ( 2 );
222 amount = new QLineEdit ( amountbox ); 222 amount = new QLineEdit ( amountbox );
223 amount->setAlignment ( Qt::AlignRight ); 223 amount->setAlignment ( Qt::AlignRight );
224 amount->setText ( transfer->getAmount ( transferid ) ); 224 amount->setText ( transfer->getAmount ( transferid ) );
225 QPushButton *calculatorbutton = new QPushButton( amountbox ); 225 QPushButton *calculatorbutton = new QPushButton( amountbox );
226 calculatorbutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/kcalc.png" ) ); 226 calculatorbutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/kcalc.png" ) );
227 connect ( calculatorbutton, SIGNAL ( released() ), this, SLOT ( showCalculator() ) ); 227 connect ( calculatorbutton, SIGNAL ( released() ), this, SLOT ( showCalculator() ) );
228 228
229 QCheckBox *clearedcheckbox = new QCheckBox ( "Cleared", editransfer ); 229 QCheckBox *clearedcheckbox = new QCheckBox ( "Cleared", editransfer );
230 230
231 QBoxLayout *layout = new QVBoxLayout ( editransfer, 4, 2 ); 231 QBoxLayout *layout = new QVBoxLayout ( editransfer, 4, 2 );
232 layout->addWidget ( fromaccountlabel, Qt::AlignLeft ); 232 layout->addWidget ( fromaccountlabel, Qt::AlignLeft );
233 layout->addWidget ( fromaccountbox, Qt::AlignLeft ); 233 layout->addWidget ( fromaccountbox, Qt::AlignLeft );
234 layout->addWidget ( toaccountlabel, Qt::AlignLeft ); 234 layout->addWidget ( toaccountlabel, Qt::AlignLeft );
235 layout->addWidget ( toaccountbox, Qt::AlignLeft ); 235 layout->addWidget ( toaccountbox, Qt::AlignLeft );
236 layout->addSpacing ( 5 ); 236 layout->addSpacing ( 5 );
237 layout->addWidget ( datelabel, Qt::AlignLeft ); 237 layout->addWidget ( datelabel, Qt::AlignLeft );
238 layout->addWidget ( datebox, Qt::AlignLeft ); 238 layout->addWidget ( datebox, Qt::AlignLeft );
239 layout->addWidget ( amounttlabel, Qt::AlignLeft ); 239 layout->addWidget ( amounttlabel, Qt::AlignLeft );
240 layout->addWidget ( amountbox, Qt::AlignLeft ); 240 layout->addWidget ( amountbox, Qt::AlignLeft );