summaryrefslogtreecommitdiff
path: root/noncore/apps/checkbook/mainwindow.cpp
authordrw <drw>2002-11-30 22:51:39 (UTC)
committer drw <drw>2002-11-30 22:51:39 (UTC)
commit666313593479c03cdc88bd8fde926af181cb8423 (patch) (unidiff)
tree79f5334d7ec7918146469d567466607ebaea28a8 /noncore/apps/checkbook/mainwindow.cpp
parent2e2bbf823ba532f349ad9ca3dd84cf7f758f36b0 (diff)
downloadopie-666313593479c03cdc88bd8fde926af181cb8423.zip
opie-666313593479c03cdc88bd8fde926af181cb8423.tar.gz
opie-666313593479c03cdc88bd8fde926af181cb8423.tar.bz2
Checkbook password protection
Diffstat (limited to 'noncore/apps/checkbook/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/checkbook/mainwindow.cpp26
1 files changed, 22 insertions, 4 deletions
diff --git a/noncore/apps/checkbook/mainwindow.cpp b/noncore/apps/checkbook/mainwindow.cpp
index 567b8ad..2c0abf1 100644
--- a/noncore/apps/checkbook/mainwindow.cpp
+++ b/noncore/apps/checkbook/mainwindow.cpp
@@ -27,8 +27,10 @@
27*/ 27*/
28 28
29#include "mainwindow.h" 29#include "mainwindow.h"
30#include "password.h"
30#include "checkbook.h" 31#include "checkbook.h"
31 32
33#include <qpe/config.h>
32#include <qpe/global.h> 34#include <qpe/global.h>
33#include <qpe/qpeapplication.h> 35#include <qpe/qpeapplication.h>
34#include <qpe/qpemenubar.h> 36#include <qpe/qpemenubar.h>
@@ -105,7 +107,7 @@ MainWindow::MainWindow()
105 cbList->sort(); 107 cbList->sort();
106 cbList->setSelected( 0, TRUE ); 108 cbList->setSelected( 0, TRUE );
107 109
108 currencySymbol = '$'; 110 currencySymbol = "$";
109} 111}
110 112
111MainWindow::~MainWindow() 113MainWindow::~MainWindow()
@@ -127,6 +129,25 @@ void MainWindow::slotNew()
127void MainWindow::slotEdit() 129void MainWindow::slotEdit()
128{ 130{
129 QString currname = cbList->currentText(); 131 QString currname = cbList->currentText();
132
133 QString tempstr = cbDir;
134 tempstr.append( currname );
135 tempstr.append( ".qcb" );
136
137 Config config( tempstr, Config::File );
138 config.setGroup( "Account" );
139 QString password = config.readEntryCrypt( "Password", "" );
140 if ( password != "" )
141 {
142 Password *pw = new Password( this, tr( "Enter password" ), tr( "Please enter your password:" ) );
143 if ( pw->exec() != QDialog::Accepted || pw->password != password )
144 {
145 delete pw;
146 return;
147 }
148 delete pw;
149 }
150
130 Checkbook *currcb = new Checkbook( this, currname, cbDir, currencySymbol ); 151 Checkbook *currcb = new Checkbook( this, currname, cbDir, currencySymbol );
131 currcb->showMaximized(); 152 currcb->showMaximized();
132 if ( currcb->exec() == QDialog::Accepted ) 153 if ( currcb->exec() == QDialog::Accepted )
@@ -137,9 +158,6 @@ void MainWindow::slotEdit()
137 cbList->changeItem( newname, cbList->currentItem() ); 158 cbList->changeItem( newname, cbList->currentItem() );
138 cbList->sort(); 159 cbList->sort();
139 160
140 QString tempstr = cbDir;
141 tempstr.append( currname );
142 tempstr.append( ".qcb" );
143 QFile f( tempstr ); 161 QFile f( tempstr );
144 if ( f.exists() ) 162 if ( f.exists() )
145 { 163 {