aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/main_window/MainWindowSlotFunction.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2021-12-14 17:49:05 +0000
committerSaturneric <[email protected]>2021-12-14 17:49:05 +0000
commit66cd551c8ba7152d4af4aafca41b44d94a7f6bae (patch)
treeee1d44951edfd9d2c74186aedbc2d071b5ec1a28 /src/ui/main_window/MainWindowSlotFunction.cpp
parentModified Core to Optimization & Fixed Problem (diff)
downloadGpgFrontend-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.cpp22
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"),