From a62592d73bafbdc00c3af68570ce4adac2f25c4e Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Wed, 12 Jul 2017 16:07:02 -0700 Subject: Fixes for: 'MAINT-7588 Viewer takes 3 to 5 seconds to load TOS and styling different on redirecting page' and 'MAINT-7599 Reformat ToS 'Accept' label as a single string'. The former's load time is improved by only asking for the HTTP header to check site is alive and then applying a specific CSS style to the page instead of relying on the CEF default (which appears to change often). The latter replaces the XUI checkbox label with a text box and adjusts it visually as necessary for enabled/disabled states --- indra/newview/llfloatertos.cpp | 25 ++++++++++++++-------- indra/newview/llfloatertos.h | 2 ++ indra/newview/skins/default/xui/en/floater_tos.xml | 12 ++++++----- 3 files changed, 25 insertions(+), 14 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp index 1743d0fc69..6af2e666b2 100644 --- a/indra/newview/llfloatertos.cpp +++ b/indra/newview/llfloatertos.cpp @@ -74,8 +74,7 @@ BOOL LLFloaterTOS::postBuild() } // disable Agree to TOS radio button until the page has fully loaded - LLCheckBoxCtrl* tos_agreement = getChild("agree_chk"); - tos_agreement->setEnabled( false ); + updateAgreeEnabled(false); // hide the SL text widget if we're displaying TOS with using a browser widget. LLUICtrl *editor = getChild("tos_text"); @@ -148,8 +147,7 @@ void LLFloaterTOS::setSiteIsAlive( bool alive ) LL_INFOS("TOS") << "ToS page: ToS page unavailable!" << LL_ENDL; // normally this is set when navigation to TOS page navigation completes (so you can't accept before TOS loads) // but if the page is unavailable, we need to do this now - LLCheckBoxCtrl* tos_agreement = getChild("agree_chk"); - tos_agreement->setEnabled( true ); + updateAgreeEnabled(true); } } #endif @@ -166,6 +164,17 @@ void LLFloaterTOS::draw() LLModalDialog::draw(); } + +// update status of "Agree" checkbox and text +void LLFloaterTOS::updateAgreeEnabled(bool enabled) +{ + LLCheckBoxCtrl* tos_agreement_agree_cb = getChild("agree_chk"); + tos_agreement_agree_cb->setEnabled(enabled); + + LLTextBox* tos_agreement_agree_text = getChild("agree_list"); + tos_agreement_agree_text->setEnabled(enabled); +} + // static void LLFloaterTOS::updateAgree(LLUICtrl*, void* userdata ) { @@ -227,9 +236,8 @@ void LLFloaterTOS::handleMediaEvent(LLPluginClassMedia* /*self*/, EMediaEvent ev else if(mRealNavigateBegun) { LL_INFOS("TOS") << "TOS: NAVIGATE COMPLETE" << LL_ENDL; - // enable Agree to TOS radio button now that page has loaded - LLCheckBoxCtrl * tos_agreement = getChild("agree_chk"); - tos_agreement->setEnabled( true ); + // enable Agree to TOS check box now that page has loaded + updateAgreeEnabled(true); } } } @@ -242,9 +250,8 @@ void LLFloaterTOS::testSiteIsAliveCoro(LLHandle handle, std::string u LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); LLCore::HttpOptions::ptr_t httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); - httpOpts->setWantHeaders(true); - + httpOpts->setHeadersOnly(true); LL_INFOS("testSiteIsAliveCoro") << "Generic POST for " << url << LL_ENDL; diff --git a/indra/newview/llfloatertos.h b/indra/newview/llfloatertos.h index e70c9f24af..85033acf4d 100644 --- a/indra/newview/llfloatertos.h +++ b/indra/newview/llfloatertos.h @@ -58,6 +58,8 @@ public: void setSiteIsAlive( bool alive ); + void updateAgreeEnabled(bool enabled); + // inherited from LLViewerMediaObserver /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); diff --git a/indra/newview/skins/default/xui/en/floater_tos.xml b/indra/newview/skins/default/xui/en/floater_tos.xml index e3b49bf917..8976d2a78f 100644 --- a/indra/newview/skins/default/xui/en/floater_tos.xml +++ b/indra/newview/skins/default/xui/en/floater_tos.xml @@ -13,7 +13,7 @@ - data:text/html,%3Chtml%3E%3Chead%3E%3C/head%3E%3Cbody text=%22000000%22%3E%3Ch2%3E Loading %3Ca%20target%3D%22_external%22%20href%3D%22http%3A//secondlife.com/app/tos/%22%3ETerms%20of%20Service%3C/a%3E...%3C/h2%3E %3C/body%3E %3C/html%3E + data:text/html;charset=utf-8;base64,PGh0bWw+DQo8aGVhZD4NCjxzdHlsZT4NCmJvZHkgew0KICBmb250LWZhbWlseTogIkRlamEgVnUgU2FucyIsIEhlbHZldGljYSwgQXJpYWwsIHNhbnMtc2VyaWY7DQogIGNvbG9yOiAjZmZmOw0KICBiYWNrZ3JvdW5kLWNvbG9yOiByZ2IoMzEsIDMxLCAzMSk7DQp9DQphIHsNCiAgICBjb2xvcjogcmdiKDkyLCAxNzcsIDE0Nik7DQogICAgdGV4dC1kZWNvcmF0aW9uOiBub25lOw0KfQ0KI2NlbnRlcmVkIHsNCiAgcG9zaXRpb246IHJlbGF0aXZlOw0KICBmbG9hdDogbGVmdDsNCiAgdG9wOiA1MCU7DQogIGxlZnQ6IDUwJTsNCiAgdHJhbnNmb3JtOiB0cmFuc2xhdGUoLTUwJSwgLTUwJSk7DQp9DQo8L3N0eWxlPg0KPC9oZWFkPg0KPGJvZHk+DQo8ZGl2IGlkPSJjZW50ZXJlZCI+TG9hZGluZyA8YSB0YXJnZXQ9Il9leHRlcm5hbCIgaHJlZj0iaHR0cDovL3NlY29uZGxpZmUuY29tL2FwcC90b3MvIj5UZXJtcyBvZiBTZXJ2aWNlPC9hPi4uLjwvZGl2Pg0KPC9ib2R5Pg0KPC9odG1sPg== the Second Life Terms and Conditions, Privacy Policy, and Terms of Service, including the dispute resolution requirements. + text_readonly_color="LabelDisabledColor" + width="552"> + I have read and agree to the Second Life Terms and Conditions, Privacy Policy, and Terms of Service, including the dispute resolution requirements.