GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
SubkeyGenerateDialog.h
1 
27 #ifndef GPGFRONTEND_SUBKEYGENERATEDIALOG_H
28 #define GPGFRONTEND_SUBKEYGENERATEDIALOG_H
29 
30 #include "core/GpgContext.h"
31 #include "core/GpgGenKeyInfo.h"
32 #include "ui/GpgFrontendUI.h"
33 
34 namespace GpgFrontend::UI {
39 class SubkeyGenerateDialog : public QDialog {
40  Q_OBJECT
41 
42  public:
49  explicit SubkeyGenerateDialog(const KeyId& key_id, QWidget* parent);
50 
51  signals:
56  void SignalSubKeyGenerated();
57 
58  private:
59  GpgKey key_;
60 
61  std::unique_ptr<GenKeyInfo> gen_key_info_ =
62  std::make_unique<GenKeyInfo>(true);
63 
64  QGroupBox* key_usage_group_box_{};
65  QDialogButtonBox* button_box_;
66  QLabel* error_label_{};
67  QSpinBox* key_size_spin_box_{};
68  QComboBox* key_type_combo_box_{};
69  QDateTimeEdit* date_edit_{};
70  QCheckBox* expire_check_box_{};
71 
72  std::vector<QCheckBox*> key_usage_check_boxes_;
73  QDateTime max_date_time_;
74 
80  QGroupBox* create_key_usage_group_box();
81 
87  QGroupBox* create_basic_info_group_box();
92  void set_signal_slot();
93 
97  void refresh_widgets_state();
98 
99  private slots:
100 
106 
111  void slot_key_gen_accept();
112 
118  void slot_encryption_box_changed(int state);
119 
125  void slot_signing_box_changed(int state);
126 
132  void slot_certification_box_changed(int state);
133 
139  void slot_authentication_box_changed(int state);
140 
146  void slot_activated_key_type(int index);
147 };
148 
149 } // namespace GpgFrontend::UI
150 
151 #endif // GPGFRONTEND_SUBKEYGENERATEDIALOG_H
GpgFrontend::UI::WaitingDialog
Definition: WaitingDialog.h:40
GpgFrontend::UI
Definition: VerifyDetailsDialog.cpp:33
GpgFrontend::UI::SubkeyGenerateDialog::slot_encryption_box_changed
void slot_encryption_box_changed(int state)
Definition: SubkeyGenerateDialog.cpp:304
GpgFrontend::UI::SubkeyGenerateDialog::key_size_spin_box_
QSpinBox * key_size_spin_box_
Spinbox for the keys size (in bit)
Definition: SubkeyGenerateDialog.h:67
GpgFrontend::UI::SubkeyGenerateDialog::refresh_widgets_state
void refresh_widgets_state()
Definition: SubkeyGenerateDialog.cpp:189
GpgFrontend::UI::SubkeyGenerateDialog::SubkeyGenerateDialog
SubkeyGenerateDialog(const KeyId &key_id, QWidget *parent)
Construct a new Subkey Generate Dialog object.
Definition: SubkeyGenerateDialog.cpp:37
GpgFrontend::UI::SubkeyGenerateDialog::expire_check_box_
QCheckBox * expire_check_box_
Checkbox, if key should expire.
Definition: SubkeyGenerateDialog.h:70
GpgFrontend::SingletonFunctionObject< GlobalSettingStation >::GetInstance
static GlobalSettingStation & GetInstance(int channel=GpgFrontend::GPGFRONTEND_DEFAULT_CHANNEL)
Get the Instance object.
Definition: GpgFunctionObject.h:181
GpgFrontend::UI::SubkeyGenerateDialog::create_basic_info_group_box
QGroupBox * create_basic_info_group_box()
Create a basic info group box object.
Definition: SubkeyGenerateDialog.cpp:117
GpgFrontend::GlobalSettingStation::GetUISettings
libconfig::Setting & GetUISettings() noexcept
Definition: GlobalSettingStation.h:68
GpgFrontend::GpgKeyGetter
Definition: GpgKeyGetter.h:45
GpgFrontend::UI::SubkeyGenerateDialog::slot_expire_box_changed
void slot_expire_box_changed()
Definition: SubkeyGenerateDialog.cpp:181
GpgFrontend::GpgKeyOpera::GenerateSubkey
GpgFrontend::GpgError GenerateSubkey(const GpgKey &key, const std::unique_ptr< GenKeyInfo > &params)
Definition: GpgKeyOpera.cpp:245
GpgFrontend::UI::SubkeyGenerateDialog::button_box_
QDialogButtonBox * button_box_
Box for standard buttons.
Definition: SubkeyGenerateDialog.h:65
GpgFrontend::UI::SubkeyGenerateDialog::key_usage_check_boxes_
std::vector< QCheckBox * > key_usage_check_boxes_
ENCR, SIGN, CERT, AUTH.
Definition: SubkeyGenerateDialog.h:72
GpgFrontend::UI::SubkeyGenerateDialog::create_key_usage_group_box
QGroupBox * create_key_usage_group_box()
Create a key usage group box object.
Definition: SubkeyGenerateDialog.cpp:84
GpgFrontend::UI::SubkeyGenerateDialog::slot_certification_box_changed
void slot_certification_box_changed(int state)
Definition: SubkeyGenerateDialog.cpp:320
GpgFrontend::UI::SubkeyGenerateDialog::error_label_
QLabel * error_label_
Label containing error message.
Definition: SubkeyGenerateDialog.h:66
GpgFrontend::UI::SubkeyGenerateDialog::slot_signing_box_changed
void slot_signing_box_changed(int state)
Definition: SubkeyGenerateDialog.cpp:312
GpgFrontend::UI::SubkeyGenerateDialog
Definition: SubkeyGenerateDialog.h:39
GpgFrontend::UI::SubkeyGenerateDialog::slot_activated_key_type
void slot_activated_key_type(int index)
Definition: SubkeyGenerateDialog.cpp:336
GpgFrontend::UI::SubkeyGenerateDialog::slot_key_gen_accept
void slot_key_gen_accept()
Definition: SubkeyGenerateDialog.cpp:238
GpgFrontend::check_gpg_error_2_err_code
GPGFRONTEND_CORE_EXPORT gpg_err_code_t check_gpg_error_2_err_code(gpgme_error_t err, gpgme_error_t predict=GPG_ERR_NO_ERROR)
Definition: GpgConstants.cpp:66
GpgFrontend::UI::SubkeyGenerateDialog::key_type_combo_box_
QComboBox * key_type_combo_box_
Combobox for Key tpe.
Definition: SubkeyGenerateDialog.h:68
GpgFrontend::UI::SubkeyGenerateDialog::slot_authentication_box_changed
void slot_authentication_box_changed(int state)
Definition: SubkeyGenerateDialog.cpp:328
GpgFrontend::GenKeyInfo::GetSupportedKeyAlgo
static const std::vector< std::string > & GetSupportedKeyAlgo()
Get the Supported Key Algo object.
Definition: GpgGenKeyInfo.cpp:200
GpgFrontend::UI::SubkeyGenerateDialog::date_edit_
QDateTimeEdit * date_edit_
Date edit for expiration date.
Definition: SubkeyGenerateDialog.h:69
GpgFrontend::UI::SubkeyGenerateDialog::set_signal_slot
void set_signal_slot()
Set the signal slot object.
Definition: SubkeyGenerateDialog.cpp:159
GpgFrontend::UI::SignalStation::GetInstance
static SignalStation * GetInstance()
Get the Instance object.
Definition: SignalStation.cpp:37
GpgFrontend::GpgKey
Definition: GpgKey.h:44