summaryrefslogtreecommitdiff
path: root/noncore/apps/checkbook/mainwindow.cpp
Unidiff
Diffstat (limited to 'noncore/apps/checkbook/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/checkbook/mainwindow.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/apps/checkbook/mainwindow.cpp b/noncore/apps/checkbook/mainwindow.cpp
index bf00102..25f9910 100644
--- a/noncore/apps/checkbook/mainwindow.cpp
+++ b/noncore/apps/checkbook/mainwindow.cpp
@@ -21,97 +21,97 @@
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#include "listedit.h" 34#include "listedit.h"
35 35
36#include <qpe/config.h> 36#include <qpe/config.h>
37#include <qpe/global.h> 37#include <qpe/global.h>
38#include <qpe/qpeapplication.h> 38#include <qpe/qpeapplication.h>
39#include <qpe/qpemenubar.h> 39#include <qpe/qpemenubar.h>
40#include <qpe/qpemessagebox.h> 40#include <qpe/qpemessagebox.h>
41#include <qpe/qpetoolbar.h> 41#include <qpe/qpetoolbar.h>
42#include <qpe/resource.h> 42#include <qpe/resource.h>
43 43
44#include <qaction.h> 44#include <qaction.h>
45#include <qcheckbox.h> 45#include <qcheckbox.h>
46#include <qdir.h> 46#include <qdir.h>
47#include <qlineedit.h> 47#include <qlineedit.h>
48#include <qwhatsthis.h> 48#include <qwhatsthis.h>
49 49
50 50
51MainWindow::MainWindow( QWidget* parent, const char* name, WFlags fl ) 51MainWindow::MainWindow( QWidget* parent, const char* name, WFlags fl )
52 : QMainWindow( parent, name, fl || WStyle_ContextHelp ) 52 : QMainWindow( parent, name, fl || WStyle_ContextHelp )
53{ 53{
54 setCaption( tr( "Checkbook" ) ); 54 setCaption( tr( "Checkbook" ) );
55 55
56 cbDir = Global::applicationFileName( "checkbook", "" ); 56 cbDir = Global::applicationFileName( "checkbook", "" );
57 lockIcon = Resource::loadPixmap( "locked" ); 57 lockIcon = Resource::loadPixmap( "locked" );
58 58
59 // Load configuration options 59 // Load configuration options
60 Config config( "checkbook" ); 60 Config config( "checkbook" );
61 _cfg.readConfig( config ); 61 _cfg.readConfig( config );
62 62
63 63
64 // Build menu and tool bars 64 // Build menu and tool bars
65 setToolBarsMovable( FALSE ); 65 setToolBarsMovable( FALSE );
66 66
67 QPEToolBar *bar = new QPEToolBar( this ); 67 QPEToolBar *bar = new QPEToolBar( this );
68 bar->setHorizontalStretchable( TRUE ); 68 bar->setHorizontalStretchable( TRUE );
69 QPEMenuBar *mb = new QPEMenuBar( bar ); 69 QMenuBar *mb = new QMenuBar( bar );
70 mb->setMargin( 0 ); 70 mb->setMargin( 0 );
71 QPopupMenu *popup = new QPopupMenu( this ); 71 QPopupMenu *popup = new QPopupMenu( this );
72 72
73 bar = new QPEToolBar( this ); 73 bar = new QPEToolBar( this );
74 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 );
75 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." ) );
76 connect( a, SIGNAL( activated() ), this, SLOT( slotNew() ) ); 76 connect( a, SIGNAL( activated() ), this, SLOT( slotNew() ) );
77 a->addTo( popup ); 77 a->addTo( popup );
78 a->addTo( bar ); 78 a->addTo( bar );
79 79
80 actionOpen = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ), QString::null, 80 actionOpen = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ), QString::null,
81 0, this, 0 ); 81 0, this, 0 );
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." ) ); 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." ) );
83 connect( actionOpen, SIGNAL( activated() ), this, SLOT( slotEdit() ) ); 83 connect( actionOpen, SIGNAL( activated() ), this, SLOT( slotEdit() ) );
84 actionOpen->addTo( popup ); 84 actionOpen->addTo( popup );
85 actionOpen->addTo( bar ); 85 actionOpen->addTo( bar );
86 86
87 actionDelete = new QAction( tr( "Delete" ), Resource::loadPixmap( "trash" ), QString::null, 87 actionDelete = new QAction( tr( "Delete" ), Resource::loadPixmap( "trash" ), QString::null,
88 0, this, 0 ); 88 0, this, 0 );
89 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." ) );
90 connect( actionDelete, SIGNAL( activated() ), this, SLOT( slotDelete() ) ); 90 connect( actionDelete, SIGNAL( activated() ), this, SLOT( slotDelete() ) );
91 actionDelete->addTo( popup ); 91 actionDelete->addTo( popup );
92 actionDelete->addTo( bar ); 92 actionDelete->addTo( bar );
93 93
94 popup->insertSeparator(); 94 popup->insertSeparator();
95 95
96 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 );
97 a->setWhatsThis( tr( "Click here to configure this app." ) ); 97 a->setWhatsThis( tr( "Click here to configure this app." ) );
98 connect( a, SIGNAL( activated() ), this, SLOT( slotConfigure() ) ); 98 connect( a, SIGNAL( activated() ), this, SLOT( slotConfigure() ) );
99 a->addTo( popup ); 99 a->addTo( popup );
100 a->addTo( bar ); 100 a->addTo( bar );
101 101
102 mb->insertItem( tr( "Checkbook" ), popup ); 102 mb->insertItem( tr( "Checkbook" ), popup );
103 103
104 // Load Checkbook selection list 104 // Load Checkbook selection list
105 checkbooks = new CBInfoList(); 105 checkbooks = new CBInfoList();
106 106
107 QDir checkdir( cbDir ); 107 QDir checkdir( cbDir );
108 if (checkdir.exists() == true) 108 if (checkdir.exists() == true)
109 { 109 {
110 QStringList cblist = checkdir.entryList( "*.qcb", QDir::Files|QDir::Readable|QDir::Writable, 110 QStringList cblist = checkdir.entryList( "*.qcb", QDir::Files|QDir::Readable|QDir::Writable,
111 QDir::Time ); 111 QDir::Time );
112 CBInfo *cb = 0x0; 112 CBInfo *cb = 0x0;
113 QString filename; 113 QString filename;
114 114
115 for ( QStringList::Iterator it = cblist.begin(); it != cblist.end(); it++ ) 115 for ( QStringList::Iterator it = cblist.begin(); it != cblist.end(); it++ )
116 { 116 {
117 filename = cbDir; 117 filename = cbDir;