2018-11-04 11:26:20 +01:00
|
|
|
|
#ifndef PASSWORDPROMPTDIALOG_H
|
|
|
|
|
|
#define PASSWORDPROMPTDIALOG_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
|
|
|
|
|
|
|
|
class QCheckBox;
|
2018-11-08 21:50:49 +01:00
|
|
|
|
class QDialogButtonBox;
|
2018-11-04 11:26:20 +01:00
|
|
|
|
class QLabel;
|
|
|
|
|
|
class QLineEdit;
|
|
|
|
|
|
|
|
|
|
|
|
class PasswordPromptDialog : public QDialog
|
|
|
|
|
|
{
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
public:
|
2018-11-08 21:50:49 +01:00
|
|
|
|
enum Flag {
|
|
|
|
|
|
ConfirmPassword = 1,
|
|
|
|
|
|
SaveOption = 2
|
|
|
|
|
|
};
|
2018-11-04 11:26:20 +01:00
|
|
|
|
|
2018-11-08 21:50:49 +01:00
|
|
|
|
Q_DECLARE_FLAGS(Flags, Flag)
|
|
|
|
|
|
//Q_FLAG(Flags)
|
|
|
|
|
|
|
|
|
|
|
|
explicit PasswordPromptDialog(Flags flags, QWidget *parent = nullptr);
|
|
|
|
|
|
|
|
|
|
|
|
void setDescription(const QString &description);
|
2018-11-04 11:26:20 +01:00
|
|
|
|
|
|
|
|
|
|
QString password() const;
|
2018-11-08 21:50:49 +01:00
|
|
|
|
bool saveChecked() const;
|
2018-11-04 11:26:20 +01:00
|
|
|
|
private:
|
2018-11-08 21:50:49 +01:00
|
|
|
|
Flags m_Flags;
|
2018-11-04 11:26:20 +01:00
|
|
|
|
QLabel *m_connectionLabel = nullptr;
|
2018-11-08 21:50:49 +01:00
|
|
|
|
QLabel *m_passwordLabel[2] = { nullptr, nullptr };
|
|
|
|
|
|
QLineEdit *m_passwordInput[2] = { nullptr, nullptr };
|
2018-11-04 11:26:20 +01:00
|
|
|
|
QCheckBox *m_saveCheck = nullptr;
|
2018-11-08 21:50:49 +01:00
|
|
|
|
QDialogButtonBox *m_DialogButtons = nullptr;
|
2018-11-04 11:26:20 +01:00
|
|
|
|
|
|
|
|
|
|
void retranslateUi();
|
2018-11-08 21:50:49 +01:00
|
|
|
|
void updateOkEnabled();
|
2018-11-04 11:26:20 +01:00
|
|
|
|
|
|
|
|
|
|
private slots:
|
2018-11-08 21:50:49 +01:00
|
|
|
|
void passwordChanged(const QString &text);
|
2018-11-04 11:26:20 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // PASSWORDPROMPTDIALOG_H
|