aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/main_window/MainWindowSlotFunction.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2021-08-23 08:20:19 +0000
committerSaturneric <[email protected]>2021-08-23 08:20:19 +0000
commitbe69cccea41c17214631529cd265476d31dc3406 (patch)
treed8d36c2a85b5d3ab89f2ce011b7b5ff3294bf1dc /src/ui/main_window/MainWindowSlotFunction.cpp
parentFunctions addition and improvement; (diff)
downloadGpgFrontend-be69cccea41c17214631529cd265476d31dc3406.tar.gz
GpgFrontend-be69cccea41c17214631529cd265476d31dc3406.zip
Improve the automatic key exchange function; fix some known problems;
Diffstat (limited to '')
-rw-r--r--src/ui/main_window/MainWindowSlotFunction.cpp35
1 files changed, 23 insertions, 12 deletions
diff --git a/src/ui/main_window/MainWindowSlotFunction.cpp b/src/ui/main_window/MainWindowSlotFunction.cpp
index 3d1d6f77..7c740595 100644
--- a/src/ui/main_window/MainWindowSlotFunction.cpp
+++ b/src/ui/main_window/MainWindowSlotFunction.cpp
@@ -287,7 +287,6 @@ void MainWindow::slotVerify() {
void MainWindow::slotEncryptSign() {
-
if (edit->tabCount() == 0) return;
if (edit->slotCurPageTextEdit() != nullptr) {
@@ -372,9 +371,7 @@ void MainWindow::slotEncryptSign() {
auto pubkeyUploader = PubkeyUploader(mCtx, signerKeys);
pubkeyUploader.start();
if(!pubkeyUploader.result()) {
- QMessageBox::warning(nullptr,
- tr("Warning"),
- tr("Automatic public key exchange failed."));
+
}
}
@@ -385,6 +382,8 @@ void MainWindow::slotEncryptSign() {
edit->slotFillTextEditWithText(*tmp2);
}
+ qDebug() << "Start Analyse Result";
+
auto resultAnalyseEncr = new EncryptResultAnalyse(error, encr_result);
auto resultAnalyseSign = new SignResultAnalyse(mCtx, error, sign_result);
int status = std::min(resultAnalyseEncr->getStatus(), resultAnalyseSign->getStatus());
@@ -452,6 +451,21 @@ void MainWindow::slotDecryptVerify() {
gpgme_decrypt_result_t d_result = nullptr;
gpgme_verify_result_t v_result = nullptr;
+ auto *dialog = new WaitingDialog(tr("Decrypting and Verifying"), this);
+
+ // Automatically import public keys that are not stored locally
+ if(settings.value("advanced/autoPubkeyExchange").toBool()) {
+ gpgme_verify_result_t tmp_v_result = nullptr;
+ auto thread = QThread::create([&]() {
+ mCtx->verify(&text, nullptr, &tmp_v_result);
+ });
+ thread->start();
+ while (thread->isRunning()) QApplication::processEvents();
+ auto* checker = new UnknownSignersChecker(mCtx, tmp_v_result);
+ checker->start();
+ checker->deleteLater();
+ }
+
gpgme_error_t error;
auto thread = QThread::create([&]() {
error = mCtx->decryptVerify(text, decrypted, &d_result, &v_result);
@@ -459,20 +473,14 @@ void MainWindow::slotDecryptVerify() {
connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
thread->start();
- auto *dialog = new WaitingDialog(tr("Decrypting and Verifying"), this);
while (thread->isRunning()) {
QApplication::processEvents();
}
- // Automatically import public keys that are not stored locally
- if(settings.value("advanced/autoPubkeyExchange").toBool()) {
- auto* checker = new UnknownSignersChecker(mCtx, v_result);
- checker->start();
- checker->deleteLater();
- }
-
dialog->close();
+ qDebug() << "Start Analyse Result";
+
infoBoard->associateTextEdit(edit->curTextPage());
if (gpgme_err_code(error) == GPG_ERR_NO_ERROR)
@@ -498,6 +506,9 @@ void MainWindow::slotDecryptVerify() {
}
delete resultAnalyseDecrypt;
delete resultAnalyseVerify;
+
+ qDebug() << "End Analyse Result";
+
} else if (edit->slotCurPageFileTreeView() != nullptr) {
this->slotFileDecryptVerify();
}