summaryrefslogtreecommitdiff
path: root/src/gui/register.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-03-14 03:56:02 +0300
committerAndrei Karas <akaras@inbox.ru>2012-03-14 04:06:13 +0300
commit112d2ad1904051160822d1845d1418cca889c0d5 (patch)
tree9731934d9dc367f931c028158f3d26a670e18feb /src/gui/register.cpp
parent02e9a62ce9a0f288804bfa2aa59c3a84b0376c4a (diff)
downloadmv-112d2ad1904051160822d1845d1418cca889c0d5.tar.gz
mv-112d2ad1904051160822d1845d1418cca889c0d5.tar.bz2
mv-112d2ad1904051160822d1845d1418cca889c0d5.tar.xz
mv-112d2ad1904051160822d1845d1418cca889c0d5.zip
Add support for other gender.
Fix per gender and race items separation.
Diffstat (limited to 'src/gui/register.cpp')
-rw-r--r--src/gui/register.cpp25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/gui/register.cpp b/src/gui/register.cpp
index 4f696dc9d..eebbfa603 100644
--- a/src/gui/register.cpp
+++ b/src/gui/register.cpp
@@ -67,6 +67,7 @@ RegisterDialog::RegisterDialog(LoginData *data):
mEmailField(nullptr),
mMaleButton(nullptr),
mFemaleButton(nullptr),
+ mOtherButton(nullptr),
mWrongDataNoticeListener(new WrongDataNoticeListener),
mLoginData(data)
{
@@ -97,8 +98,18 @@ RegisterDialog::RegisterDialog(LoginData *data):
{
mMaleButton = new RadioButton(_("Male"), "sex", true);
mFemaleButton = new RadioButton(_("Female"), "sex", false);
- placer(1, row, mMaleButton);
- placer(2, row, mFemaleButton);
+ if (serverVersion >= 5)
+ {
+ mOtherButton = new RadioButton(_("Other"), "sex", false);
+ placer(0, row, mMaleButton);
+ placer(1, row, mFemaleButton);
+ placer(2, row, mOtherButton);
+ }
+ else
+ {
+ placer(1, row, mMaleButton);
+ placer(2, row, mFemaleButton);
+ }
row++;
}
@@ -235,9 +246,13 @@ void RegisterDialog::action(const gcn::ActionEvent &event)
mLoginData->username = mUserField->getText();
mLoginData->password = mPasswordField->getText();
- if (mFemaleButton)
- mLoginData->gender = mFemaleButton->isSelected() ?
- GENDER_FEMALE : GENDER_MALE;
+ if (mFemaleButton && mFemaleButton->isSelected())
+ mLoginData->gender = GENDER_FEMALE;
+ else if (mOtherButton && mOtherButton->isSelected())
+ mLoginData->gender = GENDER_OTHER;
+ else
+ mLoginData->gender = GENDER_MALE;
+
if (mEmailField)
mLoginData->email = mEmailField->getText();
mLoginData->registerLogin = true;