aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanellogin.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:22 -0500
committerJacek Antonelli2008-08-15 23:45:22 -0500
commit1e8e051fafa147fc3375bf7693c781e3be17b6d4 (patch)
tree071633b1e27b13f52619ea60a58338bfab34538a /linden/indra/newview/llpanellogin.cpp
parentSecond Life viewer sources 1.18.6.0-RC (diff)
downloadmeta-impy-1e8e051fafa147fc3375bf7693c781e3be17b6d4.zip
meta-impy-1e8e051fafa147fc3375bf7693c781e3be17b6d4.tar.gz
meta-impy-1e8e051fafa147fc3375bf7693c781e3be17b6d4.tar.bz2
meta-impy-1e8e051fafa147fc3375bf7693c781e3be17b6d4.tar.xz
Second Life viewer sources 1.18.6.1-RC
Diffstat (limited to 'linden/indra/newview/llpanellogin.cpp')
-rw-r--r--linden/indra/newview/llpanellogin.cpp49
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
676void 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