summaryrefslogtreecommitdiffstats
path: root/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mainwindow.cpp')
-rw-r--r--mainwindow.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/mainwindow.cpp b/mainwindow.cpp
index a4f45f0..c670f0d 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -27,11 +27,13 @@ void MainWindow::on_pushButtonDecrypt_clicked()
QMessageBox::information(this, tr("Kein Datei ausgewählt"),
tr("Sie haben keine Datei eingegen die Entschlüsselt werden soll."));
ui->lineEditFilePath->setFocus();
- out = QFileDialog::getSaveFileName(this,
- tr("Speicherort für Entschlüsseltedatei"), tr("Alle Datein"));
}
else
{
+ out = QFileDialog::getSaveFileName(this,
+ tr("Speicherort für Entschlüsseltedatei"), QDir::homePath(),
+ tr("Alle Datein"));
+
if (out.isEmpty())
{
QMessageBox::warning(this, tr("Keine Seicherort ausgefählt"),
@@ -50,8 +52,22 @@ void MainWindow::on_pushButtonDecrypt_clicked()
}
}
}
+ else
+ {
+ QMessageBox::information(this, tr("Kein Schlüssel Importirt"),
+ tr("Bitte Importiren Sie ihr Schlüsselpaar"));
+ // Versuche ein Schlüssel zu Importiren.
+ on_actionImport_triggered();
+
+ // wenn das erfolgreich war versuche erneut zu entschlüsseln.
+ if (hybridcrypt.isUserKeyInitialised())
+ {
+ on_pushButtonDecrypt_clicked();
+ }
+ }
}
+
void MainWindow::on_pushButtonEncrypt_clicked()
{
PublicKeyImportDialog publicKeyImport;
@@ -87,6 +103,7 @@ void MainWindow::on_pushButtonEncrypt_clicked()
void MainWindow::on_pushButtonOpenFile_clicked()
{
QString fielname = QFileDialog::getOpenFileName(this, tr("Datei Öffnen"),
+ QDir::homePath(),
tr("Alle Datein"));
ui->lineEditFilePath->setText(fielname);
}
@@ -97,7 +114,8 @@ void MainWindow::on_actionImport_triggered()
{
// nur für pem und der
QString filename = QFileDialog::getOpenFileName(this,
- tr("Schlüssel Datei für Import."), tr("Schlüssel Datei (*.pem,*.der)"));
+ tr("Schlüssel Datei für Import."), QDir::homePath(),
+ tr("Schlüssel Datei (*.pem,*.der)"));
if (!filename.isEmpty())
{