GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
SubkeyGenerateDialog.h
1 
29 #pragma once
30 
31 #include <memory>
32 
33 #include "core/function/gpg/GpgContext.h"
34 #include "core/model/GpgGenKeyInfo.h"
35 #include "core/model/GpgKey.h"
36 #include "core/typedef/GpgTypedef.h"
37 #include "core/utils/MemoryUtils.h"
38 #include "ui/GpgFrontendUI.h"
39 #include "ui/dialog/GeneralDialog.h"
40 
41 namespace GpgFrontend::UI {
47  Q_OBJECT
48 
49  public:
56  explicit SubkeyGenerateDialog(const KeyId& key_id, QWidget* parent);
57 
58  private:
59  GpgKey key_;
60 
61  std::shared_ptr<GenKeyInfo> gen_key_info_ =
62  SecureCreateSharedObject<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_{};
72 
73  std::vector<QCheckBox*> key_usage_check_boxes_;
74  QDateTime max_date_time_;
75 
81  QGroupBox* create_key_usage_group_box();
82 
88  QGroupBox* create_basic_info_group_box();
93  void set_signal_slot();
94 
98  void refresh_widgets_state();
99 
100  private slots:
101 
107 
112  void slot_key_gen_accept();
113 
119  void slot_encryption_box_changed(int state);
120 
126  void slot_signing_box_changed(int state);
127 
133  void slot_certification_box_changed(int state);
134 
140  void slot_authentication_box_changed(int state);
141 
147  void slot_activated_key_type(int index);
148 };
149 
150 } // namespace GpgFrontend::UI
Definition: GpgKey.h:40
Definition: GeneralDialog.h:35
Definition: SubkeyGenerateDialog.h:46
QCheckBox * no_pass_phrase_check_box_
Checkbox, if key should expire.
Definition: SubkeyGenerateDialog.h:71
QGroupBox * create_basic_info_group_box()
Create a basic info group box object.
Definition: SubkeyGenerateDialog.cpp:122
void slot_authentication_box_changed(int state)
Definition: SubkeyGenerateDialog.cpp:352
void slot_encryption_box_changed(int state)
Definition: SubkeyGenerateDialog.cpp:328
void slot_expire_box_changed()
Definition: SubkeyGenerateDialog.cpp:194
void refresh_widgets_state()
Definition: SubkeyGenerateDialog.cpp:202
void slot_activated_key_type(int index)
Definition: SubkeyGenerateDialog.cpp:360
std::vector< QCheckBox * > key_usage_check_boxes_
ENCR, SIGN, CERT, AUTH.
Definition: SubkeyGenerateDialog.h:73
QLabel * error_label_
Label containing error message.
Definition: SubkeyGenerateDialog.h:66
void slot_certification_box_changed(int state)
Definition: SubkeyGenerateDialog.cpp:344
SubkeyGenerateDialog(const KeyId &key_id, QWidget *parent)
Construct a new Subkey Generate Dialog object.
Definition: SubkeyGenerateDialog.cpp:44
void set_signal_slot()
Set the signal slot object.
Definition: SubkeyGenerateDialog.cpp:167
QGroupBox * create_key_usage_group_box()
Create a key usage group box object.
Definition: SubkeyGenerateDialog.cpp:89
QDateTimeEdit * date_edit_
Date edit for expiration date.
Definition: SubkeyGenerateDialog.h:69
QSpinBox * key_size_spin_box_
Spinbox for the keys size (in bit)
Definition: SubkeyGenerateDialog.h:67
void slot_key_gen_accept()
Definition: SubkeyGenerateDialog.cpp:266
QDialogButtonBox * button_box_
Box for standard buttons.
Definition: SubkeyGenerateDialog.h:65
QComboBox * key_type_combo_box_
Combobox for Key tpe.
Definition: SubkeyGenerateDialog.h:68
void slot_signing_box_changed(int state)
Definition: SubkeyGenerateDialog.cpp:336
QCheckBox * expire_check_box_
Checkbox, if key should expire.
Definition: SubkeyGenerateDialog.h:70
Definition: FileReadTask.cpp:31