diff options
Diffstat (limited to '')
-rw-r--r-- | include/ui/KeygenDialog.h | 50 |
1 files changed, 43 insertions, 7 deletions
diff --git a/include/ui/KeygenDialog.h b/include/ui/KeygenDialog.h index cca92830..933f8bbe 100644 --- a/include/ui/KeygenDialog.h +++ b/include/ui/KeygenDialog.h @@ -42,18 +42,17 @@ public: explicit KeyGenDialog(GpgME::GpgContext *ctx, QWidget *parent = nullptr); private: - void generateKeyDialog(); - /** - * @details Check the password strength of the text in the passwordEdit member - * - * @return digit between 0 and 6, the higher the more secure is the password - */ - int checkPassWordStrength(); + QGroupBox *create_key_usage_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])+)\]))"}; GpgME::GpgContext *mCtx; /** The current gpg context */ __attribute__((unused)) KeyGenThread *keyGenThread{}; /** Thread for key generation */ __attribute__((unused)) QStringList errorMessages; /** List of errors occuring when checking entries of lineedits */ + GenKeyInfo genKeyInfo{}; + QDialogButtonBox *buttonBox; /** Box for standardbuttons */ QLabel *errorLabel{}; /** Label containing error message */ QLineEdit *nameEdit{}; /** Lineedit for the keys name */ @@ -65,8 +64,35 @@ private: QComboBox *keyTypeComboBox{}; /** Combobox for Keytpe */ QDateTimeEdit *dateEdit{}; /** Dateedit for expiration date */ QCheckBox *expireCheckBox{}; /** Checkbox, if key should expire */ + QCheckBox *noPassPhraseCheckBox{}; QSlider *pwStrengthSlider{}; /** Slider showing the password strength */ + QGroupBox *keyUsageGroupBox{}; /** Group of Widgets detecting the usage of the Key **/ + +// ENCR, SIGN, CERT, AUTH + std::vector<QCheckBox *> keyUsageCheckBoxes; + + KeyGenThread *kg = nullptr; + + void generateKeyDialog(); + + /** + * @details Check the password strength of the text in the passwordEdit member + * + * @return digit between 0 and 6, the higher the more secure is the password + */ + int checkPassWordStrength(); + + + /** + * @details Refresh widgets state by GenKeyInfo + */ + void refresh_widgets_state(); + + void set_signal_slot(); + + bool check_email_address(const QString &str); + private slots: /** @@ -84,6 +110,16 @@ private slots: */ void slotKeyGenAccept(); + void slotEncryptionBoxChanged(int state); + + void slotSigningBoxChanged(int state); + + void slotCertificationBoxChanged(int state); + + void slotAuthenticationBoxChanged(int state); + + void slotActivatedKeyType(int index); + }; #endif // __KEYGENDIALOG_H__ |