47 Window(
_(
"Change Password"), true),
51 gcn::Label *accountLabel =
new Label(
60 place(0, 0, accountLabel, 3);
63 place(0, 3,
new Label(
_(
"Type new password twice:")), 3);
86 if (event.getId() ==
"cancel")
90 else if (event.getId() ==
"change_password")
97 Log::info(
"ChangePasswordDialog::Password change, Username is %s",
107 if (oldPassword.empty())
113 else if (newFirstPass.length() < min)
117 " %d characters long."), min);
120 else if (newFirstPass.length() > max - 1 )
124 "than %d characters long."), max);
127 else if (newFirstPass != newSecondPass)
WrongDataNoticeListener * mWrongDataNoticeListener
gcn::Button * mChangePassButton
gcn::TextField * mFirstPassField
ChangePasswordDialog(LoginData *loginData)
gcn::Button * mCancelButton
void action(const gcn::ActionEvent &event) override
Called when receiving actions from the widgets.
gcn::TextField * mOldPassField
gcn::TextField * mSecondPassField
~ChangePasswordDialog() override
static void setState(State state)
LayoutCell & setPadding(int p)
Sets the padding around the cell content.
virtual unsigned int getMaxPasswordLength() const
virtual unsigned int getMinPasswordLength() const
void center()
Positions the window in the center of it's parent.
virtual void setVisible(bool visible)
Overloads window setVisible by Guichan to allow sticky window handling.
void reflowLayout(int w=0, int h=0)
Computes the position of the widgets according to the current layout.
LayoutCell & place(int x, int y, gcn::Widget *, int w=1, int h=1)
Adds a widget to the window and sets it at given cell.
Listener used while dealing with wrong data.
void setTarget(gcn::TextField *textField)
@ STATE_CHANGEPASSWORD_ATTEMPT
void info(const char *log_text,...) LOG_PRINTF_ATTR
LoginHandler * getLoginHandler()
std::string strprintf(char const *format,...)
A safe version of sprintf that returns a std::string of the result.