summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/checkbook/checkbook.cpp26
-rw-r--r--noncore/apps/checkbook/mainwindow.cpp59
-rw-r--r--noncore/apps/checkbook/mainwindow.h2
-rw-r--r--noncore/apps/checkbook/transaction.cpp23
4 files changed, 74 insertions, 36 deletions
diff --git a/noncore/apps/checkbook/checkbook.cpp b/noncore/apps/checkbook/checkbook.cpp
index 2919927..ee65784 100644
--- a/noncore/apps/checkbook/checkbook.cpp
+++ b/noncore/apps/checkbook/checkbook.cpp
@@ -45,2 +45,3 @@
45#include <qpushbutton.h> 45#include <qpushbutton.h>
46#include <qwhatsthis.h>
46#include <qwidget.h> 47#include <qwidget.h>
@@ -48,3 +49,3 @@
48Checkbook::Checkbook( QWidget *parent, const QString &n, const QString &fd, char symbol ) 49Checkbook::Checkbook( QWidget *parent, const QString &n, const QString &fd, char symbol )
49 : QDialog( parent, 0, TRUE, 0 ) 50 : QDialog( parent, 0, TRUE, WStyle_ContextHelp )
50{ 51{
@@ -112,4 +113,6 @@ QWidget *Checkbook::initInfo()
112 QLabel *label = new QLabel( tr( "Name:" ), container ); 113 QLabel *label = new QLabel( tr( "Name:" ), container );
114 QWhatsThis::add( label, tr( "Enter name of checkbook here." ) );
113 layout->addWidget( label, 0, 0 ); 115 layout->addWidget( label, 0, 0 );
114 nameEdit = new QLineEdit( container ); 116 nameEdit = new QLineEdit( container );
117 QWhatsThis::add( nameEdit, tr( "Enter name of checkbook here." ) );
115 connect( nameEdit, SIGNAL( textChanged( const QString & ) ), 118 connect( nameEdit, SIGNAL( textChanged( const QString & ) ),
@@ -120,4 +123,6 @@ QWidget *Checkbook::initInfo()
120 label = new QLabel( tr( "Type:" ), container ); 123 label = new QLabel( tr( "Type:" ), container );
124 QWhatsThis::add( label, tr( "Select type of checkbook here." ) );
121 layout->addWidget( label, 1, 0 ); 125 layout->addWidget( label, 1, 0 );
122 typeList = new QComboBox( container ); 126 typeList = new QComboBox( container );
127 QWhatsThis::add( typeList, tr( "Select type of checkbook here." ) );
123 typeList->insertItem( tr( "Savings" ) ); // 0 128 typeList->insertItem( tr( "Savings" ) ); // 0
@@ -132,4 +137,6 @@ QWidget *Checkbook::initInfo()
132 label = new QLabel( tr( "Bank:" ), container ); 137 label = new QLabel( tr( "Bank:" ), container );
138 QWhatsThis::add( label, tr( "Enter name of the bank for this checkbook here." ) );
133 layout->addWidget( label, 2, 0 ); 139 layout->addWidget( label, 2, 0 );
134 bankEdit = new QLineEdit( container ); 140 bankEdit = new QLineEdit( container );
141 QWhatsThis::add( bankEdit, tr( "Enter name of the bank for this checkbook here." ) );
135 layout->addWidget( bankEdit, 2, 1 ); 142 layout->addWidget( bankEdit, 2, 1 );
@@ -138,4 +145,6 @@ QWidget *Checkbook::initInfo()
138 label = new QLabel( tr( "Account number:" ), container ); 145 label = new QLabel( tr( "Account number:" ), container );
146 QWhatsThis::add( label, tr( "Enter account number for this checkbook here." ) );
139 layout->addWidget( label, 3, 0 ); 147 layout->addWidget( label, 3, 0 );
140 acctNumEdit = new QLineEdit( container ); 148 acctNumEdit = new QLineEdit( container );
149 QWhatsThis::add( acctNumEdit, tr( "Enter account number for this checkbook here." ) );
141 layout->addWidget( acctNumEdit, 3, 1 ); 150 layout->addWidget( acctNumEdit, 3, 1 );
@@ -144,4 +153,6 @@ QWidget *Checkbook::initInfo()
144 label = new QLabel( tr( "PIN number:" ), container ); 153 label = new QLabel( tr( "PIN number:" ), container );
154 QWhatsThis::add( label, tr( "Enter PIN number for this checkbook here." ) );
145 layout->addWidget( label, 4, 0 ); 155 layout->addWidget( label, 4, 0 );
146 pinNumEdit = new QLineEdit( container ); 156 pinNumEdit = new QLineEdit( container );
157 QWhatsThis::add( pinNumEdit, tr( "Enter PIN number for this checkbook here." ) );
147 layout->addWidget( pinNumEdit, 4, 1 ); 158 layout->addWidget( pinNumEdit, 4, 1 );
@@ -150,4 +161,6 @@ QWidget *Checkbook::initInfo()
150 label = new QLabel( tr( "Starting balance:" ), container ); 161 label = new QLabel( tr( "Starting balance:" ), container );
162 QWhatsThis::add( label, tr( "Enter the initial balance for this checkbook here." ) );
151 layout->addWidget( label, 5, 0 ); 163 layout->addWidget( label, 5, 0 );
152 balanceEdit = new QLineEdit( container ); 164 balanceEdit = new QLineEdit( container );
165 QWhatsThis::add( balanceEdit, tr( "Enter the initial balance for this checkbook here." ) );
153 connect( balanceEdit, SIGNAL( textChanged( const QString & ) ), 166 connect( balanceEdit, SIGNAL( textChanged( const QString & ) ),
@@ -158,4 +171,6 @@ QWidget *Checkbook::initInfo()
158 label = new QLabel( tr( "Notes:" ), container ); 171 label = new QLabel( tr( "Notes:" ), container );
172 QWhatsThis::add( label, tr( "Enter any additional information for this checkbook here." ) );
159 layout->addWidget( label, 6, 0 ); 173 layout->addWidget( label, 6, 0 );
160 notesEdit = new QMultiLineEdit( container ); 174 notesEdit = new QMultiLineEdit( container );
175 QWhatsThis::add( notesEdit, tr( "Enter any additional information for this checkbook here." ) );
161 notesEdit->setMaximumHeight( 85 ); 176 notesEdit->setMaximumHeight( 85 );
@@ -176,2 +191,3 @@ QWidget *Checkbook::initTransactions()
176 control ); 191 control );
192 QWhatsThis::add( balanceLabel, tr( "This area shows the current balance in this checkbook." ) );
177 layout->addMultiCellWidget( balanceLabel, 0, 0, 0, 2 ); 193 layout->addMultiCellWidget( balanceLabel, 0, 0, 0, 2 );
@@ -179,2 +195,3 @@ QWidget *Checkbook::initTransactions()
179 tranTable = new QListView( control ); 195 tranTable = new QListView( control );
196 QWhatsThis::add( tranTable, tr( "This is a listing of all transactions entered for this checkbook.\n\nTo sort entries by a specific field, click on the column name." ) );
180 tranTable->addColumn( tr( "ID" ) ); 197 tranTable->addColumn( tr( "ID" ) );
@@ -191,2 +208,3 @@ QWidget *Checkbook::initTransactions()
191 QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), control ); 208 QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), control );
209 QWhatsThis::add( btn, tr( "Click here to add a new transaction." ) );
192 connect( btn, SIGNAL( clicked() ), this, SLOT( slotNewTran() ) ); 210 connect( btn, SIGNAL( clicked() ), this, SLOT( slotNewTran() ) );
@@ -195,2 +213,3 @@ QWidget *Checkbook::initTransactions()
195 btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Edit" ), control ); 213 btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Edit" ), control );
214 QWhatsThis::add( btn, tr( "Select a transaction and then click here to edit it." ) );
196 connect( btn, SIGNAL( clicked() ), this, SLOT( slotEditTran() ) ); 215 connect( btn, SIGNAL( clicked() ), this, SLOT( slotEditTran() ) );
@@ -198,3 +217,4 @@ QWidget *Checkbook::initTransactions()
198 217
199 btn = new QPushButton( Resource::loadPixmap( "editdelete" ), tr( "Delete" ), control ); 218 btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), control );
219 QWhatsThis::add( btn, tr( "Select a checkbook and then click here to delete it." ) );
200 connect( btn, SIGNAL( clicked() ), this, SLOT( slotDeleteTran() ) ); 220 connect( btn, SIGNAL( clicked() ), this, SLOT( slotDeleteTran() ) );
@@ -225,2 +245,3 @@ QWidget *Checkbook::initCharts()
225 QWidget *graphWidget = new QWidget( control ); 245 QWidget *graphWidget = new QWidget( control );
246 QWhatsThis::add( graphWidget, tr( "Graph not implemented yet." ) );
226 layout->addMultiCellWidget( graphWidget, 0, 0, 0, 1 ); 247 layout->addMultiCellWidget( graphWidget, 0, 0, 0, 1 );
@@ -229,2 +250,3 @@ QWidget *Checkbook::initCharts()
229 QPushButton *btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Draw" ), control ); 250 QPushButton *btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Draw" ), control );
251 QWhatsThis::add( btn, tr( "Click here to draw the graph." ) );
230 connect( btn, SIGNAL( clicked() ), this, SLOT( slotDrawGraph() ) ); 252 connect( btn, SIGNAL( clicked() ), this, SLOT( slotDrawGraph() ) );
diff --git a/noncore/apps/checkbook/mainwindow.cpp b/noncore/apps/checkbook/mainwindow.cpp
index 9410536..ead17b4 100644
--- a/noncore/apps/checkbook/mainwindow.cpp
+++ b/noncore/apps/checkbook/mainwindow.cpp
@@ -43,5 +43,6 @@
43#include <qstring.h> 43#include <qstring.h>
44#include <qwhatsthis.h>
44 45
45MainWindow::MainWindow() 46MainWindow::MainWindow()
46 : QMainWindow() 47 : QMainWindow( 0x0, 0x0, WStyle_ContextHelp )
47{ 48{
@@ -61,9 +62,4 @@ MainWindow::MainWindow()
61 bar = new QPEToolBar( this ); 62 bar = new QPEToolBar( this );
62 actionOpen = new QAction( tr( "Open" ), Resource::loadPixmap( "fileopen" ), QString::null,
63 0, this, 0 );
64 connect( actionOpen, SIGNAL( activated() ), this, SLOT( slotOpen() ) );
65 actionOpen->addTo( popup );
66 actionOpen->addTo( bar );
67
68 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); 63 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 );
64 a->setWhatsThis( tr( "Click here to create a new checkbook.\n\nYou also can select New from the Checkbook menu." ) );
69 connect( a, SIGNAL( activated() ), this, SLOT( slotNew() ) ); 65 connect( a, SIGNAL( activated() ), this, SLOT( slotNew() ) );
@@ -72,4 +68,12 @@ MainWindow::MainWindow()
72 68
73 actionDelete = new QAction( tr( "Delete" ), Resource::loadPixmap( "editdelete" ), QString::null, 69 actionOpen = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ), QString::null,
70 0, this, 0 );
71 actionOpen->setWhatsThis( tr( "Select a checkbook and then click here to edit it.\n\nYou also can select Edit from the Checkbook menu, or click and hold on a checkbook name." ) );
72 connect( actionOpen, SIGNAL( activated() ), this, SLOT( slotEdit() ) );
73 actionOpen->addTo( popup );
74 actionOpen->addTo( bar );
75
76 actionDelete = new QAction( tr( "Delete" ), Resource::loadPixmap( "trash" ), QString::null,
74 0, this, 0 ); 77 0, this, 0 );
78 actionDelete->setWhatsThis( tr( "Select a checkbook and then click here delete it.\n\nYou also can select Delete from the Checkbook menu." ) );
75 connect( actionDelete, SIGNAL( activated() ), this, SLOT( slotDelete() ) ); 79 connect( actionDelete, SIGNAL( activated() ), this, SLOT( slotDelete() ) );
@@ -78,8 +82,2 @@ MainWindow::MainWindow()
78 82
79 popup->insertSeparator();
80
81 a = new QAction( tr( "Exit" ), QString::null, 0, this, 0 );
82 connect( a, SIGNAL( activated() ), this, SLOT( close() ) );
83 a->addTo( popup );
84
85 mb->insertItem( tr( "Checkbook" ), popup ); 83 mb->insertItem( tr( "Checkbook" ), popup );
@@ -88,5 +86,6 @@ MainWindow::MainWindow()
88 cbList = new QListBox( this ); 86 cbList = new QListBox( this );
87 QWhatsThis::add( cbList, tr( "This is a listing of all checkbooks currently available." ) );
89 QPEApplication::setStylusOperation( cbList->viewport(), QPEApplication::RightOnHold ); 88 QPEApplication::setStylusOperation( cbList->viewport(), QPEApplication::RightOnHold );
90 connect( cbList, SIGNAL( rightButtonPressed( QListBoxItem *, const QPoint & ) ), 89 connect( cbList, SIGNAL( rightButtonPressed( QListBoxItem *, const QPoint & ) ),
91 this, SLOT( slotOpen() ) ); 90 this, SLOT( slotEdit() ) );
92 setCentralWidget( cbList ); 91 setCentralWidget( cbList );
@@ -115,3 +114,15 @@ MainWindow::~MainWindow()
115 114
116void MainWindow::slotOpen() 115void MainWindow::slotNew()
116{
117 Checkbook *currcb = new Checkbook( this, "", cbDir, currencySymbol );
118 currcb->showMaximized();
119 if ( currcb->exec() == QDialog::Accepted )
120 {
121 cbList->insertItem( currcb->getName() );
122 cbList->sort();
123 delete currcb;
124 }
125}
126
127void MainWindow::slotEdit()
117{ 128{
@@ -138,14 +149,2 @@ void MainWindow::slotOpen()
138 149
139void MainWindow::slotNew()
140{
141 Checkbook *currcb = new Checkbook( this, "", cbDir, currencySymbol );
142 currcb->showMaximized();
143 if ( currcb->exec() == QDialog::Accepted )
144 {
145 cbList->insertItem( currcb->getName() );
146 cbList->sort();
147 delete currcb;
148 }
149}
150
151void MainWindow::slotDelete() 150void MainWindow::slotDelete()
@@ -154,4 +153,2 @@ void MainWindow::slotDelete()
154 { 153 {
155 cbList->removeItem( cbList->currentItem() );
156
157 QString name = cbDir + cbList->currentText() + ".qcb"; 154 QString name = cbDir + cbList->currentText() + ".qcb";
@@ -162,2 +159,4 @@ void MainWindow::slotDelete()
162 } 159 }
160
161 cbList->removeItem( cbList->currentItem() );
163 } 162 }
diff --git a/noncore/apps/checkbook/mainwindow.h b/noncore/apps/checkbook/mainwindow.h
index 54fbba6..2c5d93b 100644
--- a/noncore/apps/checkbook/mainwindow.h
+++ b/noncore/apps/checkbook/mainwindow.h
@@ -54,4 +54,4 @@ class MainWindow : public QMainWindow
54 private slots: 54 private slots:
55 void slotOpen();
56 void slotNew(); 55 void slotNew();
56 void slotEdit();
57 void slotDelete(); 57 void slotDelete();
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
@@ -45,4 +45,3 @@
45#include <qstring.h> 45#include <qstring.h>
46 46#include <qwhatsthis.h>
47#include <stdio.h>
48 47
@@ -50,3 +49,3 @@ Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *in
50 char symbol ) 49 char symbol )
51 : QDialog( parent, 0, TRUE, 0 ) 50 : QDialog( parent, 0, TRUE, WStyle_ContextHelp )
52{ 51{
@@ -81,2 +80,3 @@ Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *in
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 );
@@ -84,2 +84,3 @@ Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *in
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 );
@@ -91,2 +92,3 @@ Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *in
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 );
@@ -94,2 +96,3 @@ Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *in
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 );
@@ -104,4 +107,6 @@ Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *in
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 );
@@ -111,4 +116,6 @@ Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *in
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 );
@@ -117,4 +124,6 @@ Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *in
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 );
@@ -123,4 +132,6 @@ Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *in
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 );
@@ -129,4 +140,6 @@ Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *in
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 );
@@ -135,4 +148,6 @@ Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *in
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 );
@@ -141,4 +156,6 @@ Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *in
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 );