diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-08-27 14:43:31 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-08-27 14:43:31 +0000 |
commit | 97cdacdaf3cfa0970597483d41838906125886bc (patch) | |
tree | c4e10a46db95f3d57dc45849ce68b917d37b2854 /src/gui | |
parent | 71bded93f43a02b167ec2a9a46b90a5fcc842180 (diff) | |
download | mana-97cdacdaf3cfa0970597483d41838906125886bc.tar.gz mana-97cdacdaf3cfa0970597483d41838906125886bc.tar.bz2 mana-97cdacdaf3cfa0970597483d41838906125886bc.tar.xz mana-97cdacdaf3cfa0970597483d41838906125886bc.zip |
Got rid of server input field since connecting to the account server now
happens before the login and register dialogs.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/login.cpp | 25 | ||||
-rw-r--r-- | src/gui/login.h | 1 | ||||
-rw-r--r-- | src/gui/register.cpp | 24 | ||||
-rw-r--r-- | src/gui/register.h | 1 |
4 files changed, 15 insertions, 36 deletions
diff --git a/src/gui/login.cpp b/src/gui/login.cpp index cb16dcb4..1d9b6e1e 100644 --- a/src/gui/login.cpp +++ b/src/gui/login.cpp @@ -59,53 +59,43 @@ LoginDialog::LoginDialog(LoginData *loginData): { gcn::Label *userLabel = new gcn::Label("Name:"); gcn::Label *passLabel = new gcn::Label("Password:"); - gcn::Label *serverLabel = new gcn::Label("Server:"); mUserField = new TextField(mLoginData->username); mPassField = new PasswordField(mLoginData->password); - mServerField = new TextField(mLoginData->hostname); mKeepCheck = new CheckBox("Keep", mLoginData->remember); mOkButton = new Button("OK", "ok", this); mCancelButton = new Button("Cancel", "cancel", this); mRegisterButton = new Button("Register", "register", this); - setContentSize(200, 100); + setContentSize(200, 91); userLabel->setPosition(5, 5); passLabel->setPosition(5, 14 + userLabel->getHeight()); - serverLabel->setPosition( - 5, 23 + userLabel->getHeight() + passLabel->getHeight()); mUserField->setPosition(65, 5); mPassField->setPosition(65, 14 + userLabel->getHeight()); - mServerField->setPosition( - 65, 23 + userLabel->getHeight() + passLabel->getHeight()); mUserField->setWidth(130); mPassField->setWidth(130); - mServerField->setWidth(130); - mKeepCheck->setPosition(4, 77); + mKeepCheck->setPosition(4, 68); mCancelButton->setPosition( 200 - mCancelButton->getWidth() - 5, - 100 - mCancelButton->getHeight() - 5); + 91 - mCancelButton->getHeight() - 5); mOkButton->setPosition( mCancelButton->getX() - mOkButton->getWidth() - 5, - 100 - mOkButton->getHeight() - 5); - mRegisterButton->setPosition(mKeepCheck->getX() + mKeepCheck->getWidth() + 10, - 100 - mRegisterButton->getHeight() - 5); + 91 - mOkButton->getHeight() - 5); + mRegisterButton->setPosition( + mKeepCheck->getX() + mKeepCheck->getWidth() + 10, + 91 - mRegisterButton->getHeight() - 5); mUserField->setEventId("ok"); mPassField->setEventId("ok"); - mServerField->setEventId("ok"); mUserField->addActionListener(this); mPassField->addActionListener(this); - mServerField->addActionListener(this); mKeepCheck->addActionListener(this); add(userLabel); add(passLabel); - add(serverLabel); add(mUserField); add(mPassField); - add(mServerField); add(mKeepCheck); add(mOkButton); add(mCancelButton); @@ -141,7 +131,6 @@ LoginDialog::action(const std::string &eventId, gcn::Widget *widget) } else { - mLoginData->hostname = mServerField->getText(); mLoginData->username = mUserField->getText(); mLoginData->password = mPassField->getText(); mLoginData->remember = mKeepCheck->isMarked(); diff --git a/src/gui/login.h b/src/gui/login.h index 7218dca8..6d510da7 100644 --- a/src/gui/login.h +++ b/src/gui/login.h @@ -70,7 +70,6 @@ class LoginDialog : public Window, public gcn::ActionListener { private: gcn::TextField *mUserField; gcn::TextField *mPassField; - gcn::TextField *mServerField; gcn::CheckBox *mKeepCheck; gcn::Button *mOkButton; gcn::Button *mCancelButton; diff --git a/src/gui/register.cpp b/src/gui/register.cpp index 8004d30e..00880352 100644 --- a/src/gui/register.cpp +++ b/src/gui/register.cpp @@ -51,17 +51,15 @@ RegisterDialog::RegisterDialog(LoginData *loginData): gcn::Label *passwordLabel = new gcn::Label("Password:"); gcn::Label *confirmLabel = new gcn::Label("Confirm:"); gcn::Label *emailLabel = new gcn::Label("Email:"); - gcn::Label *serverLabel = new gcn::Label("Server:"); mUserField = new TextField("player"); mPasswordField = new PasswordField(); mConfirmField = new PasswordField(); mEmailField = new TextField(); - mServerField = new TextField(); mRegisterButton = new Button("Register", "register", this); mCancelButton = new Button("Cancel", "cancel", this); - int width = 200; - int height = 150; + const int width = 200; + const int height = 130; setContentSize(width, height); mUserField->setPosition(65, 5); @@ -75,38 +73,33 @@ RegisterDialog::RegisterDialog(LoginData *loginData): mEmailField->setPosition( 65, mConfirmField->getY() + mConfirmField->getHeight() + 7); mEmailField->setWidth(130); - mServerField->setPosition( - 65, 8 + mEmailField->getY() + mEmailField->getHeight() + 7); - mServerField->setWidth(130); userLabel->setPosition(5, mUserField->getY() + 1); passwordLabel->setPosition(5, mPasswordField->getY() + 1); confirmLabel->setPosition(5, mConfirmField->getY() + 1); emailLabel->setPosition(5, mEmailField->getY() + 1); - serverLabel->setPosition(5, mServerField->getY() + 1); - mRegisterButton->setPosition(5, height - mRegisterButton->getHeight() - 5); - mCancelButton->setPosition(10 + mRegisterButton->getWidth(), - mRegisterButton->getY()); + mCancelButton->setPosition( + width - 5 - mCancelButton->getWidth(), + height - 5 - mCancelButton->getHeight()); + mRegisterButton->setPosition( + mCancelButton->getX() - 5 - mRegisterButton->getWidth(), + mCancelButton->getY()); add(userLabel); add(passwordLabel); add(emailLabel); - add(serverLabel); add(confirmLabel); add(mUserField); add(mPasswordField); add(mConfirmField); add(mEmailField); - add(mServerField); add(mRegisterButton); add(mCancelButton); setLocationRelativeTo(getParent()); mUserField->requestFocus(); mUserField->setCaretPosition(mUserField->getText().length()); - - mServerField->setText(config.getValue("host", "")); } RegisterDialog::~RegisterDialog() @@ -199,7 +192,6 @@ RegisterDialog::action(const std::string &eventId, gcn::Widget *widget) // No errors detected, register the new user. mRegisterButton->setEnabled(false); - mLoginData->hostname = config.getValue("host", "animesites.de"); mLoginData->port = (short)config.getValue("port", 0); mLoginData->username = mUserField->getText(); mLoginData->password = mPasswordField->getText(); diff --git a/src/gui/register.h b/src/gui/register.h index 72a32bb0..8551b9e0 100644 --- a/src/gui/register.h +++ b/src/gui/register.h @@ -66,7 +66,6 @@ class RegisterDialog : public Window, public gcn::ActionListener { gcn::TextField *mPasswordField; gcn::TextField *mConfirmField; gcn::TextField *mEmailField; - gcn::TextField *mServerField; gcn::Button *mRegisterButton; gcn::Button *mCancelButton; |