aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/main_window/MainWindowSlotFunction.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2021-08-20 11:47:45 +0000
committerSaturneric <[email protected]>2021-08-20 11:47:45 +0000
commit2e27baf284fde00c5fc1d81e1f8bc891b8163766 (patch)
treeafe51202a3e615fcd9c5946f031099f4373332c0 /src/ui/main_window/MainWindowSlotFunction.cpp
parentBugs Fixed; (diff)
downloadGpgFrontend-2e27baf284fde00c5fc1d81e1f8bc891b8163766.tar.gz
GpgFrontend-2e27baf284fde00c5fc1d81e1f8bc891b8163766.zip
Improve Functions;
Bugs Fixed;
Diffstat (limited to 'src/ui/main_window/MainWindowSlotFunction.cpp')
-rw-r--r--src/ui/main_window/MainWindowSlotFunction.cpp28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/ui/main_window/MainWindowSlotFunction.cpp b/src/ui/main_window/MainWindowSlotFunction.cpp
index d6f1e880..d31ef73b 100644
--- a/src/ui/main_window/MainWindowSlotFunction.cpp
+++ b/src/ui/main_window/MainWindowSlotFunction.cpp
@@ -24,6 +24,7 @@
#include "MainWindow.h"
#include "ui/SendMailDialog.h"
+#include "ui/widgets/SignersPicker.h"
/**
@@ -154,7 +155,7 @@ void MainWindow::slotSign() {
infoBoard->associateTextEdit(edit->curTextPage());
edit->slotFillTextEditWithText(QString::fromUtf8(*tmp));
- auto resultAnalyse = new SignResultAnalyse(error, result);
+ auto resultAnalyse = new SignResultAnalyse(mCtx, error, result);
auto &reportText = resultAnalyse->getResultReport();
if (resultAnalyse->getStatus() < 0)
@@ -328,13 +329,33 @@ void MainWindow::slotEncryptSign() {
tr("None of the selected key pairs can provide the signature function."));
}
+ QVector<GpgKey> signerKeys;
+
+ auto signersPicker = new SignersPicker(mCtx, this);
+
+ QEventLoop loop;
+ connect(signersPicker, SIGNAL(accepted()), &loop, SLOT(quit()));
+ loop.exec();
+
+ signersPicker->getCheckedSigners(signerKeys);
+
+ for(const auto &key : keys) {
+ qDebug() << "Keys " << key.email;
+ }
+
+ for(const auto &signer : signerKeys) {
+ qDebug() << "Signers " << signer.email;
+ }
+
+
auto *tmp = new QByteArray();
gpgme_encrypt_result_t encr_result = nullptr;
gpgme_sign_result_t sign_result = nullptr;
gpgme_error_t error;
auto thread = QThread::create([&]() {
- error = mCtx->encryptSign(keys, edit->curTextPage()->toPlainText().toUtf8(), tmp, &encr_result,
+ error = mCtx->encryptSign(keys, signerKeys, edit->curTextPage()->toPlainText().toUtf8(), tmp,
+ &encr_result,
&sign_result);
});
connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
@@ -353,7 +374,7 @@ void MainWindow::slotEncryptSign() {
}
auto resultAnalyseEncr = new EncryptResultAnalyse(error, encr_result);
- auto resultAnalyseSign = new SignResultAnalyse(error, sign_result);
+ auto resultAnalyseSign = new SignResultAnalyse(mCtx, error, sign_result);
int status = std::min(resultAnalyseEncr->getStatus(), resultAnalyseSign->getStatus());
auto reportText = resultAnalyseEncr->getResultReport() + resultAnalyseSign->getResultReport();
@@ -523,7 +544,6 @@ void MainWindow::uploadKeyToServer() {
}
-
void MainWindow::slotOpenFile(QString &path) {
edit->slotOpenFile(path);
}