diff options
author | Saturn&Eric <[email protected]> | 2023-03-31 21:27:08 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2023-03-31 21:27:08 +0000 |
commit | 3cb863592a548edc074dde045493e0f83e5d694a (patch) | |
tree | 242534c257e723f49080428db22118c75706e233 /src/ui/dialog/import_export/KeyServerImportDialog.cpp | |
parent | Merge pull request #91 from saturneric/dev/2.0.10/main (diff) | |
parent | feat: add project security document (diff) | |
download | GpgFrontend-2.1.0.tar.gz GpgFrontend-2.1.0.zip |
Merge pull request #93 from saturneric/dev/2.0.10/mainv2.1.0
Develop 2.1.0.2
Diffstat (limited to 'src/ui/dialog/import_export/KeyServerImportDialog.cpp')
-rw-r--r-- | src/ui/dialog/import_export/KeyServerImportDialog.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/ui/dialog/import_export/KeyServerImportDialog.cpp b/src/ui/dialog/import_export/KeyServerImportDialog.cpp index 713c5a58..5692f607 100644 --- a/src/ui/dialog/import_export/KeyServerImportDialog.cpp +++ b/src/ui/dialog/import_export/KeyServerImportDialog.cpp @@ -47,6 +47,23 @@ KeyServerImportDialog::KeyServerImportDialog(bool automatic, QWidget* parent) // Layout for messagebox auto* message_layout = new QHBoxLayout(); + // get settings + auto& settings = GlobalSettingStation::GetInstance().GetUISettings(); + // read settings + bool forbid_all_gnupg_connection = false; + try { + forbid_all_gnupg_connection = + settings.lookup("network.forbid_all_gnupg_connection"); + } catch (...) { + SPDLOG_ERROR("setting operation error: forbid_all_gnupg_connection"); + } + + if (forbid_all_gnupg_connection) { + QMessageBox::critical(this, "Forbidden", "GnuPG is in offline mode now."); + this->close(); + this->deleteLater(); + } + if (automatic) { setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint); } else { @@ -249,6 +266,10 @@ void KeyServerImportDialog::slot_search() { Thread::TaskRunnerGetter::GetInstance() .GetTaskRunner(Thread::TaskRunnerGetter::kTaskRunnerType_Network) ->PostTask(task); + + QEventLoop loop; + connect(task, &Thread::Task::SignalTaskEnd, &loop, &QEventLoop::quit); + loop.exec(); } void KeyServerImportDialog::slot_search_finished( |