aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/UserInterfaceUtils.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2022-05-07 17:01:29 +0000
committerSaturneric <[email protected]>2022-05-07 17:01:29 +0000
commitf1a2ce4bcb7d46981d1fc471e517709f076d9365 (patch)
treee9d42769dccaf452ba14394e0e0fe574fcd086dd /src/ui/UserInterfaceUtils.cpp
parentfix: add openssl dependency for windows ci (diff)
downloadGpgFrontend-f1a2ce4bcb7d46981d1fc471e517709f076d9365.tar.gz
GpgFrontend-f1a2ce4bcb7d46981d1fc471e517709f076d9365.zip
refactor: develop 2.0.6 start
1. delete smtp ability 2. change libs link type to dramatic
Diffstat (limited to 'src/ui/UserInterfaceUtils.cpp')
-rw-r--r--src/ui/UserInterfaceUtils.cpp39
1 files changed, 7 insertions, 32 deletions
diff --git a/src/ui/UserInterfaceUtils.cpp b/src/ui/UserInterfaceUtils.cpp
index 8353d28b..52b7eb28 100644
--- a/src/ui/UserInterfaceUtils.cpp
+++ b/src/ui/UserInterfaceUtils.cpp
@@ -30,13 +30,11 @@
#include <utility>
+#include "core/common/CoreCommonUtil.h"
#include "core/function/FileOperator.h"
-#include "core/function/result_analyse/GpgResultAnalyse.h"
+#include "core/function/GlobalSettingStation.h"
#include "ui/SignalStation.h"
#include "ui/dialog/WaitingDialog.h"
-#include "ui/mail/SendMailDialog.h"
-#include "core/function/GlobalSettingStation.h"
-#include "ui/widgets/InfoBoardWidget.h"
#include "ui/widgets/TextEdit.h"
namespace GpgFrontend::UI {
@@ -44,31 +42,6 @@ namespace GpgFrontend::UI {
std::unique_ptr<GpgFrontend::UI::CommonUtils>
GpgFrontend::UI::CommonUtils::instance_ = nullptr;
-#ifdef SMTP_SUPPORT
-void send_an_email(QWidget *parent, InfoBoardWidget *info_board,
- const QString &text, bool attach_signature) {
- info_board->AddOptionalAction(_("Send Encrypted Mail"), [=]() {
- bool smtp_enabled = false;
- try {
- smtp_enabled = GlobalSettingStation::GetInstance().GetUISettings().lookup(
- "smtp.enable");
- } catch (...) {
- LOG(INFO) << "Reading smtp settings error";
- }
- if (smtp_enabled) {
- auto dialog = new SendMailDialog(text, parent);
- dialog->SetContentEncryption(false);
- dialog->SetAttachSignature(attach_signature);
- dialog->show();
- } else {
- QMessageBox::warning(nullptr, _("Function Disabled"),
- _("Please go to the settings interface to "
- "enable and configure this function."));
- }
- });
-}
-#endif
-
void show_verify_details(QWidget *parent, InfoBoardWidget *info_board,
GpgError error, const GpgVerifyResult &verify_result) {
// take out result
@@ -156,6 +129,8 @@ CommonUtils *CommonUtils::GetInstance() {
}
CommonUtils::CommonUtils() : QWidget(nullptr) {
+ connect(CoreCommonUtil::GetInstance(), &CoreCommonUtil::SignalGnupgNotInstall,
+ this, &CommonUtils::SignalGnupgNotInstall);
connect(this, &CommonUtils::SignalKeyStatusUpdated,
SignalStation::GetInstance(),
&SignalStation::SignalKeyDatabaseRefresh);
@@ -252,7 +227,7 @@ void CommonUtils::SlotExecuteGpgCommand(
}
void CommonUtils::SlotImportKeyFromKeyServer(
- int ctx_channel, const KeyIdArgsList &key_ids,
+ const KeyIdArgsList &key_ids,
const ImportCallbackFunctiopn &callback) {
std::string target_keyserver;
if (target_keyserver.empty()) {
@@ -274,7 +249,7 @@ void CommonUtils::SlotImportKeyFromKeyServer(
}
auto thread =
- QThread::create([target_keyserver, key_ids, callback, ctx_channel]() {
+ QThread::create([target_keyserver, key_ids, callback]() {
QUrl target_keyserver_url(target_keyserver.c_str());
auto network_manager = std::make_unique<QNetworkAccessManager>();
@@ -323,7 +298,7 @@ void CommonUtils::SlotImportKeyFromKeyServer(
// Try importing
GpgImportInformation result =
- GpgKeyImportExporter::GetInstance(ctx_channel)
+ GpgKeyImportExporter::GetInstance()
.ImportKey(std::move(key_data_ptr));
if (result.imported == 1) {