diff options
Diffstat (limited to 'linden/indra/newview/llpanellogin.cpp')
-rw-r--r-- | linden/indra/newview/llpanellogin.cpp | 49 |
1 files changed, 41 insertions, 8 deletions
diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp index 3e64bba..c7f10fd 100644 --- a/linden/indra/newview/llpanellogin.cpp +++ b/linden/indra/newview/llpanellogin.cpp | |||
@@ -149,6 +149,13 @@ void LLLoginHandler::parse(const LLSD& queryMap) | |||
149 | gGridChoice = GRID_INFO_UMA; | 149 | gGridChoice = GRID_INFO_UMA; |
150 | } | 150 | } |
151 | 151 | ||
152 | #if !LL_RELEASE_FOR_DOWNLOAD | ||
153 | if (gGridChoice > GRID_INFO_NONE && gGridChoice < GRID_INFO_LOCAL) | ||
154 | { | ||
155 | gSavedSettings.setS32("ServerChoice", gGridChoice); | ||
156 | } | ||
157 | #endif | ||
158 | |||
152 | snprintf(gGridName, MAX_STRING, "%s", gGridInfo[gGridChoice].mName); /* Flawfinder: ignore */ | 159 | snprintf(gGridName, MAX_STRING, "%s", gGridInfo[gGridChoice].mName); /* Flawfinder: ignore */ |
153 | LLAppViewer::instance()->resetURIs(); | 160 | LLAppViewer::instance()->resetURIs(); |
154 | 161 | ||
@@ -304,6 +311,9 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, | |||
304 | LLWebBrowserCtrl* web_browser = LLUICtrlFactory::getWebBrowserCtrlByName(this, "login_html"); | 311 | LLWebBrowserCtrl* web_browser = LLUICtrlFactory::getWebBrowserCtrlByName(this, "login_html"); |
305 | if ( web_browser ) | 312 | if ( web_browser ) |
306 | { | 313 | { |
314 | // observe browser events | ||
315 | web_browser->addObserver( this ); | ||
316 | |||
307 | // don't make it a tab stop until SL-27594 is fixed | 317 | // don't make it a tab stop until SL-27594 is fixed |
308 | web_browser->setTabStop(FALSE); | 318 | web_browser->setTabStop(FALSE); |
309 | 319 | ||
@@ -329,7 +339,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, | |||
329 | 339 | ||
330 | // kick off a request to grab the url manually | 340 | // kick off a request to grab the url manually |
331 | gResponsePtr = LLIamHereLogin::build( this ); | 341 | gResponsePtr = LLIamHereLogin::build( this ); |
332 | LLHTTPClient::get( childGetValue( "real_url" ).asString(), gResponsePtr ); | 342 | LLHTTPClient::head( childGetValue( "real_url" ).asString(), gResponsePtr ); |
333 | }; | 343 | }; |
334 | #else | 344 | #else |
335 | mHtmlAvailable = FALSE; | 345 | mHtmlAvailable = FALSE; |
@@ -351,20 +361,27 @@ void LLPanelLogin::setSiteIsAlive( bool alive ) | |||
351 | 361 | ||
352 | // mark as available | 362 | // mark as available |
353 | mHtmlAvailable = TRUE; | 363 | mHtmlAvailable = TRUE; |
354 | }; | 364 | } |
355 | } | 365 | } |
356 | else | 366 | else |
357 | // the site is not available (missing page, server down, other badness) | 367 | // the site is not available (missing page, server down, other badness) |
358 | { | 368 | { |
359 | if ( web_browser ) | 369 | if ( web_browser ) |
360 | { | 370 | { |
361 | // hide browser control (revealing default one) | 371 | // painfully build the path to the loading screen |
362 | web_browser->setVisible( FALSE ); | 372 | std::string loading_path( gDirUtilp->getExpandedFilename( LL_PATH_SKINS, "" ) ); |
373 | loading_path.append( gDirUtilp->getDirDelimiter() ); | ||
374 | loading_path.append( "html" ); | ||
375 | loading_path.append( gDirUtilp->getDirDelimiter() ); | ||
376 | loading_path.append( "loading-error" ); | ||
377 | loading_path.append( gDirUtilp->getDirDelimiter() ); | ||
378 | loading_path.append( "index.html" ); | ||
379 | web_browser->navigateTo( loading_path.c_str() ); | ||
363 | 380 | ||
364 | // mark as unavailable | 381 | // mark as available |
365 | mHtmlAvailable = FALSE; | 382 | mHtmlAvailable = TRUE; |
366 | }; | 383 | } |
367 | }; | 384 | } |
368 | #else | 385 | #else |
369 | mHtmlAvailable = FALSE; | 386 | mHtmlAvailable = FALSE; |
370 | #endif | 387 | #endif |
@@ -655,6 +672,22 @@ void LLPanelLogin::loadLoginPage() | |||
655 | web_browser->navigateTo( oStr.str() ); | 672 | web_browser->navigateTo( oStr.str() ); |
656 | } | 673 | } |
657 | 674 | ||
675 | #if LL_LIBXUL_ENABLED | ||
676 | void LLPanelLogin::onNavigateComplete( const EventType& eventIn ) | ||
677 | { | ||
678 | LLWebBrowserCtrl* web_browser = LLUICtrlFactory::getWebBrowserCtrlByName(sInstance, "login_html"); | ||
679 | if (web_browser) | ||
680 | { | ||
681 | // *HACK HACK HACK HACK! | ||
682 | /* Stuff a Tab key into the browser now so that the first field will | ||
683 | ** get the focus! The embedded javascript on the page that properly | ||
684 | ** sets the initial focus in a real web browser is not working inside | ||
685 | ** the viewer, so this is an UGLY HACK WORKAROUND for now. | ||
686 | */ | ||
687 | web_browser->handleKey(KEY_TAB, MASK_NONE, false); | ||
688 | } | ||
689 | } | ||
690 | #endif | ||
658 | 691 | ||
659 | //--------------------------------------------------------------------------- | 692 | //--------------------------------------------------------------------------- |
660 | // Protected methods | 693 | // Protected methods |