summaryrefslogtreecommitdiff
path: root/src/gui/register.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-10-01 12:48:28 -0600
committerJared Adams <jaxad0127@gmail.com>2009-10-01 12:48:28 -0600
commitda61b7e9cb40e75ad0d74cc64853bf1b08d0a031 (patch)
treea1d5157ac530b42ce4ca2c316fcaa419cc23c01c /src/gui/register.cpp
parent83fd36204202b4b5cca7e6cdb37c025919f32f08 (diff)
downloadmana-da61b7e9cb40e75ad0d74cc64853bf1b08d0a031.tar.gz
mana-da61b7e9cb40e75ad0d74cc64853bf1b08d0a031.tar.bz2
mana-da61b7e9cb40e75ad0d74cc64853bf1b08d0a031.tar.xz
mana-da61b7e9cb40e75ad0d74cc64853bf1b08d0a031.zip
Finish merging registration dialog
Diffstat (limited to 'src/gui/register.cpp')
-rw-r--r--src/gui/register.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/gui/register.cpp b/src/gui/register.cpp
index ec91c098..50f63c69 100644
--- a/src/gui/register.cpp
+++ b/src/gui/register.cpp
@@ -52,6 +52,7 @@ void WrongDataNoticeListener::action(const gcn::ActionEvent &event)
mTarget->requestFocus();
}
+std::string *RegisterDialog::useEmail = NULL;
Gender *RegisterDialog::useGender = NULL;
RegisterDialog::RegisterDialog(LoginData *loginData):
@@ -62,17 +63,13 @@ RegisterDialog::RegisterDialog(LoginData *loginData):
gcn::Label *userLabel = new Label(_("Name:"));
gcn::Label *passwordLabel = new Label(_("Password:"));
gcn::Label *confirmLabel = new Label(_("Confirm:"));
-#ifdef TMWSERV_SUPPORT
gcn::Label *emailLabel = new Label(_("Email:"));
-#endif
mUserField = new TextField(loginData->username);
mPasswordField = new PasswordField(loginData->password);
mConfirmField = new PasswordField;
mMaleButton = new RadioButton(_("Male"), "sex", true);
mFemaleButton = new RadioButton(_("Female"), "sex", false);
-#ifdef TMWSERV_SUPPORT
mEmailField = new TextField;
-#endif
mRegisterButton = new Button(_("Register"), "register", this);
mCancelButton = new Button(_("Cancel"), "cancel", this);
@@ -88,15 +85,14 @@ RegisterDialog::RegisterDialog(LoginData *loginData):
place(2, 3, mFemaleButton);
}
-#ifdef TMWSERV_SUPPORT
- place(0, 3, emailLabel);
-#endif
+ if (useEmail)
+ {
+ place(0, 3, emailLabel);
+ place(1, 3, mEmailField, 3).setPadding(2);
+ }
place(1, 0, mUserField, 3).setPadding(2);
place(1, 1, mPasswordField, 3).setPadding(2);
place(1, 2, mConfirmField, 3).setPadding(2);
-#ifdef TMWSERV_SUPPORT
- place(1, 3, mEmailField, 3).setPadding(2);
-#endif
place = getPlacer(0, 2);
place(1, 0, mRegisterButton);
place(2, 0, mCancelButton);
@@ -215,9 +211,8 @@ void RegisterDialog::action(const gcn::ActionEvent &event)
if (useGender)
*useGender = mFemaleButton->isSelected() ? GENDER_FEMALE :
GENDER_MALE;
-#ifdef TMWSERV_SUPPORT
- mLoginData->email = mEmailField->getText();
-#endif
+ if (useEmail)
+ *useEmail = mEmailField->getText();
mLoginData->registerLogin = true;
state = STATE_REGISTER_ATTEMPT;
@@ -230,6 +225,11 @@ void RegisterDialog::keyPressed(gcn::KeyEvent &keyEvent)
mRegisterButton->setEnabled(canSubmit());
}
+void RegisterDialog::setEmail(std::string *email)
+{
+ useEmail = email;
+}
+
void RegisterDialog::setGender(Gender *gender)
{
useGender = gender;