diff options
| author | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-10-03 20:06:13 +0200 |
|---|---|---|
| committer | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-10-03 20:13:06 +0200 |
| commit | 0fe36b45385da152a289acf7b429edd81287a125 (patch) | |
| tree | 3259243c1271fceac30d8527fde862b71a502056 /mainwindow.cpp | |
| parent | 4656d10d77256fb506a29f31363f87fcd90930bc (diff) | |
| download | src-0fe36b45385da152a289acf7b429edd81287a125.tar.gz src-0fe36b45385da152a289acf7b429edd81287a125.zip | |
Speicher Schlüssel nur, wenn Nutzer nicht Passwort abbricht
Diffstat (limited to 'mainwindow.cpp')
| -rw-r--r-- | mainwindow.cpp | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/mainwindow.cpp b/mainwindow.cpp index b1e2f4c..2901c04 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -121,16 +121,18 @@ void MainWindow::on_actionImport_triggered() if (!filename.isEmpty()) { PasswordDialog pwd; - pwd.exec(); - try + if (pwd.exec()) { - hybridcrypt.importUserKeypair(filename, pwd.getPassword()); - statusBar()->showMessage("Import war erfolgreich.", messageTimeout); - } - catch (CryptException e) - { - QMessageBox::critical(this, tr("Fehler beim Importieren"), e.what()); + try + { + hybridcrypt.importUserKeypair(filename, pwd.getPassword()); + statusBar()->showMessage("Import war erfolgreich.", messageTimeout); + } + catch (CryptException e) + { + QMessageBox::critical(this, tr("Fehler beim Importieren"), e.what()); + } } } } @@ -147,18 +149,18 @@ void MainWindow::on_actionExportMyKeypair_triggered() { PasswordDialog pwd; - pwd.exec(); - - try + if (pwd.exec()) { - hybridcrypt.exportUserKeypair(expoKeyFileName, pwd.getPassword()); - statusBar()->showMessage("Export war erflogreich.", messageTimeout); - } - catch (CryptException e) - { - QMessageBox::critical(this, tr("Fehler beim Exportieren"), e.what()); + try + { + hybridcrypt.exportUserKeypair(expoKeyFileName, pwd.getPassword()); + statusBar()->showMessage("Export war erflogreich.", messageTimeout); + } + catch (CryptException e) + { + QMessageBox::critical(this, tr("Fehler beim Exportieren"), e.what()); + } } - } } } |
