diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index ed2394392..f55f7cf52 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3,10 +3,9 @@ * @brief The LLAppViewer class definitions * * $LicenseInfo:firstyear=2007&license=viewergpl$ - * + * Second Life Viewer Source Code * Copyright (c) 2007-2009, Linden Research, Inc. * - * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement @@ -30,8 +29,8 @@ * $/LicenseInfo$ */ - #include "llviewerprecompiledheaders.h" + #include "llappviewer.h" #include "hippogridmanager.h" @@ -41,7 +40,6 @@ #include "llfeaturemanager.h" #include "lluictrlfactory.h" #include "lltexteditor.h" -#include "llalertdialog.h" #include "llerrorcontrol.h" #include "lleventtimer.h" #include "llviewertexturelist.h" @@ -56,14 +54,13 @@ #include "llmd5.h" #include "llmeshrepository.h" #include "llpumpio.h" -#include "llimpanel.h" #include "llmimetypes.h" #include "llstartup.h" #include "llfocusmgr.h" #include "llviewerjoystick.h" -#include "llfloaterjoystick.h" #include "llares.h" -#include "llfloatersnapshot.h" +#include "llcurl.h" +#include "llcalc.h" #include "lltexturestats.h" #include "llviewerwindow.h" #include "llviewerdisplay.h" @@ -80,7 +77,9 @@ #include "llfirstuse.h" #include "llrender.h" #include "llvector4a.h" -#include "llfontfreetype.h" +#include "llimpanel.h" // For LLVoiceClient and LLVoiceChannel +#include "llvoavatarself.h" +#include "llprogressview.h" #include "llvocache.h" #include "llvopartgroup.h" #include "llfloaterteleporthistory.h" @@ -92,10 +91,10 @@ #include "llavatarnamecache.h" #include "lldiriterator.h" #include "llimagej2c.h" +#include "llmemory.h" #include "llprimitive.h" #include "llnotifications.h" #include "llnotificationsutil.h" -#include "llcurl.h" #include #if LL_WINDOWS @@ -121,7 +120,6 @@ #include "aihttptimeoutpolicy.h" // // The files below handle dependencies from cleanup. -#include "llcalc.h" #include "llkeyframemotion.h" #include "llworldmap.h" #include "llhudmanager.h" @@ -133,7 +131,6 @@ #include "llviewermenu.h" #include "llselectmgr.h" #include "lltrans.h" -#include "lltrans.h" #include "lltracker.h" #include "llviewerparcelmgr.h" #include "llworldmapview.h" @@ -144,15 +141,12 @@ #include "lldebugview.h" #include "llconsole.h" #include "llcontainerview.h" -#include "llfloaterstats.h" #include "llhoverview.h" -#include "llfloatermemleak.h" #include "llsdserialize.h" #include "llworld.h" #include "llhudeffecttrail.h" -#include "llhudeffectlookat.h" #include "llvectorperfoptions.h" #include "llurlsimstring.h" #include "llwatchdog.h" @@ -160,24 +154,23 @@ // Included so that constants/settings might be initialized // in save_settings_to_globals() #include "llbutton.h" -#include "llcombobox.h" #include "llstatusbar.h" #include "llsurface.h" #include "llvosky.h" #include "llvotree.h" -#include "llvoavatarself.h" #include "llfolderview.h" #include "lltoolbar.h" #include "llframestats.h" #include "llagentpilot.h" -#include "llsrv.h" #include "llvovolume.h" #include "llflexibleobject.h" #include "llvosurfacepatch.h" +#include "llcommandlineparser.h" +#include "llfloatermemleak.h" +#include "llfloatersnapshot.h" #include "llfloaterinventory.h" // includes for idle() idleShutdown() -#include "floaterao.h" #include "llviewercontrol.h" #include "lleventnotifier.h" #include "llcallbacklist.h" @@ -192,10 +185,7 @@ #include "llviewerthrottle.h" #include "llparcel.h" #include "llviewerassetstats.h" -#include "llcommandlineparser.h" -#include "llprogressview.h" -#include "llmemory.h" #include "llmainlooprepeater.h" // [RLVa:KB] @@ -220,12 +210,6 @@ //---------------------------------------------------------------------------- // viewer.cpp - these are only used in viewer, should be easily moved. - - - - - - #if LL_DARWIN extern void init_apple_menu(const char* product); #endif // LL_DARWIN @@ -483,6 +467,7 @@ static void settings_to_globals() LLSurface::setTextureSize(gSavedSettings.getU32("RegionTextureSize")); LLRender::sGLCoreProfile = gSavedSettings.getBOOL("RenderGLCoreProfile"); + LLImageGL::sGlobalUseAnisotropic = gSavedSettings.getBOOL("RenderAnisotropic"); LLImageGL::sCompressTextures = gSavedSettings.getBOOL("RenderCompressTextures"); LLVOVolume::sLODFactor = gSavedSettings.getF32("RenderVolumeLODFactor"); @@ -1196,6 +1181,7 @@ bool LLAppViewer::mainLoop() // canonical per-frame event mainloop.post(newFrame); + if (!LLApp::isExiting()) { pingMainloopTimeout("Main:JoystickKeyboard"); @@ -1203,7 +1189,7 @@ bool LLAppViewer::mainLoop() // Scan keyboard for movement keys. Command keys and typing // are handled by windows callbacks. Don't do this until we're // done initializing. JC - if (gViewerWindow->mWindow->getVisible() + if (gViewerWindow->mWindow->getVisible() && gViewerWindow->getActive() && !gViewerWindow->getWindow()->getMinimized() && LLStartUp::getStartupState() == STATE_STARTED @@ -1320,7 +1306,6 @@ bool LLAppViewer::mainLoop() ms_sleep(500); } - const F64 max_idle_time = run_multiple_threads ? 0.0 : llmin(.005*10.0*gFrameIntervalSeconds, 0.005); // 50ms/second, no more than 5ms/frame idleTimer.reset(); while(1) @@ -1382,7 +1367,6 @@ bool LLAppViewer::mainLoop() pingMainloopTimeout("Main:End"); } - } catch(std::bad_alloc) { @@ -1738,7 +1722,8 @@ bool LLAppViewer::cleanup() writeDebugInfo(); if(!gDirUtilp->getLindenUserDir(true).empty()) - LLViewerMedia::saveCookieFile(); + LLViewerMedia::saveCookieFile(); + // Stop the plugin read thread if it's running. LLPluginProcessParent::setUseReadThread(false); // Stop curl responder call backs. @@ -1758,11 +1743,11 @@ bool LLAppViewer::cleanup() pending += LLAppViewer::getTextureFetch()->update(1); // unpauses the texture fetch thread pending += LLVFSThread::updateClass(0); pending += LLLFSThread::updateClass(0); - if (pending == 0) + if (!pending) { break; } - if (idleTimer.getElapsedTimeF64() >= max_idle_time) + else if (idleTimer.getElapsedTimeF64() >= max_idle_time) { llwarns << "Quitting with pending background tasks." << llendl; break; @@ -1927,6 +1912,7 @@ bool LLAppViewer::initThreads() // Mesh streaming and caching gMeshRepo.init(); + // *FIX: no error handling here! return true; } @@ -2122,20 +2108,14 @@ bool LLAppViewer::initConfiguration() if(!loadSettingsFromDirectory(settings_w, "Default", set_defaults)) { std::ostringstream msg; - msg << "Second Life could not load its default settings file. \n" - << "The installation may be corrupted. \n"; - - OSMessageBox( - msg.str(), - LLStringUtil::null, - OSMB_OK); - + msg << "Unable to load default settings file. The installation may be corrupted."; + OSMessageBox(msg.str(),LLStringUtil::null,OSMB_OK); return false; } LLUICtrlFactory::getInstance()->setupPaths(); // setup paths for LLTrans based on settings files only LLTrans::parseStrings("strings.xml", default_trans_args); - + //COA vars in gSavedSettings will be linked to gSavedPerAccountSettings entries that will be created if not present. //Signals will be shared between linked vars. gSavedSettings.connectCOAVars(gSavedPerAccountSettings); @@ -2165,8 +2145,8 @@ bool LLAppViewer::initConfiguration() // timeout for mac and linux. There is no call stack info // on these platform to help debug. #ifndef LL_RELEASE_FOR_DOWNLOAD - gSavedSettings.setBOOL("WatchdogEnabled", FALSE); gSavedSettings.setBOOL("QAMode", TRUE ); + gSavedSettings.setBOOL("WatchdogEnabled", 0); #endif #ifndef LL_WINDOWS @@ -2210,6 +2190,7 @@ bool LLAppViewer::initConfiguration() LLControlGroupCLP clp; std::string cmd_line_config = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "cmd_line.xml"); + clp.configure(cmd_line_config, &gSavedSettings); if(!initParseCommandLine(clp)) @@ -2245,9 +2226,8 @@ bool LLAppViewer::initConfiguration() clp.notify(); // Register the core crash option as soon as we can - // if we want gdb post-mortum on cores we need to be up and running + // if we want gdb post-mortem on cores we need to be up and running // ASAP or we might miss init issue etc. - if(clp.hasOption("disablecrashlogger")) { llwarns << "Crashes will be handled by system, stack trace logs and crash logger are both disabled" <getControl(name); - // if(c) - // { - // c->setDefault(value); - // } - // else - // { - // llwarns << "'--setdefault' specified with unknown setting: '" - // << name << "'." << llendl; - // } - // } - //} - } - if(clp.hasOption("set")) { const LLCommandLineParser::token_vector_t& set_values = clp.getOption("set"); @@ -2548,7 +2498,7 @@ bool LLAppViewer::initConfiguration() if ( nextLoginLocation.length() ) { LLURLSimString::setString( nextLoginLocation ); - }; + } gLastRunVersion = gSavedSettings.getString("LastRunVersion"); @@ -2740,7 +2690,6 @@ void LLAppViewer::writeSystemInfo() gDebugInfo["SLLog"] = LLError::logFileName(); gDebugInfo["ClientInfo"]["Name"] = gVersionChannel; - gDebugInfo["ClientInfo"]["MajorVersion"] = gVersionMajor; gDebugInfo["ClientInfo"]["MinorVersion"] = gVersionMinor; gDebugInfo["ClientInfo"]["PatchVersion"] = gVersionPatch; @@ -2748,7 +2697,6 @@ void LLAppViewer::writeSystemInfo() gDebugInfo["CAFilename"] = gDirUtilp->getCAFile(); - //need to put in something to lie about this stuff gDebugInfo["CPUInfo"]["CPUString"] = gSysCPU.getCPUString(); gDebugInfo["CPUInfo"]["CPUFamily"] = gSysCPU.getFamily(); gDebugInfo["CPUInfo"]["CPUMhz"] = gSysCPU.getMHz(); @@ -2761,10 +2709,10 @@ void LLAppViewer::writeSystemInfo() gDebugInfo["OSInfo"] = getOSInfo().getOSStringSimple(); // The user is not logged on yet, but record the current grid choice login url - // which may have been the intended grid. This can b + // which may have been the intended grid. gDebugInfo["GridName"] = LLViewerLogin::getInstance()->getGridLabel(); - // *FIX:Mani - move this ddown in llappviewerwin32 + // *FIX:Mani - move this down in llappviewerwin32 #ifdef LL_WINDOWS DWORD thread_id = GetCurrentThreadId(); gDebugInfo["MainloopThreadID"] = (S32)thread_id; @@ -2814,6 +2762,7 @@ void LLAppViewer::handleViewerCrash() llinfos << "Last render pool type: " << LLPipeline::sCurRenderPoolType << llendl ; LLMemory::logMemoryInfo(true) ; + //print out recorded call stacks if there are any. LLError::LLCallStacks::print(); @@ -2842,7 +2791,6 @@ void LLAppViewer::handleViewerCrash() //We already do this in writeSystemInfo(), but we do it again here to make /sure/ we have a version //to check against no matter what - gDebugInfo["ClientInfo"]["Name"] = gVersionChannel; gDebugInfo["ClientInfo"]["MajorVersion"] = gVersionMajor; @@ -3020,13 +2968,11 @@ void LLAppViewer::initMarkerFile() std::string llerror_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, LLERROR_MARKER_FILE_NAME); std::string error_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME); - if (LLAPRFile::isExist(mMarkerFileName, LL_APR_RB) && !anotherInstanceRunning()) { gLastExecEvent = LAST_EXEC_FROZE; LL_INFOS("MarkerFile") << "Exec marker found: program froze on previous execution" << LL_ENDL; } - if(LLAPRFile::isExist(logout_marker_file, LL_APR_RB)) { gLastExecEvent = LAST_EXEC_LOGOUT_FROZE; @@ -3738,17 +3684,6 @@ void LLAppViewer::loadNameCache() { if(gCacheName->importFile(cache_file)) return; } - - // Try to load from the legacy format. This should go away after a - // while. Phoenix 2008-01-30 -#if 0 - LLFILE* name_cache_fp = LLFile::fopen(name_cache, "r"); // Flawfinder: ignore - if (name_cache_fp) - { - gCacheName->importFile(name_cache_fp); - fclose(name_cache_fp); - } -#endif } void LLAppViewer::saveNameCache() @@ -3801,6 +3736,7 @@ static LLFastTimer::DeclareTimer FTM_WORLD_UPDATE("Update World"); static LLFastTimer::DeclareTimer FTM_NETWORK("Network"); static LLFastTimer::DeclareTimer FTM_AGENT_NETWORK("Agent Network"); static LLFastTimer::DeclareTimer FTM_VLMANAGER("VL Manager"); + /////////////////////////////////////////////////////// // idle() // @@ -3861,7 +3797,6 @@ void LLAppViewer::idle() // // Special case idle if still starting up // - if (LLStartUp::getStartupState() < STATE_STARTED) { // Skip rest if idle startup returns false (essentially, no world yet) @@ -3923,7 +3858,6 @@ void LLAppViewer::idle() // Manage statistics // // - { // Initialize the viewer_stats_timer with an already elapsed time // of SEND_STATS_PERIOD so that the initial stats report will @@ -4322,7 +4256,6 @@ void LLAppViewer::sendLogoutRequest() { if(!mLogoutRequestSent && gMessageSystem) { - LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_LogoutRequest); msg->nextBlockFast(_PREHASH_AgentData); @@ -4426,6 +4359,7 @@ static LLFastTimer::DeclareTimer FTM_RETRANSMIT("Retransmit"); static LLFastTimer::DeclareTimer FTM_TIMEOUT_CHECK("Timeout Check"); static LLFastTimer::DeclareTimer FTM_DYNAMIC_THROTTLE("Dynamic Throttle"); static LLFastTimer::DeclareTimer FTM_CHECK_REGION_CIRCUIT("Check Region Circuit"); + void LLAppViewer::idleNetwork() { pingMainloopTimeout("idleNetwork"); @@ -4442,7 +4376,8 @@ void LLAppViewer::idleNetwork() // Read all available packets from network const S64 frame_count = gFrameCount; // U32->S64 F32 total_time = 0.0f; - while (gMessageSystem->checkAllMessages(frame_count, gServicePump)) + + while (gMessageSystem->checkAllMessages(frame_count, gServicePump)) { if (gDoDisconnect) { diff --git a/indra/newview/llinventoryactions.cpp b/indra/newview/llinventoryactions.cpp index 5f0c183ee..ed0c6c54e 100644 --- a/indra/newview/llinventoryactions.cpp +++ b/indra/newview/llinventoryactions.cpp @@ -31,79 +31,26 @@ */ #include "llviewerprecompiledheaders.h" - -#include // for std::pair<> - -#include "llinventorypanel.h" -#include "llpanelobjectinventory.h" -#include "llinventorybridge.h" - -#include "message.h" - -#include "llagent.h" #include "llagentwearables.h" -#include "llcallingcard.h" -#include "llcheckboxctrl.h" // for radio buttons -#include "llfoldervieweventlistener.h" -#include "llnotificationsutil.h" -#include "llradiogroup.h" -#include "llspinctrl.h" -#include "lltextbox.h" -#include "llui.h" - - -#include "llviewercontrol.h" -#include "llfirstuse.h" -#include "llfloateravatarinfo.h" -#include "llfloaterchat.h" -#include "llfloatercustomize.h" -#include "llfloaterinventory.h" -#include "llfloaterproperties.h" -#include "llfocusmgr.h" -#include "llfolderview.h" -#include "llgesturemgr.h" -#include "lliconctrl.h" +#include "llimview.h" #include "llinventoryfunctions.h" +#include "llinventorybridge.h" #include "llinventoryclipboard.h" #include "llinventorymodelbackgroundfetch.h" -#include "lllineeditor.h" +#include "llinventorypanel.h" #include "llmakeoutfitdialog.h" -#include "llmenugl.h" -#include "llpreviewanim.h" -#include "llpreviewgesture.h" -#include "llpreviewlandmark.h" -#include "llpreviewnotecard.h" -#include "llpreviewscript.h" -#include "llpreviewsound.h" -#include "llpreviewtexture.h" -#include "llresmgr.h" -#include "llscrollcontainer.h" -#include "llimview.h" -#include "lltooldraganddrop.h" -#include "llviewertexturelist.h" -#include "llviewerinventory.h" -#include "llviewerobjectlist.h" -#include "llviewerwindow.h" +#include "llnotificationsutil.h" +#include "llpanelmaininventory.h" +#include "llpanelobjectinventory.h" +#include "llpreview.h" // For LLMultiPreview +#include "llfoldervieweventlistener.h" +#include "lltrans.h" #include "llvoavatarself.h" -#include "llwearable.h" -#include "llwearablelist.h" -#include "llviewermessage.h" -#include "llviewerregion.h" -#include "lltabcontainer.h" -#include "lluictrlfactory.h" -#include "llselectmgr.h" -// -#include "lllocalinventory.h" -#include "statemachine/aifilepicker.h" -// +extern LLUUID gAgentID; using namespace LLOldEvents; -const std::string NEW_LSL_NAME = "New Script"; // *TODO:Translate? (probably not) -const std::string NEW_NOTECARD_NAME = "New Note"; // *TODO:Translate? (probably not) -const std::string NEW_GESTURE_NAME = "New Gesture"; // *TODO:Translate? (probably not) - typedef LLMemberListener object_inventory_listener_t; typedef LLMemberListener inventory_listener_t; typedef LLMemberListener inventory_panel_listener_t; @@ -116,42 +63,39 @@ bool doToSelected(LLFolderView* folder, std::string action) folder->startRenamingSelectedItem(); return true; } - if ("delete" == action) + else if ("delete" == action) { folder->removeSelectedItems(); return true; } - - if ("copy" == action || "cut" == action) + else if ("copy" == action || "cut" == action) { LLInventoryClipboard::instance().reset(); } std::set selected_items = folder->getSelectionList(); - LLMultiPreview* multi_previewp = NULL; - LLMultiProperties* multi_propertiesp = NULL; + LLMultiFloater* multi_floaterp = NULL; if (("task_open" == action || "open" == action) && selected_items.size() > 1) { S32 left, top; gFloaterView->getNewFloaterPosition(&left, &top); - multi_previewp = new LLMultiPreview(LLRect(left, top, left + 300, top - 100)); - gFloaterView->addChild(multi_previewp); + multi_floaterp = new LLMultiPreview(LLRect(left, top, left + 300, top - 100)); + gFloaterView->addChild(multi_floaterp); - LLFloater::setFloaterHost(multi_previewp); - + LLFloater::setFloaterHost(multi_floaterp); } else if (("task_properties" == action || "properties" == action) && selected_items.size() > 1) { S32 left, top; gFloaterView->getNewFloaterPosition(&left, &top); - multi_propertiesp = new LLMultiProperties(LLRect(left, top, left + 100, top - 100)); - gFloaterView->addChild(multi_propertiesp); + multi_floaterp = new LLMultiProperties(LLRect(left, top, left + 100, top - 100)); + gFloaterView->addChild(multi_floaterp); - LLFloater::setFloaterHost(multi_propertiesp); + LLFloater::setFloaterHost(multi_floaterp); } std::set::iterator set_iter; @@ -167,13 +111,9 @@ bool doToSelected(LLFolderView* folder, std::string action) } LLFloater::setFloaterHost(NULL); - if (multi_previewp) + if (multi_floaterp) { - multi_previewp->open(); - } - else if (multi_propertiesp) - { - multi_propertiesp->open(); /*Flawfinder: ignore*/ + multi_floaterp->open(); } return true; @@ -183,12 +123,11 @@ class LLDoToSelectedPanel : public object_inventory_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - std::string action = userdata.asString(); LLPanelObjectInventory *panel = mPtr; LLFolderView* folder = panel->getRootFolder(); if(!folder) return true; - return doToSelected(folder, action); + return doToSelected(folder, userdata.asString()); } }; @@ -196,12 +135,11 @@ class LLDoToSelectedFloater : public inventory_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - std::string action = userdata.asString(); LLInventoryPanel *panel = mPtr->getPanel(); LLFolderView* folder = panel->getRootFolder(); if(!folder) return true; - return doToSelected(folder, action); + return doToSelected(folder, userdata.asString()); } }; @@ -209,12 +147,11 @@ class LLDoToSelected : public inventory_panel_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - std::string action = userdata.asString(); LLInventoryPanel *panel = mPtr; LLFolderView* folder = panel->getRootFolder(); if(!folder) return true; - return doToSelected(folder, action); + return doToSelected(folder, userdata.asString()); } }; @@ -356,7 +293,7 @@ void do_create(LLInventoryModel *model, LLInventoryPanel *ptr, std::string type, else if ("lsl" == type) { LLUUID parent_id = self ? self->getUUID() : model->findCategoryUUIDForType(LLFolderType::FT_LSL_TEXT); - ptr->createNewItem(NEW_LSL_NAME, + ptr->createNewItem(LLTrans::getString("New Script"), parent_id, LLAssetType::AT_LSL_TEXT, LLInventoryType::IT_LSL, @@ -365,7 +302,7 @@ void do_create(LLInventoryModel *model, LLInventoryPanel *ptr, std::string type, else if ("notecard" == type) { LLUUID parent_id = self ? self->getUUID() : model->findCategoryUUIDForType(LLFolderType::FT_NOTECARD); - ptr->createNewItem(NEW_NOTECARD_NAME, + ptr->createNewItem(LLTrans::getString("New Note"), parent_id, LLAssetType::AT_NOTECARD, LLInventoryType::IT_NOTECARD, @@ -374,7 +311,7 @@ void do_create(LLInventoryModel *model, LLInventoryPanel *ptr, std::string type, else if ("gesture" == type) { LLUUID parent_id = self ? self->getUUID() : model->findCategoryUUIDForType(LLFolderType::FT_GESTURE); - ptr->createNewItem(NEW_GESTURE_NAME, + ptr->createNewItem(LLTrans::getString("New Gesture"), parent_id, LLAssetType::AT_GESTURE, LLInventoryType::IT_GESTURE, @@ -383,11 +320,11 @@ void do_create(LLInventoryModel *model, LLInventoryPanel *ptr, std::string type, else if ("outfit" == type) { new LLMakeOutfitDialog(false); + return; } else { - LLWearableType::EType wear_type = LLWearableType::typeNameToType(type); - LLAgentWearables::createWearable(wear_type, false, self ? self->getUUID() : LLUUID::null); + LLAgentWearables::createWearable(LLWearableType::typeNameToType(type), false, self ? self->getUUID() : LLUUID::null); } ptr->getRootFolder()->setNeedsAutoRename(TRUE); } @@ -411,14 +348,6 @@ class LLDoCreateFloater : public inventory_listener_t LLInventoryModel* model = mPtr->getPanel()->getModel(); if(!model) return false; std::string type = userdata.asString(); - // - if(type == "pretend") - { - LLFloaterNewLocalInventory* floater = new LLFloaterNewLocalInventory(); - floater->center(); - } - else - // do_create(model, mPtr->getPanel(), type); return true; } @@ -484,28 +413,6 @@ class LLSetSortBy : public inventory_listener_t } }; -// -class LLLoadInvCacheFloater : public inventory_listener_t -{ - bool handleEvent(LLPointer event, const LLSD& userdata) - { - LLInventoryModel* model = mPtr->getPanel()->getModel(); - if(!model) return false; - AIFilePicker* filepicker = AIFilePicker::create(); - filepicker->open(FFLOAD_INVGZ, "", "invgz"); - filepicker->run(boost::bind(&LLLoadInvCacheFloater::filepicker_callback, this, filepicker)); - return true; - } - - void filepicker_callback(AIFilePicker* filepicker) - { - if(filepicker->hasFilename()) - { - LLLocalInventory::loadInvCache(filepicker->getFilename()); - } - } -}; - class LLRefreshInvModel : public inventory_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) @@ -522,8 +429,7 @@ class LLSetSearchType : public inventory_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - std::string toggle = userdata.asString(); - U32 flags = mPtr->getActivePanel()->getRootFolder()->toggleSearchType(toggle); + U32 flags = mPtr->getActivePanel()->getRootFolder()->toggleSearchType(userdata.asString()); mPtr->getControl("Inventory.SearchName")->setValue((BOOL)(flags & 1)); mPtr->getControl("Inventory.SearchDesc")->setValue((BOOL)(flags & 2)); mPtr->getControl("Inventory.SearchCreator")->setValue((BOOL)(flags & 4)); @@ -546,8 +452,7 @@ class LLBeginIMSession : public inventory_panel_listener_t LLDynamicArray members; EInstantMessage type = IM_SESSION_CONFERENCE_START; - std::set::const_iterator iter; - for (iter = selected_items.begin(); iter != selected_items.end(); iter++) + for (std::set::const_iterator iter = selected_items.begin(); iter != selected_items.end(); iter++) { LLUUID item = *iter; @@ -577,11 +482,10 @@ class LLBeginIMSession : public inventory_panel_listener_t { // create the session gIMMgr->setFloaterOpen(TRUE); - S32 i; - + LLAvatarTracker& at = LLAvatarTracker::instance(); LLUUID id; - for(i = 0; i < count; ++i) + for(S32 i = 0; i < count; ++i) { id = item_array.get(i)->getCreatorUUID(); if(at.isBuddyOnline(id)) @@ -660,27 +564,28 @@ class LLAttachObject : public inventory_panel_listener_t break; } } - if (attachmentp == NULL) + if (!attachmentp) { return true; } - LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem(id); - - if(item && gInventory.isObjectDescendentOf(id, gInventory.getRootFolderID())) + if (LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem(id)) { - rez_attachment(item, attachmentp); // don't replace if called from an "Attach To..." menu - } - else if(item && item->isFinished()) - { - // must be in library. copy it to our inventory and put it on. - LLPointer cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, attachmentp, false)); - copy_inventory_item( - gAgent.getID(), - item->getPermissions().getOwner(), - item->getUUID(), - LLUUID::null, - std::string(), - cb); + if(gInventory.isObjectDescendentOf(id, gInventory.getRootFolderID())) + { + rez_attachment(item, attachmentp); // don't replace if called from an "Attach To..." menu + } + else if(item->isFinished()) + { + // must be in library. copy it to our inventory and put it on. + LLPointer cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, attachmentp, false)); + copy_inventory_item( + gAgentID, + item->getPermissions().getOwner(), + item->getUUID(), + LLUUID::null, + std::string(), + cb); + } } gFocusMgr.setKeyboardFocus(NULL); @@ -688,16 +593,6 @@ class LLAttachObject : public inventory_panel_listener_t } }; -/* -class LL : public listener_t -{ - bool handleEvent(LLPointer event, const LLSD& userdata) - { - return true; - } -}; -*/ - void init_object_inventory_panel_actions(LLPanelObjectInventory *panel) { (new LLDoToSelectedPanel())->registerListener(panel, "Inventory.DoToSelected"); @@ -709,9 +604,6 @@ void init_inventory_actions(LLInventoryView *floater) (new LLCloseAllFoldersFloater())->registerListener(floater, "Inventory.CloseAllFolders"); (new LLEmptyTrashFloater())->registerListener(floater, "Inventory.EmptyTrash"); (new LLDoCreateFloater())->registerListener(floater, "Inventory.DoCreate"); - // - (new LLLoadInvCacheFloater())->registerListener(floater, "Inventory.LoadInvCache"); - // (new LLNewWindow())->registerListener(floater, "Inventory.NewWindow"); (new LLShowFilters())->registerListener(floater, "Inventory.ShowFilters"); @@ -719,7 +611,6 @@ void init_inventory_actions(LLInventoryView *floater) (new LLSetSortBy())->registerListener(floater, "Inventory.SetSortBy"); (new LLSetSearchType())->registerListener(floater, "Inventory.SetSearchType"); - } void init_inventory_panel_actions(LLInventoryPanel *panel) diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index 887f0a474..9db175ec2 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -102,12 +102,12 @@ void LLInventoryCompletionObserver::changed(U32 mask) { // scan through the incomplete items and move or erase them as // appropriate. - if(!mIncomplete.empty()) + if (!mIncomplete.empty()) { - for(uuid_vec_t::iterator it = mIncomplete.begin(); it < mIncomplete.end(); ) + for (uuid_vec_t::iterator it = mIncomplete.begin(); it < mIncomplete.end(); ) { - LLViewerInventoryItem* item = gInventory.getItem(*it); - if(!item) + const LLViewerInventoryItem* item = gInventory.getItem(*it); + if (!item) { it = mIncomplete.erase(it); continue; @@ -120,7 +120,7 @@ void LLInventoryCompletionObserver::changed(U32 mask) } ++it; } - if(mIncomplete.empty()) + if (mIncomplete.empty()) { done(); } @@ -129,7 +129,7 @@ void LLInventoryCompletionObserver::changed(U32 mask) void LLInventoryCompletionObserver::watchItem(const LLUUID& id) { - if(id.notNull()) + if (id.notNull()) { mIncomplete.push_back(id); } @@ -158,6 +158,7 @@ void LLInventoryFetchItemsObserver::changed(U32 mask) // appropriate. if (!mIncomplete.empty()) { + // Have we exceeded max wait time? bool timeout_expired = mFetchingPeriod.hasExpired(); @@ -201,6 +202,7 @@ void LLInventoryFetchItemsObserver::changed(U32 mask) void fetch_items_from_llsd(const LLSD& items_llsd) { if (!items_llsd.size() || gDisconnected) return; + LLSD body; body[0]["cap_name"] = "FetchInventory2"; body[1]["cap_name"] = "FetchLib2"; @@ -244,7 +246,7 @@ void fetch_items_from_llsd(const LLSD& items_llsd) for (S32 j=0; jnewMessageFast(_PREHASH_FetchInventory); @@ -255,13 +257,13 @@ void fetch_items_from_llsd(const LLSD& items_llsd) msg->nextBlockFast(_PREHASH_InventoryData); msg->addUUIDFast(_PREHASH_OwnerID, item_entry["owner_id"].asUUID()); msg->addUUIDFast(_PREHASH_ItemID, item_entry["item_id"].asUUID()); - if(msg->isSendFull(NULL)) + if (msg->isSendFull(NULL)) { start_new_message = TRUE; gAgent.sendReliableMessage(); } } - if(!start_new_message) + if (!start_new_message) { gAgent.sendReliableMessage(); } @@ -335,8 +337,8 @@ void LLInventoryFetchDescendentsObserver::changed(U32 mask) { for (uuid_vec_t::iterator it = mIncomplete.begin(); it < mIncomplete.end();) { - LLViewerInventoryCategory* cat = gInventory.getCategory(*it); - if(!cat) + const LLViewerInventoryCategory* cat = gInventory.getCategory(*it); + if (!cat) { it = mIncomplete.erase(it); continue; @@ -465,7 +467,7 @@ void LLInventoryFetchComboObserver::startFetch() void LLInventoryExistenceObserver::watchItem(const LLUUID& id) { - if(id.notNull()) + if (id.notNull()) { mMIA.push_back(id); } @@ -475,12 +477,12 @@ void LLInventoryExistenceObserver::changed(U32 mask) { // scan through the incomplete items and move or erase them as // appropriate. - if(!mMIA.empty()) + if (!mMIA.empty()) { - for(uuid_vec_t::iterator it = mMIA.begin(); it < mMIA.end(); ) + for (uuid_vec_t::iterator it = mMIA.begin(); it < mMIA.end(); ) { LLViewerInventoryItem* item = gInventory.getItem(*it); - if(!item) + if (!item) { ++it; continue; @@ -488,7 +490,7 @@ void LLInventoryExistenceObserver::changed(U32 mask) mExist.push_back(*it); it = mMIA.erase(it); } - if(mMIA.empty()) + if (mMIA.empty()) { done(); } @@ -589,7 +591,7 @@ void LLInventoryAddedObserver::changed(U32 mask) LLPointer titem = new LLViewerInventoryItem; S32 num_blocks = msg->getNumberOfBlocksFast(_PREHASH_InventoryData); - for(S32 i = 0; i < num_blocks; ++i) + for (S32 i = 0; i < num_blocks; ++i) { titem->unpackMessage(msg, _PREHASH_InventoryData, i); if (!(titem->getUUID().isNull())) @@ -639,18 +641,18 @@ LLInventoryTransactionObserver::LLInventoryTransactionObserver(const LLTransacti void LLInventoryTransactionObserver::changed(U32 mask) { - if(mask & LLInventoryObserver::ADD) + if (mask & LLInventoryObserver::ADD) { // This could be it - see if we are processing a bulk update LLMessageSystem* msg = gMessageSystem; - if(msg->getMessageName() + if (msg->getMessageName() && (0 == strcmp(msg->getMessageName(), "BulkUpdateInventory"))) { // we have a match for the message - now check the // transaction id. LLUUID id; msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_TransactionID, id); - if(id == mTransactionID) + if (id == mTransactionID) { // woo hoo, we found it uuid_vec_t folders; @@ -658,19 +660,19 @@ void LLInventoryTransactionObserver::changed(U32 mask) S32 count; count = msg->getNumberOfBlocksFast(_PREHASH_FolderData); S32 i; - for(i = 0; i < count; ++i) + for (i = 0; i < count; ++i) { msg->getUUIDFast(_PREHASH_FolderData, _PREHASH_FolderID, id, i); - if(id.notNull()) + if (id.notNull()) { folders.push_back(id); } } count = msg->getNumberOfBlocksFast(_PREHASH_ItemData); - for(i = 0; i < count; ++i) + for (i = 0; i < count; ++i) { msg->getUUIDFast(_PREHASH_ItemData, _PREHASH_ItemID, id, i); - if(id.notNull()) + if (id.notNull()) { items.push_back(id); } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 448d54373..c728c47df 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3,10 +3,9 @@ * @brief Dumping ground for viewer-side message system callbacks. * * $LicenseInfo:firstyear=2002&license=viewergpl$ - * + * Second Life Viewer Source Code * Copyright (c) 2002-2009, Linden Research, Inc. * - * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement @@ -34,14 +33,10 @@ #include "llviewermessage.h" #include -#include - #include "llanimationstates.h" #include "llaudioengine.h" #include "llavatarnamecache.h" #include "../lscript/lscript_byteformat.h" //Need LSCRIPTRunTimePermissionBits and SCRIPT_PERMISSION_* - -#include "llcachename.h" #include "lleconomy.h" #include "llfocusmgr.h" #include "llfollowcamparams.h" @@ -66,11 +61,9 @@ #include "llfloaterchat.h" #include "llfloatergroupinfo.h" #include "llfloaterimagepreview.h" -#include "llfloaterinventory.h" #include "llfloaterland.h" #include "llfloaterregioninfo.h" #include "llfloaterlandholdings.h" -#include "llurldispatcher.h" #include "llfloatermute.h" #include "llfloaterpostcard.h" #include "llfloaterpreference.h" @@ -86,6 +79,7 @@ #include "llnotifications.h" #include "llnotificationsutil.h" #include "llpanelgrouplandmoney.h" +#include "llpanelmaininventory.h" #include "llselectmgr.h" #include "llstartup.h" #include "llsky.h" @@ -94,18 +88,13 @@ #include "llimview.h" #include "llfloateractivespeakers.h" #include "lltrans.h" -#include "lluploaddialog.h" -#include "llviewercamera.h" -#include "llviewerdisplay.h" #include "llviewerfoldertype.h" #include "llviewergenericmessage.h" #include "llviewermenu.h" #include "llviewerinventory.h" #include "llviewerjoystick.h" -#include "llviewerobject.h" #include "llviewerobjectlist.h" #include "llviewerparcelmgr.h" -#include "llviewerpartsource.h" #include "llviewerstats.h" #include "llviewertexteditor.h" #include "llviewerthrottle.h" @@ -119,15 +108,12 @@ #include "llkeythrottle.h" #include "llagentui.h" #include "llviewerregion.h" -// -#include "llviewernetwork.h" -// -// [RLVa:KB] +// [RLVa:KB] - Checked: 2010-03-09 (RLVa-1.2.0a) +#include "llfloateravatarinfo.h" // Checked: 2009-07-08 (RLVa-1.0.0e) #include "rlvhandler.h" #include "rlvinventory.h" #include "rlvui.h" -#include "rlvcommon.h" // [/RLVa:KB] #if SHY_MOD //Command handler @@ -140,9 +126,6 @@ #include "sgversion.h" #include "m7wlinterface.h" -#include "llwlparammanager.h" -#include "llwaterparammanager.h" - #include "llgiveinventory.h" #include @@ -161,10 +144,6 @@ static const boost::regex NEWLINES("\\n{1}"); extern AIHTTPTimeoutPolicy authHandler_timeout; -// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) -#include "llfloateravatarinfo.h" -// [/RLVa:KB] - // // Constants // @@ -4974,7 +4953,7 @@ void process_sound_trigger(LLMessageSystem *msg, void **) if (object_id == owner_id && !gSavedSettings.getBOOL("EnableGestureSounds")) { // Don't mute own gestures, if they're not muted. - if(owner_id != gAgent.getID() || !gSavedSettings.getBOOL("EnableGestureSoundsSelf")) + if (owner_id != gAgentID || !gSavedSettings.getBOOL("EnableGestureSoundsSelf")) return; } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 4b9158aa2..e1a6cf7e8 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7458,10 +7458,6 @@ LLBBox LLVOAvatar::getHUDBBox() const return bbox; } -void LLVOAvatar::rebuildHUD() -{ -} - //----------------------------------------------------------------------------- // onFirstTEMessageReceived() //----------------------------------------------------------------------------- @@ -7981,6 +7977,7 @@ void LLVOAvatar::getAnimNames( LLDynamicArray* names ) names->put( "enter_away_from_keyboard_state" ); } +// static void LLVOAvatar::onBakedTextureMasksLoaded( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata ) { if (!userdata) return; @@ -8074,7 +8071,7 @@ void LLVOAvatar::onInitialBakedTextureLoaded( BOOL success, LLViewerFetchedTextu { LLUUID *avatar_idp = (LLUUID *)userdata; LLVOAvatar *selfp = gObjectList.findAvatar(*avatar_idp); - + if (selfp) { LL_DEBUGS("Avatar") << selfp->avString() << "discard_level " << discard_level << " success " << success << " final " << final << LL_ENDL; @@ -8095,7 +8092,7 @@ void LLVOAvatar::onBakedTextureLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata) { - // llinfos << "onBakedTextureLoaded: " << src_vi->getID() << llendl; + LL_DEBUGS("Avatar") << "onBakedTextureLoaded: " << src_vi->getID() << LL_ENDL; LLUUID id = src_vi->getID(); LLUUID *avatar_idp = (LLUUID *)userdata; @@ -8125,7 +8122,6 @@ void LLVOAvatar::onBakedTextureLoaded(BOOL success, // Called when baked texture is loaded and also when we start up with a baked texture void LLVOAvatar::useBakedTexture( const LLUUID& id ) { - for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { LLViewerTexture* image_baked = getImage( mBakedTextureDatas[i].mTextureIndex, 0 ); diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 67c554cb7..94c97be83 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -755,7 +755,6 @@ public: public: BOOL hasHUDAttachment() const; LLBBox getHUDBBox() const; - void rebuildHUD(); void resetHUDAttachments(); BOOL canAttachMoreObjects() const; BOOL canAttachMoreObjects(U32 n) const; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index b893f6ec2..8e256d85b 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -4719,11 +4719,6 @@ void LLPipeline::rebuildPools() } max_count--; } - - if (isAgentAvatarValid()) - { - gAgentAvatarp->rebuildHUD(); - } } void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp )