GpgFrontend Project A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.

KeyMgmt.h
1
29 #ifndef __KEYMGMT_H__
30 #define __KEYMGMT_H__
31
32 #include "import_export/KeyImportDetailDialog.h"
33 #include "import_export/KeyServerImportDialog.h"
34 #include "ui/GpgFrontendUI.h"
35 #include "ui/key_generate/KeygenDialog.h"
36 #include "ui/keypair_details/KeyDetailsDialog.h"
37 #include "ui/widgets/KeyList.h"
38
39 namespace GpgFrontend::UI {
40
45 class KeyMgmt : public QMainWindow {
46 Q_OBJECT
47
48 public:
54 explicit KeyMgmt(QWidget* parent = nullptr);
55
56 public slots:
57
62 void SlotGenerateSubKey();
63
68 void SlotExportKeyToKeyPackage();
69
74 void SlotExportKeyToClipboard();
75
80 void SlotExportAsOpenSSHFormat();
81
86 void SlotDeleteSelectedKeys();
87
92 void SlotDeleteCheckedKeys();
93
98 void SlotGenerateKeyDialog();
99
104 void SlotShowKeyDetails();
105
110 void SlotSaveWindowState();
111
116 void SlotImportKeyPackage();
117
118 signals:
119
124 void SignalStatusBarChanged(QString);
125
130 void SignalKeyStatusUpdated();
131
132 private:
137 void create_menus();
138
143 void create_actions();
144
149 void create_tool_bars();
150
156 void delete_keys_with_warning(GpgFrontend::KeyIdArgsListPtr uidList);
157
158 KeyList* key_list_;
159 QMenu* file_menu_{};
160 QMenu* key_menu_{};
161 QMenu* generate_key_menu_{};
162 QMenu* import_key_menu_{};
163 QAction* open_key_file_act_{};
164 QAction* export_key_to_file_act_{};
165 QAction* export_key_as_open_ssh_format_{};
166 QAction* export_key_to_clipboard_act_{};
167 QAction* delete_checked_keys_act_{};
168 QAction* delete_selected_keys_act_{};
169 QAction* generate_key_dialog_act_{};
170 QAction* generate_key_pair_act_{};
171 QAction* generate_subkey_act_{};
172 QAction* import_key_from_clipboard_act_{};
173 QAction* import_key_from_file_act_{};
174 QAction* import_key_from_key_server_act_{};
175 QAction* import_keys_from_key_package_act_{};
176 QAction* close_act_{};
177 QAction* show_key_details_act_{};
178 KeyServerImportDialog* import_dialog_{};
179
180 protected:
186 void closeEvent(QCloseEvent* event) override;
187 };
188
189 } // namespace GpgFrontend::UI
190
191 #endif // __KEYMGMT_H__
GpgFrontend::UI::KeyMgmt::KeyMgmt
KeyMgmt(QWidget *parent=nullptr)
Construct a new Key Mgmt object.
Definition: KeyMgmt.cpp:46
GpgFrontend::UI
Definition: VerifyDetailsDialog.cpp:33
GpgFrontend::UI::KeyMgmt::create_menus
void create_menus()
Create a menus object.
Definition: KeyMgmt.cpp:265
GpgFrontend::UI::KeyMgmt::create_actions
void create_actions()
Create a actions object.
Definition: KeyMgmt.cpp:169
GpgFrontend::KeyPackageOperator::ImportKeyPackage
static bool ImportKeyPackage(const std::filesystem::path &key_package_path, const std::filesystem::path &phrase_path, GpgFrontend::GpgImportInformation &import_info)
import key package
Definition: KeyPackageOperator.cpp:71
GpgFrontend::write_buffer_to_file
GPGFRONTEND_CORE_EXPORT bool write_buffer_to_file(const std::string &path, const std::string &out_buffer)
Definition: GpgConstants.cpp:135
GpgFrontend::GlobalSettingStation::SyncSettings
void SyncSettings() noexcept
sync the settings to the file
Definition: GlobalSettingStation.cpp:33
GpgFrontend::SingletonFunctionObject< GlobalSettingStation >::GetInstance
static GlobalSettingStation & GetInstance(int channel=GpgFrontend::GPGFRONTEND_DEFAULT_CHANNEL)
Get the Instance object.
Definition: GpgFunctionObject.h:57
GpgFrontend::GlobalSettingStation::GetUISettings
libconfig::Setting & GetUISettings() noexcept
Definition: GlobalSettingStation.h:68
GpgFrontend::UI::KeyList::AddListGroupTab
void AddListGroupTab(const QString &name, KeyListRow::KeyType selectType=KeyListRow::SECRET_OR_PUBLIC_KEY, KeyListColumn::InfoType infoType=KeyListColumn::ALL, const std::function< bool(const GpgKey &)> &filter=[](const GpgKey &) -> bool { return true;})
Definition: KeyList.cpp:95
GpgFrontend::UI::KeyMgmt::closeEvent
void closeEvent(QCloseEvent *event) override
Definition: KeyMgmt.cpp:409
GpgFrontend::UI::KeyList::GetChecked
KeyIdArgsListPtr GetChecked()
Get the Checked object.
Definition: KeyList.cpp:182
GpgFrontend::UI::KeyMgmt
Definition: KeyMgmt.h:45
GpgFrontend::UI::KeyList::AddMenuAction
void AddMenuAction(QAction *act)
Definition: KeyList.cpp:301
GpgFrontend::UI::KeyServerImportDialog
Definition: KeyServerImportDialog.h:43
GpgFrontend::UI::KeyDetailsDialog
Definition: KeyDetailsDialog.h:37
GpgFrontend::UI::KeyList::GetSelected
KeyIdArgsListPtr GetSelected()
Get the Selected object.
Definition: KeyList.cpp:254
GpgFrontend::UI::CommonUtils::SlotImportKeyFromFile
void SlotImportKeyFromFile(QWidget *parent)
Definition: UserInterfaceUtils.cpp:156
GpgFrontend::UI::KeyMgmt::create_tool_bars
void create_tool_bars()
Create a tool bars object.
Definition: KeyMgmt.cpp:288
GpgFrontend::GpgKey::IsPrivateKey
bool IsPrivateKey() const
Definition: GpgKey.cpp:140
GpgFrontend::UI::KeyList::SetDoubleClickedAction
void SetDoubleClickedAction(std::function< void(const GpgKey &, QWidget *)> action)
Set the Double Clicked Action object.
Definition: KeyList.cpp:404
GpgFrontend::UI::KeyMgmt::delete_keys_with_warning
void delete_keys_with_warning(GpgFrontend::KeyIdArgsListPtr uidList)
Definition: KeyMgmt.cpp:328
GpgFrontend::UI::CommonUtils::SlotImportKeyFromKeyServer
void SlotImportKeyFromKeyServer(QWidget *parent)
Definition: UserInterfaceUtils.cpp:172
GpgFrontend::UI::KeyList
Definition: KeyList.h:152
GpgFrontend::GpgKey::IsExpired
bool IsExpired() const
Definition: GpgKey.cpp:142
GpgFrontend::UI::SignalStation::GetInstance
static SignalStation * GetInstance()
Get the Instance object.
Definition: SignalStation.cpp:35
GpgFrontend::UI::CommonUtils::SlotImportKeyFromClipboard
void SlotImportKeyFromClipboard(QWidget *parent)
Definition: UserInterfaceUtils.cpp:177
GpgFrontend::GpgKey::IsRevoked
bool IsRevoked() const
Definition: GpgKey.cpp:144
GpgFrontend::GpgKeyGetter::GetKey
GpgKey GetKey(const std::string &fpr)
Get the Key object.
Definition: GpgKeyGetter.cpp:38
GpgFrontend::GpgKey::IsDisabled
bool IsDisabled() const
Definition: GpgKey.cpp:146
GpgFrontend::GpgKey::IsHasMasterKey
bool IsHasMasterKey() const
Definition: GpgKey.cpp:148
GpgFrontend::UI::CommonUtils::GetInstance
static CommonUtils * GetInstance()
Get the Instance object.
Definition: UserInterfaceUtils.cpp:124
GpgFrontend::GpgKey
Definition: GpgKey.h:44
GpgFrontend::GpgKeyOpera::DeleteKeys
void DeleteKeys(KeyIdArgsListPtr key_ids)
Definition: GpgKeyOpera.cpp:52
GpgFrontend::UI::SignalStation::SignalRefreshStatusBar
void SignalRefreshStatusBar(const QString &message, int timeout)