Diffstat (limited to 'noncore/apps/qashmoney/transferdialog.cpp') (more/less context) (ignore whitespace changes)
-rwxr-xr-x | noncore/apps/qashmoney/transferdialog.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/apps/qashmoney/transferdialog.cpp b/noncore/apps/qashmoney/transferdialog.cpp index 558abec..7a12fbf 100755 --- a/noncore/apps/qashmoney/transferdialog.cpp +++ b/noncore/apps/qashmoney/transferdialog.cpp | |||
@@ -1,112 +1,112 @@ | |||
1 | #include "transferdialog.h" | 1 | #include "transferdialog.h" |
2 | #include "datepicker.h" | 2 | #include "datepicker.h" |
3 | #include "calculator.h" | 3 | #include "calculator.h" |
4 | 4 | ||
5 | 5 | ||
6 | extern Preferences *preferences; | 6 | extern Preferences *preferences; |
7 | extern Account *account; | 7 | extern Account *account; |
8 | 8 | ||
9 | TransferDialog::TransferDialog ( QWidget *parent, int fromaccountid, int toaccountid ) : QDialog ( parent, 0, TRUE ) | 9 | TransferDialog::TransferDialog ( QWidget *parent, int fromaccountid, int toaccountid ) : QDialog ( parent, 0, TRUE ) |
10 | { | 10 | { |
11 | dateedited = FALSE; | 11 | dateedited = FALSE; |
12 | setCaption ( "Transfer" ); | 12 | setCaption ( "Transfer" ); |
13 | 13 | ||
14 | fromaccountlabel = new QLabel ( "From account:", this ); | 14 | fromaccountlabel = new QLabel ( "From account:", this ); |
15 | QFont f = this->font(); | 15 | QFont f = this->font(); |
16 | f.setWeight ( QFont::Bold ); | 16 | f.setWeight ( QFont::Bold ); |
17 | fromaccountlabel->setFont ( f ); | 17 | fromaccountlabel->setFont ( f ); |
18 | fromaccount = new QLabel ( account->getAccountName ( fromaccountid ), this ); | 18 | fromaccount = new QLabel ( account->getAccountName ( fromaccountid ), this ); |
19 | 19 | ||
20 | toaccountlabel = new QLabel ( "To Account:", this ); | 20 | toaccountlabel = new QLabel ( "To Account:", this ); |
21 | toaccountlabel->setFont ( f ); | 21 | toaccountlabel->setFont ( f ); |
22 | toaccount = new QLabel ( account->getAccountName ( toaccountid ), this ); | 22 | toaccount = new QLabel ( account->getAccountName ( toaccountid ), this ); |
23 | 23 | ||
24 | datelabel = new QLabel ( "Date", this ); | 24 | datelabel = new QLabel ( "Date", this ); |
25 | 25 | ||
26 | datebox = new QHBox ( this ); | 26 | datebox = new QHBox ( this ); |
27 | datebox->setSpacing ( 2 ); | 27 | datebox->setSpacing ( 2 ); |
28 | date = new QLineEdit ( datebox ); | 28 | date = new QLineEdit ( datebox ); |
29 | date->setAlignment ( Qt::AlignRight ); | 29 | date->setAlignment ( Qt::AlignRight ); |
30 | date->setDisabled ( TRUE ); | 30 | date->setDisabled ( TRUE ); |
31 | datebutton = new QPushButton ( datebox ); | 31 | datebutton = new QPushButton ( datebox ); |
32 | datebutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/date.png" ) ); | 32 | datebutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/date.png" ) ); |
33 | connect ( datebutton, SIGNAL ( released () ), this, SLOT ( showCalendar () ) ); | 33 | connect ( datebutton, SIGNAL ( released() ), this, SLOT ( showCalendar() ) ); |
34 | 34 | ||
35 | amounttlabel = new QLabel ( "Amount", this ); | 35 | amounttlabel = new QLabel ( "Amount", this ); |
36 | 36 | ||
37 | amountbox = new QHBox ( this ); | 37 | amountbox = new QHBox ( this ); |
38 | amountbox->setSpacing ( 2 ); | 38 | amountbox->setSpacing ( 2 ); |
39 | amount = new QLineEdit ( amountbox ); | 39 | amount = new QLineEdit ( amountbox ); |
40 | amount->setAlignment ( Qt::AlignRight ); | 40 | amount->setAlignment ( Qt::AlignRight ); |
41 | calculatorbutton = new QPushButton( amountbox ); | 41 | calculatorbutton = new QPushButton( amountbox ); |
42 | calculatorbutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/kcalc.png" ) ); | 42 | calculatorbutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/kcalc.png" ) ); |
43 | connect ( calculatorbutton, SIGNAL ( released() ), this, SLOT ( showCalculator() ) ); | 43 | connect ( calculatorbutton, SIGNAL ( released() ), this, SLOT ( showCalculator() ) ); |
44 | 44 | ||
45 | clearedcheckbox = new QCheckBox ( "Cleared", this ); | 45 | clearedcheckbox = new QCheckBox ( "Cleared", this ); |
46 | 46 | ||
47 | layout = new QVBoxLayout ( this, 4, 2 ); | 47 | layout = new QVBoxLayout ( this, 4, 2 ); |
48 | layout->addWidget ( fromaccountlabel, Qt::AlignLeft ); | 48 | layout->addWidget ( fromaccountlabel, Qt::AlignLeft ); |
49 | layout->addWidget ( fromaccount, Qt::AlignLeft ); | 49 | layout->addWidget ( fromaccount, Qt::AlignLeft ); |
50 | layout->addWidget ( toaccountlabel, Qt::AlignLeft ); | 50 | layout->addWidget ( toaccountlabel, Qt::AlignLeft ); |
51 | layout->addWidget ( toaccount, Qt::AlignLeft ); | 51 | layout->addWidget ( toaccount, Qt::AlignLeft ); |
52 | layout->addSpacing ( 5 ); | 52 | layout->addSpacing ( 5 ); |
53 | layout->addWidget ( datelabel, Qt::AlignLeft ); | 53 | layout->addWidget ( datelabel, Qt::AlignLeft ); |
54 | layout->addWidget ( datebox, Qt::AlignLeft ); | 54 | layout->addWidget ( datebox, Qt::AlignLeft ); |
55 | layout->addWidget ( amounttlabel, Qt::AlignLeft ); | 55 | layout->addWidget ( amounttlabel, Qt::AlignLeft ); |
56 | layout->addWidget ( amountbox, Qt::AlignLeft ); | 56 | layout->addWidget ( amountbox, Qt::AlignLeft ); |
57 | layout->addWidget ( clearedcheckbox, Qt::AlignLeft ); | 57 | layout->addWidget ( clearedcheckbox, Qt::AlignLeft ); |
58 | } | 58 | } |
59 | 59 | ||
60 | bool TransferDialog::getDateEdited () | 60 | bool TransferDialog::getDateEdited () |
61 | { | 61 | { |
62 | return dateedited; | 62 | return dateedited; |
63 | } | 63 | } |
64 | 64 | ||
65 | void TransferDialog::showCalendar () | 65 | void TransferDialog::showCalendar () |
66 | { | 66 | { |
67 | QDate newDate = QDate::currentDate (); | 67 | QDate newDate = QDate::currentDate (); |
68 | DatePicker *dp = new DatePicker ( newDate ); | 68 | DatePicker *dp = new DatePicker ( newDate ); |
69 | if ( dp->exec () == QDialog::Accepted ) | 69 | if ( dp->exec () == QDialog::Accepted ) |
70 | { | 70 | { |
71 | // Set date integers | 71 | // Set date integers |
72 | year = dp->getYear(); | 72 | year = dp->getYear(); |
73 | month = dp->getMonth(); | 73 | month = dp->getMonth(); |
74 | day = dp->getDay(); | 74 | day = dp->getDay(); |
75 | 75 | ||
76 | // Set dateedited to TRUE | 76 | // Set dateedited to TRUE |
77 | // This tells the accountdisplay object that the user edited an account | 77 | // This tells the accountdisplay object that the user edited an account |
78 | // and did change the date | 78 | // and did change the date |
79 | dateedited = TRUE; | 79 | dateedited = TRUE; |
80 | 80 | ||
81 | // Display date with our selected format | 81 | // Display date with our selected format |
82 | date->setText ( preferences->getDate ( year, month, day ) ); | 82 | date->setText ( preferences->getDate ( year, month, day ) ); |
83 | } | 83 | } |
84 | } | 84 | } |
85 | 85 | ||
86 | int TransferDialog::getDay () | 86 | int TransferDialog::getDay () |
87 | { | 87 | { |
88 | return day; | 88 | return day; |
89 | } | 89 | } |
90 | 90 | ||
91 | int TransferDialog::getMonth () | 91 | int TransferDialog::getMonth () |
92 | { | 92 | { |
93 | return month; | 93 | return month; |
94 | } | 94 | } |
95 | 95 | ||
96 | int TransferDialog::getYear () | 96 | int TransferDialog::getYear () |
97 | { | 97 | { |
98 | return year; | 98 | return year; |
99 | } | 99 | } |
100 | 100 | ||
101 | void TransferDialog::showCalculator () | 101 | void TransferDialog::showCalculator () |
102 | { | 102 | { |
103 | Calculator *calculator = new Calculator ( this ); | 103 | Calculator *calculator = new Calculator ( this ); |
104 | if ( calculator->exec () == QDialog::Accepted ) | 104 | if ( calculator->exec () == QDialog::Accepted ) |
105 | amount->setText ( calculator->display->text() ); | 105 | amount->setText ( calculator->display->text() ); |
106 | } | 106 | } |
107 | 107 | ||
108 | 108 | ||
109 | 109 | ||
110 | 110 | ||
111 | 111 | ||
112 | 112 | ||