Added remember option to password dialog.

Made to remember password of password manager for given time but not completely sure
how to implement that yet.
This commit is contained in:
eelke 2018-11-15 19:24:29 +01:00
parent f432c2aa68
commit 287073afdc
4 changed files with 42 additions and 11 deletions

View file

@ -5,6 +5,7 @@
#include <optional>
class QCheckBox;
class QComboBox;
class QDialogButtonBox;
class QLabel;
class QLineEdit;
@ -15,7 +16,8 @@ class PasswordPromptDialog : public QDialog
public:
enum Flag {
ConfirmPassword = 1,
SaveOption = 2
SaveOption = 2,
RememberPassword = 4
};
Q_DECLARE_FLAGS(Flags, Flag)
@ -31,6 +33,10 @@ public:
QString password() const;
bool saveChecked() const;
/// Returns how long the user wants the password remembered
///
/// \return time to remember password in minutes, 0= do not remember, -1= until termination
int remember() const;
private:
static const char* translateContext;
@ -39,6 +45,8 @@ private:
QLabel *m_passwordLabel[2] = { nullptr, nullptr };
QLineEdit *m_passwordInput[2] = { nullptr, nullptr };
QCheckBox *m_saveCheck = nullptr;
QLabel *m_rememberLabel = nullptr;
QComboBox *m_rememberChoices = nullptr;
QDialogButtonBox *m_DialogButtons = nullptr;
std::optional<QString> m_customCaption;