GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
KeyNewUIDDialog.h
1 
27 #ifndef GPGFRONTEND_KEYNEWUIDDIALOG_H
28 #define GPGFRONTEND_KEYNEWUIDDIALOG_H
29 
30 #include "core/GpgContext.h"
31 #include "ui/GpgFrontendUI.h"
32 
33 namespace GpgFrontend::UI {
34 class KeyNewUIDDialog : public QDialog {
35  Q_OBJECT
36 
37  public:
44  KeyNewUIDDialog(const KeyId& key, QWidget* parent = nullptr);
45 
46  signals:
51  void SignalUIDCreated();
52 
53  private slots:
54 
59  void slot_create_new_uid();
60 
61  private:
62  GpgKey m_key_;
63 
64  QLineEdit* name_{};
65  QLineEdit* email_{};
66  QLineEdit* comment_{};
67 
68  QPushButton* create_button_{};
69 
70  QStringList error_messages_;
71  QLabel* error_label_{};
72 
73  QRegularExpression re_email_{
74  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])+)\]))"};
75 
83  bool check_email_address(const QString& str);
84 };
85 } // namespace GpgFrontend::UI
86 
87 #endif // GPGFRONTEND_KEYNEWUIDDIALOG_H
GpgFrontend::UI
Definition: FileReadTask.cpp:31
GpgFrontend::SingletonFunctionObject< GpgUIDOperator >::GetInstance
static GpgUIDOperator & GetInstance(int channel=GpgFrontend::GPGFRONTEND_DEFAULT_CHANNEL)
Get the Instance object.
Definition: GpgFunctionObject.h:170
GpgFrontend::GpgKeyGetter
Definition: GpgKeyGetter.h:45
GpgFrontend::UI::KeyNewUIDDialog::slot_create_new_uid
void slot_create_new_uid()
Definition: KeyNewUIDDialog.cpp:72
GpgFrontend::UI::KeyNewUIDDialog::KeyNewUIDDialog
KeyNewUIDDialog(const KeyId &key, QWidget *parent=nullptr)
Construct a new Key New U I D Dialog object.
Definition: KeyNewUIDDialog.cpp:34
GpgFrontend::UI::SignalStation::GetInstance
static SignalStation * GetInstance()
Get the Instance object.
Definition: SignalStation.cpp:37
GpgFrontend::UI::KeyNewUIDDialog
Definition: KeyNewUIDDialog.h:34
GpgFrontend::GpgKey
Definition: GpgKey.h:41
GpgFrontend::UI::KeyNewUIDDialog::check_email_address
bool check_email_address(const QString &str)
Definition: KeyNewUIDDialog.cpp:109