diff options
author | Saturneric <[email protected]> | 2021-12-14 17:49:05 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2021-12-14 17:49:05 +0000 |
commit | 66cd551c8ba7152d4af4aafca41b44d94a7f6bae (patch) | |
tree | ee1d44951edfd9d2c74186aedbc2d071b5ec1a28 /src/ui/main_window/MainWindowSlotFunction.cpp | |
parent | Modified Core to Optimization & Fixed Problem (diff) | |
download | GpgFrontend-66cd551c8ba7152d4af4aafca41b44d94a7f6bae.tar.gz GpgFrontend-66cd551c8ba7152d4af4aafca41b44d94a7f6bae.zip |
SMTP Support Added.
Diffstat (limited to 'src/ui/main_window/MainWindowSlotFunction.cpp')
-rw-r--r-- | src/ui/main_window/MainWindowSlotFunction.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/ui/main_window/MainWindowSlotFunction.cpp b/src/ui/main_window/MainWindowSlotFunction.cpp index 6f51bfcf..8ef66cfa 100644 --- a/src/ui/main_window/MainWindowSlotFunction.cpp +++ b/src/ui/main_window/MainWindowSlotFunction.cpp @@ -40,6 +40,7 @@ #include "gpg/function/GpgKeyImportExportor.h" #include "ui/UserInterfaceUtils.h" #include "ui/help/AboutDialog.h" +#include "ui/settings/GlobalSettingStation.h" #include "ui/widgets/SignersPicker.h" namespace GpgFrontend::UI { @@ -114,7 +115,16 @@ void MainWindow::slotEncrypt() { if (resultAnalyse.getStatus() >= 0) { infoBoard->resetOptionActionsMenu(); infoBoard->addOptionalAction("Send Mail", [this]() { - if (settings.value("sendMail/enable", false).toBool()) + bool smtp_enabled = false; + try { + smtp_enabled = + GlobalSettingStation::GetInstance().GetUISettings().lookup( + "smtp.enable"); + } catch (...) { + LOG(INFO) << "Reading smtp settings error"; + } + + if (smtp_enabled) new SendMailDialog(edit->curTextPage()->toPlainText(), this); else { QMessageBox::warning(nullptr, _("Function Disabled"), @@ -357,7 +367,15 @@ void MainWindow::slotEncryptSign() { #ifdef SMTP_SUPPORT infoBoard->resetOptionActionsMenu(); infoBoard->addOptionalAction("Send Mail", [this]() { - if (settings.value("sendMail/enable", false).toBool()) + bool smtp_enabled = false; + try { + smtp_enabled = + GlobalSettingStation::GetInstance().GetUISettings().lookup( + "smtp.enable"); + } catch (...) { + LOG(INFO) << "Reading smtp settings error"; + } + if (smtp_enabled) new SendMailDialog(edit->curTextPage()->toPlainText(), this); else { QMessageBox::warning(nullptr, _("Function Disabled"), |