KeygenDialog.h
#ifndef __KEYGENDIALOG_H__
#define __KEYGENDIALOG_H__
#include "core/GpgContext.h"
#include "core/GpgGenKeyInfo.h"
#include "ui/GpgFrontendUI.h"
#include "ui/dialog/GeneralDialog.h"
namespace GpgFrontend::UI {
class KeyGenDialog : public GeneralDialog {
Q_OBJECT
public:
explicit KeyGenDialog(QWidget* parent = nullptr);
signals:
void SignalKeyGenerated();
private:
QGroupBox* create_key_usage_group_box();
QGroupBox* create_basic_info_group_box();
QRegularExpression re_email_{
R"((?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\]))"};
QStringList error_messages_;
std::unique_ptr<GenKeyInfo> gen_key_info_ =
std::make_unique<GenKeyInfo>();
QDialogButtonBox* button_box_;
QLabel* error_label_{};
QLineEdit* name_edit_{};
QLineEdit* email_edit_{};
QLineEdit* comment_edit_{};
QSpinBox* key_size_spin_box_{};
QComboBox* key_type_combo_box_{};
QDateTimeEdit* date_edit_{};
QCheckBox* expire_check_box_{};
QCheckBox* no_pass_phrase_check_box_{};
QGroupBox* key_usage_group_box_{};
QDateTime max_date_time_;
std::vector<QCheckBox*> key_usage_check_boxes_;
void generate_key_dialog();
void refresh_widgets_state();
void set_signal_slot();
bool check_email_address(const QString& str);
private slots:
void slot_expire_box_changed();
void slot_key_gen_accept();
void slot_encryption_box_changed(int state);
void slot_signing_box_changed(int state);
void slot_certification_box_changed(int state);
void slot_authentication_box_changed(int state);
void slot_activated_key_type(int index);
};
} // namespace GpgFrontend::UI
#endif // __KEYGENDIALOG_H__
GpgFrontend::UI::KeyGenDialog::name_edit_
QLineEdit * name_edit_
Line edit for the keys name.
Definition: KeygenDialog.h:93
GpgFrontend::UI::KeyGenDialog::expire_check_box_
QCheckBox * expire_check_box_
Checkbox, if key should expire.
Definition: KeygenDialog.h:99
GpgFrontend::UI::WaitingDialog
Definition: WaitingDialog.h:40
GpgFrontend::UI
Definition: FileReadTask.cpp:31
GpgFrontend::UI::KeyGenDialog::slot_authentication_box_changed
void slot_authentication_box_changed(int state)
Definition: KeygenDialog.cpp:246
GpgFrontend::UI::KeyGenDialog::key_size_spin_box_
QSpinBox * key_size_spin_box_
Spinbox for the keys size (in bit)
Definition: KeygenDialog.h:96
GpgFrontend::UI::KeyGenDialog::slot_encryption_box_changed
void slot_encryption_box_changed(int state)
Definition: KeygenDialog.cpp:222
GpgFrontend::UI::KeyGenDialog::slot_signing_box_changed
void slot_signing_box_changed(int state)
Definition: KeygenDialog.cpp:230
GpgFrontend::SingletonFunctionObject< GlobalSettingStation >::GetInstance
static GlobalSettingStation & GetInstance(int channel=GpgFrontend::GPGFRONTEND_DEFAULT_CHANNEL)
Get the Instance object.
Definition: GpgFunctionObject.h:170
GpgFrontend::UI::KeyGenDialog::date_edit_
QDateTimeEdit * date_edit_
Date edit for expiration date.
Definition: KeygenDialog.h:98
GpgFrontend::GlobalSettingStation::GetUISettings
libconfig::Setting & GetUISettings() noexcept
Definition: GlobalSettingStation.h:63
GpgFrontend::UI::KeyGenDialog::check_email_address
bool check_email_address(const QString &str)
Definition: KeygenDialog.cpp:347
GpgFrontend::UI::GeneralDialog
Definition: GeneralDialog.h:35
GpgFrontend::UI::KeyGenDialog::key_usage_check_boxes_
std::vector< QCheckBox * > key_usage_check_boxes_
ENCR, SIGN, CERT, AUTH.
Definition: KeygenDialog.h:104
GpgFrontend::UI::KeyGenDialog::error_label_
QLabel * error_label_
Label containing error message.
Definition: KeygenDialog.h:92
GpgFrontend::UI::KeyGenDialog::email_edit_
QLineEdit * email_edit_
Line edit for the keys email.
Definition: KeygenDialog.h:94
GpgFrontend::GpgKeyOpera::GenerateKey
GpgFrontend::GpgError GenerateKey(const std::unique_ptr< GenKeyInfo > &params, GpgGenKeyResult &result)
Definition: GpgKeyOpera.cpp:165
GpgFrontend::UI::KeyGenDialog::slot_expire_box_changed
void slot_expire_box_changed()
Definition: KeygenDialog.cpp:181
GpgFrontend::UI::KeyGenDialog::button_box_
QDialogButtonBox * button_box_
Box for standard buttons.
Definition: KeygenDialog.h:91
GpgFrontend::UI::KeyGenDialog::create_key_usage_group_box
QGroupBox * create_key_usage_group_box()
Create a key usage group box object.
Definition: KeygenDialog.cpp:189
GpgFrontend::UI::KeyGenDialog::comment_edit_
QLineEdit * comment_edit_
Line edit for the keys comment.
Definition: KeygenDialog.h:95
GpgFrontend::UI::KeyGenDialog::slot_key_gen_accept
void slot_key_gen_accept()
Definition: KeygenDialog.cpp:90
GpgFrontend::UI::KeyGenDialog::slot_activated_key_type
void slot_activated_key_type(int index)
Definition: KeygenDialog.cpp:254
GpgFrontend::GenKeyInfo::GetSupportedKeyAlgo
static const std::vector< std::string > & GetSupportedKeyAlgo()
Get the Supported Key Algo object.
Definition: GpgGenKeyInfo.cpp:200
GpgFrontend::UI::KeyGenDialog::set_signal_slot
void set_signal_slot()
Set the signal slot object.
Definition: KeygenDialog.cpp:316
GpgFrontend::UI::KeyGenDialog::key_type_combo_box_
QComboBox * key_type_combo_box_
Combobox for Key type.
Definition: KeygenDialog.h:97
GpgFrontend::UI::KeyGenDialog::slot_certification_box_changed
void slot_certification_box_changed(int state)
Definition: KeygenDialog.cpp:238
GpgFrontend::UI::SignalStation::GetInstance
static SignalStation * GetInstance()
Get the Instance object.
Definition: SignalStation.cpp:37
GpgFrontend::UI::KeyGenDialog::KeyGenDialog
KeyGenDialog(QWidget *parent=nullptr)
Definition: KeygenDialog.cpp:38
GpgFrontend::UI::KeyGenDialog
Definition: KeygenDialog.h:41
GpgFrontend::UI::KeyGenDialog::key_usage_group_box_
QGroupBox * key_usage_group_box_
Definition: KeygenDialog.h:101
GpgFrontend::UI::KeyGenDialog::refresh_widgets_state
void refresh_widgets_state()
Definition: KeygenDialog.cpp:262
GpgFrontend::UI::KeyGenDialog::create_basic_info_group_box
QGroupBox * create_basic_info_group_box()
Create a basic info group box object.
Definition: KeygenDialog.cpp:351
GpgFrontend::UI::KeyGenDialog::error_messages_
QStringList error_messages_
Definition: KeygenDialog.h:87