summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/checkbook/checkbook.cpp4
-rw-r--r--noncore/apps/checkbook/configuration.cpp2
-rw-r--r--noncore/apps/checkbook/graph.cpp2
-rw-r--r--noncore/apps/checkbook/mainwindow.cpp3
-rw-r--r--noncore/apps/checkbook/password.cpp2
-rw-r--r--noncore/apps/checkbook/traninfo.h1
-rw-r--r--noncore/apps/checkbook/transaction.cpp5
7 files changed, 0 insertions, 19 deletions
diff --git a/noncore/apps/checkbook/checkbook.cpp b/noncore/apps/checkbook/checkbook.cpp
index 5fe660c..653ee4a 100644
--- a/noncore/apps/checkbook/checkbook.cpp
+++ b/noncore/apps/checkbook/checkbook.cpp
@@ -1,117 +1,113 @@
1/* 1/*
2                This file is part of the OPIE Project 2                This file is part of the OPIE Project
3 =. 3 =.
4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org> 4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org>
5           .>+-= 5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can 6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public 8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "checkbook.h" 29#include "checkbook.h"
30#include "cbinfo.h" 30#include "cbinfo.h"
31#include "transaction.h" 31#include "transaction.h"
32#include "traninfo.h" 32#include "traninfo.h"
33#include "graph.h" 33#include "graph.h"
34#include "graphinfo.h" 34#include "graphinfo.h"
35#include "password.h" 35#include "password.h"
36 36
37#include <opie/otabwidget.h> 37#include <opie/otabwidget.h>
38#include <qpe/config.h>
39#include <qpe/qpeapplication.h> 38#include <qpe/qpeapplication.h>
40#include <qpe/qpemessagebox.h> 39#include <qpe/qpemessagebox.h>
41#include <qpe/resource.h> 40#include <qpe/resource.h>
42 41
43#include <qcheckbox.h> 42#include <qcheckbox.h>
44#include <qcombobox.h> 43#include <qcombobox.h>
45#include <qfile.h>
46#include <qfontmetrics.h>
47#include <qlabel.h> 44#include <qlabel.h>
48#include <qlayout.h> 45#include <qlayout.h>
49#include <qlineedit.h> 46#include <qlineedit.h>
50#include <qmultilineedit.h> 47#include <qmultilineedit.h>
51#include <qpushbutton.h> 48#include <qpushbutton.h>
52#include <qwhatsthis.h> 49#include <qwhatsthis.h>
53#include <qwidget.h>
54 50
55Checkbook::Checkbook( QWidget *parent, CBInfo *i, const QString &symbol ) 51Checkbook::Checkbook( QWidget *parent, CBInfo *i, const QString &symbol )
56 : QDialog( parent, 0, TRUE, WStyle_ContextHelp ) 52 : QDialog( parent, 0, TRUE, WStyle_ContextHelp )
57{ 53{
58 info = i; 54 info = i;
59 currencySymbol = symbol; 55 currencySymbol = symbol;
60 56
61 if ( info->name() != "" ) 57 if ( info->name() != "" )
62 { 58 {
63 QString tempstr = info->name(); 59 QString tempstr = info->name();
64 tempstr.append( " - " ); 60 tempstr.append( " - " );
65 tempstr.append( tr( "Checkbook" ) ); 61 tempstr.append( tr( "Checkbook" ) );
66 setCaption( tempstr ); 62 setCaption( tempstr );
67 } 63 }
68 else 64 else
69 { 65 {
70 setCaption( tr( "New checkbook" ) ); 66 setCaption( tr( "New checkbook" ) );
71 } 67 }
72 68
73 // Setup layout to make everything pretty 69 // Setup layout to make everything pretty
74 QVBoxLayout *layout = new QVBoxLayout( this ); 70 QVBoxLayout *layout = new QVBoxLayout( this );
75 layout->setMargin( 2 ); 71 layout->setMargin( 2 );
76 layout->setSpacing( 4 ); 72 layout->setSpacing( 4 );
77 73
78 // Setup tabs for all info 74 // Setup tabs for all info
79 mainWidget = new OTabWidget( this ); 75 mainWidget = new OTabWidget( this );
80 layout->addWidget( mainWidget ); 76 layout->addWidget( mainWidget );
81 77
82 mainWidget->addTab( initInfo(), "checkbook/infotab", tr( "Info" ) ); 78 mainWidget->addTab( initInfo(), "checkbook/infotab", tr( "Info" ) );
83 mainWidget->addTab( initTransactions(), "checkbook/trantab", tr( "Transactions" ) ); 79 mainWidget->addTab( initTransactions(), "checkbook/trantab", tr( "Transactions" ) );
84 mainWidget->addTab( initCharts(), "checkbook/charttab", tr( "Charts" ) ); 80 mainWidget->addTab( initCharts(), "checkbook/charttab", tr( "Charts" ) );
85 mainWidget->setCurrentTab( tr( "Info" ) ); 81 mainWidget->setCurrentTab( tr( "Info" ) );
86 82
87 // Load checkbook information 83 // Load checkbook information
88 loadCheckbook(); 84 loadCheckbook();
89} 85}
90 86
91Checkbook::~Checkbook() 87Checkbook::~Checkbook()
92{ 88{
93} 89}
94 90
95QWidget *Checkbook::initInfo() 91QWidget *Checkbook::initInfo()
96{ 92{
97 QWidget *control = new QWidget( mainWidget ); 93 QWidget *control = new QWidget( mainWidget );
98 94
99 QVBoxLayout *vb = new QVBoxLayout( control ); 95 QVBoxLayout *vb = new QVBoxLayout( control );
100 96
101 QScrollView *sv = new QScrollView( control ); 97 QScrollView *sv = new QScrollView( control );
102 vb->addWidget( sv, 0, 0 ); 98 vb->addWidget( sv, 0, 0 );
103 sv->setResizePolicy( QScrollView::AutoOneFit ); 99 sv->setResizePolicy( QScrollView::AutoOneFit );
104 sv->setFrameStyle( QFrame::NoFrame ); 100 sv->setFrameStyle( QFrame::NoFrame );
105 101
106 QWidget *container = new QWidget( sv->viewport() ); 102 QWidget *container = new QWidget( sv->viewport() );
107 sv->addChild( container ); 103 sv->addChild( container );
108 104
109 QGridLayout *layout = new QGridLayout( container ); 105 QGridLayout *layout = new QGridLayout( container );
110 layout->setSpacing( 2 ); 106 layout->setSpacing( 2 );
111 layout->setMargin( 4 ); 107 layout->setMargin( 4 );
112 108
113 // Password protection 109 // Password protection
114 passwordCB = new QCheckBox( tr( "Password protect" ), container ); 110 passwordCB = new QCheckBox( tr( "Password protect" ), container );
115 QWhatsThis::add( passwordCB, tr( "Click here to enable/disable password protection of this checkbook." ) ); 111 QWhatsThis::add( passwordCB, tr( "Click here to enable/disable password protection of this checkbook." ) );
116 connect( passwordCB, SIGNAL( clicked() ), this, SLOT( slotPasswordClicked() ) ); 112 connect( passwordCB, SIGNAL( clicked() ), this, SLOT( slotPasswordClicked() ) );
117 layout->addMultiCellWidget( passwordCB, 0, 0, 0, 1 ); 113 layout->addMultiCellWidget( passwordCB, 0, 0, 0, 1 );
diff --git a/noncore/apps/checkbook/configuration.cpp b/noncore/apps/checkbook/configuration.cpp
index 37208da..7731cf3 100644
--- a/noncore/apps/checkbook/configuration.cpp
+++ b/noncore/apps/checkbook/configuration.cpp
@@ -1,76 +1,74 @@
1/* 1/*
2                This file is part of the OPIE Project 2                This file is part of the OPIE Project
3 =. 3 =.
4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org> 4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org>
5           .>+-= 5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can 6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public 8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "configuration.h" 29#include "configuration.h"
30 30
31#include <qcheckbox.h> 31#include <qcheckbox.h>
32#include <qfontmetrics.h>
33#include <qlabel.h> 32#include <qlabel.h>
34#include <qlayout.h> 33#include <qlayout.h>
35#include <qlineedit.h> 34#include <qlineedit.h>
36#include <qstring.h>
37#include <qwhatsthis.h> 35#include <qwhatsthis.h>
38 36
39Configuration::Configuration( QWidget *parent, const QString &cs, bool sl, bool sb ) 37Configuration::Configuration( QWidget *parent, const QString &cs, bool sl, bool sb )
40 : QDialog( parent, 0, TRUE, WStyle_ContextHelp ) 38 : QDialog( parent, 0, TRUE, WStyle_ContextHelp )
41{ 39{
42 setCaption( tr( "Configure Checkbook" ) ); 40 setCaption( tr( "Configure Checkbook" ) );
43 41
44 QFontMetrics fm = fontMetrics(); 42 QFontMetrics fm = fontMetrics();
45 int fh = fm.height(); 43 int fh = fm.height();
46 44
47 QGridLayout *layout = new QGridLayout( this ); 45 QGridLayout *layout = new QGridLayout( this );
48 layout->setSpacing( 4 ); 46 layout->setSpacing( 4 );
49 layout->setMargin( 4 ); 47 layout->setMargin( 4 );
50 48
51 QLabel *label = new QLabel( tr( "Enter currency symbol:" ), this ); 49 QLabel *label = new QLabel( tr( "Enter currency symbol:" ), this );
52 QWhatsThis::add( label, tr( "Enter your local currency symbol here." ) ); 50 QWhatsThis::add( label, tr( "Enter your local currency symbol here." ) );
53 label->setMaximumHeight( fh + 3 ); 51 label->setMaximumHeight( fh + 3 );
54 layout->addWidget( label, 0, 0 ); 52 layout->addWidget( label, 0, 0 );
55 53
56 symbolEdit = new QLineEdit( cs, this ); 54 symbolEdit = new QLineEdit( cs, this );
57 QWhatsThis::add( symbolEdit, tr( "Enter your local currency symbol here." ) ); 55 QWhatsThis::add( symbolEdit, tr( "Enter your local currency symbol here." ) );
58 symbolEdit->setMaximumHeight( fh + 5 ); 56 symbolEdit->setMaximumHeight( fh + 5 );
59 symbolEdit->setFocus(); 57 symbolEdit->setFocus();
60 layout->addWidget( symbolEdit, 0, 1 ); 58 layout->addWidget( symbolEdit, 0, 1 );
61 59
62 lockCB = new QCheckBox( tr( "Show whether checkbook is password\nprotected" ), this ); 60 lockCB = new QCheckBox( tr( "Show whether checkbook is password\nprotected" ), this );
63 QWhatsThis::add( lockCB, tr( "Click here to select whether or not the main window will display that the checkbook is protected with a password." ) ); 61 QWhatsThis::add( lockCB, tr( "Click here to select whether or not the main window will display that the checkbook is protected with a password." ) );
64 lockCB->setChecked( sl ); 62 lockCB->setChecked( sl );
65 layout->addMultiCellWidget( lockCB, 1, 1, 0, 1 ); 63 layout->addMultiCellWidget( lockCB, 1, 1, 0, 1 );
66 64
67 balCB = new QCheckBox( tr( "Show checkbook balances" ), this ); 65 balCB = new QCheckBox( tr( "Show checkbook balances" ), this );
68 QWhatsThis::add( balCB, tr( "Click here to select whether or not the main window will display the current balance for each checkbook." ) ); 66 QWhatsThis::add( balCB, tr( "Click here to select whether or not the main window will display the current balance for each checkbook." ) );
69 balCB->setMaximumHeight( fh + 5 ); 67 balCB->setMaximumHeight( fh + 5 );
70 balCB->setChecked( sb ); 68 balCB->setChecked( sb );
71 layout->addMultiCellWidget( balCB, 2, 2, 0, 1 ); 69 layout->addMultiCellWidget( balCB, 2, 2, 0, 1 );
72} 70}
73 71
74Configuration::~Configuration() 72Configuration::~Configuration()
75{ 73{
76} 74}
diff --git a/noncore/apps/checkbook/graph.cpp b/noncore/apps/checkbook/graph.cpp
index acdb846..389972e 100644
--- a/noncore/apps/checkbook/graph.cpp
+++ b/noncore/apps/checkbook/graph.cpp
@@ -1,97 +1,95 @@
1/* 1/*
2                This file is part of the OPIE Project 2                This file is part of the OPIE Project
3 =. 3 =.
4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org> 4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org>
5           .>+-= 5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can 6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public 8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "graph.h" 29#include "graph.h"
30#include "graphinfo.h" 30#include "graphinfo.h"
31 31
32#include <qcolor.h>
33#include <qfontmetrics.h>
34#include <qpainter.h> 32#include <qpainter.h>
35 33
36#include <math.h> 34#include <math.h>
37 35
38Graph::Graph( QWidget *parent, GraphInfo *d, const QString &name, int flags ) 36Graph::Graph( QWidget *parent, GraphInfo *d, const QString &name, int flags )
39 : QWidget( parent, name, flags ) 37 : QWidget( parent, name, flags )
40{ 38{
41 data = d; 39 data = d;
42 40
43 graph.setOptimization( QPixmap::BestOptim ); 41 graph.setOptimization( QPixmap::BestOptim );
44} 42}
45 43
46void Graph::setGraphInfo( GraphInfo *d ) 44void Graph::setGraphInfo( GraphInfo *d )
47{ 45{
48 data = d; 46 data = d;
49} 47}
50 48
51void Graph::drawGraph( bool regen ) 49void Graph::drawGraph( bool regen )
52{ 50{
53 if ( regen ) 51 if ( regen )
54 { 52 {
55 initGraph(); 53 initGraph();
56 } 54 }
57 QPainter p( this ); 55 QPainter p( this );
58 p.drawPixmap( 0, 0, graph ); 56 p.drawPixmap( 0, 0, graph );
59} 57}
60 58
61void Graph::paintEvent( QPaintEvent * ) 59void Graph::paintEvent( QPaintEvent * )
62{ 60{
63 drawGraph( FALSE ); 61 drawGraph( FALSE );
64} 62}
65 63
66void Graph::resizeEvent( QResizeEvent * ) 64void Graph::resizeEvent( QResizeEvent * )
67{ 65{
68 drawGraph( TRUE ); 66 drawGraph( TRUE );
69} 67}
70 68
71void Graph::initGraph() 69void Graph::initGraph()
72{ 70{
73 graph.resize( width(), height() ); 71 graph.resize( width(), height() );
74 graph.fill( QColor( 255, 255, 255 ) ); 72 graph.fill( QColor( 255, 255, 255 ) );
75 73
76 if ( !data ) 74 if ( !data )
77 { 75 {
78 return; 76 return;
79 } 77 }
80 78
81 // Any common stuff here (titles, ???) 79 // Any common stuff here (titles, ???)
82 80
83 switch ( data->graphType() ) 81 switch ( data->graphType() )
84 { 82 {
85 case GraphInfo::BarChart : 83 case GraphInfo::BarChart :
86 { 84 {
87 drawBarChart( width(), height(), data->maxValue() ); 85 drawBarChart( width(), height(), data->maxValue() );
88 } 86 }
89 break; 87 break;
90 case GraphInfo::PieChart : 88 case GraphInfo::PieChart :
91 { 89 {
92 drawPieChart( width(), height(), data->totalValue() ); 90 drawPieChart( width(), height(), data->totalValue() );
93 } 91 }
94 }; 92 };
95} 93}
96 94
97void Graph::drawBarChart( int width, int height, float max ) 95void Graph::drawBarChart( int width, int height, float max )
diff --git a/noncore/apps/checkbook/mainwindow.cpp b/noncore/apps/checkbook/mainwindow.cpp
index ab1ceef..6d1d7b9 100644
--- a/noncore/apps/checkbook/mainwindow.cpp
+++ b/noncore/apps/checkbook/mainwindow.cpp
@@ -1,113 +1,110 @@
1/* 1/*
2                This file is part of the OPIE Project 2                This file is part of the OPIE Project
3 =. 3 =.
4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org> 4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org>
5           .>+-= 5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can 6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public 8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "mainwindow.h" 29#include "mainwindow.h"
30#include "cbinfo.h" 30#include "cbinfo.h"
31#include "configuration.h" 31#include "configuration.h"
32#include "password.h" 32#include "password.h"
33#include "checkbook.h" 33#include "checkbook.h"
34 34
35#include <qpe/config.h> 35#include <qpe/config.h>
36#include <qpe/global.h> 36#include <qpe/global.h>
37#include <qpe/qpeapplication.h> 37#include <qpe/qpeapplication.h>
38#include <qpe/qpemenubar.h> 38#include <qpe/qpemenubar.h>
39#include <qpe/qpemessagebox.h> 39#include <qpe/qpemessagebox.h>
40#include <qpe/qpetoolbar.h> 40#include <qpe/qpetoolbar.h>
41#include <qpe/resource.h> 41#include <qpe/resource.h>
42 42
43#include <qaction.h> 43#include <qaction.h>
44#include <qcheckbox.h> 44#include <qcheckbox.h>
45#include <qdir.h> 45#include <qdir.h>
46#include <qlineedit.h> 46#include <qlineedit.h>
47#include <qlistview.h>
48#include <qpopupmenu.h>
49#include <qstring.h>
50#include <qwhatsthis.h> 47#include <qwhatsthis.h>
51 48
52MainWindow::MainWindow() 49MainWindow::MainWindow()
53 : QMainWindow( 0x0, 0x0, WStyle_ContextHelp ) 50 : QMainWindow( 0x0, 0x0, WStyle_ContextHelp )
54{ 51{
55 setCaption( tr( "Checkbook" ) ); 52 setCaption( tr( "Checkbook" ) );
56 53
57 cbDir = Global::applicationFileName( "checkbook", "" ); 54 cbDir = Global::applicationFileName( "checkbook", "" );
58 lockIcon = Resource::loadPixmap( "locked" ); 55 lockIcon = Resource::loadPixmap( "locked" );
59 56
60 // Load configuration options 57 // Load configuration options
61 Config config( "checkbook" ); 58 Config config( "checkbook" );
62 config.setGroup( "Config" ); 59 config.setGroup( "Config" );
63 currencySymbol = config.readEntry( "CurrencySymbol", "$" ); 60 currencySymbol = config.readEntry( "CurrencySymbol", "$" );
64 showLocks = config.readBoolEntry( "ShowLocks", FALSE ); 61 showLocks = config.readBoolEntry( "ShowLocks", FALSE );
65 showBalances = config.readBoolEntry( "ShowBalances", FALSE ); 62 showBalances = config.readBoolEntry( "ShowBalances", FALSE );
66 63
67 // Build menu and tool bars 64 // Build menu and tool bars
68 setToolBarsMovable( FALSE ); 65 setToolBarsMovable( FALSE );
69 66
70 QPEToolBar *bar = new QPEToolBar( this ); 67 QPEToolBar *bar = new QPEToolBar( this );
71 bar->setHorizontalStretchable( TRUE ); 68 bar->setHorizontalStretchable( TRUE );
72 QPEMenuBar *mb = new QPEMenuBar( bar ); 69 QPEMenuBar *mb = new QPEMenuBar( bar );
73 mb->setMargin( 0 ); 70 mb->setMargin( 0 );
74 QPopupMenu *popup = new QPopupMenu( this ); 71 QPopupMenu *popup = new QPopupMenu( this );
75 72
76 bar = new QPEToolBar( this ); 73 bar = new QPEToolBar( this );
77 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); 74 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 );
78 a->setWhatsThis( tr( "Click here to create a new checkbook.\n\nYou also can select New from the Checkbook menu." ) ); 75 a->setWhatsThis( tr( "Click here to create a new checkbook.\n\nYou also can select New from the Checkbook menu." ) );
79 connect( a, SIGNAL( activated() ), this, SLOT( slotNew() ) ); 76 connect( a, SIGNAL( activated() ), this, SLOT( slotNew() ) );
80 a->addTo( popup ); 77 a->addTo( popup );
81 a->addTo( bar ); 78 a->addTo( bar );
82 79
83 actionOpen = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ), QString::null, 80 actionOpen = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ), QString::null,
84 0, this, 0 ); 81 0, this, 0 );
85 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." ) ); 82 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." ) );
86 connect( actionOpen, SIGNAL( activated() ), this, SLOT( slotEdit() ) ); 83 connect( actionOpen, SIGNAL( activated() ), this, SLOT( slotEdit() ) );
87 actionOpen->addTo( popup ); 84 actionOpen->addTo( popup );
88 actionOpen->addTo( bar ); 85 actionOpen->addTo( bar );
89 86
90 actionDelete = new QAction( tr( "Delete" ), Resource::loadPixmap( "trash" ), QString::null, 87 actionDelete = new QAction( tr( "Delete" ), Resource::loadPixmap( "trash" ), QString::null,
91 0, this, 0 ); 88 0, this, 0 );
92 actionDelete->setWhatsThis( tr( "Select a checkbook and then click here delete it.\n\nYou also can select Delete from the Checkbook menu." ) ); 89 actionDelete->setWhatsThis( tr( "Select a checkbook and then click here delete it.\n\nYou also can select Delete from the Checkbook menu." ) );
93 connect( actionDelete, SIGNAL( activated() ), this, SLOT( slotDelete() ) ); 90 connect( actionDelete, SIGNAL( activated() ), this, SLOT( slotDelete() ) );
94 actionDelete->addTo( popup ); 91 actionDelete->addTo( popup );
95 actionDelete->addTo( bar ); 92 actionDelete->addTo( bar );
96 93
97 popup->insertSeparator(); 94 popup->insertSeparator();
98 95
99 a = new QAction( tr( "Configure" ), Resource::loadPixmap( "SettingsIcon" ), QString::null, 0, this, 0 ); 96 a = new QAction( tr( "Configure" ), Resource::loadPixmap( "SettingsIcon" ), QString::null, 0, this, 0 );
100 a->setWhatsThis( tr( "Click here to configure this app." ) ); 97 a->setWhatsThis( tr( "Click here to configure this app." ) );
101 connect( a, SIGNAL( activated() ), this, SLOT( slotConfigure() ) ); 98 connect( a, SIGNAL( activated() ), this, SLOT( slotConfigure() ) );
102 a->addTo( popup ); 99 a->addTo( popup );
103 a->addTo( bar ); 100 a->addTo( bar );
104 101
105 mb->insertItem( tr( "Checkbook" ), popup ); 102 mb->insertItem( tr( "Checkbook" ), popup );
106 103
107 // Load Checkbook selection list 104 // Load Checkbook selection list
108 checkbooks = new CBInfoList(); 105 checkbooks = new CBInfoList();
109 106
110 QDir checkdir( cbDir ); 107 QDir checkdir( cbDir );
111 if (checkdir.exists() == true) 108 if (checkdir.exists() == true)
112 { 109 {
113 QStringList cblist = checkdir.entryList( "*.qcb", QDir::Files|QDir::Readable|QDir::Writable, 110 QStringList cblist = checkdir.entryList( "*.qcb", QDir::Files|QDir::Readable|QDir::Writable,
diff --git a/noncore/apps/checkbook/password.cpp b/noncore/apps/checkbook/password.cpp
index 82020d5..f381271 100644
--- a/noncore/apps/checkbook/password.cpp
+++ b/noncore/apps/checkbook/password.cpp
@@ -1,99 +1,97 @@
1/* 1/*
2                This file is part of the OPIE Project 2                This file is part of the OPIE Project
3 =. 3 =.
4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org> 4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org>
5           .>+-= 5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can 6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public 8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "password.h" 29#include "password.h"
30 30
31#include <qlabel.h> 31#include <qlabel.h>
32#include <qlayout.h> 32#include <qlayout.h>
33#include <qlineedit.h> 33#include <qlineedit.h>
34#include <qpixmap.h>
35#include <qpushbutton.h> 34#include <qpushbutton.h>
36#include <qwidget.h>
37 35
38static const char* const showhideimage_data[] = { 36static const char* const showhideimage_data[] = {
39"16 16 2 1", 37"16 16 2 1",
40". c None", 38". c None",
41"# c #000000", 39"# c #000000",
42"................", 40"................",
43"...#...###...##.", 41"...#...###...##.",
44"..#.#..#..#.##..", 42"..#.#..#..#.##..",
45"..###..###.##...", 43"..###..###.##...",
46".#...#.#..##....", 44".#...#.#..##....",
47".#...#.#.##.....", 45".#...#.#.##.....",
48"........##.#..#.", 46"........##.#..#.",
49"..##...##...##..", 47"..##...##...##..",
50".#..#.###...##..", 48".#..#.###...##..",
51".#...##..#.#..#.", 49".#...##..#.#..#.",
52".#..##..........", 50".#..##..........",
53".#.##.#..#.#..#.", 51".#.##.#..#.#..#.",
54"..##...##...##..", 52"..##...##...##..",
55".##....##...##..", 53".##....##...##..",
56".#....#..#.#..#.", 54".#....#..#.#..#.",
57"................"}; 55"................"};
58 56
59Password::Password( QWidget *parent, const char *caption, const char *prompt ) 57Password::Password( QWidget *parent, const char *caption, const char *prompt )
60 : QDialog( parent, 0x0, TRUE, 0x0 ) 58 : QDialog( parent, 0x0, TRUE, 0x0 )
61{ 59{
62 setCaption( caption ); 60 setCaption( caption );
63 61
64 QGridLayout *layout = new QGridLayout( this ); 62 QGridLayout *layout = new QGridLayout( this );
65 layout->setSpacing( 2 ); 63 layout->setSpacing( 2 );
66 layout->setMargin( 4 ); 64 layout->setMargin( 4 );
67 65
68 QLabel *label = new QLabel( prompt, this ); 66 QLabel *label = new QLabel( prompt, this );
69 label->setAlignment( AlignLeft | AlignTop | WordBreak ); 67 label->setAlignment( AlignLeft | AlignTop | WordBreak );
70 layout->addMultiCellWidget( label, 0, 0, 0, 1 ); 68 layout->addMultiCellWidget( label, 0, 0, 0, 1 );
71 69
72 pw = new QLineEdit( this ); 70 pw = new QLineEdit( this );
73 pw->setEchoMode( QLineEdit::Password ); 71 pw->setEchoMode( QLineEdit::Password );
74 layout->addWidget( pw, 1, 0 ); 72 layout->addWidget( pw, 1, 0 );
75 73
76 QPixmap *pic = new QPixmap( ( const char** ) showhideimage_data ); 74 QPixmap *pic = new QPixmap( ( const char** ) showhideimage_data );
77 QPushButton *btn = new QPushButton( ( QIconSet ) *pic, QString::null, this ); 75 QPushButton *btn = new QPushButton( ( QIconSet ) *pic, QString::null, this );
78 btn->setMaximumSize( pic->width() + 10, pic->height() + 10 ); 76 btn->setMaximumSize( pic->width() + 10, pic->height() + 10 );
79 btn->setToggleButton( TRUE ); 77 btn->setToggleButton( TRUE );
80 connect( btn, SIGNAL( toggled( bool ) ), this, SLOT( slotTogglePassword( bool ) ) ); 78 connect( btn, SIGNAL( toggled( bool ) ), this, SLOT( slotTogglePassword( bool ) ) );
81 layout->addWidget( btn, 1, 1 ); 79 layout->addWidget( btn, 1, 1 );
82 80
83 password == ""; 81 password == "";
84} 82}
85 83
86Password::~Password() 84Password::~Password()
87{ 85{
88} 86}
89 87
90void Password::accept() 88void Password::accept()
91{ 89{
92 password = pw->text(); 90 password = pw->text();
93 QDialog::accept(); 91 QDialog::accept();
94} 92}
95 93
96void Password::slotTogglePassword( bool showPW ) 94void Password::slotTogglePassword( bool showPW )
97{ 95{
98 showPW ? pw->setEchoMode( QLineEdit::Normal ) : pw->setEchoMode( QLineEdit::Password ); 96 showPW ? pw->setEchoMode( QLineEdit::Normal ) : pw->setEchoMode( QLineEdit::Password );
99} 97}
diff --git a/noncore/apps/checkbook/traninfo.h b/noncore/apps/checkbook/traninfo.h
index 5f67262..f6c5cae 100644
--- a/noncore/apps/checkbook/traninfo.h
+++ b/noncore/apps/checkbook/traninfo.h
@@ -1,90 +1,89 @@
1/* 1/*
2                This file is part of the OPIE Project 2                This file is part of the OPIE Project
3 =. 3 =.
4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org> 4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org>
5           .>+-= 5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can 6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public 8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#ifndef TRANINFO_H 29#ifndef TRANINFO_H
30#define TRANINFO_H 30#define TRANINFO_H
31 31
32#include <qdatetime.h> 32#include <qdatetime.h>
33#include <qlist.h> 33#include <qlist.h>
34#include <qstring.h>
35 34
36class Config; 35class Config;
37 36
38class TranInfo 37class TranInfo
39{ 38{
40 public: 39 public:
41 TranInfo( int = 0, const QString & = 0x0, const QDate & = QDate::currentDate(), 40 TranInfo( int = 0, const QString & = 0x0, const QDate & = QDate::currentDate(),
42 bool = TRUE, const QString & = 0x0, const QString & = 0x0, 41 bool = TRUE, const QString & = 0x0, const QString & = 0x0,
43 float = 0.0, float = 0.0, 42 float = 0.0, float = 0.0,
44 const QString & = 0x0, const QString & = 0x0 ); 43 const QString & = 0x0, const QString & = 0x0 );
45 TranInfo( Config, int ); 44 TranInfo( Config, int );
46 45
47 int id() const { return i; } 46 int id() const { return i; }
48 const QString &desc() const { return d; } 47 const QString &desc() const { return d; }
49 const QDate &date() const { return td; } 48 const QDate &date() const { return td; }
50 const QString &datestr(); 49 const QString &datestr();
51 bool withdrawal()const { return w; } 50 bool withdrawal()const { return w; }
52 const QString &type() const { return t; } 51 const QString &type() const { return t; }
53 const QString &category()const { return c; } 52 const QString &category()const { return c; }
54 float amount() const { return a; } 53 float amount() const { return a; }
55 float fee() const { return f; } 54 float fee() const { return f; }
56 const QString &number()const { return cn; } 55 const QString &number()const { return cn; }
57 const QString &notes() const { return n; } 56 const QString &notes() const { return n; }
58 57
59 void setDesc( const QString &desc ) { d = desc; } 58 void setDesc( const QString &desc ) { d = desc; }
60 void setDate( const QDate &date ) { td = date; } 59 void setDate( const QDate &date ) { td = date; }
61 void setWithdrawal( bool withdrawal ) { w = withdrawal; } 60 void setWithdrawal( bool withdrawal ) { w = withdrawal; }
62 void setType( const QString &type ) { t = type; } 61 void setType( const QString &type ) { t = type; }
63 void setCategory( const QString &cat ){ c = cat; } 62 void setCategory( const QString &cat ){ c = cat; }
64 void setAmount( float amount ) { a = amount; } 63 void setAmount( float amount ) { a = amount; }
65 void setFee( float fee ) { f = fee; } 64 void setFee( float fee ) { f = fee; }
66 void setNumber( const QString &num ) { cn = num; } 65 void setNumber( const QString &num ) { cn = num; }
67 void setNotes( const QString &notes ) { n = notes; } 66 void setNotes( const QString &notes ) { n = notes; }
68 67
69 void write( Config *, int ); 68 void write( Config *, int );
70 69
71 private: 70 private:
72 int i; 71 int i;
73 QString d; 72 QString d;
74 QDate td; 73 QDate td;
75 bool w; 74 bool w;
76 QString t; 75 QString t;
77 QString c; 76 QString c;
78 float a; 77 float a;
79 float f; 78 float f;
80 QString cn; 79 QString cn;
81 QString n; 80 QString n;
82}; 81};
83 82
84class TranInfoList : public QList<TranInfo> 83class TranInfoList : public QList<TranInfo>
85{ 84{
86 protected: 85 protected:
87 int compareItems( QCollection::Item, QCollection::Item ); 86 int compareItems( QCollection::Item, QCollection::Item );
88}; 87};
89 88
90#endif 89#endif
diff --git a/noncore/apps/checkbook/transaction.cpp b/noncore/apps/checkbook/transaction.cpp
index 17be669..07d5ae1 100644
--- a/noncore/apps/checkbook/transaction.cpp
+++ b/noncore/apps/checkbook/transaction.cpp
@@ -1,109 +1,104 @@
1/* 1/*
2                This file is part of the OPIE Project 2                This file is part of the OPIE Project
3 =. 3 =.
4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org> 4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org>
5           .>+-= 5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can 6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public 8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "transaction.h" 29#include "transaction.h"
30#include "traninfo.h" 30#include "traninfo.h"
31 31
32#include <qpe/datebookmonth.h> 32#include <qpe/datebookmonth.h>
33#include <qpe/timestring.h>
34 33
35#include <qbuttongroup.h> 34#include <qbuttongroup.h>
36#include <qcombobox.h> 35#include <qcombobox.h>
37#include <qlabel.h> 36#include <qlabel.h>
38#include <qlayout.h> 37#include <qlayout.h>
39#include <qlineedit.h> 38#include <qlineedit.h>
40#include <qmultilineedit.h> 39#include <qmultilineedit.h>
41#include <qpopupmenu.h>
42#include <qpushbutton.h>
43#include <qradiobutton.h> 40#include <qradiobutton.h>
44#include <qscrollview.h>
45#include <qstring.h>
46#include <qwhatsthis.h> 41#include <qwhatsthis.h>
47 42
48Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *info, 43Transaction::Transaction( QWidget *parent, const QString &acctname, TranInfo *info,
49 const QString &symbol ) 44 const QString &symbol )
50 : QDialog( parent, 0, TRUE, WStyle_ContextHelp ) 45 : QDialog( parent, 0, TRUE, WStyle_ContextHelp )
51{ 46{
52 QString tempstr = tr( "Transaction for " ); 47 QString tempstr = tr( "Transaction for " );
53 tempstr.append( acctname ); 48 tempstr.append( acctname );
54 setCaption( tempstr ); 49 setCaption( tempstr );
55 50
56 tran = info; 51 tran = info;
57 currencySymbol = symbol; 52 currencySymbol = symbol;
58 53
59 QVBoxLayout *vb = new QVBoxLayout( this ); 54 QVBoxLayout *vb = new QVBoxLayout( this );
60 55
61 QScrollView *sv = new QScrollView( this ); 56 QScrollView *sv = new QScrollView( this );
62 vb->addWidget( sv, 0, 0 ); 57 vb->addWidget( sv, 0, 0 );
63 sv->setResizePolicy( QScrollView::AutoOneFit ); 58 sv->setResizePolicy( QScrollView::AutoOneFit );
64 sv->setFrameStyle( QFrame::NoFrame ); 59 sv->setFrameStyle( QFrame::NoFrame );
65 60
66 QWidget *container = new QWidget( sv->viewport() ); 61 QWidget *container = new QWidget( sv->viewport() );
67 sv->addChild( container ); 62 sv->addChild( container );
68 63
69 QGridLayout *layout = new QGridLayout( container ); 64 QGridLayout *layout = new QGridLayout( container );
70 layout->setSpacing( 2 ); 65 layout->setSpacing( 2 );
71 layout->setMargin( 4 ); 66 layout->setMargin( 4 );
72 67
73 // Withdrawal/Deposit 68 // Withdrawal/Deposit
74 QButtonGroup *btngrp = new QButtonGroup( container ); 69 QButtonGroup *btngrp = new QButtonGroup( container );
75 btngrp->setColumnLayout(0, Qt::Vertical ); 70 btngrp->setColumnLayout(0, Qt::Vertical );
76 btngrp->layout()->setSpacing( 0 ); 71 btngrp->layout()->setSpacing( 0 );
77 btngrp->layout()->setMargin( 0 ); 72 btngrp->layout()->setMargin( 0 );
78 btngrp->setMaximumWidth( 220 ); 73 btngrp->setMaximumWidth( 220 );
79 QGridLayout *layout2 = new QGridLayout( btngrp->layout() ); 74 QGridLayout *layout2 = new QGridLayout( btngrp->layout() );
80 layout2->setSpacing( 2 ); 75 layout2->setSpacing( 2 );
81 layout2->setMargin( 2 ); 76 layout2->setMargin( 2 );
82 withBtn = new QRadioButton( tr( "Withdrawal" ), btngrp ); 77 withBtn = new QRadioButton( tr( "Withdrawal" ), btngrp );
83 QWhatsThis::add( withBtn, tr( "Select whether the transaction is a withdrawal or deposit here." ) ); 78 QWhatsThis::add( withBtn, tr( "Select whether the transaction is a withdrawal or deposit here." ) );
84 layout2->addWidget( withBtn, 0, 0 ); 79 layout2->addWidget( withBtn, 0, 0 );
85 connect( withBtn, SIGNAL( clicked() ), this, SLOT( slotWithdrawalClicked() ) ); 80 connect( withBtn, SIGNAL( clicked() ), this, SLOT( slotWithdrawalClicked() ) );
86 depBtn = new QRadioButton( tr( "Deposit" ), btngrp ); 81 depBtn = new QRadioButton( tr( "Deposit" ), btngrp );
87 QWhatsThis::add( depBtn, tr( "Select whether the transaction is a withdrawal or deposit here." ) ); 82 QWhatsThis::add( depBtn, tr( "Select whether the transaction is a withdrawal or deposit here." ) );
88 layout2->addWidget( depBtn, 0, 1 ); 83 layout2->addWidget( depBtn, 0, 1 );
89 btngrp->setMaximumSize( 320, withBtn->height() ); 84 btngrp->setMaximumSize( 320, withBtn->height() );
90 connect( depBtn, SIGNAL( clicked() ), this, SLOT( slotDepositClicked() ) ); 85 connect( depBtn, SIGNAL( clicked() ), this, SLOT( slotDepositClicked() ) );
91 layout->addMultiCellWidget( btngrp, 0, 0, 0, 3 ); 86 layout->addMultiCellWidget( btngrp, 0, 0, 0, 3 );
92 87
93 // Date 88 // Date
94 QLabel *label = new QLabel( tr( "Date:" ), container ); 89 QLabel *label = new QLabel( tr( "Date:" ), container );
95 QWhatsThis::add( label, tr( "Select date of transaction here." ) ); 90 QWhatsThis::add( label, tr( "Select date of transaction here." ) );
96 layout->addWidget( label, 1, 0 ); 91 layout->addWidget( label, 1, 0 );
97 dateBtn = new QPushButton( TimeString::shortDate( QDate::currentDate() ), 92 dateBtn = new QPushButton( TimeString::shortDate( QDate::currentDate() ),
98 container ); 93 container );
99 QWhatsThis::add( dateBtn, tr( "Select date of transaction here." ) ); 94 QWhatsThis::add( dateBtn, tr( "Select date of transaction here." ) );
100 QPopupMenu *m1 = new QPopupMenu( container ); 95 QPopupMenu *m1 = new QPopupMenu( container );
101 datePicker = new DateBookMonth( m1, 0, TRUE ); 96 datePicker = new DateBookMonth( m1, 0, TRUE );
102 m1->insertItem( datePicker ); 97 m1->insertItem( datePicker );
103 dateBtn->setPopup( m1 ); 98 dateBtn->setPopup( m1 );
104 connect( datePicker, SIGNAL( dateClicked( int, int, int ) ), 99 connect( datePicker, SIGNAL( dateClicked( int, int, int ) ),
105 this, SLOT( slotDateChanged( int, int, int ) ) ); 100 this, SLOT( slotDateChanged( int, int, int ) ) );
106 layout->addWidget( dateBtn, 1, 1 ); 101 layout->addWidget( dateBtn, 1, 1 );
107 102
108 // Check number 103 // Check number
109 label = new QLabel( tr( "Number:" ), container ); 104 label = new QLabel( tr( "Number:" ), container );