diff options
author | saturneric <[email protected]> | 2023-12-03 07:28:41 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2023-12-03 07:28:41 +0000 |
commit | e0bc882bd46c40c86d9497fa043bbfe3e469888f (patch) | |
tree | 962b673899e4209ddd3504e975dcbac6758c496e /src/ui/main_window/MainWindowSlotUI.cpp | |
parent | feat: add buddled qt pinentry and make it works (diff) | |
download | GpgFrontend-e0bc882bd46c40c86d9497fa043bbfe3e469888f.tar.gz GpgFrontend-e0bc882bd46c40c86d9497fa043bbfe3e469888f.zip |
feat: introduce mimalloc to replace secmem
Diffstat (limited to 'src/ui/main_window/MainWindowSlotUI.cpp')
-rw-r--r-- | src/ui/main_window/MainWindowSlotUI.cpp | 50 |
1 files changed, 3 insertions, 47 deletions
diff --git a/src/ui/main_window/MainWindowSlotUI.cpp b/src/ui/main_window/MainWindowSlotUI.cpp index d640d337..65ead3ce 100644 --- a/src/ui/main_window/MainWindowSlotUI.cpp +++ b/src/ui/main_window/MainWindowSlotUI.cpp @@ -33,8 +33,7 @@ #include "core/GpgConstants.h" #include "core/function/CoreSignalStation.h" #include "core/function/GlobalSettingStation.h" -#include "pinentry/pinentrydialog.h" -#include "spdlog/spdlog.h" +#include "function/RaisePinentry.h" #include "ui/UserInterfaceUtils.h" #include "ui/dialog/Wizard.h" #include "ui/main_window/KeyMgmt.h" @@ -230,51 +229,8 @@ void MainWindow::SetCryptoMenuStatus( } void MainWindow::SlotRaisePinentry() { - auto* pinentry = - new PinEntryDialog(this, 0, 0, true, false, QString(), - QString::fromStdString(_("Show passphrase")), - QString::fromStdString(_("Hide passphrase"))); - - SPDLOG_DEBUG("setting pinetry's arguments"); - - pinentry->setPinentryInfo(new struct pinentry()); - pinentry->setPrompt(QString::fromStdString(_("PIN:"))); - pinentry->setDescription(QString()); - pinentry->setRepeatErrorText( - QString::fromStdString(_("Passphrases do not match"))); - pinentry->setGenpinLabel(QString()); - pinentry->setGenpinTT(QString()); - pinentry->setCapsLockHint(QString::fromStdString(_("Caps Lock is on"))); - pinentry->setFormattedPassphrase({false, QString()}); - pinentry->setConstraintsOptions({false, QString(), QString(), QString()}); - - pinentry->setWindowTitle(_("Pinentry")); - - /* If we reuse the same dialog window. */ - pinentry->setPin(QString()); - - pinentry->setOkText(_("Confirm")); - pinentry->setCancelText(_("Cancel")); - - SPDLOG_DEBUG("pinentry is ready to start"); - - connect(pinentry, &PinEntryDialog::finished, this, [pinentry](int result) { - bool ret = result != 0; - SPDLOG_DEBUG("PinEntryDialog finished, ret: {}", ret); - - if (!ret) { - emit CoreSignalStation::GetInstance()->SignalUserInputPassphraseCallback( - {}); - return -1; - } - - auto pin = pinentry->pin().toUtf8(); - emit CoreSignalStation::GetInstance()->SignalUserInputPassphraseCallback( - pin); - return 0; - }); - - pinentry->open(); + auto function = RaisePinentry(this); + function.Exec(); } } // namespace GpgFrontend::UI |