GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
SettingsKeyServer.h
1 
29 #ifndef GPGFRONTEND_SETTINGSKEYSERVER_H
30 #define GPGFRONTEND_SETTINGSKEYSERVER_H
31 
32 #include "ui/GpgFrontendUI.h"
33 
34 class Ui_KeyServerSettings;
35 
36 namespace GpgFrontend::UI {
41 class KeyserverTab : public QWidget {
42  Q_OBJECT
43 
44  public:
50  explicit KeyserverTab(QWidget* parent = nullptr);
51 
56  void SetSettings();
57 
62  void ApplySettings();
63 
64  private:
65  std::shared_ptr<Ui_KeyServerSettings> ui_;
66  QString default_key_server_;
67  QStringList key_server_str_list_;
68  QMenu* popup_menu_{};
69 
70  QRegularExpression url_reg_{
71  R"(^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)$)"};
72 
73  private slots:
74 
79  void slot_add_key_server();
80 
85  void slot_refresh_table();
86 
91  void slot_test_listed_key_server();
92 
93  signals:
99  void SignalRestartNeeded(bool needed);
100 
101  protected:
107  void contextMenuEvent(QContextMenuEvent* event) override;
108 };
109 } // namespace GpgFrontend::UI
110 
111 #endif // GPGFRONTEND_SETTINGSKEYSERVER_H
GpgFrontend::UI::KeyserverTab::SignalRestartNeeded
void SignalRestartNeeded(bool needed)
GpgFrontend::UI
Definition: FileReadTask.cpp:31
GpgFrontend::SingletonFunctionObject< GlobalSettingStation >::GetInstance
static GlobalSettingStation & GetInstance(int channel=GpgFrontend::GPGFRONTEND_DEFAULT_CHANNEL)
Get the Instance object.
Definition: GpgFunctionObject.h:181
GpgFrontend::UI::KeyserverTab::contextMenuEvent
void contextMenuEvent(QContextMenuEvent *event) override
Definition: SettingsKeyServer.cpp:291
GpgFrontend::UI::KeyserverTab
Definition: SettingsKeyServer.h:41
GpgFrontend::GlobalSettingStation::GetUISettings
libconfig::Setting & GetUISettings() noexcept
Definition: GlobalSettingStation.h:68
GpgFrontend::UI::SettingsObject::Check
nlohmann::json & Check(const std::string &key, const nlohmann::json &default_value)
Definition: SettingsObject.cpp:31
GpgFrontend::UI::SettingsObject
The SettingsObject class This class is used to store settings for the application securely.
Definition: SettingsObject.h:43
GpgFrontend::UI::ListedKeyServerTestThread
Definition: ListedKeyServerTestThread.h:38
GpgFrontend::UI::KeyserverTab::KeyserverTab
KeyserverTab(QWidget *parent=nullptr)
Construct a new Keyserver Tab object.
Definition: SettingsKeyServer.cpp:38
GpgFrontend::UI::KeyserverTab::SetSettings
void SetSettings()
Set the Settings object.
Definition: SettingsKeyServer.cpp:120