56 mChangePassButton(
new Button(this,
_(
"Change Password"),
67 place(0, 0, accountLabel, 3, 1);
72 place(0, 3,
new Label(
this,
_(
"Type new password twice:")), 3, 1);
94 const std::string &eventId =
event.getId();
95 if (eventId ==
"cancel")
99 else if (eventId ==
"change_password")
105 logger->
log(
"ChangePasswordDialog::Password change, Username is %s",
108 std::stringstream errorMsg;
115 if (oldPassword.empty())
119 errorMsg <<
_(
"Enter the old password first.");
122 else if (newFirstPass.length() < min)
126 errorMsg <<
strprintf(
_(
"The new password needs to be at least"
127 " %u characters long."), min);
130 else if (newFirstPass.length() > max)
134 errorMsg <<
strprintf(
_(
"The new password needs to be less "
135 "than %u characters long."), max);
138 else if (newFirstPass != newSecondPass)
142 errorMsg <<
_(
"The new password entries mismatch.");
WrongDataNoticeListener * mWrongDataNoticeListener
Button * mChangePassButton
TextField * mSecondPassField
TextField * mFirstPassField
TextField * mOldPassField
void action(const ActionEvent &event)
ChangePasswordDialog(LoginData &data)
void setState(const StateT state)
LayoutCell & setPadding(int p)
void log(const char *const log_text,...)
virtual unsigned int getMaxPasswordLength() const
virtual unsigned int getMinPasswordLength() const
const std::string & getText() const
void reflowLayout(int w, int h)
LayoutCell & place(const int x, const int y, Widget *const wg, const int w, const int h)
void setTarget(TextField *const textField)
Net::LoginHandler * loginHandler
bool error(InputEvent &event) __attribute__((noreturn))
const bool ShowCenter_true
std::string strprintf(const char *const format,...)