-rw-r--r-- | noncore/apps/checkbook/checkbook.cpp | 8 | ||||
-rw-r--r-- | noncore/apps/checkbook/opie-checkbook.control | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/noncore/apps/checkbook/checkbook.cpp b/noncore/apps/checkbook/checkbook.cpp index ee65784..4b81c6d 100644 --- a/noncore/apps/checkbook/checkbook.cpp +++ b/noncore/apps/checkbook/checkbook.cpp | |||
@@ -28,99 +28,99 @@ | |||
28 | 28 | ||
29 | #include "checkbook.h" | 29 | #include "checkbook.h" |
30 | #include "transaction.h" | 30 | #include "transaction.h" |
31 | 31 | ||
32 | #include <opie/otabwidget.h> | 32 | #include <opie/otabwidget.h> |
33 | #include <qpe/config.h> | 33 | #include <qpe/config.h> |
34 | #include <qpe/qpeapplication.h> | 34 | #include <qpe/qpeapplication.h> |
35 | #include <qpe/qpemessagebox.h> | 35 | #include <qpe/qpemessagebox.h> |
36 | #include <qpe/resource.h> | 36 | #include <qpe/resource.h> |
37 | 37 | ||
38 | #include <qcombobox.h> | 38 | #include <qcombobox.h> |
39 | #include <qfile.h> | 39 | #include <qfile.h> |
40 | #include <qlabel.h> | 40 | #include <qlabel.h> |
41 | #include <qlayout.h> | 41 | #include <qlayout.h> |
42 | #include <qlineedit.h> | 42 | #include <qlineedit.h> |
43 | #include <qlistview.h> | 43 | #include <qlistview.h> |
44 | #include <qmultilineedit.h> | 44 | #include <qmultilineedit.h> |
45 | #include <qpushbutton.h> | 45 | #include <qpushbutton.h> |
46 | #include <qwhatsthis.h> | 46 | #include <qwhatsthis.h> |
47 | #include <qwidget.h> | 47 | #include <qwidget.h> |
48 | 48 | ||
49 | Checkbook::Checkbook( QWidget *parent, const QString &n, const QString &fd, char symbol ) | 49 | Checkbook::Checkbook( QWidget *parent, const QString &n, const QString &fd, char symbol ) |
50 | : QDialog( parent, 0, TRUE, WStyle_ContextHelp ) | 50 | : QDialog( parent, 0, TRUE, WStyle_ContextHelp ) |
51 | { | 51 | { |
52 | name = n; | 52 | name = n; |
53 | filename = fd + name + ".qcb"; | 53 | filename = fd + name + ".qcb"; |
54 | filedir = fd; | 54 | filedir = fd; |
55 | currencySymbol = symbol; | 55 | currencySymbol = symbol; |
56 | currBalance = 0.0; | 56 | currBalance = 0.0; |
57 | 57 | ||
58 | if ( name != "" ) | 58 | if ( name != "" ) |
59 | { | 59 | { |
60 | setCaption( name + " - " + tr( "Checkbook" ) ); | 60 | setCaption( name + " - " + tr( "Checkbook" ) ); |
61 | } | 61 | } |
62 | else | 62 | else |
63 | { | 63 | { |
64 | setCaption( tr( "New checkbook" ) ); | 64 | setCaption( tr( "New checkbook" ) ); |
65 | } | 65 | } |
66 | 66 | ||
67 | // Setup layout to make everything pretty | 67 | // Setup layout to make everything pretty |
68 | QVBoxLayout *layout = new QVBoxLayout( this ); | 68 | QVBoxLayout *layout = new QVBoxLayout( this ); |
69 | layout->setMargin( 2 ); | 69 | layout->setMargin( 2 ); |
70 | layout->setSpacing( 4 ); | 70 | layout->setSpacing( 4 ); |
71 | 71 | ||
72 | // Setup tabs for all info | 72 | // Setup tabs for all info |
73 | mainWidget = new OTabWidget( this ); | 73 | mainWidget = new OTabWidget( this ); |
74 | layout->addWidget( mainWidget ); | 74 | layout->addWidget( mainWidget ); |
75 | 75 | ||
76 | mainWidget->addTab( initInfo(), "help_icon", tr( "Info" ) ); | 76 | mainWidget->addTab( initInfo(), "checkbook/infotab", tr( "Info" ) ); |
77 | mainWidget->addTab( initTransactions(), "Spreadsheet", tr( "Transactions" ) ); | 77 | mainWidget->addTab( initTransactions(), "checkbook/trantab", tr( "Transactions" ) ); |
78 | mainWidget->addTab( initCharts(), "DocumentTypePowerPoint", tr( "Charts" ) ); | 78 | mainWidget->addTab( initCharts(), "checkbook/charttab", tr( "Charts" ) ); |
79 | mainWidget->setCurrentTab( tr( "Info" ) ); | 79 | mainWidget->setCurrentTab( tr( "Info" ) ); |
80 | 80 | ||
81 | // Load checkbook information | 81 | // Load checkbook information |
82 | loadCheckbook(); | 82 | loadCheckbook(); |
83 | } | 83 | } |
84 | 84 | ||
85 | Checkbook::~Checkbook() | 85 | Checkbook::~Checkbook() |
86 | { | 86 | { |
87 | } | 87 | } |
88 | 88 | ||
89 | const QString &Checkbook::getName() | 89 | const QString &Checkbook::getName() |
90 | { | 90 | { |
91 | return( name ); | 91 | return( name ); |
92 | } | 92 | } |
93 | 93 | ||
94 | QWidget *Checkbook::initInfo() | 94 | QWidget *Checkbook::initInfo() |
95 | { | 95 | { |
96 | QWidget *control = new QWidget( mainWidget ); | 96 | QWidget *control = new QWidget( mainWidget ); |
97 | 97 | ||
98 | QVBoxLayout *vb = new QVBoxLayout( control ); | 98 | QVBoxLayout *vb = new QVBoxLayout( control ); |
99 | 99 | ||
100 | QScrollView *sv = new QScrollView( control ); | 100 | QScrollView *sv = new QScrollView( control ); |
101 | vb->addWidget( sv, 0, 0 ); | 101 | vb->addWidget( sv, 0, 0 ); |
102 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 102 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
103 | sv->setFrameStyle( QFrame::NoFrame ); | 103 | sv->setFrameStyle( QFrame::NoFrame ); |
104 | 104 | ||
105 | QWidget *container = new QWidget( sv->viewport() ); | 105 | QWidget *container = new QWidget( sv->viewport() ); |
106 | sv->addChild( container ); | 106 | sv->addChild( container ); |
107 | 107 | ||
108 | QGridLayout *layout = new QGridLayout( container ); | 108 | QGridLayout *layout = new QGridLayout( container ); |
109 | layout->setSpacing( 2 ); | 109 | layout->setSpacing( 2 ); |
110 | layout->setMargin( 4 ); | 110 | layout->setMargin( 4 ); |
111 | 111 | ||
112 | // Account name | 112 | // Account name |
113 | 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." ) ); | 114 | QWhatsThis::add( label, tr( "Enter name of checkbook here." ) ); |
115 | layout->addWidget( label, 0, 0 ); | 115 | layout->addWidget( label, 0, 0 ); |
116 | nameEdit = new QLineEdit( container ); | 116 | nameEdit = new QLineEdit( container ); |
117 | QWhatsThis::add( nameEdit, tr( "Enter name of checkbook here." ) ); | 117 | QWhatsThis::add( nameEdit, tr( "Enter name of checkbook here." ) ); |
118 | connect( nameEdit, SIGNAL( textChanged( const QString & ) ), | 118 | connect( nameEdit, SIGNAL( textChanged( const QString & ) ), |
119 | this, SLOT( slotNameChanged( const QString & ) ) ); | 119 | this, SLOT( slotNameChanged( const QString & ) ) ); |
120 | layout->addWidget( nameEdit, 0, 1 ); | 120 | layout->addWidget( nameEdit, 0, 1 ); |
121 | 121 | ||
122 | // Type of account | 122 | // Type of account |
123 | label = new QLabel( tr( "Type:" ), container ); | 123 | label = new QLabel( tr( "Type:" ), container ); |
124 | QWhatsThis::add( label, tr( "Select type of checkbook here." ) ); | 124 | QWhatsThis::add( label, tr( "Select type of checkbook here." ) ); |
125 | layout->addWidget( label, 1, 0 ); | 125 | layout->addWidget( label, 1, 0 ); |
126 | typeList = new QComboBox( container ); | 126 | typeList = new QComboBox( container ); |
@@ -202,97 +202,97 @@ QWidget *Checkbook::initTransactions() | |||
202 | tranTable->setAllColumnsShowFocus( TRUE ); | 202 | tranTable->setAllColumnsShowFocus( TRUE ); |
203 | layout->addMultiCellWidget( tranTable, 1, 1, 0, 2 ); | 203 | layout->addMultiCellWidget( tranTable, 1, 1, 0, 2 ); |
204 | QPEApplication::setStylusOperation( tranTable->viewport(), QPEApplication::RightOnHold ); | 204 | QPEApplication::setStylusOperation( tranTable->viewport(), QPEApplication::RightOnHold ); |
205 | connect( tranTable, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ), | 205 | connect( tranTable, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ), |
206 | this, SLOT( slotEditTran() ) ); | 206 | this, SLOT( slotEditTran() ) ); |
207 | 207 | ||
208 | 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." ) ); | 209 | QWhatsThis::add( btn, tr( "Click here to add a new transaction." ) ); |
210 | connect( btn, SIGNAL( clicked() ), this, SLOT( slotNewTran() ) ); | 210 | connect( btn, SIGNAL( clicked() ), this, SLOT( slotNewTran() ) ); |
211 | layout->addWidget( btn, 2, 0 ); | 211 | layout->addWidget( btn, 2, 0 ); |
212 | 212 | ||
213 | 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." ) ); | 214 | QWhatsThis::add( btn, tr( "Select a transaction and then click here to edit it." ) ); |
215 | connect( btn, SIGNAL( clicked() ), this, SLOT( slotEditTran() ) ); | 215 | connect( btn, SIGNAL( clicked() ), this, SLOT( slotEditTran() ) ); |
216 | layout->addWidget( btn, 2, 1 ); | 216 | layout->addWidget( btn, 2, 1 ); |
217 | 217 | ||
218 | btn = new QPushButton( Resource::loadPixmap( "trash" ), 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." ) ); | 219 | QWhatsThis::add( btn, tr( "Select a checkbook and then click here to delete it." ) ); |
220 | connect( btn, SIGNAL( clicked() ), this, SLOT( slotDeleteTran() ) ); | 220 | connect( btn, SIGNAL( clicked() ), this, SLOT( slotDeleteTran() ) ); |
221 | layout->addWidget( btn, 2, 2 ); | 221 | layout->addWidget( btn, 2, 2 ); |
222 | 222 | ||
223 | return( control ); | 223 | return( control ); |
224 | } | 224 | } |
225 | 225 | ||
226 | QWidget *Checkbook::initCharts() | 226 | QWidget *Checkbook::initCharts() |
227 | { | 227 | { |
228 | QWidget *control = new QWidget( mainWidget ); | 228 | QWidget *control = new QWidget( mainWidget ); |
229 | 229 | ||
230 | QGridLayout *layout = new QGridLayout( control ); | 230 | QGridLayout *layout = new QGridLayout( control ); |
231 | layout->setSpacing( 2 ); | 231 | layout->setSpacing( 2 ); |
232 | layout->setMargin( 4 ); | 232 | layout->setMargin( 4 ); |
233 | 233 | ||
234 | /* | 234 | /* |
235 | QLabel *label = new QLabel( control ); | 235 | QLabel *label = new QLabel( control ); |
236 | label->setText( tr( "Graph type:" ) ); | 236 | label->setText( tr( "Graph type:" ) ); |
237 | layout->addWidget( label, 0, 0 ); | 237 | layout->addWidget( label, 0, 0 ); |
238 | graphList = new QComboBox( control ); | 238 | graphList = new QComboBox( control ); |
239 | graphList->insertItem( tr( "By category" ) ); | 239 | graphList->insertItem( tr( "By category" ) ); |
240 | graphList->insertItem( tr( "..." ) ); | 240 | graphList->insertItem( tr( "..." ) ); |
241 | graphList->insertItem( tr( "..." ) ); | 241 | graphList->insertItem( tr( "..." ) ); |
242 | layout->addWidget( graphList, 0, 1 ); | 242 | layout->addWidget( graphList, 0, 1 ); |
243 | */ | 243 | */ |
244 | 244 | ||
245 | QWidget *graphWidget = new QWidget( control ); | 245 | QWidget *graphWidget = new QWidget( control ); |
246 | QWhatsThis::add( graphWidget, tr( "Graph not implemented yet." ) ); | 246 | QWhatsThis::add( graphWidget, tr( "Graph not implemented yet." ) ); |
247 | layout->addMultiCellWidget( graphWidget, 0, 0, 0, 1 ); | 247 | layout->addMultiCellWidget( graphWidget, 0, 0, 0, 1 ); |
248 | graphWidget->setBackgroundMode( QWidget::PaletteBase ); | 248 | graphWidget->setBackgroundMode( QWidget::PaletteBase ); |
249 | 249 | ||
250 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Draw" ), control ); | 250 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "checkbook/drawbtn" ), tr( "Draw" ), control ); |
251 | QWhatsThis::add( btn, tr( "Click here to draw the graph." ) ); | 251 | QWhatsThis::add( btn, tr( "Click here to draw the graph." ) ); |
252 | connect( btn, SIGNAL( clicked() ), this, SLOT( slotDrawGraph() ) ); | 252 | connect( btn, SIGNAL( clicked() ), this, SLOT( slotDrawGraph() ) ); |
253 | layout->addWidget( btn, 1, 1 ); | 253 | layout->addWidget( btn, 1, 1 ); |
254 | 254 | ||
255 | return control; | 255 | return control; |
256 | } | 256 | } |
257 | 257 | ||
258 | void Checkbook::loadCheckbook() | 258 | void Checkbook::loadCheckbook() |
259 | { | 259 | { |
260 | transactions.clear(); | 260 | transactions.clear(); |
261 | 261 | ||
262 | Config config(filename, Config::File); | 262 | Config config(filename, Config::File); |
263 | 263 | ||
264 | // Load info | 264 | // Load info |
265 | config.setGroup( "Account" ); | 265 | config.setGroup( "Account" ); |
266 | nameEdit->setText( name ); | 266 | nameEdit->setText( name ); |
267 | QString temptext = config.readEntry( "Type" ); | 267 | QString temptext = config.readEntry( "Type" ); |
268 | int i = typeList->count(); | 268 | int i = typeList->count(); |
269 | while ( i > 0 ) | 269 | while ( i > 0 ) |
270 | { | 270 | { |
271 | i--; | 271 | i--; |
272 | typeList->setCurrentItem( i ); | 272 | typeList->setCurrentItem( i ); |
273 | if ( typeList->currentText() == temptext ) | 273 | if ( typeList->currentText() == temptext ) |
274 | { | 274 | { |
275 | break; | 275 | break; |
276 | } | 276 | } |
277 | } | 277 | } |
278 | bankEdit->setText( config.readEntry( "Bank", "" ) ); | 278 | bankEdit->setText( config.readEntry( "Bank", "" ) ); |
279 | acctNumEdit->setText( config.readEntry( "Number", "" ) ); | 279 | acctNumEdit->setText( config.readEntry( "Number", "" ) ); |
280 | pinNumEdit->setText( config.readEntry( "PINNumber", "" ) ); | 280 | pinNumEdit->setText( config.readEntry( "PINNumber", "" ) ); |
281 | balanceEdit->setText( config.readEntry( "Balance", "0.0" ) ); | 281 | balanceEdit->setText( config.readEntry( "Balance", "0.0" ) ); |
282 | notesEdit->setText( config.readEntry( "Notes", "" ) ); | 282 | notesEdit->setText( config.readEntry( "Notes", "" ) ); |
283 | 283 | ||
284 | bool ok; | 284 | bool ok; |
285 | currBalance = balanceEdit->text().toFloat( &ok ); | 285 | currBalance = balanceEdit->text().toFloat( &ok ); |
286 | startBalance = currBalance; | 286 | startBalance = currBalance; |
287 | 287 | ||
288 | // Load transactions | 288 | // Load transactions |
289 | TranInfo *tran; | 289 | TranInfo *tran; |
290 | QString trandesc = ""; | 290 | QString trandesc = ""; |
291 | float amount; | 291 | float amount; |
292 | QString stramount; | 292 | QString stramount; |
293 | for ( int i = 1; trandesc != QString::null; i++ ) | 293 | for ( int i = 1; trandesc != QString::null; i++ ) |
294 | { | 294 | { |
295 | tran = new TranInfo( config, i ); | 295 | tran = new TranInfo( config, i ); |
296 | trandesc = tran->desc(); | 296 | trandesc = tran->desc(); |
297 | if ( trandesc != QString::null ) | 297 | if ( trandesc != QString::null ) |
298 | { | 298 | { |
diff --git a/noncore/apps/checkbook/opie-checkbook.control b/noncore/apps/checkbook/opie-checkbook.control index f8e14ca..7bde1db 100644 --- a/noncore/apps/checkbook/opie-checkbook.control +++ b/noncore/apps/checkbook/opie-checkbook.control | |||
@@ -1,9 +1,9 @@ | |||
1 | Files: bin/checkbook apps/Applications/checkbook.desktop pics/checkbook/checkbook.png | 1 | Files: bin/checkbook apps/Applications/checkbook.desktop pics/checkbook |
2 | Priority: optional | 2 | Priority: optional |
3 | Section: applications | 3 | Section: applications |
4 | Maintainer: drw <drw@handhelds.org> | 4 | Maintainer: Dan Williams <williamsdr@acm.org> |
5 | Architecture: arm | 5 | Architecture: arm |
6 | Version: $QPE_VERSION-$SUB_VERSION | 6 | Version: $QPE_VERSION-$SUB_VERSION |
7 | Depends: opie-base ($QPE_VERSION), libopie ($QPE_VERSION) | 7 | Depends: opie-base ($QPE_VERSION), libopie ($QPE_VERSION) |
8 | Description: Checkbook keeping program. | 8 | Description: Checkbook keeping program. |
9 | The checkbook accounting program for the Opie environment. | 9 | The checkbook accounting program for the Opie environment. |