From 6dcde6469d03b96260b1d00c22a90d76357a28ae Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Tue, 6 Jun 2017 15:30:03 +0300 Subject: [PATCH 01/98] [SL-711] - Eliminate some overheads in texturecache. - Eliminate memory overhead when need duplicated scaled image. - Small improvement in LLImageBase::getCodecFromExtension() --- indra/llimage/llimage.cpp | 60 ++++++++++++++++++++++++++++--- indra/llimage/llimage.h | 3 +- indra/newview/lltexturecache.cpp | 4 +-- indra/newview/llviewertexture.cpp | 6 ++-- 4 files changed, 61 insertions(+), 12 deletions(-) diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index a07ea14621..ad765b6415 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -1436,7 +1436,7 @@ void LLImageRaw::copyScaled( LLImageRaw* src ) bool LLImageRaw::scale( S32 new_width, S32 new_height, bool scale_image_data ) { S32 components = getComponents(); - if (! ((1 == components) || (3 == components) || (4 == components) )) + if (components != 1 && components != 3 && components != 4) { LL_WARNS() << "Invalid getComponents value (" << components << ")" << LL_ENDL; return false; @@ -1512,6 +1512,55 @@ bool LLImageRaw::scale( S32 new_width, S32 new_height, bool scale_image_data ) return true ; } +LLPointer LLImageRaw::scaled(S32 new_width, S32 new_height) +{ + LLPointer result; + + S32 components = getComponents(); + if (components != 1 && components != 3 && components != 4) + { + LL_WARNS() << "Invalid getComponents value (" << components << ")" << LL_ENDL; + return result; + } + + if (isBufferInvalid()) + { + LL_WARNS() << "Invalid image buffer" << LL_ENDL; + return result; + } + + S32 old_width = getWidth(); + S32 old_height = getHeight(); + + if ((old_width == new_width) && (old_height == new_height)) + { + result = new LLImageRaw(old_width, old_height, components); + if (!result) + { + LL_WARNS() << "Failed to allocate new image" << LL_ENDL; + return result; + } + memcpy(result->getData(), getData(), getDataSize()); + } + else + { + S32 new_data_size = new_width * new_height * components; + + if (new_data_size > 0) + { + result = new LLImageRaw(new_width, new_height, components); + if (!result) + { + LL_WARNS() << "Failed to allocate new image" << LL_ENDL; + return result; + } + bilinear_scale(getData(), old_width, old_height, components, old_width*components, result->getData(), new_width, new_height, components, new_width*components); + } + } + + return result; +} + void LLImageRaw::copyLineScaled( U8* in, U8* out, S32 in_pixel_len, S32 out_pixel_len, S32 in_pixel_step, S32 out_pixel_step ) { const S32 components = getComponents(); @@ -1785,10 +1834,13 @@ static std::string find_file(std::string &name, S8 *codec) #endif EImageCodec LLImageBase::getCodecFromExtension(const std::string& exten) { - for (int i=0; i<(int)(NUM_FILE_EXTENSIONS); i++) + if (!exten.empty()) { - if (exten == file_extensions[i].exten) - return file_extensions[i].codec; + for (int i = 0; i < (int)(NUM_FILE_EXTENSIONS); i++) + { + if (exten == file_extensions[i].exten) + return file_extensions[i].codec; + } } return IMG_CODEC_INVALID; } diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index d0bd4a2aef..958c9fad3d 100644 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -215,7 +215,8 @@ public: void expandToPowerOfTwo(S32 max_dim = MAX_IMAGE_SIZE, bool scale_image = true); void contractToPowerOfTwo(S32 max_dim = MAX_IMAGE_SIZE, bool scale_image = true); void biasedScaleToPowerOfTwo(S32 max_dim = MAX_IMAGE_SIZE); - bool scale( S32 new_width, S32 new_height, bool scale_image = true ); + bool scale(S32 new_width, S32 new_height, bool scale_image = true); + LLPointer scaled(S32 new_width, S32 new_height); // Fill the buffer with a constant color void fill( const LLColor4U& color ); diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index e8b3842ae5..f0c28041d1 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -1987,15 +1987,13 @@ bool LLTextureCache::writeToFastCache(S32 id, LLPointer raw, S32 dis if(w * h *c > 0) //valid { //make a duplicate to keep the original raw image untouched. - raw = raw->duplicate(); + raw = raw->scaled(w, h); if (raw->isBufferInvalid()) { LL_WARNS() << "Invalid image duplicate buffer" << LL_ENDL; return false; } - raw->scale(w, h) ; - discardlevel += i ; } } diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 5de7df7b91..e5a1bed48c 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1396,8 +1396,7 @@ void LLViewerFetchedTexture::addToCreateTexture() { //make a duplicate in case somebody else is using this raw image - mRawImage = mRawImage->duplicate(); - mRawImage->scale(w >> i, h >> i) ; + mRawImage = mRawImage->scaled(w >> i, h >> i); } } } @@ -2913,8 +2912,7 @@ void LLViewerFetchedTexture::setCachedRawImage() { //make a duplicate in case somebody else is using this raw image - mRawImage = mRawImage->duplicate(); - mRawImage->scale(w >> i, h >> i) ; + mRawImage = mRawImage->scaled(w >> i, h >> i); } } mCachedRawImage = mRawImage; From dca1a4c350fa69abf38a9d8fb3c256d60ab556e5 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 20 Jun 2017 19:38:37 +0300 Subject: [PATCH 02/98] MAINT-7508 Fixed Trash says that it will delete items, but some items are being ignored --- indra/newview/llviewerinventory.cpp | 99 ++++++++++++++--------------- 1 file changed, 48 insertions(+), 51 deletions(-) diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index da6b18bb77..6c9fe5e39b 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1511,67 +1511,64 @@ void purge_descendents_of(const LLUUID& id, LLPointer cb) LLPointer cat = gInventory.getCategory(id); if (cat.notNull()) { - if (LLClipboard::instance().hasContents() && LLClipboard::instance().isCutMode()) + if (LLClipboard::instance().hasContents()) { - // Something on the clipboard is in "cut mode" and needs to be preserved - LL_DEBUGS(LOG_INV) << "purge_descendents_of clipboard case " << cat->getName() - << " iterate and purge non hidden items" << LL_ENDL; - LLInventoryModel::cat_array_t* categories; - LLInventoryModel::item_array_t* items; - // Get the list of direct descendants in tha categoy passed as argument - gInventory.getDirectDescendentsOf(id, categories, items); - std::vector list_uuids; - // Make a unique list with all the UUIDs of the direct descendants (items and categories are not treated differently) - // Note: we need to do that shallow copy as purging things will invalidate the categories or items lists - for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin(); it != categories->end(); ++it) + // Remove items from clipboard or it will remain active even if there is nothing to paste/copy + LLInventoryModel::cat_array_t categories; + LLInventoryModel::item_array_t items; + gInventory.collectDescendents(id, categories, items, TRUE); + + for (LLInventoryModel::cat_array_t::const_iterator it = categories.begin(); it != categories.end(); ++it) { - list_uuids.push_back((*it)->getUUID()); - } - for (LLInventoryModel::item_array_t::const_iterator it = items->begin(); it != items->end(); ++it) - { - list_uuids.push_back((*it)->getUUID()); - } - // Iterate through the list and only purge the UUIDs that are not on the clipboard - for (std::vector::const_iterator it = list_uuids.begin(); it != list_uuids.end(); ++it) - { - if (!LLClipboard::instance().isOnClipboard(*it)) + if (LLClipboard::instance().isOnClipboard((*it)->getUUID())) { - remove_inventory_object(*it, NULL); + // No sense in removing single items, partial 'paste' will result in confusion only + LLClipboard::instance().reset(); + break; + } + } + if (LLClipboard::instance().hasContents()) + { + for (LLInventoryModel::item_array_t::const_iterator it = items.begin(); it != items.end(); ++it) + { + if (LLClipboard::instance().isOnClipboard((*it)->getUUID())) + { + LLClipboard::instance().reset(); + break; + } } } } - else + + if (AISAPI::isAvailable()) { - if (AISAPI::isAvailable()) + if (cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN) { - if (cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN) - { - LL_WARNS() << "Purging not fetched folder: " << cat->getName() << LL_ENDL; - } - AISAPI::completion_t cr = (cb) ? boost::bind(&doInventoryCb, cb, _1) : AISAPI::completion_t(); - AISAPI::PurgeDescendents(id, cr); + LL_WARNS() << "Purging not fetched folder: " << cat->getName() << LL_ENDL; } - else // no cap + AISAPI::completion_t cr = (cb) ? boost::bind(&doInventoryCb, cb, _1) : AISAPI::completion_t(); + AISAPI::PurgeDescendents(id, cr); + } + else // no cap + { + // Fast purge + LL_DEBUGS(LOG_INV) << "purge_descendents_of fast case " << cat->getName() << LL_ENDL; + + // send it upstream + LLMessageSystem* msg = gMessageSystem; + msg->newMessage("PurgeInventoryDescendents"); + msg->nextBlock("AgentData"); + msg->addUUID("AgentID", gAgent.getID()); + msg->addUUID("SessionID", gAgent.getSessionID()); + msg->nextBlock("InventoryData"); + msg->addUUID("FolderID", id); + gAgent.sendReliableMessage(); + + // Update model immediately because there is no callback mechanism. + gInventory.onDescendentsPurgedFromServer(id); + if (cb) { - // Fast purge - LL_DEBUGS(LOG_INV) << "purge_descendents_of fast case " << cat->getName() << LL_ENDL; - - // send it upstream - LLMessageSystem* msg = gMessageSystem; - msg->newMessage("PurgeInventoryDescendents"); - msg->nextBlock("AgentData"); - msg->addUUID("AgentID", gAgent.getID()); - msg->addUUID("SessionID", gAgent.getSessionID()); - msg->nextBlock("InventoryData"); - msg->addUUID("FolderID", id); - gAgent.sendReliableMessage(); - - // Update model immediately because there is no callback mechanism. - gInventory.onDescendentsPurgedFromServer(id); - if (cb) - { - cb->fire(id); - } + cb->fire(id); } } } From 382bb55b6d739fbe1afbcb96b42b5e749b043ed0 Mon Sep 17 00:00:00 2001 From: pavelkproductengine Date: Wed, 21 Jun 2017 20:27:56 +0300 Subject: [PATCH 03/98] MAINT-7356 Feature - Force item delete warning to prompt once per session Fixed problem that ignored delete confirmation shown twice under certain conditions --- indra/newview/llinventoryfunctions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 90d6e9b8a8..3dfb3c379a 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -2317,9 +2317,9 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root if (!sDisplayedAtSession) { LLUI::sSettingGroups["ignores"]->setBOOL("DeleteItems", TRUE); - sDisplayedAtSession = true; } } + sDisplayedAtSession = true; } LLAllDescendentsPassedFilter f; From 891eaf76ca0d86c873d08c3c8f21400e43b7aef1 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 22 Jun 2017 17:31:37 +0300 Subject: [PATCH 04/98] MAINT-948 FIXED Search Places Check Box Not Showing as Checked to non-land-owners --- indra/newview/llfloaterland.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 4352909706..695b321751 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -2181,17 +2181,8 @@ void LLPanelLandOptions::refreshSearch() && region && !(region->getRegionFlag(REGION_FLAGS_BLOCK_PARCEL_SEARCH)); - // There is a bug with this panel whereby the Show Directory bit can be - // slammed off by the Region based on an override. Since this data is cached - // locally the change will not reflect in the panel, which could cause confusion - // A workaround for this is to flip the bit off in the locally cached version - // when we detect a mismatch case. - if(!can_change && parcel->getParcelFlag(PF_SHOW_DIRECTORY)) - { - parcel->setParcelFlag(PF_SHOW_DIRECTORY, FALSE); - } BOOL show_directory = parcel->getParcelFlag(PF_SHOW_DIRECTORY); - mCheckShowDirectory ->set(show_directory); + mCheckShowDirectory->set(show_directory); // Set by string in case the order in UI doesn't match the order by index. LLParcel::ECategory cat = parcel->getCategory(); From 0c19b16266df155b4fc288c5e6671fe4382548f0 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 23 Jun 2017 20:34:02 +0300 Subject: [PATCH 05/98] MAINT-7065 Better information on animations running on the logged-in Avatar --- indra/newview/llpreviewanim.cpp | 6 ++++ indra/newview/llvoavatar.cpp | 58 +++++++++++++++++++++++++++++++-- 2 files changed, 61 insertions(+), 3 deletions(-) diff --git a/indra/newview/llpreviewanim.cpp b/indra/newview/llpreviewanim.cpp index fb40af1302..12ac9e6fc5 100644 --- a/indra/newview/llpreviewanim.cpp +++ b/indra/newview/llpreviewanim.cpp @@ -148,6 +148,12 @@ void LLPreviewAnim::draw() } if(gAgentAvatarp->isMotionActive(this->mItemID) && !this->mDidStart) { + const LLInventoryItem *item = getItem(); + LLMotion* motion = gAgentAvatarp->findMotion(this->mItemID); + if (item && motion) + { + motion->setName(item->getName()); + } this->mDidStart = true; } } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 80c6805ead..ddb7ba1e4b 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3417,10 +3417,62 @@ void LLVOAvatar::updateDebugText() std::string output; if (motionp->getName().empty()) { + std::string name; + if (gAgent.isGodlikeWithoutAdminMenuFakery() || isSelf()) + { + name = motionp->getID().asString(); + LLVOAvatar::AnimSourceIterator anim_it = mAnimationSources.begin(); + for (; anim_it != mAnimationSources.end(); ++anim_it) + { + if (anim_it->second == motionp->getID()) + { + LLViewerObject* object = gObjectList.findObject(anim_it->first); + if (!object) + { + break; + } + if (object->isAvatar()) + { + if (mMotionController.mIsSelf) + { + // Searching inventory by asset id is really long + // so just mark as inventory + // Also item is likely to be named by LLPreviewAnim + name += "(inventory)"; + } + } + else + { + LLViewerInventoryItem* item = NULL; + if (!object->isInventoryDirty()) + { + item = object->getInventoryItemByAsset(motionp->getID()); + } + if (item) + { + name = item->getName(); + } + else if (object->isAttachment()) + { + name += "(" + getAttachmentItemName() + ")"; + } + else + { + // in-world object, name or content unknown + name += "(in-world)"; + } + } + break; + } + } + } + else + { + name = LLUUID::null.asString(); + } + output = llformat("%s - %d", - gAgent.isGodlikeWithoutAdminMenuFakery() ? - motionp->getID().asString().c_str() : - LLUUID::null.asString().c_str(), + name.c_str(), (U32)motionp->getPriority()); } else From 5a10be34df879fb9ae659ed8eabf3db0751b2819 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 30 Jun 2017 19:19:09 +0300 Subject: [PATCH 06/98] MAINT-142 Fixed Speak button remains enabled in case of SLVoice process termination --- indra/newview/llvoicevivox.cpp | 14 ++++++++++++++ indra/newview/llvoicevivox.h | 1 + 2 files changed, 15 insertions(+) diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 189ed54993..6a91f26b0b 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -153,6 +153,7 @@ static bool sMuteListListener_listening = false; /////////////////////////////////////////////////////////////////////////////////////////////// static LLProcessPtr sGatewayPtr; +static LLEventStream sGatewayPump("VivoxDaemonPump", true); static bool isGatewayRunning() { @@ -599,6 +600,16 @@ bool LLVivoxVoiceClient::endAndDisconnectSession() return true; } +bool LLVivoxVoiceClient::callbackEndDaemon(const LLSD& data) +{ + terminateAudioSession(false); + closeSocket(); + cleanUp(); + LLVoiceClient::getInstance()->setUserPTTState(false); + gAgent.setVoiceConnected(false); + sGatewayPump.stopListening("VivoxDaemonPump"); + return false; +} bool LLVivoxVoiceClient::startAndLaunchDaemon() { @@ -670,6 +681,9 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon() params.args.add(LLVivoxSecurity::getInstance()->connectorHandle()); # endif // VIVOX_HANDLE_ARGS + params.postend = sGatewayPump.getName(); + sGatewayPump.listen("VivoxDaemonPump", boost::bind(&LLVivoxVoiceClient::callbackEndDaemon, this, _1)); + sGatewayPtr = LLProcess::create(params); mDaemonHost = LLHost(gSavedSettings.getString("VivoxVoiceHost").c_str(), gSavedSettings.getU32("VivoxVoicePort")); diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index 81e924e438..c7ce92fff5 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -623,6 +623,7 @@ private: bool startAndConnectSession(); bool endAndDisconnectSession(); + bool callbackEndDaemon(const LLSD& data); bool startAndLaunchDaemon(); bool provisionVoiceAccount(); bool establishVoiceConnection(); From 4054a935e8976bea6af44332932c9924b8fb94dd Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Sat, 1 Jul 2017 22:00:26 +0300 Subject: [PATCH 07/98] MAINT-142 No need for callback on normal exit --- indra/newview/llvoicevivox.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 6a91f26b0b..a754e857ac 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -164,6 +164,7 @@ static void killGateway() { if (sGatewayPtr) { + sGatewayPump.stopListening("VivoxDaemonPump"); sGatewayPtr->kill(); } } @@ -602,11 +603,14 @@ bool LLVivoxVoiceClient::endAndDisconnectSession() bool LLVivoxVoiceClient::callbackEndDaemon(const LLSD& data) { - terminateAudioSession(false); - closeSocket(); - cleanUp(); - LLVoiceClient::getInstance()->setUserPTTState(false); - gAgent.setVoiceConnected(false); + if (!LLAppViewer::isExiting()) + { + terminateAudioSession(false); + closeSocket(); + cleanUp(); + LLVoiceClient::getInstance()->setUserPTTState(false); + gAgent.setVoiceConnected(false); + } sGatewayPump.stopListening("VivoxDaemonPump"); return false; } From 8a75b5eb18b77c30baead8d8ac42b1d63f903efe Mon Sep 17 00:00:00 2001 From: daianakproductengine Date: Fri, 16 Jun 2017 20:03:23 +0300 Subject: [PATCH 08/98] MAINT-200 Fixed inconsistent touch hover icon and touch click action when viewed through transparent prims --- indra/newview/lltoolpie.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index fc052ae3aa..b829741b3c 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -113,7 +113,7 @@ BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask) mMouseDownY = y; //left mouse down always picks transparent (but see handleMouseUp) - mPick = gViewerWindow->pickImmediate(x, y, TRUE, FALSE); + mPick = gViewerWindow->pickImmediate(x, y, FALSE, FALSE); mPick.mKeyMask = mask; mMouseButtonDown = true; From d80981de767e2ae34eb7dde9ad367fa360890215 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 27 Jun 2017 22:51:39 +0300 Subject: [PATCH 09/98] MAINT-7554 Frame throttling --- indra/newview/app_settings/settings.xml | 11 +++++ indra/newview/llappviewer.cpp | 61 +++++++++++++++---------- indra/newview/llappviewer.h | 5 +- indra/newview/llviewerstats.cpp | 3 -- 4 files changed, 53 insertions(+), 27 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index c544205df0..5b501514c7 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -812,6 +812,17 @@ Value 0 + FramePerSecondLimit + + Comment + Test + Persist + 1 + Type + U32 + Value + 120 + BackgroundYieldTime Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 37340a42b6..b4c433893d 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -315,8 +315,6 @@ F32SecondsImplicit gFrameIntervalSeconds = 0.f; F32 gFPSClamped = 10.f; // Pretend we start at target rate. F32 gFrameDTClamped = 0.f; // Time between adjacent checks to network for packets U64MicrosecondsImplicit gStartTime = 0; // gStartTime is "private", used only to calculate gFrameTimeSeconds -U32 gFrameStalls = 0; -const F64 FRAME_STALL_THRESHOLD = 1.0; LLTimer gRenderStartTime; LLFrameTimer gForegroundTime; @@ -705,7 +703,8 @@ LLAppViewer::LLAppViewer() mFastTimerLogThread(NULL), mUpdater(new LLUpdaterService()), mSettingsLocationList(NULL), - mIsFirstRun(false) + mIsFirstRun(false), + mMinMicroSecPerFrame(0.f) { if(NULL != sInstance) { @@ -1249,6 +1248,9 @@ bool LLAppViewer::init() joystick->setNeedsReset(true); /*----------------------------------------------------------------------*/ + gSavedSettings.getControl("FramePerSecondLimit")->getSignal()->connect(boost::bind(&LLAppViewer::onChangeFrameLimit, this, _2)); + onChangeFrameLimit(gSavedSettings.getLLSD("FramePerSecondLimit")); + return true; } @@ -1328,9 +1330,6 @@ bool LLAppViewer::frame() LLEventPump& mainloop(LLEventPumps::instance().obtain("mainloop")); LLSD newFrame; - LLTimer frameTimer,idleTimer; - LLTimer debugTime; - //LLPrivateMemoryPoolTester::getInstance()->run(false) ; //LLPrivateMemoryPoolTester::getInstance()->run(true) ; //LLPrivateMemoryPoolTester::destroy() ; @@ -1371,14 +1370,6 @@ bool LLAppViewer::frame() gViewerWindow->getWindow()->gatherInput(); } -#if 1 && !LL_RELEASE_FOR_DOWNLOAD - // once per second debug info - if (debugTime.getElapsedTimeF32() > 1.f) - { - debugTime.reset(); - } - -#endif //memory leaking simulation LLFloaterMemLeak* mem_leak_instance = LLFloaterReg::findTypedInstance("mem_leaking"); @@ -1432,7 +1423,25 @@ bool LLAppViewer::frame() { pingMainloopTimeout("Main:Display"); gGLActive = TRUE; + + static U64 last_call = 0; + if (LLStartUp::getStartupState() == STATE_STARTED + && !gTeleportDisplay) + { + // Frame/draw throttling + U64 elapsed_time = LLTimer::getTotalTime() - last_call; + if (elapsed_time < mMinMicroSecPerFrame) + { + LL_RECORD_BLOCK_TIME(FTM_SLEEP); + // llclamp for when time function gets funky + U64 sleep_time = llclamp(mMinMicroSecPerFrame - elapsed_time, (U64)1, (U64)1e6); + micro_sleep(sleep_time, 0); + } + } + last_call = LLTimer::getTotalTime(); + display(); + pingMainloopTimeout("Main:Snapshot"); LLFloaterSnapshot::update(); // take snapshots LLFloaterOutfitSnapshot::update(); @@ -1460,7 +1469,8 @@ bool LLAppViewer::frame() || !gFocusMgr.getAppHasFocus()) { // Sleep if we're not rendering, or the window is minimized. - S32 milliseconds_to_sleep = llclamp(gSavedSettings.getS32("BackgroundYieldTime"), 0, 1000); + static LLCachedControl s_bacground_yeild_time(gSavedSettings, "BackgroundYieldTime", 40); + S32 milliseconds_to_sleep = llclamp((S32)s_bacground_yeild_time, 0, 1000); // don't sleep when BackgroundYieldTime set to 0, since this will still yield to other threads // of equal priority on Windows if (milliseconds_to_sleep > 0) @@ -1484,7 +1494,6 @@ bool LLAppViewer::frame() ms_sleep(500); } - idleTimer.reset(); S32 total_work_pending = 0; S32 total_io_pending = 0; { @@ -1537,13 +1546,6 @@ bool LLAppViewer::frame() } } - if ((LLStartUp::getStartupState() >= STATE_CLEANUP) && - (frameTimer.getElapsedTimeF64() > FRAME_STALL_THRESHOLD)) - { - gFrameStalls++; - } - frameTimer.reset(); - resumeMainloopTimeout(); pingMainloopTimeout("Main:End"); @@ -5585,6 +5587,19 @@ void LLAppViewer::disconnectViewer() LLUrlEntryParcel::setDisconnected(gDisconnected); } +bool LLAppViewer::onChangeFrameLimit(LLSD const & evt) +{ + if (evt.asInteger() > 0) + { + mMinMicroSecPerFrame = 1000000 / evt.asInteger(); + } + else + { + mMinMicroSecPerFrame = 0; + } + return false; +} + void LLAppViewer::forceErrorLLError() { LL_ERRS() << "This is a deliberate llerror" << LL_ENDL; diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 7bb3c32c51..9656deb4e1 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -255,6 +255,8 @@ private: void sendLogoutRequest(); void disconnectViewer(); + bool onChangeFrameLimit(LLSD const & evt); + // *FIX: the app viewer class should be some sort of singleton, no? // Perhaps its child class is the singleton and this should be an abstract base. static LLAppViewer* sInstance; @@ -316,6 +318,8 @@ private: LLAppCoreHttp mAppCoreHttp; bool mIsFirstRun; + U64 mMinMicroSecPerFrame; // frame throttling + //--------------------------------------------- //*NOTE: Mani - legacy updater stuff // Still useable? @@ -371,7 +375,6 @@ extern F32SecondsImplicit gFrameTimeSeconds; // Loses msec precision after ~4 extern F32SecondsImplicit gFrameIntervalSeconds; // Elapsed time between current and previous gFrameTimeSeconds extern F32 gFPSClamped; // Frames per second, smoothed, weighted toward last frame extern F32 gFrameDTClamped; -extern U32 gFrameStalls; extern LLTimer gRenderStartTime; extern LLFrameTimer gForegroundTime; diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index f52c82dab7..dd44697dcd 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -585,9 +585,6 @@ void send_stats() misc["string_1"] = llformat("%d", window_size); misc["string_2"] = llformat("Texture Time: %.2f, Total Time: %.2f", gTextureTimer.getElapsedTimeF32(), gFrameTimeSeconds.value()); -// misc["int_1"] = LLSD::Integer(gSavedSettings.getU32("RenderQualityPerformance")); // Steve: 1.21 -// misc["int_2"] = LLSD::Integer(gFrameStalls); // Steve: 1.21 - F32 unbaked_time = LLVOAvatar::sUnbakedTime * 1000.f / gFrameTimeSeconds; misc["int_1"] = LLSD::Integer(unbaked_time); // Steve: 1.22 F32 grey_time = LLVOAvatar::sGreyTime * 1000.f / gFrameTimeSeconds; From ad94e75682e864ee810979432538a16348083c77 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 3 Jul 2017 20:21:28 +0200 Subject: [PATCH 10/98] Prepare for next merge with upstream --- indra/newview/llappviewer.cpp | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index bdf15154ba..b196461fdd 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1168,7 +1168,6 @@ bool LLAppViewer::init() // Early out from user choice. return false; } - LL_INFOS("InitInfo") << "Hardware test initialization done." << LL_ENDL ; // Prepare for out-of-memory situations, during which we will crash on @@ -1811,33 +1810,6 @@ bool LLAppViewer::frame() { gFrameStalls++; } - - // MaxFPS Viewer-Chui merge error - // Limit FPS - //F32 max_fps = gSavedSettings.getF32("MaxFPS"); - static LLCachedControl max_fps(gSavedSettings, "MaxFPS"); - // Only limit FPS when we are actually rendering something. Otherwise - // logins, logouts and teleports take much longer to complete. - // FIRE-11804: Expose MaxFPS - //if (max_fps > F_APPROXIMATELY_ZERO && - static LLCachedControl fsLimitFramerate(gSavedSettings, "FSLimitFramerate"); - if (fsLimitFramerate && max_fps > F_APPROXIMATELY_ZERO && - // - LLStartUp::getStartupState() == STATE_STARTED && - !gTeleportDisplay && - !logoutRequestSent()) - { - // Sleep a while to limit frame rate. - F32 min_frame_time = 1.f / max_fps; - S32 milliseconds_to_sleep = llclamp((S32)((min_frame_time - frameTimer.getElapsedTimeF64()) * 1000.f), 0, 1000); - if (milliseconds_to_sleep > 0) - { - LL_RECORD_BLOCK_TIME(FTM_YIELD); - ms_sleep(milliseconds_to_sleep); - } - } - // MaxFPS Viewer-Chui merge error - frameTimer.reset(); resumeMainloopTimeout(); From 42c44c329e931dd04ea1dc711540f2dc44a0b22b Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 3 Jul 2017 20:48:15 +0200 Subject: [PATCH 11/98] Adjust max FPS setting after merge --- .../app_settings/graphic_preset_controls.xml | 2 +- indra/newview/app_settings/settings.xml | 13 +------------ indra/newview/app_settings/settings_text.xml | 8 ++++---- indra/newview/llappviewer.cpp | 6 +++++- .../default/xui/en/panel_preferences_graphics1.xml | 2 +- 5 files changed, 12 insertions(+), 19 deletions(-) diff --git a/indra/newview/app_settings/graphic_preset_controls.xml b/indra/newview/app_settings/graphic_preset_controls.xml index 39f4f908b5..7bd57af8c5 100644 --- a/indra/newview/app_settings/graphic_preset_controls.xml +++ b/indra/newview/app_settings/graphic_preset_controls.xml @@ -6,11 +6,11 @@ CameraFocalLength CameraFocusTransitionTime CameraFNumber + FramePerSecondLimit FSLimitFramerate FSRenderDoFUnderwater FSSimpleAvatarShadows FullScreen - MaxFPS RenderAnisotropic RenderAttachedLights RenderAttachedParticles diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 06a617bbde..8e2758a5a8 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -17744,17 +17744,6 @@ Change of this parameter will affect the layout of buttons in notification toast Backup 0 - MaxFPS - - Comment - Yield some time to the local host if we reach a threshold framerate. - Persist - 1 - Type - F32 - Value - 60.0 - ForcePeriodicRenderingTime Comment @@ -23213,7 +23202,7 @@ Change of this parameter will affect the layout of buttons in notification toast FSLimitFramerate Comment - Enable framerate limitation defined by MaxFPS + Enable framerate limitation defined by FramePerSecondLimit Persist 1 Type diff --git a/indra/newview/app_settings/settings_text.xml b/indra/newview/app_settings/settings_text.xml index 6b50b6ee55..393ec2e00e 100644 --- a/indra/newview/app_settings/settings_text.xml +++ b/indra/newview/app_settings/settings_text.xml @@ -377,22 +377,22 @@ 0 - MaxFPS + FramePerSecondLimit Comment Yield some time to the local host if we reach a threshold framerate. Persist 1 Type - F32 + U32 Value - 45.0 + 45 FSLimitFramerate Comment - Enable framerate limitation defined by MaxFPS + Enable framerate limitation defined by FramePerSecondLimit Persist 1 Type diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 717eca1a96..d1f2389cb7 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1683,7 +1683,11 @@ bool LLAppViewer::frame() gGLActive = TRUE; static U64 last_call = 0; - if (LLStartUp::getStartupState() == STATE_STARTED + // MaxFPS improvement + //if (LLStartUp::getStartupState() == STATE_STARTED + static LLCachedControl fsLimitFramerate(gSavedSettings, "FSLimitFramerate"); + if (fsLimitFramerate && LLStartUp::getStartupState() == STATE_STARTED + // && !gTeleportDisplay) { // Frame/draw throttling diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index b2c3597467..5d83776d50 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -1265,7 +1265,7 @@ width="256"/> Date: Tue, 4 Jul 2017 16:25:41 +0300 Subject: [PATCH 12/98] MAINT-7329 Viewer was spamming log with motion limit messages --- indra/llcharacter/llmotioncontroller.cpp | 9 ++++++--- indra/llcharacter/llmotioncontroller.h | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp index d8185aa693..35e76f1d9d 100644 --- a/indra/llcharacter/llmotioncontroller.cpp +++ b/indra/llcharacter/llmotioncontroller.cpp @@ -139,7 +139,8 @@ LLMotionController::LLMotionController() mTimeStep(0.f), mTimeStepCount(0), mLastInterp(0.f), - mIsSelf(FALSE) + mIsSelf(FALSE), + mLastCountAfterPurge(0) { } @@ -238,10 +239,12 @@ void LLMotionController::purgeExcessMotions() } } - if (mLoadedMotions.size() > 2*MAX_MOTION_INSTANCES) + U32 loaded_count = mLoadedMotions.size(); + if (loaded_count > (2 * MAX_MOTION_INSTANCES) && loaded_count > mLastCountAfterPurge) { - LL_WARNS_ONCE("Animation") << "> " << 2*MAX_MOTION_INSTANCES << " Loaded Motions" << LL_ENDL; + LL_WARNS_ONCE("Animation") << loaded_count << " Loaded Motions. Amount of motions is over limit." << LL_ENDL; } + mLastCountAfterPurge = loaded_count; } //----------------------------------------------------------------------------- diff --git a/indra/llcharacter/llmotioncontroller.h b/indra/llcharacter/llmotioncontroller.h index 72de331694..9d9c64f4f0 100644 --- a/indra/llcharacter/llmotioncontroller.h +++ b/indra/llcharacter/llmotioncontroller.h @@ -224,6 +224,8 @@ protected: F32 mLastInterp; U8 mJointSignature[2][LL_CHARACTER_MAX_ANIMATED_JOINTS]; +private: + U32 mLastCountAfterPurge; //for logging and debugging purposes }; //----------------------------------------------------------------------------- From f7f24611c69d64934b4a815636bc4a948fe8ba52 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 5 Jul 2017 19:34:04 +0300 Subject: [PATCH 13/98] MAINT-203 Fixed auto-scroll zones being uneven in inventory --- indra/llui/llscrollcontainer.cpp | 44 +++++++++++++++++++++----- indra/llui/llscrollcontainer.h | 4 ++- indra/newview/llpanelmaininventory.cpp | 2 +- 3 files changed, 40 insertions(+), 10 deletions(-) diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index f70eebc594..770315fadd 100644 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -290,7 +290,21 @@ BOOL LLScrollContainer::handleDragAndDrop(S32 x, S32 y, MASK mask, return TRUE; } +bool LLScrollContainer::canAutoScroll(S32 x, S32 y) +{ + if (mAutoScrolling) + { + return true; // already scrolling + } + return autoScroll(x, y, false); +} + bool LLScrollContainer::autoScroll(S32 x, S32 y) +{ + return autoScroll(x, y, true); +} + +bool LLScrollContainer::autoScroll(S32 x, S32 y, bool do_scroll) { static LLUICachedControl scrollbar_size_control ("UIScrollbarSize", 0); S32 scrollbar_size = (mSize == -1 ? scrollbar_size_control : mSize); @@ -302,6 +316,8 @@ bool LLScrollContainer::autoScroll(S32 x, S32 y) screenRectToLocal(getRootView()->getLocalRect(), &screen_local_extents); LLRect inner_rect_local( 0, mInnerRect.getHeight(), mInnerRect.getWidth(), 0 ); + // Note: Will also include scrollers as scroll zones, so opposite + // scroll zones might have different size due to visible scrollers if( mScrollbar[HORIZONTAL]->getVisible() ) { inner_rect_local.mBottom += scrollbar_size; @@ -325,8 +341,11 @@ bool LLScrollContainer::autoScroll(S32 x, S32 y) left_scroll_rect.mRight = inner_rect_local.mLeft + auto_scroll_region_width; if( left_scroll_rect.pointInRect( x, y ) && (mScrollbar[HORIZONTAL]->getDocPos() > 0) ) { - mScrollbar[HORIZONTAL]->setDocPos( mScrollbar[HORIZONTAL]->getDocPos() - auto_scroll_speed ); - mAutoScrolling = TRUE; + if (do_scroll) + { + mScrollbar[HORIZONTAL]->setDocPos(mScrollbar[HORIZONTAL]->getDocPos() - auto_scroll_speed); + mAutoScrolling = TRUE; + } scrolling = true; } @@ -334,8 +353,11 @@ bool LLScrollContainer::autoScroll(S32 x, S32 y) right_scroll_rect.mLeft = inner_rect_local.mRight - auto_scroll_region_width; if( right_scroll_rect.pointInRect( x, y ) && (mScrollbar[HORIZONTAL]->getDocPos() < mScrollbar[HORIZONTAL]->getDocPosMax()) ) { - mScrollbar[HORIZONTAL]->setDocPos( mScrollbar[HORIZONTAL]->getDocPos() + auto_scroll_speed ); - mAutoScrolling = TRUE; + if (do_scroll) + { + mScrollbar[HORIZONTAL]->setDocPos(mScrollbar[HORIZONTAL]->getDocPos() + auto_scroll_speed); + mAutoScrolling = TRUE; + } scrolling = true; } } @@ -345,8 +367,11 @@ bool LLScrollContainer::autoScroll(S32 x, S32 y) bottom_scroll_rect.mTop = inner_rect_local.mBottom + auto_scroll_region_height; if( bottom_scroll_rect.pointInRect( x, y ) && (mScrollbar[VERTICAL]->getDocPos() < mScrollbar[VERTICAL]->getDocPosMax()) ) { - mScrollbar[VERTICAL]->setDocPos( mScrollbar[VERTICAL]->getDocPos() + auto_scroll_speed ); - mAutoScrolling = TRUE; + if (do_scroll) + { + mScrollbar[VERTICAL]->setDocPos(mScrollbar[VERTICAL]->getDocPos() + auto_scroll_speed); + mAutoScrolling = TRUE; + } scrolling = true; } @@ -354,8 +379,11 @@ bool LLScrollContainer::autoScroll(S32 x, S32 y) top_scroll_rect.mBottom = inner_rect_local.mTop - auto_scroll_region_height; if( top_scroll_rect.pointInRect( x, y ) && (mScrollbar[VERTICAL]->getDocPos() > 0) ) { - mScrollbar[VERTICAL]->setDocPos( mScrollbar[VERTICAL]->getDocPos() - auto_scroll_speed ); - mAutoScrolling = TRUE; + if (do_scroll) + { + mScrollbar[VERTICAL]->setDocPos(mScrollbar[VERTICAL]->getDocPos() - auto_scroll_speed); + mAutoScrolling = TRUE; + } scrolling = true; } } diff --git a/indra/llui/llscrollcontainer.h b/indra/llui/llscrollcontainer.h index c4c4d0a136..a2f7d14f1a 100644 --- a/indra/llui/llscrollcontainer.h +++ b/indra/llui/llscrollcontainer.h @@ -114,7 +114,8 @@ public: virtual void draw(); virtual bool addChild(LLView* view, S32 tab_group = 0); - + + bool canAutoScroll(S32 x, S32 y); bool autoScroll(S32 x, S32 y); S32 getSize() const { return mSize; } @@ -128,6 +129,7 @@ private: virtual void scrollHorizontal( S32 new_pos ); virtual void scrollVertical( S32 new_pos ); void updateScroll(); + bool autoScroll(S32 x, S32 y, bool do_scroll); void calcVisibleSize( S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar ) const; LLScrollbar* mScrollbar[ORIENTATION_COUNT]; diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index dd75ae9c06..c34dd64cba 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -540,7 +540,7 @@ BOOL LLPanelMainInventory::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, { // Check to see if we are auto scrolling from the last frame LLInventoryPanel* panel = (LLInventoryPanel*)this->getActivePanel(); - BOOL needsToScroll = panel->getScrollableContainer()->autoScroll(x, y); + BOOL needsToScroll = panel->getScrollableContainer()->canAutoScroll(x, y); if(mFilterTabs) { if(needsToScroll) From 4bcaac489ee909f6cec30b6e1783c225869747b5 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Mon, 10 Jul 2017 15:47:26 +0300 Subject: [PATCH 14/98] MAINT-7565 FIXED Inconsistent name format in nearby chat toast and chat history --- indra/newview/llviewermessage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 06f868dc08..eadbd8cd54 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3569,7 +3569,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) LLAvatarName av_name; if (LLAvatarNameCache::get(from_id, &av_name)) { - chat.mFromName = av_name.getDisplayName(); + chat.mFromName = av_name.getCompleteName(); } else { From 6bc2c5789cfedee024d6eb8d33972bfa713ce3fc Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 7 Jul 2017 20:01:06 +0300 Subject: [PATCH 15/98] MAINT-6931 Fixed Flexi prims being FPS dependent --- indra/newview/llflexibleobject.cpp | 79 ++++++++++++++++-------------- indra/newview/llflexibleobject.h | 4 +- 2 files changed, 44 insertions(+), 39 deletions(-) diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp index b6e61f83b1..e075a311c2 100644 --- a/indra/newview/llflexibleobject.cpp +++ b/indra/newview/llflexibleobject.cpp @@ -43,9 +43,9 @@ #include "llworld.h" #include "llvoavatar.h" +static const F32 SEC_PER_FLEXI_FRAME = 1.f / 60.f; // 60 flexi updates per second /*static*/ F32 LLVolumeImplFlexible::sUpdateFactor = 1.0f; std::vector LLVolumeImplFlexible::sInstanceList; -std::vector LLVolumeImplFlexible::sUpdateDelay; static LLTrace::BlockTimerStatHandle FTM_FLEXIBLE_REBUILD("Rebuild"); static LLTrace::BlockTimerStatHandle FTM_DO_FLEXIBLE_UPDATE("Flexible Update"); @@ -56,7 +56,10 @@ static LLTrace::BlockTimerStatHandle FTM_DO_FLEXIBLE_UPDATE("Flexible Update"); // constructor //----------------------------------------------- LLVolumeImplFlexible::LLVolumeImplFlexible(LLViewerObject* vo, LLFlexibleObjectData* attributes) : - mVO(vo), mAttributes(attributes) + mVO(vo), + mAttributes(attributes), + mLastFrameNum(0), + mLastUpdatePeriod(0) { static U32 seed = 0; mID = seed++; @@ -64,7 +67,6 @@ LLVolumeImplFlexible::LLVolumeImplFlexible(LLViewerObject* vo, LLFlexibleObjectD mUpdated = FALSE; mInitializedRes = -1; mSimulateRes = 0; - mFrameNum = 0; mCollisionSphereRadius = 0.f; mRenderRes = -1; @@ -75,7 +77,6 @@ LLVolumeImplFlexible::LLVolumeImplFlexible(LLViewerObject* vo, LLFlexibleObjectD mInstanceIndex = sInstanceList.size(); sInstanceList.push_back(this); - sUpdateDelay.push_back(0); }//----------------------------------------------- LLVolumeImplFlexible::~LLVolumeImplFlexible() @@ -86,28 +87,28 @@ LLVolumeImplFlexible::~LLVolumeImplFlexible() { sInstanceList[mInstanceIndex] = sInstanceList[end_idx]; sInstanceList[mInstanceIndex]->mInstanceIndex = mInstanceIndex; - sUpdateDelay[mInstanceIndex] = sUpdateDelay[end_idx]; } sInstanceList.pop_back(); - sUpdateDelay.pop_back(); } //static void LLVolumeImplFlexible::updateClass() { - std::vector::iterator delay_iter = sUpdateDelay.begin(); + LL_RECORD_BLOCK_TIME(FTM_DO_FLEXIBLE_UPDATE); + U64 virtual_frame_num = LLTimer::getElapsedSeconds() / SEC_PER_FLEXI_FRAME; for (std::vector::iterator iter = sInstanceList.begin(); iter != sInstanceList.end(); ++iter) { - --(*delay_iter); - if (*delay_iter <= 0) + // Note: by now update period might have changed + if ((*iter)->mRenderRes == -1 + || (*iter)->mLastFrameNum + (*iter)->mLastUpdatePeriod <= virtual_frame_num + || (*iter)->mLastFrameNum > virtual_frame_num) //time issues, overflow { (*iter)->doIdleUpdate(); } - ++delay_iter; } } @@ -334,15 +335,12 @@ void LLVolumeImplFlexible::updateRenderRes() // updated every time step. In the future, perhaps there could be an // optimization similar to what Havok does for objects that are stationary. //--------------------------------------------------------------------------------- -static LLTrace::BlockTimerStatHandle FTM_FLEXIBLE_UPDATE("Update Flexies"); void LLVolumeImplFlexible::doIdleUpdate() { LLDrawable* drawablep = mVO->mDrawable; if (drawablep) { - //LL_RECORD_BLOCK_TIME(FTM_FLEXIBLE_UPDATE); - //ensure drawable is active drawablep->makeActive(); @@ -354,15 +352,20 @@ void LLVolumeImplFlexible::doIdleUpdate() { updateRenderRes(); gPipeline.markRebuild(drawablep, LLDrawable::REBUILD_POSITION, FALSE); - sUpdateDelay[mInstanceIndex] = 0; } else { F32 pixel_area = mVO->getPixelArea(); + // Note: Flexies afar will be rarely updated, closer ones will be updated more frequently. + // But frequency differences are extremely noticeable, so consider modifying update factor, + // or at least clamping value a bit more from both sides. U32 update_period = (U32) (llmax((S32) (LLViewerCamera::getInstance()->getScreenPixelArea()*0.01f/(pixel_area*(sUpdateFactor+1.f))),0)+1); // MAINT-1890 Clamp the update period to ensure that the update_period is no greater than 32 frames - update_period = llclamp(update_period, 0U, 32U); + update_period = llclamp(update_period, 1U, 32U); + + // We control how fast flexies update, buy splitting updates among frames + U64 virtual_frame_num = LLTimer::getElapsedSeconds() / SEC_PER_FLEXI_FRAME; if (visible) { @@ -370,42 +373,44 @@ void LLVolumeImplFlexible::doIdleUpdate() pixel_area > 256.f) { U32 id; - if (mVO->isRootEdit()) { id = mID; } else { - LLVOVolume* parent = (LLVOVolume*) mVO->getParent(); + LLVOVolume* parent = (LLVOVolume*)mVO->getParent(); id = parent->getVolumeInterfaceID(); } - if (mVO->isRootEdit()) - { - id = mID; + + // Throttle flexies and spread load by preventing flexies from updating in same frame + // Shows how many frames we need to wait before next update + U64 throttling_delay = (virtual_frame_num + id) % update_period; + + if ((throttling_delay == 0 && mLastFrameNum < virtual_frame_num) //one or more virtual frames per frame + || (mLastFrameNum + update_period < virtual_frame_num)) // missed virtual frame + { + // We need mLastFrameNum to compensate for 'unreliable time' and to filter 'duplicate' frames + // If happened too late, subtract throttling_delay (it is zero otherwise) + mLastFrameNum = virtual_frame_num - throttling_delay; + + // Store update period for updateClass() + // Note: Consider substituting update_period with mLastUpdatePeriod everywhere. + mLastUpdatePeriod = update_period; + + updateRenderRes(); + + gPipeline.markRebuild(drawablep, LLDrawable::REBUILD_POSITION, FALSE); + } + } } else { - LLVOVolume* parent = (LLVOVolume*) mVO->getParent(); - id = parent->getVolumeInterfaceID(); - } - - if ((LLDrawable::getCurrentFrame()+id)%update_period == 0) - { - sUpdateDelay[mInstanceIndex] = (S32) update_period-1; - - updateRenderRes(); - - gPipeline.markRebuild(drawablep, LLDrawable::REBUILD_POSITION, FALSE); + mLastFrameNum = virtual_frame_num; + mLastUpdatePeriod = update_period; } } - } - else - { - sUpdateDelay[mInstanceIndex] = (S32) update_period; - } -} } } diff --git a/indra/newview/llflexibleobject.h b/indra/newview/llflexibleobject.h index a00551df8e..9383ab03ae 100644 --- a/indra/newview/llflexibleobject.h +++ b/indra/newview/llflexibleobject.h @@ -72,7 +72,6 @@ class LLVolumeImplFlexible : public LLVolumeInterface { private: static std::vector sInstanceList; - static std::vector sUpdateDelay; S32 mInstanceIndex; public: @@ -133,7 +132,8 @@ private: S32 mInitializedRes; S32 mSimulateRes; S32 mRenderRes; - U32 mFrameNum; + U64 mLastFrameNum; + U32 mLastUpdatePeriod; LLVector3 mCollisionSpherePosition; F32 mCollisionSphereRadius; U32 mID; From 36235df02d1fe5860371853472e04b4221bea3cd Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 10 Jul 2017 19:48:41 +0300 Subject: [PATCH 16/98] MAINT-7576 Fixed scroll zone being too small and hardcoded --- indra/llui/llscrollcontainer.cpp | 6 ++++-- indra/llui/llscrollcontainer.h | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index 770315fadd..6135cc56ad 100644 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -72,6 +72,7 @@ LLScrollContainer::Params::Params() hide_scrollbar("hide_scrollbar"), min_auto_scroll_rate("min_auto_scroll_rate", 100), max_auto_scroll_rate("max_auto_scroll_rate", 1000), + max_auto_scroll_zone("max_auto_scroll_zone", 16), reserve_scroll_corner("reserve_scroll_corner", false), size("size", -1) {} @@ -88,6 +89,7 @@ LLScrollContainer::LLScrollContainer(const LLScrollContainer::Params& p) mReserveScrollCorner(p.reserve_scroll_corner), mMinAutoScrollRate(p.min_auto_scroll_rate), mMaxAutoScrollRate(p.max_auto_scroll_rate), + mMaxAutoScrollZone(p.max_auto_scroll_zone), mScrolledView(NULL), mSize(p.size) { @@ -332,8 +334,8 @@ bool LLScrollContainer::autoScroll(S32 x, S32 y, bool do_scroll) S32 auto_scroll_speed = ll_round(mAutoScrollRate * LLFrameTimer::getFrameDeltaTimeF32()); // autoscroll region should take up no more than one third of visible scroller area - S32 auto_scroll_region_width = llmin(inner_rect_local.getWidth() / 3, 10); - S32 auto_scroll_region_height = llmin(inner_rect_local.getHeight() / 3, 10); + S32 auto_scroll_region_width = llmin(inner_rect_local.getWidth() / 3, (S32)mMaxAutoScrollZone); + S32 auto_scroll_region_height = llmin(inner_rect_local.getHeight() / 3, (S32)mMaxAutoScrollZone); if( mScrollbar[HORIZONTAL]->getVisible() ) { diff --git a/indra/llui/llscrollcontainer.h b/indra/llui/llscrollcontainer.h index a2f7d14f1a..e6c7891397 100644 --- a/indra/llui/llscrollcontainer.h +++ b/indra/llui/llscrollcontainer.h @@ -66,6 +66,7 @@ public: hide_scrollbar; Optional min_auto_scroll_rate, max_auto_scroll_rate; + Optional max_auto_scroll_zone; Optional bg_color; Optional scroll_callback; Optional size; @@ -143,6 +144,7 @@ private: F32 mAutoScrollRate; F32 mMinAutoScrollRate; F32 mMaxAutoScrollRate; + U32 mMaxAutoScrollZone; bool mHideScrollbar; }; From 1144fdc0441d1ea2113474585ed55d2690501a7b Mon Sep 17 00:00:00 2001 From: daianakproductengine Date: Mon, 10 Jul 2017 20:15:04 +0300 Subject: [PATCH 17/98] MAINT-6976 Fixed incorrect search line for open grid's in Search floater --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llweb.cpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 5b501514c7..2987f84319 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4545,7 +4545,7 @@ Type String Value - http://search.secondlife.com/viewer/[CATEGORY]/?q=[QUERY]&p=[AUTH_TOKEN]&r=[MATURITY]&lang=[LANGUAGE]&g=[GODLIKE]&sid=[SESSION_ID]&rid=[REGION_ID]&pid=[PARCEL_ID]&channel=[CHANNEL]&version=[VERSION]&major=[VERSION_MAJOR]&minor=[VERSION_MINOR]&patch=[VERSION_PATCH]&build=[VERSION_BUILD] + https://search.[GRID]/viewer/[CATEGORY]/?q=[QUERY]&p=[AUTH_TOKEN]&r=[MATURITY]&lang=[LANGUAGE]&g=[GODLIKE]&sid=[SESSION_ID]&rid=[REGION_ID]&pid=[PARCEL_ID]&channel=[CHANNEL]&version=[VERSION]&major=[VERSION_MAJOR]&minor=[VERSION_MINOR]&patch=[VERSION_PATCH]&build=[VERSION_BUILD] HighResSnapshot diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index 8026dc3ea8..ec82765b96 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -224,6 +224,22 @@ std::string LLWeb::expandURLSubstitutions(const std::string &url, } substitution["PARCEL_ID"] = llformat("%d", parcel_id); + // find the grid + std::string current_grid = LLGridManager::getInstance()->getGridId(); + std::transform(current_grid.begin(), current_grid.end(), current_grid.begin(), ::tolower); + if (current_grid == "agni") + { + substitution["GRID"] = "secondlife.com"; + } + else if (current_grid == "damballah") + { + // Staging grid has its own naming scheme. + substitution["GRID"] = "secondlife-staging.com"; + } + else + { + substitution["GRID"] = llformat("%s.lindenlab.com", current_grid.c_str()); + } // expand all of the substitution strings and escape the url std::string expanded_url = url; LLStringUtil::format(expanded_url, substitution); From 2c77a197be1b1c5c19008f9cd5ea7508a61d1bfe Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 11 Jul 2017 11:38:52 +0300 Subject: [PATCH 18/98] MAINT-7554 Removed unneeded check --- indra/newview/llappviewer.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index b4c433893d..6a9d22dd07 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1425,8 +1425,7 @@ bool LLAppViewer::frame() gGLActive = TRUE; static U64 last_call = 0; - if (LLStartUp::getStartupState() == STATE_STARTED - && !gTeleportDisplay) + if (!gTeleportDisplay) { // Frame/draw throttling U64 elapsed_time = LLTimer::getTotalTime() - last_call; From 5478f2a223b5b679fe4515aa5a88f9ae1ed36985 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 11 Jul 2017 14:54:29 +0300 Subject: [PATCH 19/98] MAINT-7581 [contribution] Closing the 'Replace links' floater crashes the viewer if a replace is in progress --- doc/contributions.txt | 1 + indra/newview/llfloaterlinkreplace.cpp | 22 +++++++++------------- indra/newview/llfloaterlinkreplace.h | 11 +++-------- 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index 549adaaef7..064639fe72 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -823,6 +823,7 @@ Kitty Barnett MAINT-6154 MAINT-6568 STORM-2149 + MAINT-7581 Kolor Fall Komiko Okamoto Korvel Noh diff --git a/indra/newview/llfloaterlinkreplace.cpp b/indra/newview/llfloaterlinkreplace.cpp index 3f80d6f1a4..10cce3bd22 100644 --- a/indra/newview/llfloaterlinkreplace.cpp +++ b/indra/newview/llfloaterlinkreplace.cpp @@ -41,16 +41,13 @@ LLFloaterLinkReplace::LLFloaterLinkReplace(const LLSD& key) mRemainingItems(0), mSourceUUID(LLUUID::null), mTargetUUID(LLUUID::null), - mInstance(NULL), mBatchSize(gSavedSettings.getU32("LinkReplaceBatchSize")) { mEventTimer.stop(); - mInstance = this; } LLFloaterLinkReplace::~LLFloaterLinkReplace() { - mInstance = NULL; } BOOL LLFloaterLinkReplace::postBuild() @@ -180,11 +177,9 @@ void LLFloaterLinkReplace::onStartClicked() } } -void LLFloaterLinkReplace::linkCreatedCallback(const LLUUID& old_item_id, - const LLUUID& target_item_id, - bool needs_wearable_ordering_update, - bool needs_description_update, - const LLUUID& outfit_folder_id) +// static +void LLFloaterLinkReplace::linkCreatedCallback(LLHandle floater_handle, const LLUUID& old_item_id, const LLUUID& target_item_id, + bool needs_wearable_ordering_update, bool needs_description_update, const LLUUID& outfit_folder_id) { LL_DEBUGS() << "Inventory link replace:" << LL_NEWLINE << " - old_item_id = " << old_item_id.asString() << LL_NEWLINE @@ -239,20 +234,21 @@ void LLFloaterLinkReplace::linkCreatedCallback(const LLUUID& old_item_id, outfit_update_folder = outfit_folder_id; } - LLPointer cb = new LLBoostFuncInventoryCallback(boost::bind(&LLFloaterLinkReplace::itemRemovedCallback, this, outfit_update_folder)); + LLPointer cb = new LLBoostFuncInventoryCallback(boost::bind(&LLFloaterLinkReplace::itemRemovedCallback, floater_handle, outfit_update_folder)); remove_inventory_object(old_item_id, cb); } -void LLFloaterLinkReplace::itemRemovedCallback(const LLUUID& outfit_folder_id) +// static +void LLFloaterLinkReplace::itemRemovedCallback(LLHandle floater_handle, const LLUUID& outfit_folder_id) { if (outfit_folder_id.notNull()) { LLAppearanceMgr::getInstance()->updateClothingOrderingInfo(outfit_folder_id); } - if (mInstance) + if (!floater_handle.isDead()) { - decreaseOpenItemCount(); + floater_handle.get()->decreaseOpenItemCount(); } } @@ -324,7 +320,7 @@ void LLFloaterLinkReplace::processBatch(LLInventoryModel::item_array_t items) LLInventoryObject::const_object_list_t obj_array; obj_array.push_back(LLConstPointer(target_item)); LLPointer cb = new LLBoostFuncInventoryCallback(boost::bind(&LLFloaterLinkReplace::linkCreatedCallback, - this, + getDerivedHandle(), source_item->getUUID(), target_item->getUUID(), needs_wearable_ordering_update, diff --git a/indra/newview/llfloaterlinkreplace.h b/indra/newview/llfloaterlinkreplace.h index 377dd1d450..dd5c301206 100644 --- a/indra/newview/llfloaterlinkreplace.h +++ b/indra/newview/llfloaterlinkreplace.h @@ -98,12 +98,9 @@ private: void updateFoundLinks(); void processBatch(LLInventoryModel::item_array_t items); - void linkCreatedCallback(const LLUUID& old_item_id, - const LLUUID& target_item_id, - bool needs_wearable_ordering_update, - bool needs_description_update, - const LLUUID& outfit_folder_id); - void itemRemovedCallback(const LLUUID& outfit_folder_id); + static void linkCreatedCallback(LLHandle floater_handle, const LLUUID& old_item_id, const LLUUID& target_item_id, + bool needs_wearable_ordering_update, bool needs_description_update, const LLUUID& outfit_folder_id); + static void itemRemovedCallback(LLHandle floater_handle, const LLUUID& outfit_folder_id); void onSourceItemDrop(const LLUUID& source_item_id); void onTargetItemDrop(const LLUUID& target_item_id); @@ -120,8 +117,6 @@ private: U32 mBatchSize; LLInventoryModel::item_array_t mRemainingInventoryItems; - - LLFloaterLinkReplace* mInstance; }; #endif // LL_FLOATERLINKREPLACE_H From 530f69ff33a6b3854c489590eddb0ba7d6bd7264 Mon Sep 17 00:00:00 2001 From: pavelkproductengine Date: Mon, 10 Jul 2017 17:22:12 +0300 Subject: [PATCH 20/98] MAINT-7541 Not able to save login credentials on clean install --- doc/contributions.txt | 1 + indra/newview/llmachineid.cpp | 35 +++++++++++++++++++++++------------ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index 064639fe72..b5d4e181bf 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -1041,6 +1041,7 @@ Nicholaz Beresford Nick Rhodes NickyD MAINT-873 + MAINT-7541 Nicky Dasmijn VWR-29228 MAINT-1392 diff --git a/indra/newview/llmachineid.cpp b/indra/newview/llmachineid.cpp index b5fd3df0f3..b0ee8e7fcb 100644 --- a/indra/newview/llmachineid.cpp +++ b/indra/newview/llmachineid.cpp @@ -37,6 +37,28 @@ using namespace std; unsigned char static_unique_id[] = {0,0,0,0,0,0}; bool static has_static_unique_id = false; +#if LL_WINDOWS + +class LLComInitialize +{ + HRESULT mHR; +public: + LLComInitialize() + { + mHR = CoInitializeEx(0, COINIT_MULTITHREADED); + if (FAILED(mHR)) + LL_DEBUGS("AppInit") << "Failed to initialize COM library. Error code = 0x" << hex << mHR << LL_ENDL; + } + + ~LLComInitialize() + { + if (SUCCEEDED(mHR)) + CoUninitialize(); + } +}; + +#endif //LL_WINDOWS + // get an unique machine id. // NOT THREAD SAFE - do before setting up threads. // MAC Address doesn't work for Windows 7 since the first returned hardware MAC address changes with each reboot, Go figure?? @@ -59,12 +81,7 @@ S32 LLMachineID::init() // Step 1: -------------------------------------------------- // Initialize COM. ------------------------------------------ - hres = CoInitializeEx(0, COINIT_MULTITHREADED); - if (FAILED(hres)) - { - LL_DEBUGS("AppInit") << "Failed to initialize COM library. Error code = 0x" << hex << hres << LL_ENDL; - return 1; // Program has failed. - } + LLComInitialize comInit; // Step 2: -------------------------------------------------- // Set general COM security levels -------------------------- @@ -89,7 +106,6 @@ S32 LLMachineID::init() if (FAILED(hres)) { LL_WARNS("AppInit") << "Failed to initialize security. Error code = 0x" << hex << hres << LL_ENDL; - CoUninitialize(); return 1; // Program has failed. } @@ -107,7 +123,6 @@ S32 LLMachineID::init() if (FAILED(hres)) { LL_WARNS("AppInit") << "Failed to create IWbemLocator object." << " Err code = 0x" << hex << hres << LL_ENDL; - CoUninitialize(); return 1; // Program has failed. } @@ -134,7 +149,6 @@ S32 LLMachineID::init() { LL_WARNS("AppInit") << "Could not connect. Error code = 0x" << hex << hres << LL_ENDL; pLoc->Release(); - CoUninitialize(); return 1; // Program has failed. } @@ -160,7 +174,6 @@ S32 LLMachineID::init() LL_WARNS("AppInit") << "Could not set proxy blanket. Error code = 0x" << hex << hres << LL_ENDL; pSvc->Release(); pLoc->Release(); - CoUninitialize(); return 1; // Program has failed. } @@ -181,7 +194,6 @@ S32 LLMachineID::init() LL_WARNS("AppInit") << "Query for operating system name failed." << " Error code = 0x" << hex << hres << LL_ENDL; pSvc->Release(); pLoc->Release(); - CoUninitialize(); return 1; // Program has failed. } @@ -236,7 +248,6 @@ S32 LLMachineID::init() pLoc->Release(); if (pEnumerator) pEnumerator->Release(); - CoUninitialize(); ret_code=0; #else unsigned char * staticPtr = (unsigned char *)(&static_unique_id[0]); From f7186ac2604cf01b0f9666a8cb510aa91169e3a0 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Tue, 11 Jul 2017 20:46:53 +0300 Subject: [PATCH 21/98] Contributors list fix: NickyD and Nicky Dasmijn are the same person --- doc/contributions.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index b5d4e181bf..6f4e88e836 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -1039,10 +1039,9 @@ Nicholaz Beresford VWR-2682 VWR-2684 Nick Rhodes -NickyD +Nicky Dasmijn MAINT-873 MAINT-7541 -Nicky Dasmijn VWR-29228 MAINT-1392 MAINT-873 From 4f9071c806f35564fec338682199e8c64d40fd6c Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 12 Jul 2017 12:10:47 +0300 Subject: [PATCH 22/98] MAINT-7587 FIXED Unresolved region name variable when trying to enter skill gaming region --- indra/newview/llviewermessage.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index eadbd8cd54..1ce18f5496 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -6851,14 +6851,10 @@ void process_teleport_failed(LLMessageSystem *msg, void**) // Get the message ID msg->getStringFast(_PREHASH_AlertInfo, _PREHASH_Message, message_id); big_reason = LLAgent::sTeleportErrorMessages[message_id]; - if ( big_reason.size() > 0 ) - { // Substitute verbose reason from the local map - args["REASON"] = big_reason; - } - else - { // Nothing found in the map - use what the server returned in the original message block + if ( big_reason.size() <= 0 ) + { + // Nothing found in the map - use what the server returned in the original message block msg->getStringFast(_PREHASH_Info, _PREHASH_Reason, big_reason); - args["REASON"] = big_reason; } LLSD llsd_block; @@ -6873,6 +6869,16 @@ void process_teleport_failed(LLMessageSystem *msg, void**) } else { + if(llsd_block.has("REGION_NAME")) + { + std::string region_name = llsd_block["REGION_NAME"].asString(); + if(!region_name.empty()) + { + LLStringUtil::format_map_t name_args; + name_args["[REGION_NAME]"] = region_name; + LLStringUtil::format(big_reason, name_args); + } + } // change notification name in this special case if (handle_teleport_access_blocked(llsd_block, message_id, args["REASON"])) { @@ -6884,7 +6890,7 @@ void process_teleport_failed(LLMessageSystem *msg, void**) } } } - + args["REASON"] = big_reason; } else { // Extra message payload not found - use what the simulator sent From ab26a700474aa5480d678da67543c9d0f31bb52a Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 13 Jul 2017 11:01:20 +0300 Subject: [PATCH 23/98] MAINT-7593 FIXED "Failed to parse parameter" spam --- indra/llcommon/llinitparam.cpp | 7 +--- indra/llui/llxuiparser.cpp | 36 +++++-------------- .../default/xui/en/floater_grid_status.xml | 1 - .../default/xui/en/floater_web_content.xml | 1 - .../xui/en/panel_active_object_row.xml | 20 ++--------- .../xui/en/panel_media_settings_general.xml | 4 +-- .../xui/en/panel_preferences_advanced.xml | 2 +- .../default/xui/en/panel_preferences_chat.xml | 3 +- 8 files changed, 15 insertions(+), 59 deletions(-) diff --git a/indra/llcommon/llinitparam.cpp b/indra/llcommon/llinitparam.cpp index 1d104cf55d..aa2f4eb289 100644 --- a/indra/llcommon/llinitparam.cpp +++ b/indra/llcommon/llinitparam.cpp @@ -193,12 +193,7 @@ namespace LLInitParam { if (!silent) { - std::string file_name = p.getCurrentFileName(); - if(!file_name.empty()) - { - file_name = "in file: " + file_name; - } - p.parserWarning(llformat("Failed to parse parameter \"%s\" %s", p.getCurrentElementName().c_str(), file_name.c_str())); + p.parserWarning(llformat("Failed to parse parameter \"%s\"", p.getCurrentElementName().c_str())); } return false; } diff --git a/indra/llui/llxuiparser.cpp b/indra/llui/llxuiparser.cpp index 99a0869ce3..138ba8bf02 100644 --- a/indra/llui/llxuiparser.cpp +++ b/indra/llui/llxuiparser.cpp @@ -58,10 +58,6 @@ static LLInitParam::Parser::parser_inspect_func_map_t sSimpleXUIInspectFuncs; const char* NO_VALUE_MARKER = "no_value"; -#ifdef LL_WINDOWS -const S32 LINE_NUMBER_HERE = 0; -#endif - struct MaxOccursValues : public LLInitParam::TypeValuesHelper { static void declareValues() @@ -1313,22 +1309,14 @@ bool LLXUIParser::writeSDValue(Parser& parser, const void* val_ptr, name_stack_t void LLXUIParser::parserWarning(const std::string& message) { -#ifdef LL_WINDOWS - // use Visual Studio friendly formatting of output message for easy access to originating xml - LL_INFOS() << llformat("%s(%d):\t%s", mCurFileName.c_str(), mCurReadNode->getLineNumber(), message.c_str()) << LL_ENDL; -#else - Parser::parserWarning(message); -#endif + std::string warning_msg = llformat("%s:\t%s(%d)", message.c_str(), mCurFileName.c_str(), mCurReadNode->getLineNumber()); + Parser::parserWarning(warning_msg); } void LLXUIParser::parserError(const std::string& message) { -#ifdef LL_WINDOWS - // use Visual Studio friendly formatting of output message for easy access to originating xml - LL_INFOS() << llformat("%s(%d):\t%s", mCurFileName.c_str(), mCurReadNode->getLineNumber(), message.c_str()) << LL_ENDL; -#else - Parser::parserError(message); -#endif + std::string error_msg = llformat("%s:\t%s(%d)", message.c_str(), mCurFileName.c_str(), mCurReadNode->getLineNumber()); + Parser::parserError(error_msg); } @@ -1641,22 +1629,14 @@ bool LLSimpleXUIParser::processText() void LLSimpleXUIParser::parserWarning(const std::string& message) { -#ifdef LL_WINDOWS - // use Visual Studio friendly formatting of output message for easy access to originating xml - LL_INFOS() << llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str()) << LL_ENDL; -#else - Parser::parserWarning(message); -#endif + std::string warning_msg = llformat("%s:\t%s", message.c_str(), mCurFileName.c_str()); + Parser::parserWarning(warning_msg); } void LLSimpleXUIParser::parserError(const std::string& message) { -#ifdef LL_WINDOWS - // use Visual Studio friendly formatting of output message for easy access to originating xml - LL_INFOS() << llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str()) << LL_ENDL; -#else - Parser::parserError(message); -#endif + std::string error_msg = llformat("%s:\t%s", message.c_str(), mCurFileName.c_str()); + Parser::parserError(error_msg); } bool LLSimpleXUIParser::readFlag(Parser& parser, void* val_ptr) diff --git a/indra/newview/skins/default/xui/en/floater_grid_status.xml b/indra/newview/skins/default/xui/en/floater_grid_status.xml index b97bd8056d..bf78204282 100644 --- a/indra/newview/skins/default/xui/en/floater_grid_status.xml +++ b/indra/newview/skins/default/xui/en/floater_grid_status.xml @@ -12,7 +12,6 @@ save_rect="true" save_visibility="true" title="" - initial_mime_type="text/html" width="780" tab_stop="true" filename="floater_web_content.xml"/> diff --git a/indra/newview/skins/default/xui/en/floater_web_content.xml b/indra/newview/skins/default/xui/en/floater_web_content.xml index 4473ce0cda..fe9ffba6cd 100644 --- a/indra/newview/skins/default/xui/en/floater_web_content.xml +++ b/indra/newview/skins/default/xui/en/floater_web_content.xml @@ -10,7 +10,6 @@ help_topic="floater_web_content" save_rect="true" title="" - initial_mime_type="text/html" width="780"> + visible="false"> + visible="false"> diff --git a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml index 78f771cd51..9e7023d2f2 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml @@ -1,7 +1,6 @@ From 31ff6baf68f62997f608938535fe3192ab4ff270 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 13 Jul 2017 19:17:07 +0300 Subject: [PATCH 24/98] MAINT-7326 Increased default texture and vfs cache size --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llappviewer.cpp | 14 +++----------- .../default/xui/en/panel_preferences_advanced.xml | 2 +- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 2987f84319..0303581d62 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1393,7 +1393,7 @@ Type U32 Value - 512 + 1024 CacheValidateCounter diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 6a9d22dd07..f72eb48f81 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4397,23 +4397,15 @@ bool LLAppViewer::initCache() // Init the texture cache // Allocate 80% of the cache size for textures const S32 MB = 1024 * 1024; - const S64 MIN_CACHE_SIZE = 64 * MB; + const S64 MIN_CACHE_SIZE = 256 * MB; const S64 MAX_CACHE_SIZE = 9984ll * MB; const S64 MAX_VFS_SIZE = 1024 * MB; // 1 GB S64 cache_size = (S64)(gSavedSettings.getU32("CacheSize")) * MB; cache_size = llclamp(cache_size, MIN_CACHE_SIZE, MAX_CACHE_SIZE); - S64 texture_cache_size = ((cache_size * 8) / 10); - S64 vfs_size = cache_size - texture_cache_size; - - if (vfs_size > MAX_VFS_SIZE) - { - // Give the texture cache more space, since the VFS can't be bigger than 1GB. - // This happens when the user's CacheSize setting is greater than 5GB. - vfs_size = MAX_VFS_SIZE; - texture_cache_size = cache_size - MAX_VFS_SIZE; - } + S64 vfs_size = llmin((S64)((cache_size * 2) / 10), MAX_VFS_SIZE); + S64 texture_cache_size = cache_size - vfs_size; S64 extra = LLAppViewer::getTextureCache()->initCache(LL_PATH_CACHE, texture_cache_size, texture_cache_mismatch); texture_cache_size -= extra; diff --git a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml index d6e2d06316..83ce912c77 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml @@ -32,7 +32,7 @@ height="23" increment="64" initial_value="1024" - label="Cache size (64 - 9984MB)" + label="Cache size (256 - 9984MB)" label_width="150" layout="topleft" left="80" From a5660211f46cc99cefd6ab93d1a1136b19d33b4b Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 18 Jul 2017 16:17:59 +0300 Subject: [PATCH 25/98] MAINT-7607 FIXED Viewer crashes when double clicking on scroll bar arrow in Outfit Gallery tab --- indra/newview/lloutfitgallery.cpp | 25 ++++++++++++------------- indra/newview/lloutfitgallery.h | 7 ++++--- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index 31e89c0ed0..5518656f3f 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -344,7 +344,7 @@ void LLOutfitGallery::removeFromLastRow(LLOutfitGalleryItem* item) mItemPanels.pop_back(); } -LLOutfitGalleryItem* LLOutfitGallery::buildGalleryItem(std::string name) +LLOutfitGalleryItem* LLOutfitGallery::buildGalleryItem(std::string name, LLUUID outfit_id) { LLOutfitGalleryItem::Params giparams; LLOutfitGalleryItem* gitem = LLUICtrlFactory::create(giparams); @@ -353,6 +353,7 @@ LLOutfitGalleryItem* LLOutfitGallery::buildGalleryItem(std::string name) gitem->setFollowsLeft(); gitem->setFollowsTop(); gitem->setOutfitName(name); + gitem->setUUID(outfit_id); return gitem; } @@ -511,7 +512,7 @@ void LLOutfitGallery::updateAddedCategory(LLUUID cat_id) if (!cat) return; std::string name = cat->getName(); - LLOutfitGalleryItem* item = buildGalleryItem(name); + LLOutfitGalleryItem* item = buildGalleryItem(name, cat_id); mOutfitMap.insert(LLOutfitGallery::outfit_map_value_t(cat_id, item)); item->setRightMouseDownCallback(boost::bind(&LLOutfitListBase::outfitRightClickCallBack, this, _1, _2, _3, cat_id)); @@ -661,7 +662,8 @@ LLOutfitGalleryItem::LLOutfitGalleryItem(const Params& p) mSelected(false), mWorn(false), mDefaultImage(true), - mOutfitName("") + mOutfitName(""), + mUUID(LLUUID()) { buildFromFile("panel_outfit_gallery_item.xml"); } @@ -745,23 +747,20 @@ BOOL LLOutfitGalleryItem::handleRightMouseDown(S32 x, S32 y, MASK mask) return LLUICtrl::handleRightMouseDown(x, y, mask); } -BOOL LLOutfitGallery::handleDoubleClick(S32 x, S32 y, MASK mask) +BOOL LLOutfitGalleryItem::handleDoubleClick(S32 x, S32 y, MASK mask) { LLTabContainer* appearence_tabs = LLPanelOutfitsInventory::findInstance()->getChild("appearance_tabs"); - LLPanel* panel = NULL; - LLAccordionCtrl* accordion = NULL; - if (appearence_tabs != NULL) + if (appearence_tabs && (mUUID != LLUUID())) { appearence_tabs->selectTabByName("outfitslist_tab"); - panel = appearence_tabs->getCurrentPanel(); - if (panel != NULL) + LLPanel* panel = appearence_tabs->getCurrentPanel(); + if (panel) { - accordion = panel->getChild("outfits_accordion"); + LLAccordionCtrl* accordion = panel->getChild("outfits_accordion"); LLOutfitsList* outfit_list = dynamic_cast(panel); if (accordion != NULL && outfit_list != NULL) { - LLUUID item_id = getSelectedOutfitUUID(); - outfit_list->setSelectedOutfitByUUID(item_id); + outfit_list->setSelectedOutfitByUUID(mUUID); LLAccordionCtrlTab* tab = accordion->getSelectedTab(); tab->showAndFocusHeader(); return TRUE; @@ -769,7 +768,7 @@ BOOL LLOutfitGallery::handleDoubleClick(S32 x, S32 y, MASK mask) } } - return LLUICtrl::handleDoubleClick(x, y, mask); + return LLPanel::handleDoubleClick(x, y, mask); } void LLOutfitGalleryItem::setImageAssetId(LLUUID image_asset_id) diff --git a/indra/newview/lloutfitgallery.h b/indra/newview/lloutfitgallery.h index 37e75f1109..2566247072 100644 --- a/indra/newview/lloutfitgallery.h +++ b/indra/newview/lloutfitgallery.h @@ -115,8 +115,6 @@ public: void onBeforeOutfitSnapshotSave(); void onAfterOutfitSnapshotSave(); - /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); - protected: /*virtual*/ void onHighlightBaseOutfit(LLUUID base_id, LLUUID prev_id); /*virtual*/ void onSetSelectedOutfitByUUID(const LLUUID& outfit_uuid); @@ -150,7 +148,7 @@ private: void updateRowsIfNeeded(); void updateGalleryWidth(); - LLOutfitGalleryItem* buildGalleryItem(std::string name); + LLOutfitGalleryItem* buildGalleryItem(std::string name, LLUUID outfit_id); void onTextureSelectionChanged(LLInventoryItem* itemp); @@ -258,6 +256,7 @@ public: /*virtual*/ void draw(); /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); void setDefaultImage(); void setImageAssetId(LLUUID asset_id); @@ -265,6 +264,7 @@ public: void setOutfitName(std::string name); void setOutfitWorn(bool value); void setSelected(bool value); + void setUUID(LLUUID outfit_id) {mUUID = outfit_id;} std::string getItemName() {return mOutfitName;} bool isDefaultImage() {return mDefaultImage;} @@ -274,6 +274,7 @@ public: private: LLPointer mTexturep; + LLUUID mUUID; LLUUID mImageAssetId; LLTextBox* mOutfitNameText; LLTextBox* mOutfitWornText; From ac83e82008cb19f2fd5532dea4dc4b556bd0dd6e Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 24 Jul 2017 10:13:35 +0300 Subject: [PATCH 26/98] MAINT-7326 Fixed minimal value check --- .../newview/skins/default/xui/en/panel_preferences_advanced.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml index 83ce912c77..4f0bb9d3b7 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml @@ -37,7 +37,7 @@ layout="topleft" left="80" max_val="9984" - min_val="64" + min_val="256" top_pad="10" name="cachesizespinner" width="200" /> From 1a5fa01fb894d8e7da575d313fd5270fe4289ca7 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 24 Jul 2017 17:06:12 +0300 Subject: [PATCH 27/98] MAINT-7495 Viewer retries too many time apon 504 from login.cgi --- indra/llcorehttp/_httpinternal.h | 5 ++++- indra/llcorehttp/_httpoprequest.cpp | 5 +++++ indra/llcorehttp/_httpoprequest.h | 2 ++ indra/llcorehttp/_httppolicy.cpp | 16 ++++++--------- indra/llcorehttp/httpoptions.cpp | 12 ++++++++++++ indra/llcorehttp/httpoptions.h | 22 ++++++++++++++++++++- indra/newview/app_settings/settings.xml | 4 ++-- indra/newview/lllogininstance.cpp | 11 ++++++++--- indra/newview/llxmlrpclistener.cpp | 2 +- indra/newview/llxmlrpctransaction.cpp | 26 ++++++++++++++++--------- indra/newview/llxmlrpctransaction.h | 2 +- 11 files changed, 79 insertions(+), 28 deletions(-) diff --git a/indra/llcorehttp/_httpinternal.h b/indra/llcorehttp/_httpinternal.h index 79c89d6c92..690ebbecd8 100644 --- a/indra/llcorehttp/_httpinternal.h +++ b/indra/llcorehttp/_httpinternal.h @@ -127,9 +127,12 @@ const int HTTP_TRACE_MAX = HTTP_TRACE_CURL_BODIES; // We want to span a few windows to allow transport to slow // after onset of the throttles and then recover without a final // failure. Other systems may need other constants. -const int HTTP_RETRY_COUNT_DEFAULT = 8; +const int HTTP_RETRY_COUNT_DEFAULT = 5; const int HTTP_RETRY_COUNT_MIN = 0; const int HTTP_RETRY_COUNT_MAX = 100; +const HttpTime HTTP_RETRY_BACKOFF_MIN_DEFAULT = 1E6L; // 1 sec +const HttpTime HTTP_RETRY_BACKOFF_MAX_DEFAULT = 5E6L; // 5 sec +const HttpTime HTTP_RETRY_BACKOFF_MAX = 20E6L; // 20 sec const int HTTP_REDIRECTS_DEFAULT = 10; diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp index 07cc0e4625..fceed8524b 100644 --- a/indra/llcorehttp/_httpoprequest.cpp +++ b/indra/llcorehttp/_httpoprequest.cpp @@ -140,6 +140,8 @@ HttpOpRequest::HttpOpRequest() mPolicy503Retries(0), mPolicyRetryAt(HttpTime(0)), mPolicyRetryLimit(HTTP_RETRY_COUNT_DEFAULT), + mPolicyMinRetryBackoff(HttpTime(HTTP_RETRY_BACKOFF_MIN_DEFAULT)), + mPolicyMaxRetryBackoff(HttpTime(HTTP_RETRY_BACKOFF_MAX_DEFAULT)), mCallbackSSLVerify(NULL) { // *NOTE: As members are added, retry initialization/cleanup @@ -434,6 +436,9 @@ void HttpOpRequest::setupCommon(HttpRequest::policy_t policy_id, mPolicyRetryLimit = options->getRetries(); mPolicyRetryLimit = llclamp(mPolicyRetryLimit, HTTP_RETRY_COUNT_MIN, HTTP_RETRY_COUNT_MAX); mTracing = (std::max)(mTracing, llclamp(options->getTrace(), HTTP_TRACE_MIN, HTTP_TRACE_MAX)); + + mPolicyMinRetryBackoff = llclamp(options->getMinBackoff(), HttpTime(0), HTTP_RETRY_BACKOFF_MAX); + mPolicyMaxRetryBackoff = llclamp(options->getMaxBackoff(), mPolicyMinRetryBackoff, HTTP_RETRY_BACKOFF_MAX); } } diff --git a/indra/llcorehttp/_httpoprequest.h b/indra/llcorehttp/_httpoprequest.h index dbcc57d0fd..43d49324af 100644 --- a/indra/llcorehttp/_httpoprequest.h +++ b/indra/llcorehttp/_httpoprequest.h @@ -232,6 +232,8 @@ public: int mPolicy503Retries; HttpTime mPolicyRetryAt; int mPolicyRetryLimit; + HttpTime mPolicyMinRetryBackoff; // initial delay between retries (mcs) + HttpTime mPolicyMaxRetryBackoff; }; // end class HttpOpRequest diff --git a/indra/llcorehttp/_httppolicy.cpp b/indra/llcorehttp/_httppolicy.cpp index b2709b53ec..4889cac9bf 100644 --- a/indra/llcorehttp/_httppolicy.cpp +++ b/indra/llcorehttp/_httppolicy.cpp @@ -151,20 +151,16 @@ void HttpPolicy::addOp(const HttpOpRequest::ptr_t &op) void HttpPolicy::retryOp(const HttpOpRequest::ptr_t &op) { - static const HttpTime retry_deltas[] = - { - 250000, // 1st retry in 0.25 S, etc... - 500000, - 1000000, - 2000000, - 5000000 // ... to every 5.0 S. - }; - static const int delta_max(int(LL_ARRAY_SIZE(retry_deltas)) - 1); static const HttpStatus error_503(503); const HttpTime now(totalTime()); const int policy_class(op->mReqPolicy); - HttpTime delta(retry_deltas[llclamp(op->mPolicyRetries, 0, delta_max)]); + + HttpTime delta_min = op->mPolicyMinRetryBackoff; + HttpTime delta_max = op->mPolicyMaxRetryBackoff; + // mPolicyRetries limited to 100 + U32 delta_factor = op->mPolicyRetries <= 10 ? 1 << op->mPolicyRetries : 1024; + HttpTime delta = llmin(delta_min * delta_factor, delta_max); bool external_delta(false); if (op->mReplyRetryAfter > 0 && op->mReplyRetryAfter < 30) diff --git a/indra/llcorehttp/httpoptions.cpp b/indra/llcorehttp/httpoptions.cpp index aab447f2dd..df5aa52fa9 100644 --- a/indra/llcorehttp/httpoptions.cpp +++ b/indra/llcorehttp/httpoptions.cpp @@ -39,6 +39,8 @@ HttpOptions::HttpOptions() : mTimeout(HTTP_REQUEST_TIMEOUT_DEFAULT), mTransferTimeout(HTTP_REQUEST_XFER_TIMEOUT_DEFAULT), mRetries(HTTP_RETRY_COUNT_DEFAULT), + mMinRetryBackoff(HTTP_RETRY_BACKOFF_MIN_DEFAULT), + mMaxRetryBackoff(HTTP_RETRY_BACKOFF_MAX_DEFAULT), mUseRetryAfter(HTTP_USE_RETRY_AFTER_DEFAULT), mFollowRedirects(true), mVerifyPeer(false), @@ -81,6 +83,16 @@ void HttpOptions::setRetries(unsigned int retries) mRetries = retries; } +void HttpOptions::setMinBackoff(HttpTime delay) +{ + mMinRetryBackoff = delay; +} + +void HttpOptions::setMaxBackoff(HttpTime delay) +{ + mMaxRetryBackoff = delay; +} + void HttpOptions::setUseRetryAfter(bool use_retry) { mUseRetryAfter = use_retry; diff --git a/indra/llcorehttp/httpoptions.h b/indra/llcorehttp/httpoptions.h index 510eaa45bb..8a6de61b04 100644 --- a/indra/llcorehttp/httpoptions.h +++ b/indra/llcorehttp/httpoptions.h @@ -101,13 +101,31 @@ public: /// Sets the number of retries on an LLCore::HTTPRequest before the /// request fails. - // Default: 8 + // Default: 5 void setRetries(unsigned int retries); unsigned int getRetries() const { return mRetries; } + /// Sets minimal delay before request retries. In microseconds. + /// HttpPolicy will increase delay from min to max with each retry + // Default: 1 000 000 mcs + void setMinBackoff(HttpTime delay); + HttpTime getMinBackoff() const + { + return mMinRetryBackoff; + } + + /// Sets maximum delay before request retries. In microseconds. + /// HttpPolicy will increase delay from min to max with each retry + // Default: 5 000 000 mcs + void setMaxBackoff(HttpTime delay); + HttpTime getMaxBackoff() const + { + return mMaxRetryBackoff; + } + // Default: true void setUseRetryAfter(bool use_retry); bool getUseRetryAfter() const @@ -166,6 +184,8 @@ protected: unsigned int mTimeout; unsigned int mTransferTimeout; unsigned int mRetries; + HttpTime mMinRetryBackoff; + HttpTime mMaxRetryBackoff; bool mUseRetryAfter; bool mFollowRedirects; bool mVerifyPeer; diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 0303581d62..4154c96378 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5592,12 +5592,12 @@ Type F32 Value - 10.0 + 40.0 LoginSRVPump Comment - Name of the message pump that handles SRV request + Name of the message pump that handles SRV request (deprecated) Persist 0 Type diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index b4d0bb6823..40e98947a3 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -63,6 +63,8 @@ #include #include +const S32 LOGIN_MAX_RETRIES = 3; + class LLLoginInstance::Disposable { public: virtual ~Disposable() {} @@ -610,13 +612,16 @@ void LLLoginInstance::constructAuthParams(LLPointer user_credentia request_params["host_id"] = gSavedSettings.getString("HostID"); request_params["extended_errors"] = true; // request message_id and message_args + // Specify desired timeout/retry options + LLSD http_params; + http_params["timeout"] = gSavedSettings.getF32("LoginSRVTimeout"); + http_params["retries"] = LOGIN_MAX_RETRIES; + mRequestData.clear(); mRequestData["method"] = "login_to_simulator"; mRequestData["params"] = request_params; mRequestData["options"] = requested_options; - - mRequestData["cfg_srv_timeout"] = gSavedSettings.getF32("LoginSRVTimeout"); - mRequestData["cfg_srv_pump"] = gSavedSettings.getString("LoginSRVPump"); + mRequestData["http_params"] = http_params; } bool LLLoginInstance::handleLoginEvent(const LLSD& event) diff --git a/indra/newview/llxmlrpclistener.cpp b/indra/newview/llxmlrpclistener.cpp index cc3645131d..99070d5bee 100644 --- a/indra/newview/llxmlrpclistener.cpp +++ b/indra/newview/llxmlrpclistener.cpp @@ -312,7 +312,7 @@ public: } XMLRPC_RequestSetData(request, xparams); - mTransaction.reset(new LLXMLRPCTransaction(mUri, request)); + mTransaction.reset(new LLXMLRPCTransaction(mUri, request, true, command.has("http_params")? LLSD(command["http_params"]) : LLSD())); mPreviousStatus = mTransaction->status(NULL); // Free the XMLRPC_REQUEST object and the attached data values. diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index f8b38669b6..0c8495a6e4 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -208,7 +208,7 @@ public: std::string mCertStore; LLPointer mErrorCert; - Impl(const std::string& uri, XMLRPC_REQUEST request, bool useGzip); + Impl(const std::string& uri, XMLRPC_REQUEST request, bool useGzip, const LLSD& httpParams); Impl(const std::string& uri, const std::string& method, LLXMLRPCValue params, bool useGzip); ~Impl(); @@ -219,7 +219,7 @@ public: void setHttpStatus(const LLCore::HttpStatus &status); private: - void init(XMLRPC_REQUEST request, bool useGzip); + void init(XMLRPC_REQUEST request, bool useGzip, const LLSD& httpParams); }; LLXMLRPCTransaction::Handler::Handler(LLCore::HttpRequest::ptr_t &request, @@ -315,13 +315,13 @@ void LLXMLRPCTransaction::Handler::onCompleted(LLCore::HttpHandle handle, //========================================================================= LLXMLRPCTransaction::Impl::Impl(const std::string& uri, - XMLRPC_REQUEST request, bool useGzip) + XMLRPC_REQUEST request, bool useGzip, const LLSD& httpParams) : mHttpRequest(), mStatus(LLXMLRPCTransaction::StatusNotStarted), mURI(uri), mResponse(0) { - init(request, useGzip); + init(request, useGzip, httpParams); } @@ -337,7 +337,7 @@ LLXMLRPCTransaction::Impl::Impl(const std::string& uri, XMLRPC_RequestSetRequestType(request, xmlrpc_request_call); XMLRPC_RequestSetData(request, params.getValue()); - init(request, useGzip); + init(request, useGzip, LLSD()); // DEV-28398: without this XMLRPC_RequestFree() call, it looks as though // the 'request' object is simply leaked. It's less clear to me whether we // should also ask to free request value data (second param 1), since the @@ -345,7 +345,7 @@ LLXMLRPCTransaction::Impl::Impl(const std::string& uri, XMLRPC_RequestFree(request, 1); } -void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip) +void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip, const LLSD& httpParams) { LLCore::HttpOptions::ptr_t httpOpts; LLCore::HttpHeaders::ptr_t httpHeaders; @@ -359,7 +359,15 @@ void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip) // LLRefCounted starts with a 1 ref, so don't add a ref in the smart pointer httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()); - httpOpts->setTimeout(40L); + // delay between repeats will start from 5 sec and grow to 20 sec with each repeat + httpOpts->setMinBackoff(5E6L); + httpOpts->setMaxBackoff(20E6L); + + httpOpts->setTimeout(httpParams.has("timeout") ? httpParams["timeout"].asInteger() : 40L); + if (httpParams.has("retries")) + { + httpOpts->setRetries(httpParams["retries"].asInteger()); + } bool vefifySSLCert = !gSavedSettings.getBOOL("NoVerifySSLCert"); mCertStore = gSavedSettings.getString("CertStore"); @@ -526,8 +534,8 @@ void LLXMLRPCTransaction::Impl::setHttpStatus(const LLCore::HttpStatus &status) LLXMLRPCTransaction::LLXMLRPCTransaction( - const std::string& uri, XMLRPC_REQUEST request, bool useGzip) -: impl(* new Impl(uri, request, useGzip)) + const std::string& uri, XMLRPC_REQUEST request, bool useGzip, const LLSD& httpParams) +: impl(* new Impl(uri, request, useGzip, httpParams)) { } diff --git a/indra/newview/llxmlrpctransaction.h b/indra/newview/llxmlrpctransaction.h index 3a1c9c82b7..7a9bc991f7 100644 --- a/indra/newview/llxmlrpctransaction.h +++ b/indra/newview/llxmlrpctransaction.h @@ -85,7 +85,7 @@ class LLXMLRPCTransaction { public: LLXMLRPCTransaction(const std::string& uri, - XMLRPC_REQUEST request, bool useGzip = true); + XMLRPC_REQUEST request, bool useGzip = true, const LLSD& httpParams = LLSD()); // does not take ownership of the request object // request can be freed as soon as the transaction is constructed From 548b372af2cf871541e2d3ceb2ca84bd670dc27b Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Mon, 24 Jul 2017 17:48:55 +0300 Subject: [PATCH 28/98] MAINT-7629 FIXED Crash in LLSpeakerMgr::findSpeaker(LLUUID const &) --- indra/newview/llchathistory.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 5748eeec47..a9e8e77a0b 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -452,11 +452,13 @@ public: if (gAgent.isInGroup(mSessionID)) { LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(mSessionID); - const LLSpeaker * speakerp = speaker_mgr->findSpeaker(getAvatarId()); - - if (NULL != speakerp) + if(speaker_mgr) { - return !speakerp->mModeratorMutedText; + const LLSpeaker * speakerp = speaker_mgr->findSpeaker(getAvatarId()); + if (NULL != speakerp) + { + return !speakerp->mModeratorMutedText; + } } } return false; From 06c2f24df9929951bbe67cf5187745e25dafa13a Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 25 Jul 2017 17:39:40 +0300 Subject: [PATCH 29/98] MAINT-7636 Crash in LLPanelClassifiedInfo::sendClickMessage(..) --- indra/newview/llpanelclassified.cpp | 55 ++++++++++++++++------------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 5d1ae4ff10..b9b97f4cce 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -208,19 +208,21 @@ void LLPanelClassifiedInfo::onOpen(const LLSD& key) LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(getClassifiedId()); gGenericDispatcher.addHandler("classifiedclickthrough", &sClassifiedClickThrough); - // While we're at it let's get the stats from the new table if that - // capability exists. - std::string url = gAgent.getRegion()->getCapability("SearchStatRequest"); - if (!url.empty()) + if (gAgent.getRegion()) { - LL_INFOS() << "Classified stat request via capability" << LL_ENDL; - LLSD body; - LLUUID classifiedId = getClassifiedId(); - body["classified_id"] = classifiedId; - LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpPost(url, body, - boost::bind(&LLPanelClassifiedInfo::handleSearchStatResponse, classifiedId, _1)); + // While we're at it let's get the stats from the new table if that + // capability exists. + std::string url = gAgent.getRegion()->getCapability("SearchStatRequest"); + if (!url.empty()) + { + LL_INFOS() << "Classified stat request via capability" << LL_ENDL; + LLSD body; + LLUUID classifiedId = getClassifiedId(); + body["classified_id"] = classifiedId; + LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpPost(url, body, + boost::bind(&LLPanelClassifiedInfo::handleSearchStatResponse, classifiedId, _1)); + } } - // Update classified click stats. // *TODO: Should we do this when opening not from search? sendClickMessage("profile"); @@ -540,21 +542,24 @@ void LLPanelClassifiedInfo::sendClickMessage( const LLVector3d& global_pos, const std::string& sim_name) { - // You're allowed to click on your own ads to reassure yourself - // that the system is working. - LLSD body; - body["type"] = type; - body["from_search"] = from_search; - body["classified_id"] = classified_id; - body["parcel_id"] = parcel_id; - body["dest_pos_global"] = global_pos.getValue(); - body["region_name"] = sim_name; + if (gAgent.getRegion()) + { + // You're allowed to click on your own ads to reassure yourself + // that the system is working. + LLSD body; + body["type"] = type; + body["from_search"] = from_search; + body["classified_id"] = classified_id; + body["parcel_id"] = parcel_id; + body["dest_pos_global"] = global_pos.getValue(); + body["region_name"] = sim_name; - std::string url = gAgent.getRegion()->getCapability("SearchStatTracking"); - LL_INFOS() << "Sending click msg via capability (url=" << url << ")" << LL_ENDL; - LL_INFOS() << "body: [" << body << "]" << LL_ENDL; - LLCoreHttpUtil::HttpCoroutineAdapter::messageHttpPost(url, body, - "SearchStatTracking Click report sent.", "SearchStatTracking Click report NOT sent."); + std::string url = gAgent.getRegion()->getCapability("SearchStatTracking"); + LL_INFOS() << "Sending click msg via capability (url=" << url << ")" << LL_ENDL; + LL_INFOS() << "body: [" << body << "]" << LL_ENDL; + LLCoreHttpUtil::HttpCoroutineAdapter::messageHttpPost(url, body, + "SearchStatTracking Click report sent.", "SearchStatTracking Click report NOT sent."); + } } void LLPanelClassifiedInfo::sendClickMessage(const std::string& type) From 822183057b13c8187d9dab68232b4274bc3ec3b2 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Wed, 26 Jul 2017 15:49:55 +0300 Subject: [PATCH 30/98] MAINT-7637 Don't allow adding own avatar to rendering exceptions list --- indra/newview/llfloateravatarrendersettings.cpp | 7 +++++++ indra/newview/skins/default/xui/en/notifications.xml | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/indra/newview/llfloateravatarrendersettings.cpp b/indra/newview/llfloateravatarrendersettings.cpp index 2bae7d63aa..8bdb70a20d 100644 --- a/indra/newview/llfloateravatarrendersettings.cpp +++ b/indra/newview/llfloateravatarrendersettings.cpp @@ -27,11 +27,13 @@ #include "llfloateravatarrendersettings.h" +#include "llagent.h" #include "llavatarnamecache.h" #include "llfloateravatarpicker.h" #include "llfiltereditor.h" #include "llfloaterreg.h" #include "llnamelistctrl.h" +#include "llnotificationsutil.h" #include "llmenugl.h" #include "lltrans.h" #include "llviewerobjectlist.h" @@ -268,6 +270,11 @@ void LLFloaterAvatarRenderSettings::onClickAdd(const LLSD& userdata) void LLFloaterAvatarRenderSettings::callbackAvatarPicked(const uuid_vec_t& ids, S32 visual_setting) { if (ids.empty()) return; + if(ids[0] == gAgentID) + { + LLNotificationsUtil::add("AddSelfRenderExceptions"); + return; + } setAvatarRenderSetting(ids[0], visual_setting); } diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 71b0edb572..6147005d22 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -6573,6 +6573,13 @@ Topic: [SUBJECT], Message: [MESSAGE] Although you're very nice, you can't add yourself as a friend. + +You can't add yourself to the rendering exceptions list. + + Date: Thu, 3 Aug 2017 16:30:01 +0300 Subject: [PATCH 31/98] MAINT-7653 Crash in LLVOAvatarSelf::updateAvatarRezMetrics(bool) --- indra/newview/llvoavatarself.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index aa5d82a096..d62862dfb8 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2246,7 +2246,9 @@ bool LLVOAvatarSelf::updateAvatarRezMetrics(bool force_send) { const F32 AV_METRICS_INTERVAL_QA = 30.0; F32 send_period = 300.0; - if (gSavedSettings.getBOOL("QAModeMetrics")) + + static LLCachedControl qa_mode_metrics(gSavedSettings,"QAModeMetrics"); + if (qa_mode_metrics) { send_period = AV_METRICS_INTERVAL_QA; } From f600e1ac5141cb014a94b187130788593d394a95 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Fri, 4 Aug 2017 18:10:52 +0300 Subject: [PATCH 32/98] MAINT-7655 Auto-open debug console if any "Info to Debug Console" operations are picked --- indra/newview/llviewermenu.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index c68f6b8a15..0ad3ef2f71 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -618,6 +618,7 @@ class LLAdvancedDumpInfoToConsole : public view_listener_t { bool handleEvent(const LLSD& userdata) { + gDebugView->mDebugConsolep->setVisible(TRUE); std::string info_type = userdata.asString(); if ("region" == info_type) { From 6a0cf31d10e4f378fba40a8f3b0aca2fcfa5b53d Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sat, 5 Aug 2017 14:04:10 +0200 Subject: [PATCH 33/98] Manual merge of SL-717 with Zi's extended inventory search so we can simply discard LL's upcoming commit without screwing things up --- indra/llui/llfolderviewmodel.h | 23 +- indra/newview/llconversationmodel.h | 4 + indra/newview/llinventorybridge.cpp | 182 +++++++------ indra/newview/llinventorybridge.h | 13 +- indra/newview/llinventoryfilter.cpp | 185 ++++++++------ indra/newview/llinventoryfilter.h | 41 +-- indra/newview/llinventorypanel.cpp | 37 +-- indra/newview/llinventorypanel.h | 10 +- indra/newview/llpanelmaininventory.cpp | 241 ++++++++++++++---- indra/newview/llpanelmaininventory.h | 12 +- indra/newview/llpanelobjectinventory.cpp | 5 + indra/newview/llsidepanelinventory.cpp | 13 + indra/newview/llsidepanelinventory.h | 1 + .../ansastorm/xui/en/panel_main_inventory.xml | 54 ++-- .../xui/de/floater_inventory_view_finder.xml | 2 + .../skins/default/xui/de/menu_inventory.xml | 2 +- .../xui/en/floater_inventory_view_finder.xml | 20 +- .../skins/default/xui/en/menu_inventory.xml | 6 +- .../xui/en/menu_inventory_gear_default.xml | 57 ++--- .../skins/default/xui/fr/menu_inventory.xml | 2 +- .../skins/default/xui/ja/menu_inventory.xml | 2 +- .../skins/default/xui/pl/menu_inventory.xml | 2 +- .../skins/default/xui/ru/menu_inventory.xml | 2 +- .../vintage/xui/en/panel_main_inventory.xml | 53 ++-- 24 files changed, 579 insertions(+), 390 deletions(-) diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index f838d2f736..4a41c3a53d 100644 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -28,22 +28,6 @@ #include "llfontgl.h" // just for StyleFlags enum #include "llfolderview.h" -// Reintegrate search by uuid/creator/descripting from Zi Ree after CHUI Merge -// Interface to query extended object attributes, -class FSFolderViewModelItem -{ -public: - virtual std::string getSearchableCreator( void ) const - { return ""; } - virtual std::string getSearchableDescription( void ) const - { return ""; } - virtual std::string getSearchableUUID( void ) const - { return ""; } - virtual std::string getSearchableAll( void ) const - { return ""; } -}; -// - // These are grouping of inventory types. // Order matters when sorting system folders to the top. enum EInventorySortGroup @@ -149,7 +133,7 @@ public: // This is an abstract base class that users of the folderview classes // would use to bridge the folder view with the underlying data -class LLFolderViewModelItem : public LLRefCount, public LLTrace::MemTrackable, public FSFolderViewModelItem +class LLFolderViewModelItem : public LLRefCount, public LLTrace::MemTrackable { public: LLFolderViewModelItem() @@ -163,6 +147,11 @@ public: virtual const std::string& getDisplayName() const = 0; virtual const std::string& getSearchableName() const = 0; + virtual std::string getSearchableDescription() const = 0; + virtual std::string getSearchableCreatorName()const = 0; + virtual std::string getSearchableUUIDString() const = 0; + virtual std::string getSearchableAll() const = 0; // Zi's extended inventory search + virtual LLPointer getIcon() const = 0; virtual LLPointer getIconOpen() const { return getIcon(); } virtual LLPointer getIconOverlay() const { return NULL; } diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h index 640f1a4144..0cd9e624b2 100644 --- a/indra/newview/llconversationmodel.h +++ b/indra/newview/llconversationmodel.h @@ -72,6 +72,10 @@ public: virtual const std::string& getName() const { return mName; } virtual const std::string& getDisplayName() const { return mName; } virtual const std::string& getSearchableName() const { return mName; } + virtual std::string getSearchableDescription() const { return LLStringUtil::null; } + virtual std::string getSearchableCreatorName() const { return LLStringUtil::null; } + virtual std::string getSearchableUUIDString() const {return LLStringUtil::null;} + virtual std::string getSearchableAll() const { return LLStringUtil::null; } // Zi's extended inventory search virtual const LLUUID& getUUID() const { return mUUID; } virtual time_t getCreationDate() const { return 0; } virtual LLPointer getIcon() const { return NULL; } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index e3d66205f7..79e9f5504e 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -228,6 +228,68 @@ const std::string& LLInvFVBridge::getDisplayName() const return mDisplayName; } +std::string LLInvFVBridge::getSearchableDescription() const +{ + const LLInventoryModel* model = getInventoryModel(); + if (model) + { + const LLInventoryItem *item = model->getItem(mUUID); + if(item) + { + std::string desc = item->getDescription(); + LLStringUtil::toUpper(desc); + return desc; + } + } + return LLStringUtil::null; +} + +std::string LLInvFVBridge::getSearchableCreatorName() const +{ + const LLInventoryModel* model = getInventoryModel(); + if (model) + { + const LLInventoryItem *item = model->getItem(mUUID); + if(item) + { + LLAvatarName av_name; + if (LLAvatarNameCache::get(item->getCreatorUUID(), &av_name)) + { + std::string username = av_name.getUserName(); + LLStringUtil::toUpper(username); + return username; + } + } + } + return LLStringUtil::null; +} + +std::string LLInvFVBridge::getSearchableUUIDString() const +{ + const LLInventoryModel* model = getInventoryModel(); + if (model) + { + const LLInventoryItem *item = model->getItem(mUUID); + if(item) + { + std::string uuid = item->getAssetUUID().asString(); + LLStringUtil::toUpper(uuid); + return uuid; + } + } + return LLStringUtil::null; +} + +// Zi's extended inventory search +std::string LLInvFVBridge::getSearchableAll() const +{ + return getSearchableName() + "+" + + getSearchableCreatorName() + "+" + + getSearchableDescription() + "+" + + getSearchableUUIDString(); +} +// + // Folders have full perms PermissionMask LLInvFVBridge::getPermissionMask() const { @@ -889,6 +951,12 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, // disabled_items.push_back(std::string("Properties")); //} // + + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); + if (active_panel && (active_panel->getName() != "All Items")) + { + items.push_back(std::string("Show in Main Panel")); + } } void LLInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) @@ -1695,25 +1763,6 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action) { gotoItem(); } - - // Find item in main inventory tab - if ("find_in_main" == action) - { - // Go to the item. Similar to gotoItem() but with normal items, not links. - LLInventoryObject *obj = getInventoryObject(); - - mInventoryPanel.get()->getParentByType()->selectFirstTab(); - if (obj) - { - LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(); - if (active_panel) - { - active_panel->setSelection(obj->getUUID(), TAKE_FOCUS_YES); - } - } - } - // - if ("open" == action || "open_original" == action) { openItem(); @@ -1751,6 +1800,11 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action) gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(buffer)); return; } + else if ("show_in_main_panel" == action) + { + LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, mUUID, TRUE); + return; + } else if ("cut" == action) { cutToClipboard(); @@ -2017,13 +2071,19 @@ void LLItemBridge::buildDisplayName() const { mDisplayName.assign(LLStringUtil::null); } - + S32 old_length = mSearchableName.length(); + S32 new_length = mDisplayName.length() + getLabelSuffix().length(); + mSearchableName.assign(mDisplayName); mSearchableName.append(getLabelSuffix()); LLStringUtil::toUpper(mSearchableName); - //Name set, so trigger a sort - if(mParent) + if ((old_length > new_length) && getInventoryFilter()) + { + getInventoryFilter()->setModified(LLFolderViewFilter::FILTER_MORE_RESTRICTIVE); + } + //Name set, so trigger a sort + if(mParent) { mParent->requestSort(); } @@ -3361,6 +3421,11 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) return; } // + else if ("show_in_main_panel" == action) + { + LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, mUUID, TRUE); + return; + } else if ("cut" == action) { cutToClipboard(); @@ -6872,10 +6937,6 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) if ( (rlv_handler_t::isEnabled()) && (!gRlvAttachmentLocks.canDetach(item)) ) disabled_items.push_back(std::string("Detach From Yourself")); // [/RLVa:KB] - // Add "Find in Main" option to Worn Items - if (mInventoryPanel.get()->getName() == "Worn Items") - items.push_back(std::string("Find in Main")); // This should appear only in Worn Items tab - // } else if (!isItemInTrash() && !isLinkedObjectInTrash() && !isLinkedObjectMissing() && !isCOFFolder()) { @@ -7174,10 +7235,6 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) if ( (rlv_handler_t::isEnabled()) && (!gRlvWearableLocks.canRemove(item)) ) disabled_items.push_back(std::string("Take Off")); // [/RLVa:KB] - // Add "Find in Main" option to Worn Items - if (mInventoryPanel.get()->getName() == "Worn Items") - items.push_back(std::string("Find in Main")); - // } else { @@ -7980,69 +8037,4 @@ LLInvFVBridge* LLWornInventoryBridgeBuilder::createBridge( return new_listener; } - -// Reintegrate search by uuid/creator/descripting from Zi Ree after CHUI Merge -std::string LLInvFVBridge::getSearchableCreator( void ) const -{ - LLInventoryItem *pItem( dynamic_cast< LLInventoryItem* >( getInventoryObject() ) ); - - std::string strCreator; - if(pItem) - { - LLAvatarName av_name; - if (LLAvatarNameCache::get(pItem->getCreatorUUID(), &av_name)) - { - strCreator = av_name.getUserName(); - LLStringUtil::toUpper( strCreator ); - } - } - - return strCreator; -} - -std::string LLInvFVBridge::getSearchableDescription( void ) const -{ - LLInventoryItem *pItem( dynamic_cast< LLInventoryItem* >( getInventoryObject() ) ); - - std::string strDescr; - - if(pItem) - { - if(!pItem->getDescription().empty() ) - { - strDescr = pItem->getDescription(); - LLStringUtil::toUpper( strDescr ); - } - } - - return strDescr; -} - -std::string LLInvFVBridge::getSearchableUUID( void ) const -{ - LLInventoryItem *pItem( dynamic_cast< LLInventoryItem* >( getInventoryObject() ) ); - - std::string strUUID; - if(pItem) - { - if(!pItem->getAssetUUID().isNull()) - { - strUUID = pItem->getAssetUUID().asString(); - LLStringUtil::toUpper( strUUID ); - } - - } - return strUUID; - -} - -std::string LLInvFVBridge::getSearchableAll( void ) const -{ - return getSearchableName() + "+" + - getSearchableCreator() + "+" + - getSearchableDescription() + "+" + - getSearchableUUID(); -} -// - // EOF diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index cb5064ac4c..a95969952e 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -94,6 +94,11 @@ public: virtual const std::string& getDisplayName() const; const std::string& getSearchableName() const { return mSearchableName; } + std::string getSearchableDescription() const; + std::string getSearchableCreatorName() const; + std::string getSearchableUUIDString() const; + std::string getSearchableAll() const; // Zi's extended inventory search + virtual PermissionMask getPermissionMask() const; virtual LLFolderType::EType getPreferredType() const; virtual time_t getCreationDate() const; @@ -206,14 +211,6 @@ protected: void purgeItem(LLInventoryModel *model, const LLUUID &uuid); void removeObject(LLInventoryModel *model, const LLUUID &uuid); virtual void buildDisplayName() const {} - - // Reintegrate search by uuid/creator/descripting from Zi Ree after CHUI Merge -public: - virtual std::string getSearchableCreator( void ) const; - virtual std::string getSearchableDescription( void ) const; - virtual std::string getSearchableUUID( void ) const; - virtual std::string getSearchableAll( void ) const; - // }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index ad49c5f9d3..154a3ef598 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -29,6 +29,7 @@ #include "llinventoryfilter.h" // viewer includes +#include "llagent.h" #include "llfolderviewmodel.h" #include "llfolderviewitem.h" #include "llinventorymodel.h" @@ -74,13 +75,14 @@ LLInventoryFilter::LLInventoryFilter(const Params& p) : mName(p.name), mFilterModified(FILTER_NONE), mEmptyLookupMessage("InventoryNoMatchingItems"), - mFilterSubStringTarget(SUBST_TARGET_NAME), // Extended Inventory Search mFilterOps(p.filter_ops), mBackupFilterOps(mFilterOps), mFilterSubString(p.substring), mCurrentGeneration(0), mFirstRequiredGeneration(0), - mFirstSuccessGeneration(0) + mFirstSuccessGeneration(0), + mSearchType(SEARCHTYPE_NAME), + mFilterCreatorType(FILTERCREATOR_ALL) { // Begin Multi-substring inventory search mSubStringMatchOffsets.clear(); @@ -89,31 +91,10 @@ LLInventoryFilter::LLInventoryFilter(const Params& p) // copy mFilterOps into mDefaultFilterOps markDefault(); + mUsername = gAgentUsername; + LLStringUtil::toUpper(mUsername); } -// Extended Inventory Search -void LLInventoryFilter::setFilterSubStringTarget(const std::string& targetName) -{ - if (targetName == "name") - mFilterSubStringTarget = SUBST_TARGET_NAME; - else if (targetName == "creator") - mFilterSubStringTarget = SUBST_TARGET_CREATOR; - else if (targetName == "description") - mFilterSubStringTarget = SUBST_TARGET_DESCRIPTION; - else if (targetName == "uuid") - mFilterSubStringTarget = SUBST_TARGET_UUID; - else if (targetName == "all") - mFilterSubStringTarget = SUBST_TARGET_ALL; - else - LL_WARNS("LLInventoryFilter") << "Unknown sub string target: " << targetName << LL_ENDL; -} - -LLInventoryFilter::EFilterSubstringTarget LLInventoryFilter::getFilterSubStringTarget() const -{ - return mFilterSubStringTarget; -} -// Extended Inventory Search - bool LLInventoryFilter::check(const LLFolderViewModelItem* item) { const LLFolderViewModelItemInventory* listener = dynamic_cast(item); @@ -126,30 +107,48 @@ bool LLInventoryFilter::check(const LLFolderViewModelItem* item) } // Multi-substring inventory search - //bool passed = (mFilterSubString.size() ? listener->getSearchableName().find(mFilterSubString) != std::string::npos : true); + //std::string desc = listener->getSearchableCreatorName(); + //switch(mSearchType) + //{ + // case SEARCHTYPE_CREATOR: + // desc = listener->getSearchableCreatorName(); + // break; + // case SEARCHTYPE_DESCRIPTION: + // desc = listener->getSearchableDescription(); + // break; + // case SEARCHTYPE_UUID: + // desc = listener->getSearchableUUIDString(); + // break; + // case SEARCHTYPE_NAME: + // default: + // desc = listener->getSearchableName(); + // break; + //} + + //bool passed = (mFilterSubString.size() ? desc.find(mFilterSubString) != std::string::npos : true); std::string::size_type string_offset = std::string::npos; if (mFilterSubStrings.size()) { std::string searchLabel; - switch (mFilterSubStringTarget) + switch (mSearchType) { - case SUBST_TARGET_NAME: + case SEARCHTYPE_NAME: searchLabel = listener->getSearchableName(); break; - case SUBST_TARGET_CREATOR: - searchLabel = listener->getSearchableCreator(); - break; - case SUBST_TARGET_DESCRIPTION: + case SEARCHTYPE_DESCRIPTION: searchLabel = listener->getSearchableDescription(); break; - case SUBST_TARGET_UUID: - searchLabel = listener->getSearchableUUID(); + case SEARCHTYPE_CREATOR: + searchLabel = listener->getSearchableCreatorName(); break; - case SUBST_TARGET_ALL: + case SEARCHTYPE_UUID: + searchLabel = listener->getSearchableUUIDString(); + break; + case SEARCHTYPE_ALL: searchLabel = listener->getSearchableAll(); break; default: - LL_WARNS("LLInventoryFilter") << "Unknown search substring target: " << mFilterSubStringTarget << LL_ENDL; + LL_WARNS("LLInventoryFilter") << "Unknown search substring target: " << mSearchType << LL_ENDL; searchLabel = listener->getSearchableName(); break; } @@ -184,6 +183,7 @@ bool LLInventoryFilter::check(const LLFolderViewModelItem* item) passed = passed && checkAgainstFilterType(listener); passed = passed && checkAgainstPermissions(listener); passed = passed && checkAgainstFilterLinks(listener); + passed = passed && checkAgainstCreator(listener); return passed; } @@ -332,6 +332,32 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent } } + // + //if(filterTypes & FILTERTYPE_WORN) + //{ + // if (!get_is_item_worn(object_id)) + // { + // return FALSE; + // } + //} + //////////////////////////////////////////////////////////////////////////////// + // FILTERTYPE_WORN + // Pass if this item is worn (hiding COF and Outfits folders) + if (filterTypes & FILTERTYPE_WORN) + { + if (!object) + { + return FALSE; + } + const LLUUID& cat_id = object->getParentUUID(); + const LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id); + return !LLAppearanceMgr::instance().getIsInCOF(object_id) // Not a link in COF + && (!cat || cat->getPreferredType() != LLFolderType::FT_OUTFIT) // Not a link in an outfit folder + && get_is_item_worn(object_id); + } + // + + //////////////////////////////////////////////////////////////////////////////// // FILTERTYPE_UUID // Pass if this item is the target UUID or if it links to the target UUID @@ -399,24 +425,6 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent } // - // - //////////////////////////////////////////////////////////////////////////////// - // FILTERTYPE_WORN - // Pass if this item is worn (hiding COF and Outfits folders) - if (filterTypes & FILTERTYPE_WORN) - { - if (!object) - { - return FALSE; - } - const LLUUID& cat_id = object->getParentUUID(); - const LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id); - return !LLAppearanceMgr::instance().getIsInCOF(object_id) // Not a link in COF - && (!cat || cat->getPreferredType() != LLFolderType::FT_OUTFIT) // Not a link in an outfit folder - && get_is_item_worn(object_id); - } - // - //////////////////////////////////////////////////////////////////////////////// // FILTERTYPE_EMPTYFOLDERS // Pass if this item is a folder and is not a system folder that should be hidden @@ -571,6 +579,24 @@ bool LLInventoryFilter::checkAgainstFilterLinks(const LLFolderViewModelItemInven return TRUE; } +bool LLInventoryFilter::checkAgainstCreator(const LLFolderViewModelItemInventory* listener) const +{ + if (!listener) return TRUE; + const BOOL is_folder = listener->getInventoryType() == LLInventoryType::IT_CATEGORY; + switch(mFilterCreatorType) + { + case FILTERCREATOR_SELF: + if(is_folder) return FALSE; + return (listener->getSearchableCreatorName() == mUsername); + case FILTERCREATOR_OTHERS: + if(is_folder) return FALSE; + return (listener->getSearchableCreatorName() != mUsername); + case FILTERCREATOR_ALL: + default: + return TRUE; + } +} + const std::string& LLInventoryFilter::getFilterSubString(BOOL trim) const { return mFilterSubString; @@ -578,7 +604,17 @@ const std::string& LLInventoryFilter::getFilterSubString(BOOL trim) const std::string::size_type LLInventoryFilter::getStringMatchOffset(LLFolderViewModelItem* item) const { - return mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos; + // Zi's extended inventory search + //if (mSearchType == SEARCHTYPE_NAME) + if (mSearchType == SEARCHTYPE_NAME || mSearchType == SEARCHTYPE_ALL) + // + { + return mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos; + } + else + { + return std::string::npos; + } } bool LLInventoryFilter::isDefault() const @@ -651,6 +687,24 @@ void LLInventoryFilter::updateFilterTypes(U64 types, U64& current_types) } } +void LLInventoryFilter::setSearchType(ESearchType type) +{ + if(mSearchType != type) + { + mSearchType = type; + setModified(); + } +} + +void LLInventoryFilter::setFilterCreator(EFilterCreatorType type) +{ + if(mFilterCreatorType != type) + { + mFilterCreatorType = type; + setModified(); + } +} + void LLInventoryFilter::setFilterObjectTypes(U64 types) { updateFilterTypes(types, mFilterOps.mFilterObjectTypes); @@ -674,6 +728,11 @@ void LLInventoryFilter::setFilterEmptySystemFolders() mFilterOps.mFilterTypes |= FILTERTYPE_EMPTYFOLDERS; } +void LLInventoryFilter::setFilterWorn() +{ + mFilterOps.mFilterTypes |= FILTERTYPE_WORN; +} + void LLInventoryFilter::setFilterMarketplaceActiveFolders() { mFilterOps.mFilterTypes |= FILTERTYPE_MARKETPLACE_ACTIVE; @@ -1041,21 +1100,6 @@ void LLInventoryFilter::setFindAllLinksMode(const std::string &search_name, cons setFilterLinks(FILTERLINK_ONLY_LINKS); } -// -void LLInventoryFilter::setFilterWorn(BOOL worn) -{ - setModified(); - if (worn) - { - mFilterOps.mFilterTypes |= FILTERTYPE_WORN; - } - else - { - mFilterOps.mFilterTypes &= ~FILTERTYPE_WORN; - } -} -// - // FIRE-19340: search inventory by transferable permission void LLInventoryFilter::setFilterTransferable(BOOL transferable) { @@ -1317,7 +1361,6 @@ LLInventoryFilter& LLInventoryFilter::operator=( const LLInventoryFilter& othe setFilterPermissions(other.getFilterPermissions()); setFilterSubString(other.getFilterSubString()); setDateRangeLastLogoff(other.isSinceLogoff()); - setFilterWorn(other.getFilterWorn()); // FIRE-19340: search inventory by transferable permission setFilterTransferable(other.getFilterTransferable()); return *this; diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index f7c17a64ab..9313aa06d0 100644 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -58,7 +58,7 @@ public: FILTERTYPE_MARKETPLACE_UNASSOCIATED = 0x1 << 8, // pass if folder is a marketplace non associated (no market ID) folder FILTERTYPE_MARKETPLACE_LISTING_FOLDER = 0x1 << 9, // pass iff folder is a listing folder FILTERTYPE_NO_MARKETPLACE_ITEMS = 0x1 << 10, // pass iff folder is not under the marketplace - FILTERTYPE_WORN = 0x1 << 11, // search by wearable type + FILTERTYPE_WORN = 0x1 << 11, // pass if item is worn FILTERTYPE_TRANSFERABLE = 0x1 << 12 // FIRE-19340: search inventory by transferable permission }; @@ -84,16 +84,21 @@ public: SO_FOLDERS_BY_WEIGHT = 0x1 << 3, // Force folder sort by weight, usually, amount of some elements in their descendents }; - // Extended Inventory Search - enum EFilterSubstringTarget + enum ESearchType { - SUBST_TARGET_NAME = 0, // Classic search for item name - SUBST_TARGET_CREATOR, // Search for creator name - SUBST_TARGET_DESCRIPTION, // Search for item description - SUBST_TARGET_UUID, // Search for asset UUID - SUBST_TARGET_ALL // Search in all fields at the same time + SEARCHTYPE_NAME, + SEARCHTYPE_DESCRIPTION, + SEARCHTYPE_CREATOR, + SEARCHTYPE_UUID, + SEARCHTYPE_ALL // Zi's extended inventory search + }; + + enum EFilterCreatorType + { + FILTERCREATOR_ALL, + FILTERCREATOR_SELF, + FILTERCREATOR_OTHERS }; - // Extended Inventory Search struct FilterOps { @@ -191,6 +196,7 @@ public: void setFilterUUID(const LLUUID &object_id); void setFilterWearableTypes(U64 types); void setFilterEmptySystemFolders(); + void setFilterWorn(); void removeFilterEmptySystemFolders(); // Optional hiding of empty system folders void setFilterMarketplaceActiveFolders(); void setFilterMarketplaceInactiveFolders(); @@ -198,6 +204,10 @@ public: void setFilterMarketplaceListingFolders(bool select_only_listing_folders); void setFilterNoMarketplaceFolder(); void updateFilterTypes(U64 types, U64& current_types); + void setSearchType(ESearchType type); + ESearchType getSearchType() { return mSearchType; } + void setFilterCreator(EFilterCreatorType type); + EFilterCreatorType getFilterCreator() { return mFilterCreatorType; } void setFilterSubString(const std::string& string); const std::string& getFilterSubString(BOOL trim = FALSE) const; @@ -231,9 +241,7 @@ public: void setFindAllLinksMode(const std::string &search_name, const LLUUID& search_id); // - void setFilterWorn(BOOL worn); BOOL getFilterWorn() const { return mFilterOps.mFilterTypes & FILTERTYPE_WORN; } - // // FIRE-19340: search inventory by transferable permission void setFilterTransferable(BOOL transferable); @@ -252,11 +260,6 @@ public: std::string::size_type getStringMatchOffset(LLFolderViewModelItem* item) const; std::string::size_type getFilterStringSize() const; - // Extended Inventory Search - void setFilterSubStringTarget(const std::string& targetName); - EFilterSubstringTarget getFilterSubStringTarget() const; - std::string getSearchableTarget(const LLFolderViewItem* item) const; - // Extended Inventory Search // +-------------------------------------------------------------------+ // + Presentation @@ -316,6 +319,7 @@ private: bool checkAgainstPermissions(const class LLFolderViewModelItemInventory* listener) const; bool checkAgainstPermissions(const LLInventoryItem* item) const; bool checkAgainstFilterLinks(const class LLFolderViewModelItemInventory* listener) const; + bool checkAgainstCreator(const class LLFolderViewModelItemInventory* listener) const; bool checkAgainstClipboard(const LLUUID& object_id) const; FilterOps mFilterOps; @@ -327,10 +331,10 @@ private: // Multi-substring inventory search std::vector mSubStringMatchOffsets; std::vector mFilterSubStrings; - EFilterSubstringTarget mFilterSubStringTarget; // Multi-substring inventory search std::string mFilterSubStringOrig; + std::string mUsername; const std::string mName; S32 mCurrentGeneration; @@ -345,6 +349,9 @@ private: std::string mFilterText; std::string mEmptyLookupMessage; + + ESearchType mSearchType; + EFilterCreatorType mFilterCreatorType; }; #endif diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 78ac28c99d..cd730e2ca5 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -382,6 +382,11 @@ void LLInventoryPanel::setFilterTypes(U64 types, LLInventoryFilter::EFilterType getFilter().setFilterCategoryTypes(types); } +void LLInventoryPanel::setFilterWorn() +{ + getFilter().setFilterWorn(); +} + U32 LLInventoryPanel::getFilterObjectTypes() const { return getFilter().getFilterObjectTypes(); @@ -408,18 +413,6 @@ void LLInventoryPanel::setFilterSubString(const std::string& string) getFilter().setFilterSubString(string); } -// Extended Inventory Search -void LLInventoryPanel::setFilterSubStringTarget(const std::string& target) -{ - getFilter().setFilterSubStringTarget(target); -} - -LLInventoryFilter::EFilterSubstringTarget LLInventoryPanel::getFilterSubStringTarget() const -{ - return getFilter().getFilterSubStringTarget(); -} -// Extended Inventory Search - const std::string LLInventoryPanel::getFilterSubString() { return getFilter().getFilterSubString(); @@ -470,12 +463,15 @@ U64 LLInventoryPanel::getFilterLinks() } // Filter Links Menu -// -void LLInventoryPanel::setWorn(BOOL worn) +void LLInventoryPanel::setSearchType(LLInventoryFilter::ESearchType type) { - getFilter().setFilterWorn(worn); + getFilter().setSearchType(type); +} + +LLInventoryFilter::ESearchType LLInventoryPanel::getSearchType() +{ + return getFilter().getSearchType(); } -// // FIRE-19340: search inventory by transferable permission void LLInventoryPanel::setTransferable(BOOL transferable) @@ -1520,9 +1516,14 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open) } //static -void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id) +void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, BOOL main_panel) { - LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(auto_open); + LLInventoryPanel *active_panel; + if (main_panel) + { + LLFloaterSidePanelContainer::getPanel("inventory")->selectAllItemsPanel(); + } + active_panel = LLInventoryPanel::getActiveInventoryPanel(auto_open); if (active_panel) { diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index cfe96864d7..522a387eea 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -173,23 +173,21 @@ public: LLInventoryFilter& getFilter(); const LLInventoryFilter& getFilter() const; void setFilterTypes(U64 filter, LLInventoryFilter::EFilterType = LLInventoryFilter::FILTERTYPE_OBJECT); + void setFilterWorn(); U32 getFilterObjectTypes() const; void setFilterPermMask(PermissionMask filter_perm_mask); U32 getFilterPermMask() const; void setFilterWearableTypes(U64 filter); void setFilterSubString(const std::string& string); const std::string getFilterSubString(); - // Extended Inventory Search - void setFilterSubStringTarget(const std::string& target); - LLInventoryFilter::EFilterSubstringTarget getFilterSubStringTarget() const; - // Extended Inventory Search void setSinceLogoff(BOOL sl); void setHoursAgo(U32 hours); void setDateSearchDirection(U32 direction); BOOL getSinceLogoff(); void setFilterLinks(U64 filter_links); U64 getFilterLinks(); // Filter Links Menu - void setWorn(BOOL worn); // + void setSearchType(LLInventoryFilter::ESearchType type); + LLInventoryFilter::ESearchType getSearchType(); void setTransferable(BOOL transferable); // FIRE-19340: search inventory by transferable permission void setShowFolderState(LLInventoryFilter::EFolderShow show); @@ -232,7 +230,7 @@ public: // "Auto_open" determines if we open an inventory panel if none are open. static LLInventoryPanel *getActiveInventoryPanel(BOOL auto_open = TRUE); - static void openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id); + static void openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, BOOL main_panel = FALSE); void addItemID(const LLUUID& id, LLFolderViewItem* itemp); void removeItemID(const LLUUID& id); diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 33766504a4..e95affb78f 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -30,6 +30,7 @@ #include "llagent.h" #include "llagentcamera.h" #include "llavataractions.h" +#include "llcheckboxctrl.h" #include "llcombobox.h" #include "lldndbutton.h" #include "lleconomy.h" @@ -94,6 +95,9 @@ public: BOOL getCheckSinceLogoff(); U32 getDateSearchDirection(); + void onCreatorSelfFilterCommit(); + void onCreatorOtherFilterCommit(); + static void onTimeAgo(LLUICtrl*, void *); static void onCloseBtn(void* user_data); static void selectAllTypes(void* user_data); @@ -105,6 +109,8 @@ private: LLPanelMainInventory* mPanelMainInventory; LLSpinCtrl* mSpinSinceDays; LLSpinCtrl* mSpinSinceHours; + LLCheckBoxCtrl* mCreatorSelf; + LLCheckBoxCtrl* mCreatorOthers; LLInventoryFilter* mFilter; }; @@ -115,11 +121,13 @@ private: LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p) : LLPanel(p), mActivePanel(NULL), + mWornItemsPanel(NULL), mSavedFolderState(NULL), mFilterText(""), mMenuGearDefault(NULL), mMenuAddHandle(), - mNeedUploadCost(true) + mNeedUploadCost(true), + mSearchTypeCombo(NULL) // Properly initialize this { // Menu Callbacks (non contex menus) mCommitCallbackRegistrar.add("Inventory.DoToSelected", boost::bind(&LLPanelMainInventory::doToSelected, this, _2)); @@ -138,8 +146,8 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p) // Filter Links Menu // Extended Inventory Search - mCommitCallbackRegistrar.add("Inventory.SearchTarget.Set", boost::bind(&LLPanelMainInventory::onSearchTargetChecked, this, _2)); - mEnableCallbackRegistrar.add("Inventory.SearchTarget.Check", boost::bind(&LLPanelMainInventory::isSearchTargetChecked, this, _2)); + mCommitCallbackRegistrar.add("Inventory.SearchType.Set", boost::bind(&LLPanelMainInventory::onSearchTypeChecked, this, _2)); + mEnableCallbackRegistrar.add("Inventory.SearchType.Check", boost::bind(&LLPanelMainInventory::isSearchTypeChecked, this, _2)); // Extended Inventory Search // Sort By menu handlers @@ -226,30 +234,38 @@ BOOL LLPanelMainInventory::postBuild() recent_items_panel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, recent_items_panel, _1, _2)); } - // Bring back worn items panel. - LLInventoryPanel* worn_items_panel = getChild("Worn Items"); - if (worn_items_panel) + LLInventoryPanel* mWornItemsPanel = getChild("Worn Items"); + if (mWornItemsPanel) { - worn_items_panel->setWorn(TRUE); - worn_items_panel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::DEFAULT_SORT_ORDER)); - worn_items_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); - LLInventoryFilter& worn_filter = worn_items_panel->getFilter(); - worn_filter.setFilterObjectTypes(0xffffffffffffffffULL & ~(0x1 << LLInventoryType::IT_GESTURE | 0x1 << LLInventoryType::IT_CATEGORY)); - worn_filter.markDefault(); + U32 filter_types = 0x0; + filter_types |= 0x1 << LLInventoryType::IT_WEARABLE; + filter_types |= 0x1 << LLInventoryType::IT_ATTACHMENT; + filter_types |= 0x1 << LLInventoryType::IT_OBJECT; + mWornItemsPanel->setFilterTypes(filter_types); + mWornItemsPanel->setFilterWorn(); + mWornItemsPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); + mWornItemsPanel->setFilterLinks(LLInventoryFilter::FILTERLINK_EXCLUDE_LINKS); + mWornItemsPanel->getFilter().markDefault(); + mWornItemsPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mWornItemsPanel, _1, _2)); - // Do not go all crazy and recurse through the whole inventory - // worn_items_panel->openAllFolders(); - if( worn_items_panel->getRootFolder() ) + // Firestorm additions + mWornItemsPanel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::DEFAULT_SORT_ORDER)); + + if (mWornItemsPanel->getRootFolder()) { - worn_items_panel->getRootFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_NO); - worn_items_panel->getRootFolder()->arrangeAll(); + mWornItemsPanel->getRootFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_NO); + mWornItemsPanel->getRootFolder()->arrangeAll(); } - // - - worn_items_panel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, worn_items_panel, _1, _2)); + // + } + // Only if we actually have it! + //mSearchTypeCombo = getChild("search_type"); + mSearchTypeCombo = findChild("search_type"); + // + if(mSearchTypeCombo) + { + mSearchTypeCombo->setCommitCallback(boost::bind(&LLPanelMainInventory::onSelectSearchType, this)); } - // - // Now load the stored settings from disk, if available. std::string filterSaveName(gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, FILTERS_FILENAME)); LL_INFOS() << "LLPanelMainInventory::init: reading from " << filterSaveName << LL_ENDL; @@ -391,6 +407,16 @@ LLPanelMainInventory::~LLPanelMainInventory( void ) delete mSavedFolderState; } +LLInventoryPanel* LLPanelMainInventory::getAllItemsPanel() +{ + return getChild("All Items"); +} + +void LLPanelMainInventory::selectAllItemsPanel() +{ + mFilterTabs->selectFirstTab(); +} + void LLPanelMainInventory::startSearch() { // this forces focus to line editor portion of search editor @@ -481,6 +507,55 @@ void LLPanelMainInventory::resetFilters() setFilterTextFromFilter(); } +void LLPanelMainInventory::onSelectSearchType() +{ + std::string new_type = mSearchTypeCombo->getValue(); + if (new_type == "search_by_name") + { + getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_NAME); + } + if (new_type == "search_by_creator") + { + getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_CREATOR); + } + if (new_type == "search_by_description") + { + getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_DESCRIPTION); + } + if (new_type == "search_by_UUID") + { + getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_UUID); + } +} + +void LLPanelMainInventory::updateSearchTypeCombo() +{ + // Check if combo box is actually there + if (!mSearchTypeCombo) + { + return; + } + // + + LLInventoryFilter::ESearchType search_type = getActivePanel()->getSearchType(); + switch(search_type) + { + case LLInventoryFilter::SEARCHTYPE_CREATOR: + mSearchTypeCombo->setValue("search_by_creator"); + break; + case LLInventoryFilter::SEARCHTYPE_DESCRIPTION: + mSearchTypeCombo->setValue("search_by_description"); + break; + case LLInventoryFilter::SEARCHTYPE_UUID: + mSearchTypeCombo->setValue("search_by_UUID"); + break; + case LLInventoryFilter::SEARCHTYPE_NAME: + default: + mSearchTypeCombo->setValue("search_by_name"); + break; + } +} + // Sort By menu handlers void LLPanelMainInventory::setSortBy(const LLSD& userdata) { @@ -572,7 +647,10 @@ void LLPanelMainInventory::onClearSearch() { BOOL initially_active = FALSE; LLFloater *finder = getFinder(); + // Worn inventory panel + //if (mActivePanel && (getActivePanel() != mWornItemsPanel)) if (mActivePanel) + // { // FIRE-5160: Don't reset inventory filter when clearing search term //initially_active = mActivePanel->getFilter().isNotDefault(); @@ -803,6 +881,13 @@ void LLPanelMainInventory::onFilterSelected() return; } + // Worn inventory panel; We do this at init and only once for performance reasons! + //if (getActivePanel() == mWornItemsPanel) + //{ + // mActivePanel->openAllFolders(); + //} + // + updateSearchTypeCombo(); // Separate search for inventory tabs from Satomi Ahn (FIRE-913 & FIRE-6862) //setFilterSubString(mFilterSubString); if (!gSavedSettings.getBOOL("FSSplitInventorySearchOverTabs")) @@ -1036,6 +1121,11 @@ BOOL LLFloaterInventoryFinder::postBuild() mSpinSinceDays = getChild("spin_days_ago"); childSetCommitCallback("spin_days_ago", onTimeAgo, this); + mCreatorSelf = getChild("check_created_by_me"); + mCreatorOthers = getChild("check_created_by_others"); + mCreatorSelf->setCommitCallback(boost::bind(&LLFloaterInventoryFinder::onCreatorSelfFilterCommit, this)); + mCreatorOthers->setCommitCallback(boost::bind(&LLFloaterInventoryFinder::onCreatorOtherFilterCommit, this)); + childSetAction("Close", onCloseBtn, this); // FIRE-5160: Don't reset inventory filter when clearing search term @@ -1082,15 +1172,15 @@ void LLFloaterInventoryFinder::onTimeAgo(LLUICtrl *ctrl, void *user_data) // FIRE-5160: Don't reset inventory filter when clearing search term void LLFloaterInventoryFinder::onResetBtn() { + mFilter->resetDefault(); LLInventoryPanel* panel = mPanelMainInventory->getPanel(); - panel->getFilter().resetDefault(); if (panel->getName() == "All Items") { panel->setFilterTypes(0xffffffffffffffffULL); } - LLInventoryFilter &filter = panel->getFilter(); - mPanelMainInventory->updateFilterDropdown(&filter); + mPanelMainInventory->updateFilterDropdown(mFilter); + mFilter->setFilterCreator(LLInventoryFilter::FILTERCREATOR_ALL); updateElementsFromFilter(); } @@ -1114,6 +1204,10 @@ void LLFloaterInventoryFinder::updateElementsFromFilter() U32 hours = mFilter->getHoursAgo(); U32 date_search_direction = mFilter->getDateSearchDirection(); + LLInventoryFilter::EFilterCreatorType filter_creator = mFilter->getFilterCreator(); + bool show_created_by_me = ((filter_creator == LLInventoryFilter::FILTERCREATOR_ALL) || (filter_creator == LLInventoryFilter::FILTERCREATOR_SELF)); + bool show_created_by_others = ((filter_creator == LLInventoryFilter::FILTERCREATOR_ALL) || (filter_creator == LLInventoryFilter::FILTERCREATOR_OTHERS)); + // update the ui elements // Make floater title translatable // setTitle(mFilter->getName()); @@ -1135,6 +1229,10 @@ void LLFloaterInventoryFinder::updateElementsFromFilter() getChild("check_snapshot")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_SNAPSHOT)); getChild("check_transferable")->setValue(mFilter->getFilterTransferable()); // FIRE-19340: search inventory by transferable permission getChild("check_show_empty")->setValue(show_folders == LLInventoryFilter::SHOW_ALL_FOLDERS); + + getChild("check_created_by_me")->setValue(show_created_by_me); + getChild("check_created_by_others")->setValue(show_created_by_others); + getChild("check_since_logoff")->setValue(mFilter->isSinceLogoff()); mSpinSinceHours->set((F32)(hours % 24)); mSpinSinceDays->set((F32)(hours / 24)); @@ -1232,6 +1330,7 @@ void LLFloaterInventoryFinder::draw() mPanelMainInventory->getPanel()->setShowFolderState(getCheckShowEmpty() ? LLInventoryFilter::SHOW_ALL_FOLDERS : LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); mPanelMainInventory->getPanel()->setFilterTypes(filter); + if (getCheckSinceLogoff()) { mSpinSinceDays->set(0); @@ -1262,6 +1361,46 @@ void LLFloaterInventoryFinder::draw() LLPanel::draw(); } +void LLFloaterInventoryFinder::onCreatorSelfFilterCommit() +{ + bool show_creator_self = mCreatorSelf->getValue(); + bool show_creator_other = mCreatorOthers->getValue(); + + if(show_creator_self && show_creator_other) + { + mFilter->setFilterCreator(LLInventoryFilter::FILTERCREATOR_ALL); + } + else if(show_creator_self) + { + mFilter->setFilterCreator(LLInventoryFilter::FILTERCREATOR_SELF); + } + else if(!show_creator_self || !show_creator_other) + { + mFilter->setFilterCreator(LLInventoryFilter::FILTERCREATOR_OTHERS); + mCreatorOthers->set(TRUE); + } +} + +void LLFloaterInventoryFinder::onCreatorOtherFilterCommit() +{ + bool show_creator_self = mCreatorSelf->getValue(); + bool show_creator_other = mCreatorOthers->getValue(); + + if(show_creator_self && show_creator_other) + { + mFilter->setFilterCreator(LLInventoryFilter::FILTERCREATOR_ALL); + } + else if(show_creator_other) + { + mFilter->setFilterCreator(LLInventoryFilter::FILTERCREATOR_OTHERS); + } + else if(!show_creator_other || !show_creator_self) + { + mFilter->setFilterCreator(LLInventoryFilter::FILTERCREATOR_SELF); + mCreatorSelf->set(TRUE); + } +} + BOOL LLFloaterInventoryFinder::getCheckShowEmpty() { return getChild("check_show_empty")->getValue(); @@ -1797,43 +1936,59 @@ BOOL LLPanelMainInventory::isFilterLinksChecked(const LLSD& userdata) // Filter Links Menu // Extended Inventory Search -void LLPanelMainInventory::onSearchTargetChecked(const LLSD& userdata) +void LLPanelMainInventory::onSearchTypeChecked(const LLSD& userdata) { - getActivePanel()->setFilterSubStringTarget(userdata.asString()); + std::string new_type = userdata.asString(); + if (new_type == "search_by_name") + { + getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_NAME); + } + if (new_type == "search_by_creator") + { + getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_CREATOR); + } + if (new_type == "search_by_description") + { + getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_DESCRIPTION); + } + if (new_type == "search_by_UUID") + { + getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_UUID); + } + if (new_type == "search_by_all") + { + getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_ALL); + } resetFilters(); } -LLInventoryFilter::EFilterSubstringTarget LLPanelMainInventory::getSearchTarget() const -{ - return getActivePanel()->getFilterSubStringTarget(); -} - -BOOL LLPanelMainInventory::isSearchTargetChecked(const LLSD& userdata) +BOOL LLPanelMainInventory::isSearchTypeChecked(const LLSD& userdata) { + LLInventoryFilter::ESearchType search_type = getActivePanel()->getSearchType(); const std::string command_name = userdata.asString(); - if (command_name == "name") + if (command_name == "search_by_name") { - return (getSearchTarget() == LLInventoryFilter::SUBST_TARGET_NAME); + return (search_type == LLInventoryFilter::SEARCHTYPE_NAME); } - if (command_name == "creator") + if (command_name == "search_by_creator") { - return (getSearchTarget() == LLInventoryFilter::SUBST_TARGET_CREATOR); + return (search_type == LLInventoryFilter::SEARCHTYPE_CREATOR); } - if (command_name == "description") + if (command_name == "search_by_description") { - return (getSearchTarget() == LLInventoryFilter::SUBST_TARGET_DESCRIPTION); + return (search_type == LLInventoryFilter::SEARCHTYPE_DESCRIPTION); } - if (command_name == "uuid") + if (command_name == "search_by_UUID") { - return (getSearchTarget() == LLInventoryFilter::SUBST_TARGET_UUID); + return (search_type == LLInventoryFilter::SEARCHTYPE_UUID); } - if (command_name == "all") + if (command_name == "search_by_all") { - return (getSearchTarget() == LLInventoryFilter::SUBST_TARGET_ALL); + return (search_type == LLInventoryFilter::SEARCHTYPE_ALL); } return FALSE; } diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 716aa9f0d6..c9df2840ee 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -35,6 +35,7 @@ #include "llfolderview.h" +class LLComboBox; class LLFolderViewItem; class LLInventoryPanel; class LLSaveFolderState; @@ -81,6 +82,8 @@ public: LLInventoryPanel* getPanel() { return mActivePanel; } LLInventoryPanel* getActivePanel() { return mActivePanel; } const LLInventoryPanel* getActivePanel() const { return mActivePanel; } + LLInventoryPanel* getAllItemsPanel(); + void selectAllItemsPanel(); // FIRE-19493: "Show Original" should open main inventory panel void showAllItemsPanel(); void resetFilters(); @@ -148,6 +151,8 @@ protected: void onExpandButtonClicked(); // Inventory Collapse and Expand Buttons void onFocusReceived(); + void onSelectSearchType(); + void updateSearchTypeCombo(); private: LLFloaterInventoryFinder* getFinder(); @@ -157,12 +162,14 @@ private: LLUICtrl* mCounterCtrl; LLHandle mFinderHandle; LLInventoryPanel* mActivePanel; + LLInventoryPanel* mWornItemsPanel; bool mResortActivePanel; LLSaveFolderState* mSavedFolderState; std::string mFilterText; std::string mFilterSubString; S32 mItemCount; std::string mItemCountString; + LLComboBox* mSearchTypeCombo; // Filter dropdown LLComboBox* mFilterComboBox; @@ -189,9 +196,8 @@ protected: // Filter Links Menu // Extended Inventory Search - BOOL isSearchTargetChecked(const LLSD& userdata); - void onSearchTargetChecked(const LLSD& userdata); - LLInventoryFilter::EFilterSubstringTarget getSearchTarget() const; + BOOL isSearchTypeChecked(const LLSD& userdata); + void onSearchTypeChecked(const LLSD& userdata); // Extended Inventory Search bool handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, EAcceptance* accept); diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 8669dce9bf..9b729a2e3c 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -115,6 +115,11 @@ public: virtual const std::string& getDisplayName() const; virtual const std::string& getSearchableName() const; + virtual std::string getSearchableDescription() const {return LLStringUtil::null;} + virtual std::string getSearchableCreatorName() const {return LLStringUtil::null;} + virtual std::string getSearchableUUIDString() const {return LLStringUtil::null;} + virtual std::string getSearchableAll() const { return LLStringUtil::null; } // Zi's extended inventory search + virtual PermissionMask getPermissionMask() const { return PERM_NONE; } /*virtual*/ LLFolderType::EType getPreferredType() const { return LLFolderType::FT_NONE; } virtual const LLUUID& getUUID() const { return mUUID; } diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 60ebc9dddf..5f683bcd8c 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -746,6 +746,19 @@ LLInventoryPanel *LLSidepanelInventory::getActivePanel() return NULL; } +void LLSidepanelInventory::selectAllItemsPanel() +{ + if (!getVisible()) + { + return; + } + if (mInventoryPanel->getVisible()) + { + mPanelMainInventory->selectAllItemsPanel(); + } + +} + BOOL LLSidepanelInventory::isMainInventoryPanelActive() const { return mInventoryPanel->getVisible(); diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h index 363c1b1ebf..13362d2b2f 100644 --- a/indra/newview/llsidepanelinventory.h +++ b/indra/newview/llsidepanelinventory.h @@ -57,6 +57,7 @@ public: /*virtual*/ void onOpen(const LLSD& key); LLInventoryPanel* getActivePanel(); // Returns an active inventory panel, if any. + void selectAllItemsPanel(); LLInventoryPanel* getInboxPanel() const { return mInventoryPanelInbox.get(); } LLPanelMainInventory* getMainInventoryPanel() const { return mPanelMainInventory; } diff --git a/indra/newview/skins/ansastorm/xui/en/panel_main_inventory.xml b/indra/newview/skins/ansastorm/xui/en/panel_main_inventory.xml index 753e0aeed0..c2ce27c058 100644 --- a/indra/newview/skins/ansastorm/xui/en/panel_main_inventory.xml +++ b/indra/newview/skins/ansastorm/xui/en/panel_main_inventory.xml @@ -327,52 +327,52 @@ name="inventory_search_by_name" label="By Name"> + function="Inventory.SearchType.Set" + parameter="search_by_name" /> + function="Inventory.SearchType.Check" + parameter="search_by_name" /> + function="Inventory.SearchType.Set" + parameter="search_by_creator" /> + function="Inventory.SearchType.Check" + parameter="search_by_creator" /> + function="Inventory.SearchType.Set" + parameter="search_by_description" /> + function="Inventory.SearchType.Check" + parameter="search_by_description" /> + function="Inventory.SearchType.Set" + parameter="search_by_UUID" /> + function="Inventory.SearchType.Check" + parameter="search_by_UUID" /> + function="Inventory.SearchType.Set" + parameter="search_by_all" /> + function="Inventory.SearchType.Check" + parameter="search_by_all" /> - - diff --git a/indra/newview/skins/default/xui/de/floater_inventory_view_finder.xml b/indra/newview/skins/default/xui/de/floater_inventory_view_finder.xml index eb2ad51f25..271164a255 100644 --- a/indra/newview/skins/default/xui/de/floater_inventory_view_finder.xml +++ b/indra/newview/skins/default/xui/de/floater_inventory_view_finder.xml @@ -16,6 +16,8 @@