From d3abd1ca85028ba143dd715e91b145bf936875f1 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Thu, 27 Feb 2014 16:26:31 -0800 Subject: Support for multiple buttons --- indra/newview/llpanellogin.cpp | 47 +- indra/newview/llpanellogin.h | 4 +- indra/newview/skins/default/xui/en/panel_login.xml | 4 + .../skins/default/xui/en/panel_login_first.xml | 517 +++++++++++---------- 4 files changed, 294 insertions(+), 278 deletions(-) diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index a17f6a2a7d..420166ba7d 100755 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -170,7 +170,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, void (*callback)(S32 option, void* user_data), void *cb_data) : LLPanel(), - mLogoImage(), mCallback(callback), mCallbackData(cb_data), mListener(new LLPanelLoginListener(this)) @@ -197,9 +196,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, login_holder->addChild(this); } - // Logo - mLogoImage = LLUI::getUIImage("startup_logo"); - if (gSavedSettings.getBOOL("FirstLoginThisInstall")) { buildFromFile( "panel_login_first.xml"); @@ -214,7 +210,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, LLLineEditor* password_edit(getChild("password_edit")); password_edit->setKeystrokeCallback(onPassKey, this); // STEAM-14: When user presses Enter with this field in focus, initiate login - password_edit->setCommitCallback(boost::bind(&LLPanelLogin::onClickConnect, this)); + password_edit->setCommitCallback(boost::bind(&LLPanelLogin::onClickConnectLast, this)); // change z sort of clickable text to be behind buttons sendChildToBack(getChildView("forgot_password_text")); @@ -272,7 +268,9 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, LLPanelLogin::onUpdateStartSLURL(start_slurl); // updates grid if needed } - childSetAction("connect_btn", onClickConnect, this); + childSetAction("connect_btn", onClickConnectLast, this); + childSetAction("connect_favorite_btn", onClickConnectFavorite, this); + childSetAction("connect_location_btn", onClickConnectLocation, this); getChild("links_login_panel")->setDefaultBtn("connect_btn"); @@ -284,8 +282,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, LLTextBox* forgot_password_text = getChild("forgot_password_text"); forgot_password_text->setClickedCallback(onClickForgotPassword, NULL); - childSetAction("create_new_account_btn", onClickNewAccount, NULL); - LLTextBox* need_help_text = getChild("login_help"); need_help_text->setClickedCallback(onClickHelp, NULL); @@ -715,8 +711,8 @@ void LLPanelLogin::autologinToLocation(const LLSLURL& slurl) if ( LLPanelLogin::sInstance != NULL ) { - void* unused_paramter = 0; - LLPanelLogin::sInstance->onClickConnect(unused_paramter); + void* unused_parameter = 0; + LLPanelLogin::sInstance->onClickConnect(unused_parameter); } } @@ -804,6 +800,27 @@ void LLPanelLogin::handleMediaEvent(LLPluginClassMedia* /*self*/, EMediaEvent ev //--------------------------------------------------------------------------- // Protected methods //--------------------------------------------------------------------------- +// static +void LLPanelLogin::onClickConnectLast(void *) +{ + std::string location = LLSLURL::SIM_LOCATION_LAST; + LLStartUp::setStartSLURL(location); + + void* unused_parameter = 0; + LLPanelLogin::sInstance->onClickConnect(unused_parameter); +} + +void LLPanelLogin::onClickConnectFavorite(void *) +{ + LLPanelLogin::sInstance->onLocationSLURL(); + + void* unused_parameter = 0; + LLPanelLogin::sInstance->onClickConnect(unused_parameter); +} + +void LLPanelLogin::onClickConnectLocation(void *) +{ +} // static void LLPanelLogin::onClickConnect(void *) @@ -872,16 +889,6 @@ void LLPanelLogin::onClickConnect(void *) } } -// static -void LLPanelLogin::onClickNewAccount(void*) -{ - if (sInstance) - { - LLWeb::loadURLExternal(LLTrans::getString("create_account_url")); - } -} - - // static void LLPanelLogin::onClickVersion(void*) { diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index bdce2b3a8c..072924c3f8 100755 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -88,6 +88,9 @@ private: void onSelectServer(); void onLocationSLURL(); + static void onClickConnectLast(void*); + static void onClickConnectFavorite(void*); + static void onClickConnectLocation(void*); static void onClickConnect(void*); static void onClickNewAccount(void*); static void onClickVersion(void*); @@ -97,7 +100,6 @@ private: static void updateServerCombo(); private: - LLPointer mLogoImage; boost::scoped_ptr mListener; void (*mCallback)(S32 option, void *userdata); diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index be6d109b6f..cf469a9aad 100755 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -111,6 +111,8 @@ tool_tip="The username you chose when you registered, like bobsmith12 or Steller Sunshine" name="username_combo" width="232"> + - - - - - - - - - - - - - - - - - - - - - - - -