summaryrefslogtreecommitdiff
path: root/noncore/apps/checkbook/transaction.cpp
Unidiff
Diffstat (limited to 'noncore/apps/checkbook/transaction.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/checkbook/transaction.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/noncore/apps/checkbook/transaction.cpp b/noncore/apps/checkbook/transaction.cpp
index 7d1781b..82baec9 100644
--- a/noncore/apps/checkbook/transaction.cpp
+++ b/noncore/apps/checkbook/transaction.cpp
@@ -40,18 +40,17 @@
40#include <qmultilineedit.h> 40#include <qmultilineedit.h>
41#include <qpopupmenu.h> 41#include <qpopupmenu.h>
42#include <qpushbutton.h> 42#include <qpushbutton.h>
43#include <qradiobutton.h> 43#include <qradiobutton.h>
44#include <qscrollview.h> 44#include <qscrollview.h>
45#include <qstring.h> 45#include <qstring.h>
46 46#include <qwhatsthis.h>
47#include <stdio.h>
48 47
49Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *info, 48Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *info,
50 char symbol ) 49 char symbol )
51 : QDialog( parent, 0, TRUE, 0 ) 50 : QDialog( parent, 0, TRUE, WStyle_ContextHelp )
52{ 51{
53 setCaption( tr( "Transaction for " ) + acctname ); 52 setCaption( tr( "Transaction for " ) + acctname );
54 53
55 tran = info; 54 tran = info;
56 currencySymbol = symbol; 55 currencySymbol = symbol;
57 56
@@ -76,74 +75,92 @@ Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *in
76 btngrp->layout()->setMargin( 0 ); 75 btngrp->layout()->setMargin( 0 );
77 btngrp->setMaximumWidth( 220 ); 76 btngrp->setMaximumWidth( 220 );
78 QGridLayout *layout2 = new QGridLayout( btngrp->layout() ); 77 QGridLayout *layout2 = new QGridLayout( btngrp->layout() );
79 layout2->setSpacing( 2 ); 78 layout2->setSpacing( 2 );
80 layout2->setMargin( 2 ); 79 layout2->setMargin( 2 );
81 withBtn = new QRadioButton( tr( "Withdrawal" ), btngrp ); 80 withBtn = new QRadioButton( tr( "Withdrawal" ), btngrp );
81 QWhatsThis::add( withBtn, tr( "Select whether the transaction is a withdrawal or deposit here." ) );
82 layout2->addWidget( withBtn, 0, 0 ); 82 layout2->addWidget( withBtn, 0, 0 );
83 connect( withBtn, SIGNAL( clicked() ), this, SLOT( slotWithdrawalClicked() ) ); 83 connect( withBtn, SIGNAL( clicked() ), this, SLOT( slotWithdrawalClicked() ) );
84 depBtn = new QRadioButton( tr( "Deposit" ), btngrp ); 84 depBtn = new QRadioButton( tr( "Deposit" ), btngrp );
85 QWhatsThis::add( depBtn, tr( "Select whether the transaction is a withdrawal or deposit here." ) );
85 layout2->addWidget( depBtn, 0, 1 ); 86 layout2->addWidget( depBtn, 0, 1 );
86 btngrp->setMaximumSize( 320, withBtn->height() ); 87 btngrp->setMaximumSize( 320, withBtn->height() );
87 connect( depBtn, SIGNAL( clicked() ), this, SLOT( slotDepositClicked() ) ); 88 connect( depBtn, SIGNAL( clicked() ), this, SLOT( slotDepositClicked() ) );
88 layout->addMultiCellWidget( btngrp, 0, 0, 0, 3 ); 89 layout->addMultiCellWidget( btngrp, 0, 0, 0, 3 );
89 90
90 // Date 91 // Date
91 QLabel *label = new QLabel( tr( "Date:" ), container ); 92 QLabel *label = new QLabel( tr( "Date:" ), container );
93 QWhatsThis::add( label, tr( "Select date of transaction here." ) );
92 layout->addWidget( label, 1, 0 ); 94 layout->addWidget( label, 1, 0 );
93 dateBtn = new QPushButton( TimeString::shortDate( QDate::currentDate() ), 95 dateBtn = new QPushButton( TimeString::shortDate( QDate::currentDate() ),
94 container ); 96 container );
97 QWhatsThis::add( dateBtn, tr( "Select date of transaction here." ) );
95 QPopupMenu *m1 = new QPopupMenu( container ); 98 QPopupMenu *m1 = new QPopupMenu( container );
96 datePicker = new DateBookMonth( m1, 0, TRUE ); 99 datePicker = new DateBookMonth( m1, 0, TRUE );
97 m1->insertItem( datePicker ); 100 m1->insertItem( datePicker );
98 dateBtn->setPopup( m1 ); 101 dateBtn->setPopup( m1 );
99 connect( datePicker, SIGNAL( dateClicked( int, int, int ) ), 102 connect( datePicker, SIGNAL( dateClicked( int, int, int ) ),
100 this, SLOT( slotDateChanged( int, int, int ) ) ); 103 this, SLOT( slotDateChanged( int, int, int ) ) );
101 layout->addWidget( dateBtn, 1, 1 ); 104 layout->addWidget( dateBtn, 1, 1 );
102 105
103 // Check number 106 // Check number
104 label = new QLabel( tr( "Number:" ), container ); 107 label = new QLabel( tr( "Number:" ), container );
108 QWhatsThis::add( label, tr( "Enter check number here." ) );
105 layout->addWidget( label, 1, 2 ); 109 layout->addWidget( label, 1, 2 );
106 numEdit = new QLineEdit( container ); 110 numEdit = new QLineEdit( container );
111 QWhatsThis::add( numEdit, tr( "Enter check number here." ) );
107 numEdit->setMaximumWidth( 40 ); 112 numEdit->setMaximumWidth( 40 );
108 layout->addWidget( numEdit, 1, 3 ); 113 layout->addWidget( numEdit, 1, 3 );
109 114
110 // Description 115 // Description
111 label = new QLabel( tr( "Description:" ), container ); 116 label = new QLabel( tr( "Description:" ), container );
117 QWhatsThis::add( label, tr( "Enter description of transaction here." ) );
112 layout->addWidget( label, 2, 0 ); 118 layout->addWidget( label, 2, 0 );
113 descEdit = new QLineEdit( container ); 119 descEdit = new QLineEdit( container );
120 QWhatsThis::add( descEdit, tr( "Enter description of transaction here." ) );
114 layout->addMultiCellWidget( descEdit, 2, 2, 1, 3 ); 121 layout->addMultiCellWidget( descEdit, 2, 2, 1, 3 );
115 122
116 // Category 123 // Category
117 label = new QLabel( tr( "Category:" ), container ); 124 label = new QLabel( tr( "Category:" ), container );
125 QWhatsThis::add( label, tr( "Select transaction category here." ) );
118 layout->addWidget( label, 3, 0 ); 126 layout->addWidget( label, 3, 0 );
119 catList = new QComboBox( container ); 127 catList = new QComboBox( container );
128 QWhatsThis::add( catList, tr( "Select transaction category here." ) );
120 layout->addMultiCellWidget( catList, 3, 3, 1, 3 ); 129 layout->addMultiCellWidget( catList, 3, 3, 1, 3 );
121 130
122 // Type 131 // Type
123 label = new QLabel( tr( "Type:" ), container ); 132 label = new QLabel( tr( "Type:" ), container );
133 QWhatsThis::add( label, tr( "Select transaction type here.\n\nThe options available vary based on whether the transaction is a deposit or withdrawal." ) );
124 layout->addWidget( label, 4, 0 ); 134 layout->addWidget( label, 4, 0 );
125 typeList = new QComboBox( container ); 135 typeList = new QComboBox( container );
136 QWhatsThis::add( typeList, tr( "Select transaction type here.\n\nThe options available vary based on whether the transaction is a deposit or withdrawal." ) );
126 layout->addMultiCellWidget( typeList, 4, 4, 1, 3 ); 137 layout->addMultiCellWidget( typeList, 4, 4, 1, 3 );
127 138
128 // Amount 139 // Amount
129 label = new QLabel( tr( "Amount:" ), container ); 140 label = new QLabel( tr( "Amount:" ), container );
141 QWhatsThis::add( label, tr( "Enter the amount of transaction here.\n\nThe value entered should always be positive." ) );
130 layout->addWidget( label, 5, 0 ); 142 layout->addWidget( label, 5, 0 );
131 amtEdit = new QLineEdit( container ); 143 amtEdit = new QLineEdit( container );
144 QWhatsThis::add( amtEdit, tr( "Enter the amount of transaction here.\n\nThe value entered should always be positive." ) );
132 layout->addMultiCellWidget( amtEdit, 5, 5, 1, 3 ); 145 layout->addMultiCellWidget( amtEdit, 5, 5, 1, 3 );
133 146
134 // Fee 147 // Fee
135 label = new QLabel( tr( "Fee:" ), container ); 148 label = new QLabel( tr( "Fee:" ), container );
149 QWhatsThis::add( label, tr( "Enter any fee amount assoiciated with this transaction.\n\nThe value entered should always be positive." ) );
136 layout->addWidget( label, 6, 0 ); 150 layout->addWidget( label, 6, 0 );
137 feeEdit = new QLineEdit( container ); 151 feeEdit = new QLineEdit( container );
152 QWhatsThis::add( feeEdit, tr( "Enter any fee amount assoiciated with this transaction.\n\nThe value entered should always be positive." ) );
138 layout->addMultiCellWidget( feeEdit, 6, 6, 1, 3 ); 153 layout->addMultiCellWidget( feeEdit, 6, 6, 1, 3 );
139 154
140 // Notes 155 // Notes
141 label = new QLabel( tr( "Notes:" ), container ); 156 label = new QLabel( tr( "Notes:" ), container );
157 QWhatsThis::add( label, tr( "Enter any additional information for this transaction here." ) );
142 layout->addWidget( label, 7, 0 ); 158 layout->addWidget( label, 7, 0 );
143 noteEdit = new QMultiLineEdit( container ); 159 noteEdit = new QMultiLineEdit( container );
160 QWhatsThis::add( noteEdit, tr( "Enter any additional information for this transaction here." ) );
144 layout->addMultiCellWidget( noteEdit, 8, 8, 0, 3 ); 161 layout->addMultiCellWidget( noteEdit, 8, 8, 0, 3 );
145 162
146 // Populate current values if provided 163 // Populate current values if provided
147 if ( info ) 164 if ( info )
148 { 165 {
149 if ( info->withdrawal() ) 166 if ( info->withdrawal() )