From c8fc414ebe3c44af36ae8f34d27758480ba73b1b Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 4 Jul 2017 16:25:41 +0300 Subject: [PATCH 01/14] 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 02/14] 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 03/14] 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 04/14] 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 05/14] 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 06/14] 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 07/14] 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 08/14] 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 09/14] 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 10/14] 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 11/14] 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 12/14] 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 13/14] 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 14/14] 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;