diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-09-06 20:57:24 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-09-06 22:58:35 +0300 |
commit | 4ad3cd45f7a8c3f6d1817705c06223d1a2798a2f (patch) | |
tree | a776928bb1339cdd29eb2e54d50eb3fa6e3448d7 /src/gui/logindialog.cpp | |
parent | 22ed653d8b630c813333d5c73a4ca02dede2a5a5 (diff) | |
download | mv-4ad3cd45f7a8c3f6d1817705c06223d1a2798a2f.tar.gz mv-4ad3cd45f7a8c3f6d1817705c06223d1a2798a2f.tar.bz2 mv-4ad3cd45f7a8c3f6d1817705c06223d1a2798a2f.tar.xz mv-4ad3cd45f7a8c3f6d1817705c06223d1a2798a2f.zip |
Improve constructors in some classes.
Diffstat (limited to 'src/gui/logindialog.cpp')
-rw-r--r-- | src/gui/logindialog.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/gui/logindialog.cpp b/src/gui/logindialog.cpp index e105911e8..4f0325a1d 100644 --- a/src/gui/logindialog.cpp +++ b/src/gui/logindialog.cpp @@ -110,7 +110,25 @@ class UpdateListModel : public gcn::ListModel LoginDialog::LoginDialog(LoginData *const data, std::string serverName, std::string *const updateHost): Window(_("Login"), false, nullptr, "login.xml"), + ActionListener(), + KeyListener(), mLoginData(data), + mUserField(new TextField(mLoginData->username)), + mPassField(new PasswordField(mLoginData->password)), + mKeepCheck(new CheckBox(_("Remember username"), mLoginData->remember)), + mUpdateTypeLabel(new Label(_("Update:"))), + mUpdateHostLabel(nullptr), + mUpdateTypeModel(new UpdateTypeModel()), + mUpdateTypeDropDown(new DropDown(mUpdateTypeModel)), + mServerButton(new Button(_("Change Server"), "server", this)), + mLoginButton(new Button(_("Login"), "login", this)), + mRegisterButton(new Button(_("Register"), "register", this)), + mCustomUpdateHost(new CheckBox(_("Custom update host"), + mLoginData->updateType & LoginData::Upd_Custom, this, "customhost")), + mUpdateHostText(new TextField(serverConfig.getValue( + "customUpdateHost", ""))), + mUpdateListModel(nullptr), + mUpdateHostDropDown(nullptr), mUpdateHost(updateHost), mServerName(serverName) { @@ -136,25 +154,11 @@ LoginDialog::LoginDialog(LoginData *const data, std::string serverName, mUpdateListModel = nullptr; mUpdateHostDropDown = nullptr; } - - mCustomUpdateHost = new CheckBox(_("Custom update host"), - mLoginData->updateType & LoginData::Upd_Custom, this, "customhost"); - - mUpdateHostText = new TextField(serverConfig.getValue( - "customUpdateHost", "")); - mUpdateHostText->adjustSize(); - mUserField = new TextField(mLoginData->username); - mPassField = new PasswordField(mLoginData->password); - if (mPassField->getText().empty() && LoginDialog::savedPassword != "") mPassField->setText(LoginDialog::savedPassword); - mKeepCheck = new CheckBox(_("Remember username"), mLoginData->remember); - mUpdateTypeLabel = new Label(_("Update:")); - mUpdateTypeModel = new UpdateTypeModel(); - mUpdateTypeDropDown = new DropDown(mUpdateTypeModel); mUpdateTypeDropDown->setActionEventId("updatetype"); mUpdateTypeDropDown->setSelected((mLoginData->updateType | LoginData::Upd_Custom) ^ LoginData::Upd_Custom); @@ -162,10 +166,6 @@ LoginDialog::LoginDialog(LoginData *const data, std::string serverName, if (!mCustomUpdateHost->isSelected()) mUpdateHostText->setVisible(false); - mRegisterButton = new Button(_("Register"), "register", this); - mServerButton = new Button(_("Change Server"), "server", this); - mLoginButton = new Button(_("Login"), "login", this); - mUserField->setActionEventId("login"); mPassField->setActionEventId("login"); |