diff options
Diffstat (limited to '')
-rw-r--r-- | src/ui/function/GpgOperaHelper.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/ui/function/GpgOperaHelper.cpp b/src/ui/function/GpgOperaHelper.cpp index f762996d..161db70e 100644 --- a/src/ui/function/GpgOperaHelper.cpp +++ b/src/ui/function/GpgOperaHelper.cpp @@ -28,10 +28,12 @@ #include "GpgOperaHelper.h" +#include "core/GpgModel.h" #include "core/function/gpg/GpgFileOpera.h" #include "core/function/result_analyse/GpgDecryptResultAnalyse.h" #include "core/function/result_analyse/GpgEncryptResultAnalyse.h" #include "core/function/result_analyse/GpgSignResultAnalyse.h" +#include "core/function/result_analyse/GpgVerifyResultAnalyse.h" #include "core/model/GpgDecryptResult.h" #include "core/model/GpgEncryptResult.h" #include "core/model/GpgSignResult.h" @@ -530,4 +532,24 @@ auto GpgOperaHelper::BuildOperasDecryptVerify( GpgBasicOperator::GetInstance(channel).DecryptVerify(buffer, callback); }); } + +void GpgOperaHelper::WaitForOpera(QWidget* parent, const QString& title, + const OperaWaitingCb& opera) { + QEventLoop looper; + QPointer<WaitingDialog> const dialog = new WaitingDialog(title, parent); + connect(dialog, &QDialog::finished, &looper, &QEventLoop::quit); + connect(dialog, &QDialog::finished, dialog, &QDialog::deleteLater); + dialog->show(); + + QTimer::singleShot(64, parent, [=]() { + opera([dialog]() { + if (dialog != nullptr) { + dialog->close(); + dialog->accept(); + } + }); + }); + + looper.exec(); +} } // namespace GpgFrontend::UI |