diff options
author | Yohann Ferreira <bertram@cegetel.net> | 2005-05-05 17:46:28 +0000 |
---|---|---|
committer | Yohann Ferreira <bertram@cegetel.net> | 2005-05-05 17:46:28 +0000 |
commit | 026faf4c349a82651b942d52f574b1895af9ab21 (patch) | |
tree | ab1fd8664b6f4aba9d597512798a4b3ca1142381 /src/gui/login.cpp | |
parent | 673fc0a7078a80ec7dbaa5f64e2cdacb8f0f2e71 (diff) | |
download | mana-026faf4c349a82651b942d52f574b1895af9ab21.tar.gz mana-026faf4c349a82651b942d52f574b1895af9ab21.tar.bz2 mana-026faf4c349a82651b942d52f574b1895af9ab21.tar.xz mana-026faf4c349a82651b942d52f574b1895af9ab21.zip |
Now the server can be set in the login window.
Diffstat (limited to 'src/gui/login.cpp')
-rw-r--r-- | src/gui/login.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/gui/login.cpp b/src/gui/login.cpp index 3b9c3cac..bdd10397 100644 --- a/src/gui/login.cpp +++ b/src/gui/login.cpp @@ -38,14 +38,16 @@ LoginDialog::LoginDialog(): { userLabel = new gcn::Label("Name:"); passLabel = new gcn::Label("Password:"); + serverLabel = new gcn::Label("Server:"); userField = new TextField("player"); passField = new PasswordField(); + serverField = new TextField(); keepCheck = new CheckBox("Keep", false); okButton = new Button("OK"); cancelButton = new Button("Cancel"); registerButton = new Button("Register"); - setContentSize(200, 75); + setContentSize(200, 100); userLabel->setPosition(5, 5); passLabel->setPosition(5, 14 + userLabel->getHeight()); @@ -53,19 +55,23 @@ LoginDialog::LoginDialog(): passField->setPosition(65, 14 + userLabel->getHeight()); userField->setWidth(130); passField->setWidth(130); - keepCheck->setPosition(4, 52); + serverField->setWidth(130); + serverLabel->setPosition(5,19 + userLabel->getHeight() + passField->getHeight()); + serverField->setPosition(65,19 + userField->getHeight() + passField->getHeight()); + keepCheck->setPosition(4, 74); keepCheck->setMarked(config.getValue("remember", 0)); cancelButton->setPosition( 200 - cancelButton->getWidth() - 5, - 75 - cancelButton->getHeight() - 5); + 97 - cancelButton->getHeight() - 5); okButton->setPosition( cancelButton->getX() - okButton->getWidth() - 5, - 75 - okButton->getHeight() - 5); + 97 - okButton->getHeight() - 5); registerButton->setPosition(keepCheck->getX() + keepCheck->getWidth() + 10, - 75 - registerButton->getHeight() - 5); + 97 - registerButton->getHeight() - 5); userField->setEventId("ok"); passField->setEventId("ok"); + serverField->setEventId("ok"); okButton->setEventId("ok"); cancelButton->setEventId("cancel"); registerButton->setEventId("register"); @@ -79,8 +85,10 @@ LoginDialog::LoginDialog(): add(userLabel); add(passLabel); + add(serverLabel); add(userField); add(passField); + add(serverField); add(keepCheck); add(okButton); add(cancelButton); @@ -96,14 +104,19 @@ LoginDialog::LoginDialog(): passField->requestFocus(); } } + + serverField->setText(config.getValue("host", "")); + } LoginDialog::~LoginDialog() { delete userLabel; delete passLabel; + delete serverLabel; delete userField; delete passField; + delete serverField; delete keepCheck; delete okButton; delete cancelButton; @@ -119,6 +132,7 @@ void LoginDialog::action(const std::string& eventId) config.setValue("remember", keepCheck->isMarked()); if (keepCheck->isMarked()) { config.setValue("username", user); + config.setValue("host", serverField->getText()); } else { config.setValue("username", ""); } |