summaryrefslogtreecommitdiff
path: root/noncore/apps/qashmoney/newtransaction.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/newtransaction.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/newtransaction.cpp') (more/less context) (ignore whitespace changes)
-rwxr-xr-xnoncore/apps/qashmoney/newtransaction.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/noncore/apps/qashmoney/newtransaction.cpp b/noncore/apps/qashmoney/newtransaction.cpp
index 5c78139..87b7f7e 100755
--- a/noncore/apps/qashmoney/newtransaction.cpp
+++ b/noncore/apps/qashmoney/newtransaction.cpp
@@ -4,109 +4,109 @@
4#include "budget.h" 4#include "budget.h"
5 5
6#include <qmultilineedit.h> 6#include <qmultilineedit.h>
7 7
8extern Budget *budget; 8extern Budget *budget;
9extern Preferences *preferences; 9extern Preferences *preferences;
10 10
11NewTransaction::NewTransaction ( QWidget* parent ) : QDialog ( parent, 0, TRUE ) 11NewTransaction::NewTransaction ( QWidget* parent ) : QDialog ( parent, 0, TRUE )
12 { 12 {
13 transactiondescription = ""; 13 transactiondescription = "";
14 currentlineitem = -1; 14 currentlineitem = -1;
15 currentbudget = -1; 15 currentbudget = -1;
16 dateedited = FALSE; 16 dateedited = FALSE;
17 setCaption( tr( "Transaction" ) ); 17 setCaption( tr( "Transaction" ) );
18 18
19 // START FIRST COLUMN 19 // START FIRST COLUMN
20 20
21 namelabel = new QLabel ( "Transaction", this ); 21 namelabel = new QLabel ( "Transaction", this );
22 22
23 transactionnamebox = new QHBox ( this ); 23 transactionnamebox = new QHBox ( this );
24 transactionname = new QComboBox ( transactionnamebox ); 24 transactionname = new QComboBox ( transactionnamebox );
25 transactionname->setEditable ( TRUE ); 25 transactionname->setEditable ( TRUE );
26 descriptionbutton = new QPushButton ( transactionnamebox ); 26 descriptionbutton = new QPushButton ( transactionnamebox );
27 descriptionbutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/info.png" ) ); 27 descriptionbutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/info.png" ) );
28 connect ( descriptionbutton, SIGNAL ( released () ), this, SLOT ( addTransactionDescription() ) ); 28 connect ( descriptionbutton, SIGNAL ( released() ), this, SLOT ( addTransactionDescription() ) );
29 29
30 amountlabel = new QLabel ( "Amount", this ); 30 amountlabel = new QLabel ( "Amount", this );
31 31
32 transactionamountbox = new QHBox ( this ); 32 transactionamountbox = new QHBox ( this );
33 transactionamount = new QLineEdit ( transactionamountbox ); 33 transactionamount = new QLineEdit ( transactionamountbox );
34 transactionamount->setAlignment ( Qt::AlignRight ); 34 transactionamount->setAlignment ( Qt::AlignRight );
35 transactionamount->setText ( "0.00" ); 35 transactionamount->setText ( "0.00" );
36 calculatorbutton = new QPushButton( transactionamountbox ); 36 calculatorbutton = new QPushButton( transactionamountbox );
37 calculatorbutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/kcalc.png" ) ); 37 calculatorbutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/kcalc.png" ) );
38 connect ( calculatorbutton, SIGNAL ( released() ), this, SLOT ( showCalculator() ) ); 38 connect ( calculatorbutton, SIGNAL ( released() ), this, SLOT ( showCalculator() ) );
39 39
40 datelabel = new QLabel ( "Date", this ); 40 datelabel = new QLabel ( "Date", this );
41 41
42 transactiondatebox = new QHBox ( this ); 42 transactiondatebox = new QHBox ( this );
43 transactiondate = new QLineEdit ( transactiondatebox ); 43 transactiondate = new QLineEdit ( transactiondatebox );
44 transactiondate->setAlignment ( Qt::AlignRight ); 44 transactiondate->setAlignment ( Qt::AlignRight );
45 transactiondate->setDisabled ( TRUE ); 45 transactiondate->setDisabled ( TRUE );
46 datebutton = new QPushButton( transactiondatebox ); 46 datebutton = new QPushButton( transactiondatebox );
47 datebutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/date.png" ) ); 47 datebutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/date.png" ) );
48 connect ( datebutton, SIGNAL ( released () ), this, SLOT ( showCalendar () ) ); 48 connect ( datebutton, SIGNAL ( released() ), this, SLOT ( showCalendar() ) );
49 49
50 clearedcheckbox = new QCheckBox ( "Cleared", this ); 50 clearedcheckbox = new QCheckBox ( "Cleared", this );
51 depositbox = new QCheckBox ( "Credit", this ); 51 depositbox = new QCheckBox ( "Credit", this );
52 52
53 // START SECOND COLUMN 53 // START SECOND COLUMN
54 54
55 numberlabel = new QLabel ( "Number", this ); 55 numberlabel = new QLabel ( "Number", this );
56 transactionnumber = new QLineEdit ( this ); 56 transactionnumber = new QLineEdit ( this );
57 57
58 budgetlabel = new QLabel ( "Budget", this ); 58 budgetlabel = new QLabel ( "Budget", this );
59 budgetbox = new QComboBox ( FALSE, this ); 59 budgetbox = new QComboBox ( FALSE, this );
60 60
61 lineitemlabel = new QLabel ( "LineItem", this ); 61 lineitemlabel = new QLabel ( "LineItem", this );
62 lineitembox = new QComboBox ( FALSE, this ); 62 lineitembox = new QComboBox ( FALSE, this );
63 63
64 layout = new QGridLayout ( this, 7, 2, 2, 2 ); 64 layout = new QGridLayout ( this, 7, 2, 2, 2 );
65 layout->addWidget ( namelabel, 0, 0, Qt::AlignLeft ); 65 layout->addWidget ( namelabel, 0, 0, Qt::AlignLeft );
66 layout->addWidget ( transactionnamebox, 1, 0, Qt::AlignLeft ); 66 layout->addWidget ( transactionnamebox, 1, 0, Qt::AlignLeft );
67 layout->addWidget ( amountlabel, 2, 0, Qt::AlignLeft ); 67 layout->addWidget ( amountlabel, 2, 0, Qt::AlignLeft );
68 layout->addWidget ( transactionamountbox, 3, 0, Qt::AlignLeft ); 68 layout->addWidget ( transactionamountbox, 3, 0, Qt::AlignLeft );
69 layout->addWidget ( datelabel, 4, 0, Qt::AlignLeft ); 69 layout->addWidget ( datelabel, 4, 0, Qt::AlignLeft );
70 layout->addWidget ( transactiondatebox, 5, 0, Qt::AlignLeft ); 70 layout->addWidget ( transactiondatebox, 5, 0, Qt::AlignLeft );
71 layout->addWidget ( clearedcheckbox, 6, 0, Qt::AlignLeft ); 71 layout->addWidget ( clearedcheckbox, 6, 0, Qt::AlignLeft );
72 layout->addWidget ( numberlabel, 0, 1, Qt::AlignLeft ); 72 layout->addWidget ( numberlabel, 0, 1, Qt::AlignLeft );
73 layout->addWidget ( transactionnumber, 1, 1, Qt::AlignLeft ); 73 layout->addWidget ( transactionnumber, 1, 1, Qt::AlignLeft );
74 layout->addWidget ( budgetlabel, 2, 1, Qt::AlignLeft ); 74 layout->addWidget ( budgetlabel, 2, 1, Qt::AlignLeft );
75 layout->addWidget ( budgetbox, 3, 1, Qt::AlignLeft ); 75 layout->addWidget ( budgetbox, 3, 1, Qt::AlignLeft );
76 layout->addWidget ( lineitemlabel, 4, 1, Qt::AlignLeft ); 76 layout->addWidget ( lineitemlabel, 4, 1, Qt::AlignLeft );
77 layout->addWidget ( lineitembox, 5, 1, Qt::AlignLeft ); 77 layout->addWidget ( lineitembox, 5, 1, Qt::AlignLeft );
78 layout->addWidget ( depositbox, 6, 1, Qt::AlignLeft ); 78 layout->addWidget ( depositbox, 6, 1, Qt::AlignLeft );
79 79
80 if ( budget->getNumberOfBudgets() != 0 ) 80 if ( budget->getNumberOfBudgets() != 0 )
81 { 81 {
82 budgetnameslist = budget->getBudgetNames(); 82 budgetnameslist = budget->getBudgetNames();
83 budgetidslist = budget->getBudgetIDs(); 83 budgetidslist = budget->getBudgetIDs();
84 budgetbox->insertStringList ( *budgetnameslist ); 84 budgetbox->insertStringList ( *budgetnameslist );
85 lineitemlabel->setEnabled ( FALSE ); 85 lineitemlabel->setEnabled ( FALSE );
86 lineitembox->setEnabled ( FALSE ); 86 lineitembox->setEnabled ( FALSE );
87 connect ( budgetbox, SIGNAL ( activated ( int ) ), this, SLOT ( setCurrentBudget ( int ) ) ); 87 connect ( budgetbox, SIGNAL ( activated(int) ), this, SLOT ( setCurrentBudget(int) ) );
88 connect ( lineitembox, SIGNAL ( activated ( int ) ), this, SLOT ( setCurrentLineItem ( int ) ) ); 88 connect ( lineitembox, SIGNAL ( activated(int) ), this, SLOT ( setCurrentLineItem(int) ) );
89 } 89 }
90 else 90 else
91 { 91 {
92 budgetlabel->setEnabled ( FALSE ); 92 budgetlabel->setEnabled ( FALSE );
93 budgetbox->setEnabled ( FALSE ); 93 budgetbox->setEnabled ( FALSE );
94 lineitemlabel->setEnabled ( FALSE ); 94 lineitemlabel->setEnabled ( FALSE );
95 lineitembox->setEnabled ( FALSE ); 95 lineitembox->setEnabled ( FALSE );
96 } 96 }
97 97
98} 98}
99 99
100NewTransaction::~NewTransaction () 100NewTransaction::~NewTransaction ()
101 { 101 {
102 } 102 }
103 103
104void NewTransaction::showCalculator () 104void NewTransaction::showCalculator ()
105{ 105{
106 Calculator *calculator = new Calculator ( this ); 106 Calculator *calculator = new Calculator ( this );
107 calculator->setMaximumWidth ( ( int ) ( this->size().width() * 0.9 ) ); 107 calculator->setMaximumWidth ( ( int ) ( this->size().width() * 0.9 ) );
108 if ( calculator->exec () == QDialog::Accepted ) 108 if ( calculator->exec () == QDialog::Accepted )
109 transactionamount->setText ( calculator->display->text() ); 109 transactionamount->setText ( calculator->display->text() );
110} 110}
111 111
112void NewTransaction::showCalendar () 112void NewTransaction::showCalendar ()