aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llstartup.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:27 -0500
committerJacek Antonelli2008-08-15 23:45:27 -0500
commita8a62201ba762e98dff92cf49033e577fc34d8d4 (patch)
tree11f8513c5cdc222f2fac0c93eb724c089803c200 /linden/indra/newview/llstartup.cpp
parentSecond Life viewer sources 1.18.6.4-RC (diff)
downloadmeta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.zip
meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.gz
meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.bz2
meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.xz
Second Life viewer sources 1.19.0.0
Diffstat (limited to 'linden/indra/newview/llstartup.cpp')
-rw-r--r--linden/indra/newview/llstartup.cpp232
1 files changed, 202 insertions, 30 deletions
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp
index 98f1658..07aefad 100644
--- a/linden/indra/newview/llstartup.cpp
+++ b/linden/indra/newview/llstartup.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -72,7 +72,6 @@
72#include "lluserrelations.h" 72#include "lluserrelations.h"
73#include "llversionviewer.h" 73#include "llversionviewer.h"
74#include "llvfs.h" 74#include "llvfs.h"
75#include "llwindow.h" // for shell_open
76#include "llxorcipher.h" // saved password, MAC address 75#include "llxorcipher.h" // saved password, MAC address
77#include "message.h" 76#include "message.h"
78#include "v3math.h" 77#include "v3math.h"
@@ -123,6 +122,7 @@
123#include "llpanelgroupnotices.h" 122#include "llpanelgroupnotices.h"
124#include "llpreview.h" 123#include "llpreview.h"
125#include "llpreviewscript.h" 124#include "llpreviewscript.h"
125#include "llsecondlifeurls.h"
126#include "llselectmgr.h" 126#include "llselectmgr.h"
127#include "llsky.h" 127#include "llsky.h"
128#include "llsrv.h" 128#include "llsrv.h"
@@ -154,6 +154,7 @@
154#include "llviewerwindow.h" 154#include "llviewerwindow.h"
155#include "llvoavatar.h" 155#include "llvoavatar.h"
156#include "llvoclouds.h" 156#include "llvoclouds.h"
157#include "llweb.h"
157#include "llworld.h" 158#include "llworld.h"
158#include "llworldmap.h" 159#include "llworldmap.h"
159#include "llxfermanager.h" 160#include "llxfermanager.h"
@@ -167,7 +168,6 @@
167#include "llnamelistctrl.h" 168#include "llnamelistctrl.h"
168#include "llnamebox.h" 169#include "llnamebox.h"
169#include "llnameeditor.h" 170#include "llnameeditor.h"
170#include "llurlsimstring.h"
171 171
172#if LL_LIBXUL_ENABLED 172#if LL_LIBXUL_ENABLED
173#include "llmozlib.h" 173#include "llmozlib.h"
@@ -351,6 +351,7 @@ BOOL idle_startup()
351 static S32 location_which = START_LOCATION_ID_LAST; 351 static S32 location_which = START_LOCATION_ID_LAST;
352 352
353 static BOOL show_connect_box = TRUE; 353 static BOOL show_connect_box = TRUE;
354 static BOOL remember_password = TRUE;
354 355
355 static BOOL stipend_since_login = FALSE; 356 static BOOL stipend_since_login = FALSE;
356 357
@@ -583,7 +584,28 @@ BOOL idle_startup()
583#endif // LL_LINUX 584#endif // LL_LINUX
584 585
585 // initialize Mozilla - pass in executable dir, location of extra dirs (chrome/, greprefs/, plugins/ etc.) and path to profile dir) 586 // initialize Mozilla - pass in executable dir, location of extra dirs (chrome/, greprefs/, plugins/ etc.) and path to profile dir)
586 LLMozLib::getInstance()->init( gDirUtilp->getExecutableDir(), componentDir, gDirUtilp->getExpandedFilename( LL_PATH_MOZILLA_PROFILE, "" ) ); 587
588 std::string application_dir;
589 std::string component_dir;
590 std::string profile_dir;
591
592#if LL_WINDOWS
593 // Fix strings passed into Mozilla; it expects local-codepage mbcs paths rather than UTF8
594 llutf16string temp_16str = utf8str_to_utf16str( gDirUtilp->getExecutableDir() );
595 application_dir = ll_convert_wide_to_string( (const wchar_t*) temp_16str.c_str() );
596
597 temp_16str = utf8str_to_utf16str( componentDir );
598 component_dir = ll_convert_wide_to_string( (const wchar_t*) temp_16str.c_str() );
599
600 temp_16str = utf8str_to_utf16str( gDirUtilp->getExpandedFilename( LL_PATH_MOZILLA_PROFILE, "" ).c_str() );
601 profile_dir = ll_convert_wide_to_string( (const wchar_t*) temp_16str.c_str() );
602#else
603 application_dir = gDirUtilp->getExecutableDir().c_str();
604 component_dir = componentDir.c_str();
605 profile_dir = gDirUtilp->getExpandedFilename( LL_PATH_MOZILLA_PROFILE, "" ).c_str();
606#endif
607
608 LLMozLib::getInstance()->init( application_dir, componentDir, profile_dir );
587 609
588#if LL_LINUX 610#if LL_LINUX
589 setlocale(LC_ALL, saved_locale.c_str() ); 611 setlocale(LC_ALL, saved_locale.c_str() );
@@ -655,7 +677,17 @@ BOOL idle_startup()
655 firstname = gCmdLineFirstName; 677 firstname = gCmdLineFirstName;
656 lastname = gCmdLineLastName; 678 lastname = gCmdLineLastName;
657 679
680 LLMD5 pass((unsigned char*)gCmdLinePassword.c_str());
681 char md5pass[33]; /* Flawfinder: ignore */
682 pass.hex_digest(md5pass);
683 password = md5pass;
684 remember_password = gSavedSettings.getBOOL("RememberPassword");
685
686#ifdef USE_VIEWER_AUTH
658 show_connect_box = TRUE; 687 show_connect_box = TRUE;
688#else
689 show_connect_box = FALSE;
690#endif
659 gAutoLogin = TRUE; 691 gAutoLogin = TRUE;
660 } 692 }
661 else if (gAutoLogin || gSavedSettings.getBOOL("AutoLogin")) 693 else if (gAutoLogin || gSavedSettings.getBOOL("AutoLogin"))
@@ -664,7 +696,13 @@ BOOL idle_startup()
664 lastname = gSavedSettings.getString("LastName"); 696 lastname = gSavedSettings.getString("LastName");
665 password = load_password_from_disk(); 697 password = load_password_from_disk();
666 gSavedSettings.setBOOL("RememberPassword", TRUE); 698 gSavedSettings.setBOOL("RememberPassword", TRUE);
699 remember_password = TRUE;
700
701#ifdef USE_VIEWER_AUTH
667 show_connect_box = TRUE; 702 show_connect_box = TRUE;
703#else
704 show_connect_box = FALSE;
705#endif
668 } 706 }
669 else 707 else
670 { 708 {
@@ -673,6 +711,7 @@ BOOL idle_startup()
673 firstname = gSavedSettings.getString("FirstName"); 711 firstname = gSavedSettings.getString("FirstName");
674 lastname = gSavedSettings.getString("LastName"); 712 lastname = gSavedSettings.getString("LastName");
675 password = load_password_from_disk(); 713 password = load_password_from_disk();
714 remember_password = gSavedSettings.getBOOL("RememberPassword");
676 show_connect_box = TRUE; 715 show_connect_box = TRUE;
677 } 716 }
678 717
@@ -694,6 +733,9 @@ BOOL idle_startup()
694 733
695 if (show_connect_box) 734 if (show_connect_box)
696 { 735 {
736 // Load all the name information out of the login view
737 LLPanelLogin::getFields(firstname, lastname, password, remember_password);
738
697 if (gNoRender) 739 if (gNoRender)
698 { 740 {
699 llerrs << "Need to autologin or use command line with norender!" << llendl; 741 llerrs << "Need to autologin or use command line with norender!" << llendl;
@@ -703,6 +745,8 @@ BOOL idle_startup()
703 745
704 // Show the login dialog 746 // Show the login dialog
705 login_show(); 747 login_show();
748 // connect dialog is already shown, so fill in the names
749 LLPanelLogin::setFields( firstname, lastname, password, remember_password );
706 750
707 LLPanelLogin::giveFocus(); 751 LLPanelLogin::giveFocus();
708 752
@@ -768,6 +812,11 @@ BOOL idle_startup()
768 812
769 if (show_connect_box) 813 if (show_connect_box)
770 { 814 {
815 // TODO if not use viewer auth
816 // Load all the name information out of the login view
817 LLPanelLogin::getFields(firstname, lastname, password, remember_password);
818 // end TODO
819
771 // HACK: Try to make not jump on login 820 // HACK: Try to make not jump on login
772 gKeyboard->resetKeys(); 821 gKeyboard->resetKeys();
773 } 822 }
@@ -777,6 +826,16 @@ BOOL idle_startup()
777 gSavedSettings.setString("FirstName", firstname); 826 gSavedSettings.setString("FirstName", firstname);
778 gSavedSettings.setString("LastName", lastname); 827 gSavedSettings.setString("LastName", lastname);
779 828
829 if (remember_password)
830 {
831 save_password_to_disk(password.c_str());
832 }
833 else
834 {
835 save_password_to_disk(NULL);
836 }
837 gSavedSettings.setBOOL("RememberPassword", remember_password);
838
780 llinfos << "Attempting login as: " << firstname << " " << lastname << llendl; 839 llinfos << "Attempting login as: " << firstname << " " << lastname << llendl;
781 gDebugInfo["LoginName"] = firstname + " " + lastname; 840 gDebugInfo["LoginName"] = firstname + " " + lastname;
782 } 841 }
@@ -823,13 +882,36 @@ BOOL idle_startup()
823 882
824 if (show_connect_box) 883 if (show_connect_box)
825 { 884 {
885 // TODO only set loginuri based on server choice if ! USE_VIEWER_AUTH
886 LLString server_label;
887 S32 domain_name_index;
888 BOOL user_picked_server = LLPanelLogin::getServer( server_label, domain_name_index );
889 gGridChoice = (EGridInfo) domain_name_index;
890 gSavedSettings.setS32("ServerChoice", gGridChoice);
891 if (gGridChoice == GRID_INFO_OTHER)
892 {
893 snprintf(gGridName, MAX_STRING, "%s", server_label.c_str());/* Flawfinder: ignore */
894 }
895
896 if ( user_picked_server )
897 { // User picked a grid from the popup, so clear the stored urls and they will be re-generated from gGridChoice
898 sAuthUris.clear();
899 LLAppViewer::instance()->resetURIs();
900 }
901
902 LLString location;
903 LLPanelLogin::getLocation( location );
904 LLURLSimString::setString( location );
905 // END TODO
826 LLPanelLogin::close(); 906 LLPanelLogin::close();
827 } 907 }
828 908
829 909
830 //For HTML parsing in text boxes. 910 //For HTML parsing in text boxes.
831 LLTextEditor::setLinkColor( gSavedSettings.getColor4("HTMLLinkColor") ); 911 LLTextEditor::setLinkColor( gSavedSettings.getColor4("HTMLLinkColor") );
832 LLTextEditor::setURLCallbacks ( &LLWeb::loadURL, &LLURLDispatcher::dispatch, &LLURLDispatcher::dispatch ); 912 LLTextEditor::setURLCallbacks ( &LLWeb::loadURL,
913 &LLURLDispatcher::dispatchFromTextEditor,
914 &LLURLDispatcher::dispatchFromTextEditor );
833 915
834 //------------------------------------------------- 916 //-------------------------------------------------
835 // Handle startup progress screen 917 // Handle startup progress screen
@@ -933,9 +1015,15 @@ BOOL idle_startup()
933 gSavedSettings.setBOOL("UseDebugMenus", TRUE); 1015 gSavedSettings.setBOOL("UseDebugMenus", TRUE);
934 requested_options.push_back("god-connect"); 1016 requested_options.push_back("god-connect");
935 } 1017 }
936 LLAppViewer::instance()->getLoginURIs(); 1018 const std::vector<std::string>& uris = LLAppViewer::instance()->getLoginURIs();
937 sAuthUris = LLAppViewer::instance()->getLoginURIs(); 1019 std::vector<std::string>::const_iterator iter, end;
938 1020 for (iter = uris.begin(), end = uris.end(); iter != end; ++iter)
1021 {
1022 std::vector<std::string> rewritten;
1023 rewritten = LLSRV::rewriteURI(*iter);
1024 sAuthUris.insert(sAuthUris.end(),
1025 rewritten.begin(), rewritten.end());
1026 }
939 sAuthUriNum = 0; 1027 sAuthUriNum = 0;
940 auth_method = "login_to_simulator"; 1028 auth_method = "login_to_simulator";
941 auth_desc = "Logging in. "; 1029 auth_desc = "Logging in. ";
@@ -979,12 +1067,14 @@ BOOL idle_startup()
979 hashed_mac.finalize(); 1067 hashed_mac.finalize();
980 hashed_mac.hex_digest(hashed_mac_string); 1068 hashed_mac.hex_digest(hashed_mac_string);
981 1069
1070 // TODO if statement here to use web_login_key
982 gUserAuthp->authenticate( 1071 gUserAuthp->authenticate(
983 sAuthUris[sAuthUriNum].c_str(), 1072 sAuthUris[sAuthUriNum].c_str(),
984 auth_method.c_str(), 1073 auth_method.c_str(),
985 firstname.c_str(), 1074 firstname.c_str(),
986 lastname.c_str(), 1075 lastname.c_str(),
987 web_login_key, 1076 // web_login_key,
1077 password.c_str(),
988 start.str().c_str(), 1078 start.str().c_str(),
989 gSkipOptionalUpdate, 1079 gSkipOptionalUpdate,
990 gAcceptTOS, 1080 gAcceptTOS,
@@ -1256,7 +1346,16 @@ BOOL idle_startup()
1256 if(text) lastname.assign(text); 1346 if(text) lastname.assign(text);
1257 gSavedSettings.setString("FirstName", firstname); 1347 gSavedSettings.setString("FirstName", firstname);
1258 gSavedSettings.setString("LastName", lastname); 1348 gSavedSettings.setString("LastName", lastname);
1259 1349
1350 if (remember_password)
1351 {
1352 save_password_to_disk(password.c_str());
1353 }
1354 else
1355 {
1356 save_password_to_disk(NULL);
1357 }
1358 gSavedSettings.setBOOL("RememberPassword", remember_password);
1260 gSavedSettings.setBOOL("LoginLastLocation", gSavedSettings.getBOOL("LoginLastLocation")); 1359 gSavedSettings.setBOOL("LoginLastLocation", gSavedSettings.getBOOL("LoginLastLocation"));
1261 1360
1262 text = gUserAuthp->getResponse("agent_access"); 1361 text = gUserAuthp->getResponse("agent_access");
@@ -1461,6 +1560,8 @@ BOOL idle_startup()
1461 reset_login(); 1560 reset_login();
1462 gAutoLogin = FALSE; 1561 gAutoLogin = FALSE;
1463 show_connect_box = TRUE; 1562 show_connect_box = TRUE;
1563 // Don't save an incorrect password to disk.
1564 save_password_to_disk(NULL);
1464 } 1565 }
1465 return do_normal_idle; 1566 return do_normal_idle;
1466 } 1567 }
@@ -1747,8 +1848,8 @@ BOOL idle_startup()
1747 } 1848 }
1748 else 1849 else
1749 { 1850 {
1750 //llinfos << "######### QuickTime version (hex) is " << std::hex << LLMediaEngine::getInstance()->getQuickTimeVersion() << llendl; 1851 llinfos << "QUICKTIME> QuickTime version (hex) is " << std::hex << LLMediaEngine::getInstance()->getQuickTimeVersion() << llendl;
1751 //llinfos << "######### QuickTime version is " << std::dec << LLMediaEngine::getInstance()->getQuickTimeVersion() << llendl; 1852 llinfos << "QUICKTIME> QuickTime version is " << std::dec << LLMediaEngine::getInstance()->getQuickTimeVersion() << llendl;
1752 if ( LLMediaEngine::getInstance()->getQuickTimeVersion() < LL_MIN_QUICKTIME_VERSION ) 1853 if ( LLMediaEngine::getInstance()->getQuickTimeVersion() < LL_MIN_QUICKTIME_VERSION )
1753 { 1854 {
1754 // turn off QuickTime if version is less than required 1855 // turn off QuickTime if version is less than required
@@ -1764,6 +1865,8 @@ BOOL idle_startup()
1764 }; 1865 };
1765 }; 1866 };
1766 #elif LL_DARWIN 1867 #elif LL_DARWIN
1868 llinfos << "QUICKTIME> QuickTime version (hex) is " << std::hex << LLMediaEngine::getInstance()->getQuickTimeVersion() << llendl;
1869 llinfos << "QUICKTIME> QuickTime version is " << std::dec << LLMediaEngine::getInstance()->getQuickTimeVersion() << llendl;
1767 if ( LLMediaEngine::getInstance()->getQuickTimeVersion() < LL_MIN_QUICKTIME_VERSION ) 1870 if ( LLMediaEngine::getInstance()->getQuickTimeVersion() < LL_MIN_QUICKTIME_VERSION )
1768 { 1871 {
1769 // turn off QuickTime if version is less than required 1872 // turn off QuickTime if version is less than required
@@ -2156,7 +2259,6 @@ BOOL idle_startup()
2156 msg->setHandlerFuncFast(_PREHASH_PreloadSound, process_preload_sound); 2259 msg->setHandlerFuncFast(_PREHASH_PreloadSound, process_preload_sound);
2157 msg->setHandlerFuncFast(_PREHASH_AttachedSound, process_attached_sound); 2260 msg->setHandlerFuncFast(_PREHASH_AttachedSound, process_attached_sound);
2158 msg->setHandlerFuncFast(_PREHASH_AttachedSoundGainChange, process_attached_sound_gain_change); 2261 msg->setHandlerFuncFast(_PREHASH_AttachedSoundGainChange, process_attached_sound_gain_change);
2159 //msg->setHandlerFuncFast(_PREHASH_AttachedSoundCutoffRadius, process_attached_sound_cutoff_radius);
2160 2262
2161 llinfos << "Initialization complete" << llendl; 2263 llinfos << "Initialization complete" << llendl;
2162 2264
@@ -2201,7 +2303,7 @@ BOOL idle_startup()
2201 else 2303 else
2202 { 2304 {
2203 args["[TYPE]"] = "home"; 2305 args["[TYPE]"] = "home";
2204 args["[HELP]"] = "\nYou may want to set a new home location."; 2306 args["[HELP]"] = "You may want to set a new home location.";
2205 } 2307 }
2206 gViewerWindow->alertXml("AvatarMoved", args); 2308 gViewerWindow->alertXml("AvatarMoved", args);
2207 } 2309 }
@@ -2339,7 +2441,7 @@ BOOL idle_startup()
2339 audio_update_volume(); 2441 audio_update_volume();
2340 2442
2341 // reset keyboard focus to sane state of pointing at world 2443 // reset keyboard focus to sane state of pointing at world
2342 gFocusMgr.setKeyboardFocus(NULL, NULL); 2444 gFocusMgr.setKeyboardFocus(NULL);
2343 2445
2344#if 0 // sjb: enable for auto-enabling timer display 2446#if 0 // sjb: enable for auto-enabling timer display
2345 gDebugView->mFastTimerView->setVisible(TRUE); 2447 gDebugView->mFastTimerView->setVisible(TRUE);
@@ -2373,12 +2475,76 @@ void login_show()
2373 // UI textures have been previously loaded in doPreloadImages() 2475 // UI textures have been previously loaded in doPreloadImages()
2374 2476
2375 llinfos << "Setting Servers" << llendl; 2477 llinfos << "Setting Servers" << llendl;
2478
2479 if( GRID_INFO_OTHER == gGridChoice )
2480 {
2481 LLPanelLogin::addServer( gGridName, GRID_INFO_OTHER );
2482 }
2483 else
2484 {
2485 LLPanelLogin::addServer( gGridInfo[gGridChoice].mLabel, gGridChoice );
2486 }
2487
2488 // Arg! We hate loops!
2489 LLPanelLogin::addServer( gGridInfo[GRID_INFO_ADITI].mLabel, GRID_INFO_ADITI );
2490 LLPanelLogin::addServer( gGridInfo[GRID_INFO_AGNI].mLabel, GRID_INFO_AGNI );
2491 LLPanelLogin::addServer( gGridInfo[GRID_INFO_ARUNA].mLabel, GRID_INFO_ARUNA );
2492 LLPanelLogin::addServer( gGridInfo[GRID_INFO_DURGA].mLabel, GRID_INFO_DURGA );
2493 LLPanelLogin::addServer( gGridInfo[GRID_INFO_GANGA].mLabel, GRID_INFO_GANGA );
2494 LLPanelLogin::addServer( gGridInfo[GRID_INFO_MITRA].mLabel, GRID_INFO_MITRA );
2495 LLPanelLogin::addServer( gGridInfo[GRID_INFO_MOHINI].mLabel, GRID_INFO_MOHINI );
2496 LLPanelLogin::addServer( gGridInfo[GRID_INFO_NANDI].mLabel, GRID_INFO_NANDI );
2497 LLPanelLogin::addServer( gGridInfo[GRID_INFO_RADHA].mLabel, GRID_INFO_RADHA );
2498 LLPanelLogin::addServer( gGridInfo[GRID_INFO_RAVI].mLabel, GRID_INFO_RAVI );
2499 LLPanelLogin::addServer( gGridInfo[GRID_INFO_SIVA].mLabel, GRID_INFO_SIVA );
2500 LLPanelLogin::addServer( gGridInfo[GRID_INFO_SHAKTI].mLabel, GRID_INFO_SHAKTI );
2501 LLPanelLogin::addServer( gGridInfo[GRID_INFO_SOMA].mLabel, GRID_INFO_SOMA );
2502 LLPanelLogin::addServer( gGridInfo[GRID_INFO_UMA].mLabel, GRID_INFO_UMA );
2503 LLPanelLogin::addServer( gGridInfo[GRID_INFO_VAAK].mLabel, GRID_INFO_VAAK );
2504 LLPanelLogin::addServer( gGridInfo[GRID_INFO_YAMI].mLabel, GRID_INFO_YAMI );
2505 LLPanelLogin::addServer( gGridInfo[GRID_INFO_LOCAL].mLabel, GRID_INFO_LOCAL );
2376} 2506}
2377 2507
2378// Callback for when login screen is closed. Option 0 = connect, option 1 = quit. 2508// Callback for when login screen is closed. Option 0 = connect, option 1 = quit.
2379void login_callback(S32 option, void *userdata) 2509void login_callback(S32 option, void *userdata)
2380{ 2510{
2511 const S32 CONNECT_OPTION = 0;
2512 const S32 QUIT_OPTION = 1;
2381 2513
2514 if (CONNECT_OPTION == option)
2515 {
2516 LLStartUp::setStartupState( STATE_LOGIN_CLEANUP );
2517 return;
2518 }
2519 else if (QUIT_OPTION == option)
2520 {
2521 // Make sure we don't save the password if the user is trying to clear it.
2522 LLString first, last, password;
2523 BOOL remember = TRUE;
2524 LLPanelLogin::getFields(first, last, password, remember);
2525 if (!remember)
2526 {
2527 // turn off the setting and write out to disk
2528 gSavedSettings.setBOOL("RememberPassword", FALSE);
2529 gSavedSettings.saveToFile(gSettingsFileName, TRUE);
2530
2531 // stomp the saved password on disk
2532 save_password_to_disk(NULL);
2533 }
2534
2535 // Next iteration through main loop should shut down the app cleanly.
2536 LLAppViewer::instance()->userQuit();
2537
2538 if (LLAppViewer::instance()->quitRequested())
2539 {
2540 LLPanelLogin::close();
2541 }
2542 return;
2543 }
2544 else
2545 {
2546 llwarns << "Unknown login button clicked" << llendl;
2547 }
2382} 2548}
2383 2549
2384LLString load_password_from_disk() 2550LLString load_password_from_disk()
@@ -2531,17 +2697,22 @@ void set_startup_status(const F32 frac, const char *string, const char* msg)
2531 2697
2532void login_alert_status(S32 option, void* user_data) 2698void login_alert_status(S32 option, void* user_data)
2533{ 2699{
2534 if (0 == option) 2700 // Buttons
2535 { 2701 switch( option )
2536 // OK button 2702 {
2537 } 2703 case 0: // OK
2538 else if (1 == option) 2704 break;
2539 { 2705 case 1: // Help
2540 // Help button 2706 LLWeb::loadURL( SUPPORT_URL );
2541 std::string help_path; 2707 break;
2542 help_path = gDirUtilp->getExpandedFilename(LL_PATH_HELP, "unable_to_connect.html"); 2708 case 2: // Teleport
2543 load_url_local_file(help_path.c_str() ); 2709 // Restart the login process, starting at our home locaton
2544 } 2710 LLURLSimString::setString(LLURLSimString::sLocationStringHome);
2711 LLStartUp::setStartupState( STATE_LOGIN_CLEANUP );
2712 break;
2713 default:
2714 llwarns << "Missing case in login_alert_status switch" << llendl;
2715 }
2545 2716
2546 LLPanelLogin::giveFocus(); 2717 LLPanelLogin::giveFocus();
2547} 2718}
@@ -2810,7 +2981,6 @@ void register_viewer_callbacks(LLMessageSystem* msg)
2810 msg->setHandlerFuncFast(_PREHASH_MeanCollisionAlert, process_mean_collision_alert_message, NULL); 2981 msg->setHandlerFuncFast(_PREHASH_MeanCollisionAlert, process_mean_collision_alert_message, NULL);
2811 msg->setHandlerFunc("ViewerFrozenMessage", process_frozen_message); 2982 msg->setHandlerFunc("ViewerFrozenMessage", process_frozen_message);
2812 2983
2813 //msg->setHandlerFuncFast(_PREHASH_RequestAvatarInfo, process_avatar_info_request);
2814 msg->setHandlerFuncFast(_PREHASH_NameValuePair, process_name_value); 2984 msg->setHandlerFuncFast(_PREHASH_NameValuePair, process_name_value);
2815 msg->setHandlerFuncFast(_PREHASH_RemoveNameValuePair, process_remove_name_value); 2985 msg->setHandlerFuncFast(_PREHASH_RemoveNameValuePair, process_remove_name_value);
2816 msg->setHandlerFuncFast(_PREHASH_AvatarAnimation, process_avatar_animation); 2986 msg->setHandlerFuncFast(_PREHASH_AvatarAnimation, process_avatar_animation);
@@ -3641,7 +3811,8 @@ bool LLStartUp::dispatchURL()
3641 // ok, if we've gotten this far and have a startup URL 3811 // ok, if we've gotten this far and have a startup URL
3642 if (!sSLURLCommand.empty()) 3812 if (!sSLURLCommand.empty())
3643 { 3813 {
3644 LLURLDispatcher::dispatch(sSLURLCommand); 3814 const bool from_external_browser = true;
3815 LLURLDispatcher::dispatch(sSLURLCommand, from_external_browser);
3645 } 3816 }
3646 else if (LLURLSimString::parse()) 3817 else if (LLURLSimString::parse())
3647 { 3818 {
@@ -3657,7 +3828,8 @@ bool LLStartUp::dispatchURL()
3657 || (dy*dy > SLOP*SLOP) ) 3828 || (dy*dy > SLOP*SLOP) )
3658 { 3829 {
3659 std::string url = LLURLSimString::getURL(); 3830 std::string url = LLURLSimString::getURL();
3660 LLURLDispatcher::dispatch(url); 3831 const bool from_external_browser = true;
3832 LLURLDispatcher::dispatch(url, from_external_browser);
3661 } 3833 }
3662 return true; 3834 return true;
3663 } 3835 }