GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
KeyNewUIDDialog.h
1 
29 #pragma once
30 
31 #include "core/function/gpg/GpgContext.h"
32 #include "core/model/GpgKey.h"
33 #include "core/typedef/GpgTypedef.h"
34 #include "ui/GpgFrontendUI.h"
35 #include "ui/dialog/GeneralDialog.h"
36 
37 namespace GpgFrontend::UI {
39  Q_OBJECT
40 
41  public:
48  KeyNewUIDDialog(const KeyId& key, QWidget* parent = nullptr);
49 
50  signals:
55  void SignalUIDCreated();
56 
57  private slots:
58 
63  void slot_create_new_uid();
64 
65  private:
66  GpgKey m_key_;
67 
68  QLineEdit* name_{};
69  QLineEdit* email_{};
70  QLineEdit* comment_{};
71 
72  QPushButton* create_button_{};
73 
74  QStringList error_messages_;
75  QLabel* error_label_{};
76 
77  QRegularExpression re_email_{
78  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])+)\]))"};
79 
87  bool check_email_address(const QString& str);
88 };
89 } // namespace GpgFrontend::UI
Definition: GpgKey.h:40
Definition: GeneralDialog.h:35
Definition: KeyNewUIDDialog.h:38
void slot_create_new_uid()
Definition: KeyNewUIDDialog.cpp:77
KeyNewUIDDialog(const KeyId &key, QWidget *parent=nullptr)
Construct a new Key New U I D Dialog object.
Definition: KeyNewUIDDialog.cpp:37
bool check_email_address(const QString &str)
Definition: KeyNewUIDDialog.cpp:115
Definition: FileReadTask.cpp:31