Improved PasswordPromptDialog
- can now also set caption - can set initial state of save option - improved size and spacing
This commit is contained in:
parent
634345b38f
commit
24751f81dd
3 changed files with 59 additions and 19 deletions
|
|
@ -2,6 +2,7 @@
|
|||
#define PASSWORDPROMPTDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <optional>
|
||||
|
||||
class QCheckBox;
|
||||
class QDialogButtonBox;
|
||||
|
|
@ -22,20 +23,29 @@ public:
|
|||
|
||||
explicit PasswordPromptDialog(Flags flags, QWidget *parent = nullptr);
|
||||
|
||||
void setDescription(const QString &description);
|
||||
|
||||
PasswordPromptDialog& setCaption(const std::optional<QString> &caption);
|
||||
PasswordPromptDialog& setDescription(const QString &description);
|
||||
/// Checks the save checkbox when save is true, this call is ignored when the checkbox does not exist
|
||||
PasswordPromptDialog& setSaveChecked(bool save);
|
||||
|
||||
QString password() const;
|
||||
bool saveChecked() const;
|
||||
private:
|
||||
static const char* translateContext;
|
||||
|
||||
Flags m_Flags;
|
||||
QLabel *m_connectionLabel = nullptr;
|
||||
QLabel *m_descriptionLabel = nullptr;
|
||||
QLabel *m_passwordLabel[2] = { nullptr, nullptr };
|
||||
QLineEdit *m_passwordInput[2] = { nullptr, nullptr };
|
||||
QCheckBox *m_saveCheck = nullptr;
|
||||
QDialogButtonBox *m_DialogButtons = nullptr;
|
||||
|
||||
std::optional<QString> m_customCaption;
|
||||
|
||||
void retranslateUi();
|
||||
void updateOkEnabled();
|
||||
void UpdateCaption();
|
||||
|
||||
private slots:
|
||||
void passwordChanged(const QString &text);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue