summaryrefslogtreecommitdiffstats
path: root/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mainwindow.cpp')
-rw-r--r--mainwindow.cpp76
1 files changed, 76 insertions, 0 deletions
diff --git a/mainwindow.cpp b/mainwindow.cpp
index 49d64fc..2f5c9e7 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -12,3 +12,79 @@ MainWindow::~MainWindow()
{
delete ui;
}
+
+
+void MainWindow::on_pushButtonDecrypt_clicked()
+{
+
+}
+
+void MainWindow::on_pushButtonEncrypt_clicked()
+{
+ PublicKeyImportDialog *temp = new PublicKeyImportDialog;
+
+ if (temp->exec()&&!ui->lineEditFilePath->isEnabled())
+ {
+ qDebug() << "Entschlüsseln möglich.";
+ // HybridCrypt::encrypt();
+ }
+ delete temp;
+
+}
+
+void MainWindow::on_pushButtonOpenFile_clicked()
+{
+ QString fielname = QFileDialog::getOpenFileName(this, "Datei öffnen",
+ "/home", tr("Datei(*)"));
+ ui->lineEditFilePath->setText(fielname);
+ qDebug() << fielname;
+
+}
+
+
+void MainWindow::on_actionImport_triggered()
+{
+ QString filename = readKeyFilename("Importiren eines Schlüsselpaares");
+
+ qDebug() << filename;
+
+ if (!filename.isEmpty())
+ {
+ QString password = readPassword();
+ qDebug() << password;
+ }
+
+}
+
+
+
+void MainWindow::on_actionClose_triggered()
+{
+ close();
+}
+
+void MainWindow::on_actionExportMyPublicKey_triggered()
+{
+
+}
+
+QString MainWindow::readKeyFilename(QString titel)
+{
+ return QFileDialog::getOpenFileName(this, titel,
+ "/home", tr("key(*.net *.der *.pem *.asc)"));
+}
+
+QString MainWindow::readPassword()
+{
+ PasswordDialog w;
+
+
+ if (w.exec())
+ {
+ return w.getPassword();
+ }
+ return "";
+}
+
+
+