diff options
Diffstat (limited to 'indra/newview/llstartup.cpp')
-rw-r--r-- | indra/newview/llstartup.cpp | 170 |
1 files changed, 87 insertions, 83 deletions
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index dad8046e50..0111676a97 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -134,6 +134,7 @@ #include "llurlsimstring.h" #include "llurlwhitelist.h" #include "lluserauth.h" +#include "llvieweraudio.h" #include "llviewerassetstorage.h" #include "llviewercamera.h" #include "llviewerdisplay.h" @@ -155,12 +156,16 @@ #include "llworldmap.h" #include "llxfermanager.h" #include "pipeline.h" -#include "viewer.h" +#include "llappviewer.h" #include "llmediaengine.h" #include "llfasttimerview.h" #include "llfloatermap.h" #include "llweb.h" #include "llvoiceclient.h" +#include "llnamelistctrl.h" +#include "llnamebox.h" +#include "llnameeditor.h" +#include "llurlsimstring.h" #if LL_LIBXUL_ENABLED #include "llmozlib.h" @@ -186,13 +191,7 @@ // // exported globals // - -// HACK: Allow server to change sun and moon IDs. -// I can't figure out how to pass the appropriate -// information into the LLVOSky constructor. JC -LLUUID gSunTextureID = IMG_SUN; -LLUUID gMoonTextureID = IMG_MOON; -LLUUID gCloudTextureID = IMG_CLOUD_POOF; +BOOL gAgentMovementCompleted = FALSE; const char* SCREEN_HOME_FILENAME = "screen_home.bmp"; const char* SCREEN_LAST_FILENAME = "screen_last.bmp"; @@ -202,7 +201,6 @@ const char* SCREEN_LAST_FILENAME = "screen_last.bmp"; // extern S32 gStartImageWidth; extern S32 gStartImageHeight; -extern std::string gSerialNumber; // // local globals @@ -250,6 +248,17 @@ void init_start_screen(S32 location_id); void release_start_screen(); void reset_login(); +void callback_cache_name(const LLUUID& id, const char* firstname, const char* lastname, BOOL is_group, void* data) +{ + LLNameListCtrl::refreshAll(id, firstname, lastname, is_group); + LLNameBox::refreshAll(id, firstname, lastname, is_group); + LLNameEditor::refreshAll(id, firstname, lastname, is_group); + + // TODO: Actually be intelligent about the refresh. + // For now, just brute force refresh the dialogs. + dialog_refresh_all(); +} + // // exported functionality // @@ -288,9 +297,9 @@ public: void update_texture_fetch() { - gTextureCache->update(1); // unpauses the texture cache thread - gImageDecodeThread->update(1); // unpauses the image thread - gTextureFetch->update(1); // unpauses the texture fetch thread + LLAppViewer::getTextureCache()->update(1); // unpauses the texture cache thread + LLAppViewer::getImageDecodeThread()->update(1); // unpauses the image thread + LLAppViewer::getTextureFetch()->update(1); // unpauses the texture fetch thread gImageList.updateImages(0.10f); } @@ -372,7 +381,7 @@ BOOL idle_startup() ///////////////////////////////////////////////// // - // Initialize stuff that doesn't need data from userserver/simulators + // Initialize stuff that doesn't need data from simulators // if (gFeatureManagerp->isSafe()) @@ -412,7 +421,7 @@ BOOL idle_startup() // *TODO:translate (maybe - very unlikely error message) // Note: alerts.xml may be invalid - if this gets translated it will need to be in the code LLString bad_xui_msg = "An error occured while updating Second Life. Please download the latest version from www.secondlife.com."; - app_early_exit(bad_xui_msg); + LLAppViewer::instance()->earlyExit(bad_xui_msg); } // // Statistics stuff @@ -465,13 +474,13 @@ BOOL idle_startup() std::string())) { std::string msg = llformat("Unable to start networking, error %d", gMessageSystem->getErrorCode()); - app_early_exit(msg); + LLAppViewer::instance()->earlyExit(msg); } LLMessageConfig::initClass("viewer", gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "")); } else { - app_early_exit("Unable to initialize communications."); + LLAppViewer::instance()->earlyExit("Unable to initialize communications."); } if(gMessageSystem && gMessageSystem->isOK()) @@ -651,7 +660,7 @@ BOOL idle_startup() else { // if not automatically logging in, display login dialog - // until a valid userserver is selected + // a valid grid is selected firstname = gSavedSettings.getString("FirstName"); lastname = gSavedSettings.getString("LastName"); password = load_password_from_disk(); @@ -731,11 +740,11 @@ BOOL idle_startup() gSavedSettings.setString("LastName", lastname); llinfos << "Attempting login as: " << firstname << " " << lastname << llendl; - write_debug("Attempting login as: "); - write_debug(firstname); - write_debug(" "); - write_debug(lastname); - write_debug("\n"); + LLAppViewer::instance()->writeDebug("Attempting login as: "); + LLAppViewer::instance()->writeDebug(firstname); + LLAppViewer::instance()->writeDebug(" "); + LLAppViewer::instance()->writeDebug(lastname); + LLAppViewer::instance()->writeDebug("\n"); } // create necessary directories @@ -783,17 +792,17 @@ BOOL idle_startup() LLString server_label; S32 domain_name_index; BOOL user_picked_server = LLPanelLogin::getServer( server_label, domain_name_index ); - gUserServerChoice = (EUserServerDomain) domain_name_index; - gSavedSettings.setS32("ServerChoice", gUserServerChoice); - if (gUserServerChoice == USERSERVER_OTHER) + gGridChoice = (EGridInfo) domain_name_index; + gSavedSettings.setS32("ServerChoice", gGridChoice); + if (gGridChoice == GRID_INFO_OTHER) { - snprintf(gUserServerName, MAX_STRING, "%s", server_label.c_str()); /* Flawfinder: ignore */ + snprintf(gGridName, MAX_STRING, "%s", server_label.c_str()); /* Flawfinder: ignore */ } if ( user_picked_server ) - { // User picked a grid from the popup, so clear the stored urls and they will be re-generated from gUserServerChoice + { // User picked a grid from the popup, so clear the stored urls and they will be re-generated from gGridChoice sAuthUris.clear(); - resetURIs(); + LLAppViewer::instance()->resetURIs(); } LLString location; @@ -908,12 +917,12 @@ BOOL idle_startup() } if (sAuthUris.empty()) { - sAuthUris = getLoginURIs(); + sAuthUris = LLAppViewer::instance()->getLoginURIs(); } sAuthUriNum = 0; auth_method = "login_to_simulator"; auth_desc = "Logging in. "; - auth_desc += gSecondLife; + auth_desc += LLAppViewer::instance()->getSecondLifeTitle(); auth_desc += " may appear frozen. Please wait."; LLStartUp::setStartupState( STATE_LOGIN_AUTHENTICATE ); } @@ -966,7 +975,7 @@ BOOL idle_startup() gLastExecFroze, requested_options, hashed_mac_string, - gSerialNumber); + LLAppViewer::instance()->getSerialNumber()); // reset globals gAcceptTOS = FALSE; gAcceptCriticalMessage = FALSE; @@ -1167,7 +1176,7 @@ BOOL idle_startup() default: if (sAuthUriNum >= (int) sAuthUris.size() - 1) { - emsg << "Unable to connect to " << gSecondLife << ".\n"; + emsg << "Unable to connect to " << LLAppViewer::instance()->getSecondLifeTitle() << ".\n"; emsg << gUserAuthp->errorMessage(); } else { sAuthUriNum++; @@ -1187,7 +1196,7 @@ BOOL idle_startup() { delete gUserAuthp; gUserAuthp = NULL; - app_force_quit(NULL); + LLAppViewer::instance()->forceQuit(); return FALSE; } @@ -1202,15 +1211,15 @@ BOOL idle_startup() const char* text; text = gUserAuthp->getResponse("agent_id"); if(text) gAgentID.set(text); - write_debug("AgentID: "); - write_debug(text); - write_debug("\n"); + LLAppViewer::instance()->writeDebug("AgentID: "); + LLAppViewer::instance()->writeDebug(text); + LLAppViewer::instance()->writeDebug("\n"); text = gUserAuthp->getResponse("session_id"); if(text) gAgentSessionID.set(text); - write_debug("SessionID: "); - write_debug(text); - write_debug("\n"); + LLAppViewer::instance()->writeDebug("SessionID: "); + LLAppViewer::instance()->writeDebug(text); + LLAppViewer::instance()->writeDebug("\n"); text = gUserAuthp->getResponse("secure_session_id"); if(text) gAgent.mSecureSessionID.set(text); @@ -1238,7 +1247,6 @@ BOOL idle_startup() } gSavedSettings.setBOOL("RememberPassword", remember_password); gSavedSettings.setBOOL("LoginLastLocation", gSavedSettings.getBOOL("LoginLastLocation")); - gSavedSettings.setBOOL("LoggedIn", TRUE); text = gUserAuthp->getResponse("agent_access"); if(text && (text[0] == 'M')) @@ -1587,7 +1595,7 @@ BOOL idle_startup() gCacheName->addObserver(callback_cache_name); // Load stored cache if possible - load_name_cache(); + LLAppViewer::instance()->loadNameCache(); } // Data storage for map of world. @@ -1985,22 +1993,8 @@ BOOL idle_startup() gAgent.sendReliableMessage(); // request all group information - // *FIX: This will not do the right thing if the message - // gets there before the requestuserserverconnection - // circuit is completed. gAgent.sendAgentDataUpdateRequest(); - - // NOTE: removed as part of user-privacy - // enhancements. this information should be available from - // login. 2006-10-16 Phoenix. - // get the users that have been granted modify powers - //msg->newMessageFast(_PREHASH_RequestGrantedProxies); - //msg->nextBlockFast(_PREHASH_AgentData); - //msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - //msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - //gAgent.sendReliableMessage(); - BOOL shown_at_exit = gSavedSettings.getBOOL("ShowInventory"); // Create the inventory views @@ -2136,7 +2130,6 @@ BOOL idle_startup() //msg->setHandlerFuncFast(_PREHASH_AttachedSoundCutoffRadius, process_attached_sound_cutoff_radius); llinfos << "Initialization complete" << llendl; - gInitializationComplete = TRUE; gRenderStartTime.reset(); gForegroundTime.reset(); @@ -2352,27 +2345,27 @@ void login_show() llinfos << "Setting Servers" << llendl; - if( USERSERVER_OTHER == gUserServerChoice ) + if( GRID_INFO_OTHER == gGridChoice ) { - LLPanelLogin::addServer( gUserServerName, USERSERVER_OTHER ); + LLPanelLogin::addServer( gGridName, GRID_INFO_OTHER ); } else { - LLPanelLogin::addServer( gUserServerDomainName[gUserServerChoice].mLabel, gUserServerChoice ); + LLPanelLogin::addServer( gGridInfo[gGridChoice].mLabel, gGridChoice ); } // Arg! We hate loops! - LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_DMZ].mLabel, USERSERVER_DMZ ); - LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_LOCAL].mLabel, USERSERVER_LOCAL ); - LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_AGNI].mLabel, USERSERVER_AGNI ); - LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_ADITI].mLabel, USERSERVER_ADITI ); - LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_SIVA].mLabel, USERSERVER_SIVA ); - LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_DURGA].mLabel, USERSERVER_DURGA ); - LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_SHAKTI].mLabel, USERSERVER_SHAKTI ); - LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_GANGA].mLabel, USERSERVER_GANGA ); - LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_UMA].mLabel, USERSERVER_UMA ); - LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_SOMA].mLabel, USERSERVER_SOMA ); - LLPanelLogin::addServer( gUserServerDomainName[USERSERVER_VAAK].mLabel, USERSERVER_VAAK ); + LLPanelLogin::addServer( gGridInfo[GRID_INFO_DMZ].mLabel, GRID_INFO_DMZ ); + LLPanelLogin::addServer( gGridInfo[GRID_INFO_LOCAL].mLabel, GRID_INFO_LOCAL ); + LLPanelLogin::addServer( gGridInfo[GRID_INFO_AGNI].mLabel, GRID_INFO_AGNI ); + LLPanelLogin::addServer( gGridInfo[GRID_INFO_ADITI].mLabel, GRID_INFO_ADITI ); + LLPanelLogin::addServer( gGridInfo[GRID_INFO_SIVA].mLabel, GRID_INFO_SIVA ); + LLPanelLogin::addServer( gGridInfo[GRID_INFO_DURGA].mLabel, GRID_INFO_DURGA ); + LLPanelLogin::addServer( gGridInfo[GRID_INFO_SHAKTI].mLabel, GRID_INFO_SHAKTI ); + LLPanelLogin::addServer( gGridInfo[GRID_INFO_GANGA].mLabel, GRID_INFO_GANGA ); + LLPanelLogin::addServer( gGridInfo[GRID_INFO_UMA].mLabel, GRID_INFO_UMA ); + LLPanelLogin::addServer( gGridInfo[GRID_INFO_SOMA].mLabel, GRID_INFO_SOMA ); + LLPanelLogin::addServer( gGridInfo[GRID_INFO_VAAK].mLabel, GRID_INFO_VAAK ); } // Callback for when login screen is closed. Option 0 = connect, option 1 = quit. @@ -2405,7 +2398,7 @@ void login_callback(S32 option, void *userdata) LLPanelLogin::close(); // Next iteration through main loop should shut down the app cleanly. - gQuit = TRUE; + LLAppViewer::instance()->userQuit(); // gQuit = TRUE; return; } @@ -2660,7 +2653,7 @@ void update_dialog_callback(S32 option, void *userdata) // ...user doesn't want to do it if (mandatory) { - app_force_quit(); + LLAppViewer::instance()->forceQuit(); // Bump them back to the login screen. //reset_login(); } @@ -2680,7 +2673,9 @@ void update_dialog_callback(S32 option, void *userdata) #elif LL_LINUX query_map["os"] = "lnx"; #endif - query_map["userserver"] = gUserServerName; + // *TODO change userserver to be grid on both viewer and sim, since + // userserver no longer exists. + query_map["userserver"] = gGridName; query_map["channel"] = gChannelName; // *TODO constantize this guy LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); @@ -2691,7 +2686,7 @@ void update_dialog_callback(S32 option, void *userdata) { // We're hosed, bail llwarns << "LLDir::getTempFilename() failed" << llendl; - app_force_quit(NULL); + LLAppViewer::instance()->forceQuit(); return; } @@ -2709,7 +2704,7 @@ void update_dialog_callback(S32 option, void *userdata) if (!CopyFileA(updater_source.c_str(), update_exe_path.c_str(), FALSE)) { llinfos << "Unable to copy the updater!" << llendl; - app_force_quit(NULL); + LLAppViewer::instance()->forceQuit(); return; } @@ -2742,13 +2737,14 @@ void update_dialog_callback(S32 option, void *userdata) program_name = "SecondLife"; } - params << " -silent -name \"" << gSecondLife << "\""; + params << " -silent -name \"" << LLAppViewer::instance()->getSecondLifeTitle() << "\""; params << " -program \"" << program_name << "\""; } llinfos << "Calling updater: " << update_exe_path << " " << params.str() << llendl; - remove_marker_file(); // In case updater fails + // *REMOVE:Mani The following call is handled through ~LLAppViewer. + // remove_marker_file(); // In case updater fails // Use spawn() to run asynchronously int retval = _spawnl(_P_NOWAIT, update_exe_path.c_str(), update_exe_path.c_str(), params.str().c_str(), NULL); @@ -2767,13 +2763,14 @@ void update_dialog_callback(S32 option, void *userdata) update_exe_path += "/AutoUpdater.app/Contents/MacOS/AutoUpdater' -url \""; update_exe_path += update_url.asString(); update_exe_path += "\" -name \""; - update_exe_path += gSecondLife; + update_exe_path += LLAppViewer::instance()->getSecondLifeTitle(); update_exe_path += "\" &"; llinfos << "Calling updater: " << update_exe_path << llendl; - - remove_marker_file(); // In case updater fails + // *REMOVE:Mani The following call is handled through ~LLAppViewer. + // remove_marker_file(); // In case updater fails + // Run the auto-updater. system(update_exe_path.c_str()); /* Flawfinder: ignore */ @@ -2781,16 +2778,18 @@ void update_dialog_callback(S32 option, void *userdata) OSMessageBox("Automatic updating is not yet implemented for Linux.\n" "Please download the latest version from www.secondlife.com.", NULL, OSMB_OK); - remove_marker_file(); + + // *REMOVE:Mani The following call is handled through ~LLAppViewer. + // remove_marker_file(); #endif - app_force_quit(NULL); + LLAppViewer::instance()->forceQuit(); } void use_circuit_callback(void**, S32 result) { // bail if we're quitting. - if(gQuit) return; + if(LLApp::isExiting()) return; if( !gUseCircuitCallbackCalled ) { gUseCircuitCallbackCalled = true; @@ -3689,3 +3688,8 @@ bool LLStartUp::dispatchURL() } return false; } + +void login_alert_done(S32 option, void* user_data) +{ + LLPanelLogin::giveFocus(); +} |