diff options
author | Callum Prentice <callum@gmail.com> | 2017-07-12 16:07:02 -0700 |
---|---|---|
committer | Callum Prentice <callum@gmail.com> | 2017-07-12 16:07:02 -0700 |
commit | a62592d73bafbdc00c3af68570ce4adac2f25c4e (patch) | |
tree | 72d4e38f12ed74b3b53d938a460117b77f9c1da7 /indra/newview/llfloatertos.cpp | |
parent | 5b64387d017f5a04826e2592710b444874daa8ad (diff) |
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
Diffstat (limited to 'indra/newview/llfloatertos.cpp')
-rw-r--r-- | indra/newview/llfloatertos.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
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<LLCheckBoxCtrl>("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<LLUICtrl>("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<LLCheckBoxCtrl>("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<LLCheckBoxCtrl>("agree_chk"); + tos_agreement_agree_cb->setEnabled(enabled); + + LLTextBox* tos_agreement_agree_text = getChild<LLTextBox>("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<LLCheckBoxCtrl>("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<LLFloater> 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; |