diff options
Diffstat (limited to 'src/gui/register.cpp')
-rw-r--r-- | src/gui/register.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/src/gui/register.cpp b/src/gui/register.cpp index 913c958f2..062275b80 100644 --- a/src/gui/register.cpp +++ b/src/gui/register.cpp @@ -62,34 +62,34 @@ void WrongDataNoticeListener::action(const gcn::ActionEvent &event) mTarget->requestFocus(); } -RegisterDialog::RegisterDialog(LoginData *loginData): - Window(_("Register")), +RegisterDialog::RegisterDialog(LoginData *data): + Window(_("Register"), false, 0, "register.xml"), mEmailField(0), mMaleButton(0), mFemaleButton(0), mWrongDataNoticeListener(new WrongDataNoticeListener), - mLoginData(loginData) + mLoginData(data) { int optionalActions = Net::getLoginHandler()->supportedOptionalActions(); gcn::Label *userLabel = new Label(_("Name:")); gcn::Label *passwordLabel = new Label(_("Password:")); gcn::Label *confirmLabel = new Label(_("Confirm:")); - mUserField = new TextField(loginData->username); - mPasswordField = new PasswordField(loginData->password); + mUserField = new TextField(mLoginData->username); + mPasswordField = new PasswordField(mLoginData->password); mConfirmField = new PasswordField; mRegisterButton = new Button(_("Register"), "register", this); mCancelButton = new Button(_("Cancel"), "cancel", this); - ContainerPlacer place; - place = getPlacer(0, 0); - place(0, 0, userLabel); - place(0, 1, passwordLabel); - place(0, 2, confirmLabel); + ContainerPlacer placer; + placer = getPlacer(0, 0); + placer(0, 0, userLabel); + placer(0, 1, passwordLabel); + placer(0, 2, confirmLabel); - place(1, 0, mUserField, 3).setPadding(2); - place(1, 1, mPasswordField, 3).setPadding(2); - place(1, 2, mConfirmField, 3).setPadding(2); + placer(1, 0, mUserField, 3).setPadding(2); + placer(1, 1, mPasswordField, 3).setPadding(2); + placer(1, 2, mConfirmField, 3).setPadding(2); int row = 3; @@ -97,8 +97,8 @@ RegisterDialog::RegisterDialog(LoginData *loginData): { mMaleButton = new RadioButton(_("Male"), "sex", true); mFemaleButton = new RadioButton(_("Female"), "sex", false); - place(1, row, mMaleButton); - place(2, row, mFemaleButton); + placer(1, row, mMaleButton); + placer(2, row, mFemaleButton); row++; } @@ -107,15 +107,15 @@ RegisterDialog::RegisterDialog(LoginData *loginData): { gcn::Label *emailLabel = new Label(_("Email:")); mEmailField = new TextField; - place(0, row, emailLabel); - place(1, row, mEmailField, 3).setPadding(2); + placer(0, row, emailLabel); + placer(1, row, mEmailField, 3).setPadding(2); row++; } - place = getPlacer(0, 2); - place(1, 0, mRegisterButton); - place(2, 0, mCancelButton); + placer = getPlacer(0, 2); + placer(1, 0, mRegisterButton); + placer(2, 0, mCancelButton); reflowLayout(250, 0); mUserField->addKeyListener(this); @@ -161,7 +161,7 @@ void RegisterDialog::action(const gcn::ActionEvent &event) const std::string user = mUserField->getText(); logger->log("RegisterDialog::register Username is %s", user.c_str()); - std::string errorMessage; + std::string errorMsg; int error = 0; unsigned int minUser = Net::getLoginHandler()->getMinUserNameLength(); @@ -172,7 +172,7 @@ void RegisterDialog::action(const gcn::ActionEvent &event) if (user.length() < minUser) { // Name too short - errorMessage = strprintf + errorMsg = strprintf (_("The username needs to be at least %d characters long."), minUser); error = 1; @@ -180,7 +180,7 @@ void RegisterDialog::action(const gcn::ActionEvent &event) else if (user.length() > maxUser - 1 ) { // Name too long - errorMessage = strprintf + errorMsg = strprintf (_("The username needs to be less than %d characters long."), maxUser); error = 1; @@ -188,7 +188,7 @@ void RegisterDialog::action(const gcn::ActionEvent &event) else if (mPasswordField->getText().length() < minPass) { // Pass too short - errorMessage = strprintf + errorMsg = strprintf (_("The password needs to be at least %d characters long."), minPass); error = 2; @@ -196,7 +196,7 @@ void RegisterDialog::action(const gcn::ActionEvent &event) else if (mPasswordField->getText().length() > maxPass - 1 ) { // Pass too long - errorMessage = strprintf + errorMsg = strprintf (_("The password needs to be less than %d characters long."), maxPass); error = 2; @@ -204,7 +204,7 @@ void RegisterDialog::action(const gcn::ActionEvent &event) else if (mPasswordField->getText() != mConfirmField->getText()) { // Password does not match with the confirmation one - errorMessage = _("Passwords do not match."); + errorMsg = _("Passwords do not match."); error = 2; } @@ -225,7 +225,7 @@ void RegisterDialog::action(const gcn::ActionEvent &event) mWrongDataNoticeListener->setTarget(this->mPasswordField); } - OkDialog *dlg = new OkDialog(_("Error"), errorMessage); + OkDialog *dlg = new OkDialog(_("Error"), errorMsg); dlg->addActionListener(mWrongDataNoticeListener); } else |