diff options
author | Saturneric <[email protected]> | 2023-03-31 08:28:09 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2023-03-31 08:28:09 +0000 |
commit | a9a809931209125034567c18245ccec936d2e991 (patch) | |
tree | bbe3fa53133d7df0f4eb0ab466d3a29fe6693bbd /src/ui/dialog/keypair_details/KeyPairOperaTab.cpp | |
parent | fix: solve some ui and logic issues in keymgt (diff) | |
download | GpgFrontend-a9a809931209125034567c18245ccec936d2e991.tar.gz GpgFrontend-a9a809931209125034567c18245ccec936d2e991.zip |
feat: improve ui when gnupg is offline
Diffstat (limited to '')
-rw-r--r-- | src/ui/dialog/keypair_details/KeyPairOperaTab.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ui/dialog/keypair_details/KeyPairOperaTab.cpp b/src/ui/dialog/keypair_details/KeyPairOperaTab.cpp index 59f3f7cf..9be77923 100644 --- a/src/ui/dialog/keypair_details/KeyPairOperaTab.cpp +++ b/src/ui/dialog/keypair_details/KeyPairOperaTab.cpp @@ -27,6 +27,7 @@ #include "KeyPairOperaTab.h" #include "KeySetExpireDateDialog.h" +#include "core/function/GlobalSettingStation.h" #include "core/function/gpg/GpgKeyImportExporter.h" #include "core/function/gpg/GpgKeyOpera.h" #include "ui/SignalStation.h" @@ -73,10 +74,23 @@ KeyPairOperaTab::KeyPairOperaTab(const std::string& key_id, QWidget* parent) } auto advance_h_box_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"); + } + auto* key_server_opera_button = new QPushButton(_("Key Server Operation (Pubkey)")); key_server_opera_button->setStyleSheet("text-align:center;"); key_server_opera_button->setMenu(key_server_opera_menu_); + key_server_opera_button->setDisabled(forbid_all_gnupg_connection); advance_h_box_layout->addWidget(key_server_opera_button); if (m_key_.IsPrivateKey() && m_key_.IsHasMasterKey()) { |