author | drw <drw> | 2002-11-30 22:51:39 (UTC) |
---|---|---|
committer | drw <drw> | 2002-11-30 22:51:39 (UTC) |
commit | 666313593479c03cdc88bd8fde926af181cb8423 (patch) (side-by-side diff) | |
tree | 79f5334d7ec7918146469d567466607ebaea28a8 /noncore/apps/checkbook/mainwindow.cpp | |
parent | 2e2bbf823ba532f349ad9ca3dd84cf7f758f36b0 (diff) | |
download | opie-666313593479c03cdc88bd8fde926af181cb8423.zip opie-666313593479c03cdc88bd8fde926af181cb8423.tar.gz opie-666313593479c03cdc88bd8fde926af181cb8423.tar.bz2 |
Checkbook password protection
Diffstat (limited to 'noncore/apps/checkbook/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/checkbook/mainwindow.cpp | 26 |
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 @@ -29,4 +29,6 @@ #include "mainwindow.h" +#include "password.h" #include "checkbook.h" +#include <qpe/config.h> #include <qpe/global.h> @@ -107,3 +109,3 @@ MainWindow::MainWindow() - currencySymbol = '$'; + currencySymbol = "$"; } @@ -129,2 +131,21 @@ void MainWindow::slotEdit() QString currname = cbList->currentText(); + + QString tempstr = cbDir; + tempstr.append( currname ); + tempstr.append( ".qcb" ); + + Config config( tempstr, Config::File ); + config.setGroup( "Account" ); + QString password = config.readEntryCrypt( "Password", "" ); + if ( password != "" ) + { + Password *pw = new Password( this, tr( "Enter password" ), tr( "Please enter your password:" ) ); + if ( pw->exec() != QDialog::Accepted || pw->password != password ) + { + delete pw; + return; + } + delete pw; + } + Checkbook *currcb = new Checkbook( this, currname, cbDir, currencySymbol ); @@ -139,5 +160,2 @@ void MainWindow::slotEdit() - QString tempstr = cbDir; - tempstr.append( currname ); - tempstr.append( ".qcb" ); QFile f( tempstr ); |