From 98f33106618af6e321e8ca3b89915f76f8ce5373 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 11 Apr 2018 08:48:35 -0400 Subject: [PATCH 01/68] DRTVWR-453: Update to viewer-manager build 514367 --- autobuild.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index c4f0598574..de66e7d683 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -3260,9 +3260,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - f87126aaff2bfd98a725900c227fdd95 + 9308ad92ea0104bf75034fc607eedc74 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/14331/90920/viewer_manager-1.0.512994-darwin64-512994.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/16517/108862/viewer_manager-1.0.514367-darwin64-514367.tar.bz2 name darwin64 @@ -3284,9 +3284,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 0cda02896adfafbfab16927e28cc41aa + 0879d503ad2fe4d46913e80c053d1d1a url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/14328/90898/viewer_manager-1.0.512994-windows-512994.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/16518/108869/viewer_manager-1.0.514367-windows-514367.tar.bz2 name windows @@ -3297,7 +3297,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors source_type hg version - 1.0.512994 + 1.0.514367 vlc-bin From e30164ef64e0d49818d346bde8083dede550f7b4 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Wed, 13 Jun 2018 14:24:28 +0300 Subject: [PATCH 02/68] MAINT-8745 Use HTTPS splash screen in viewer --- indra/newview/llviewernetwork.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp index 6937d064f9..37e0b47365 100644 --- a/indra/newview/llviewernetwork.cpp +++ b/indra/newview/llviewernetwork.cpp @@ -63,7 +63,7 @@ const std::string GRID_LOGIN_IDENTIFIER_TYPES = "login_identifier_types"; const std::string GRID_SLURL_BASE = "slurl_base"; const std::string GRID_APP_SLURL_BASE = "app_slurl_base"; -const std::string DEFAULT_LOGIN_PAGE = "http://viewer-login.agni.lindenlab.com/"; +const std::string DEFAULT_LOGIN_PAGE = "https://viewer-splash.secondlife.com"; const std::string MAIN_GRID_LOGIN_URI = "https://login.agni.lindenlab.com/cgi-bin/login.cgi"; From 39525a4d48f0dd16b2e5f9850ab6fdd25d66b0ca Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Wed, 13 Jun 2018 15:05:00 +0300 Subject: [PATCH 03/68] build fix --- indra/newview/llpanelsnapshotlocal.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llpanelsnapshotlocal.cpp b/indra/newview/llpanelsnapshotlocal.cpp index 57c5915da2..e7fced92a7 100644 --- a/indra/newview/llpanelsnapshotlocal.cpp +++ b/indra/newview/llpanelsnapshotlocal.cpp @@ -66,8 +66,8 @@ private: void onQualitySliderCommit(LLUICtrl* ctrl); void onSaveFlyoutCommit(LLUICtrl* ctrl); - void LLPanelSnapshotLocal::onLocalSaved(); - void LLPanelSnapshotLocal::onLocalCanceled(); + void onLocalSaved(); + void onLocalCanceled(); }; static LLPanelInjector panel_class("llpanelsnapshotlocal"); From f17668cc77f001656d9235887e1ff1529007747e Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Wed, 13 Jun 2018 16:56:13 +0300 Subject: [PATCH 04/68] network test fixes --- indra/newview/tests/llviewernetwork_test.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/indra/newview/tests/llviewernetwork_test.cpp b/indra/newview/tests/llviewernetwork_test.cpp index 3dd327591e..d1dddf8e7e 100644 --- a/indra/newview/tests/llviewernetwork_test.cpp +++ b/indra/newview/tests/llviewernetwork_test.cpp @@ -236,7 +236,7 @@ namespace tut std::string("https://secondlife.com/helpers/")); ensure_equals("Agni login page", LLGridManager::getInstance()->getLoginPage("util.agni.lindenlab.com"), - std::string("http://viewer-login.agni.lindenlab.com/")); + std::string("https://viewer-splash.secondlife.com/")); ensure("Agni is a system grid", LLGridManager::getInstance()->isSystemGrid("util.agni.lindenlab.com")); @@ -261,7 +261,7 @@ namespace tut std::string("http://aditi-secondlife.webdev.lindenlab.com/helpers/")); ensure_equals("Aditi login page", LLGridManager::getInstance()->getLoginPage("util.aditi.lindenlab.com"), - std::string("http://viewer-login.agni.lindenlab.com/")); + std::string("https://viewer-splash.secondlife.com/")); ensure("Aditi is a system grid", LLGridManager::getInstance()->isSystemGrid("util.aditi.lindenlab.com")); } @@ -309,7 +309,7 @@ namespace tut std::string("https://secondlife.com/helpers/")); ensure_equals("Agni login page", LLGridManager::getInstance()->getLoginPage("util.agni.lindenlab.com"), - std::string("http://viewer-login.agni.lindenlab.com/")); + std::string("https://viewer-splash.secondlife.com/")); ensure("Agni is a system grid", LLGridManager::getInstance()->isSystemGrid("util.agni.lindenlab.com")); @@ -333,7 +333,7 @@ namespace tut std::string("http://aditi-secondlife.webdev.lindenlab.com/helpers/")); ensure_equals("Aditi login page", LLGridManager::getInstance()->getLoginPage("util.aditi.lindenlab.com"), - std::string("http://viewer-login.agni.lindenlab.com/")); + std::string("https://viewer-splash.secondlife.com/")); ensure("Aditi is a system grid", LLGridManager::getInstance()->isSystemGrid("util.aditi.lindenlab.com")); @@ -422,7 +422,7 @@ namespace tut std::string("https://secondlife.com/helpers/")); ensure_equals("getLoginPage", LLGridManager::getInstance()->getLoginPage(), - std::string("http://viewer-login.agni.lindenlab.com/")); + std::string("https://viewer-splash.secondlife.com/")); ensure_equals("update url base for Agni", // relies on agni being the default std::string("https://update.secondlife.com/update"), LLGridManager::getInstance()->getUpdateServiceURL()); From f77de22d4de7c5d036f2258134c43c495fe43e50 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Wed, 13 Jun 2018 18:44:37 +0300 Subject: [PATCH 05/68] network test fixes2 --- indra/newview/llviewernetwork.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp index 37e0b47365..9f6d606a22 100644 --- a/indra/newview/llviewernetwork.cpp +++ b/indra/newview/llviewernetwork.cpp @@ -63,7 +63,7 @@ const std::string GRID_LOGIN_IDENTIFIER_TYPES = "login_identifier_types"; const std::string GRID_SLURL_BASE = "slurl_base"; const std::string GRID_APP_SLURL_BASE = "app_slurl_base"; -const std::string DEFAULT_LOGIN_PAGE = "https://viewer-splash.secondlife.com"; +const std::string DEFAULT_LOGIN_PAGE = "https://viewer-splash.secondlife.com/"; const std::string MAIN_GRID_LOGIN_URI = "https://login.agni.lindenlab.com/cgi-bin/login.cgi"; From 83dcf6b10daff1ec886063a968c884cdc79c47ed Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 14 May 2018 14:07:36 +0300 Subject: [PATCH 06/68] MAINT-8689 Diagnostics for coroutine memory crash --- indra/llcommon/llcoros.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/indra/llcommon/llcoros.cpp b/indra/llcommon/llcoros.cpp index 4bab669046..3165ce0743 100644 --- a/indra/llcommon/llcoros.cpp +++ b/indra/llcommon/llcoros.cpp @@ -283,6 +283,7 @@ void LLCoros::setStackSize(S32 stacksize) void LLCoros::printActiveCoroutines() { + LL_INFOS("LLCoros") << "Number of active coroutines: " << (S32)mCoros.size() << LL_ENDL; LL_INFOS("LLCoros") << "-------------- List of active coroutines ------------"; CoroMap::iterator iter; CoroMap::iterator end = mCoros.end(); @@ -401,7 +402,13 @@ std::string LLCoros::launch(const std::string& prefix, const callable_t& callabl std::string name(generateDistinctName(prefix)); Current current; // pass the current value of Current as previous context - CoroData* newCoro = new CoroData(current, name, callable, mStackSize); + CoroData* newCoro = new(std::nothrow) CoroData(current, name, callable, mStackSize); + if (newCoro == NULL) + { + // Out of memory? + printActiveCoroutines(); + LL_ERRS("LLCoros") << "Failed to start coroutine: " << name << " Stacksize: " << mStackSize << " Total coroutines: " << mCoros.size() << LL_ENDL; + } // Store it in our pointer map mCoros.insert(name, newCoro); // also set it as current From 5aee1efc0ec6f8d69e6239f0ba5f11db3b5fbe62 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Tue, 5 Jun 2018 15:27:22 +0300 Subject: [PATCH 07/68] MAINT-8706 Require holding Control key to drag folders into in world objects --- indra/newview/lltooldraganddrop.cpp | 17 ++++++++++++++++- indra/newview/lltooldraganddrop.h | 2 ++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 9fb53dc9ab..0f38cca56f 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -263,7 +263,7 @@ LLToolDragAndDrop::LLDragAndDropDictionary::LLDragAndDropDictionary() addEntry(DAD_CLOTHING, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dWearItem, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dUpdateInventory, &LLToolDragAndDrop::dad3dNULL)); addEntry(DAD_OBJECT, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dRezAttachmentFromInv, &LLToolDragAndDrop::dad3dGiveInventoryObject, &LLToolDragAndDrop::dad3dRezObjectOnObject, &LLToolDragAndDrop::dad3dRezObjectOnLand)); addEntry(DAD_NOTECARD, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dUpdateInventory, &LLToolDragAndDrop::dad3dNULL)); - addEntry(DAD_CATEGORY, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dWearCategory, &LLToolDragAndDrop::dad3dGiveInventoryCategory, &LLToolDragAndDrop::dad3dUpdateInventoryCategory, &LLToolDragAndDrop::dad3dNULL)); + addEntry(DAD_CATEGORY, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dWearCategory, &LLToolDragAndDrop::dad3dGiveInventoryCategory, &LLToolDragAndDrop::dad3dRezCategoryOnObject, &LLToolDragAndDrop::dad3dNULL)); addEntry(DAD_ROOT_CATEGORY, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL)); addEntry(DAD_BODYPART, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dWearItem, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dUpdateInventory, &LLToolDragAndDrop::dad3dNULL)); addEntry(DAD_ANIMATION, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dUpdateInventory, &LLToolDragAndDrop::dad3dNULL)); @@ -2335,6 +2335,21 @@ EAcceptance LLToolDragAndDrop::dad3dUpdateInventoryCategory( return rv; } + +EAcceptance LLToolDragAndDrop::dad3dRezCategoryOnObject( + LLViewerObject* obj, S32 face, MASK mask, BOOL drop) +{ + if ((mask & MASK_CONTROL)) + { + return dad3dUpdateInventoryCategory(obj, face, mask, drop); + } + else + { + return ACCEPT_NO; + } +} + + BOOL LLToolDragAndDrop::dadUpdateInventoryCategory(LLViewerObject* obj, BOOL drop) { diff --git a/indra/newview/lltooldraganddrop.h b/indra/newview/lltooldraganddrop.h index 2d99de2244..24a712029c 100644 --- a/indra/newview/lltooldraganddrop.h +++ b/indra/newview/lltooldraganddrop.h @@ -162,6 +162,8 @@ protected: MASK mask, BOOL drop); EAcceptance dad3dRezObjectOnObject(LLViewerObject* obj, S32 face, MASK mask, BOOL drop); + EAcceptance dad3dRezCategoryOnObject(LLViewerObject* obj, S32 face, + MASK mask, BOOL drop); EAcceptance dad3dRezScript(LLViewerObject* obj, S32 face, MASK mask, BOOL drop); EAcceptance dad3dTextureObject(LLViewerObject* obj, S32 face, From a902b360f2e15801e7efa09775870729a6ccf132 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 6 Jun 2018 12:10:57 +0000 Subject: [PATCH 08/68] MAINT-8478 Unable to unzoom camera after zooming object behind draw distance --- indra/newview/llagentcamera.cpp | 44 ++++++++++++++------------------- indra/newview/llagentcamera.h | 2 ++ 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 5b9f1b9d4f..92a3026096 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -76,6 +76,8 @@ const F32 AVATAR_ZOOM_MIN_Y_FACTOR = 0.7f; const F32 AVATAR_ZOOM_MIN_Z_FACTOR = 1.15f; const F32 MAX_CAMERA_DISTANCE_FROM_AGENT = 50.f; +const F32 MAX_CAMERA_DISTANCE_FROM_OBJECT = 496.f; +const F32 CAMERA_FUDGE_FROM_OBJECT = 16.f; const F32 MAX_CAMERA_SMOOTH_DISTANCE = 50.0f; @@ -738,10 +740,7 @@ F32 LLAgentCamera::getCameraZoomFraction() else { F32 min_zoom; - const F32 DIST_FUDGE = 16.f; // meters - F32 max_zoom = llmin(mDrawDistance - DIST_FUDGE, - LLWorld::getInstance()->getRegionWidthInMeters() - DIST_FUDGE, - MAX_CAMERA_DISTANCE_FROM_AGENT); + F32 max_zoom = getCameraMaxZoomDistance(); F32 distance = (F32)mCameraFocusOffsetTarget.magVec(); if (mFocusObject.notNull()) @@ -787,23 +786,17 @@ void LLAgentCamera::setCameraZoomFraction(F32 fraction) else { F32 min_zoom = LAND_MIN_ZOOM; - const F32 DIST_FUDGE = 16.f; // meters - F32 max_zoom = llmin(mDrawDistance - DIST_FUDGE, - LLWorld::getInstance()->getRegionWidthInMeters() - DIST_FUDGE, - MAX_CAMERA_DISTANCE_FROM_AGENT); + F32 max_zoom = getCameraMaxZoomDistance(); if (mFocusObject.notNull()) { - if (mFocusObject.notNull()) + if (mFocusObject->isAvatar()) { - if (mFocusObject->isAvatar()) - { - min_zoom = AVATAR_MIN_ZOOM; - } - else - { - min_zoom = OBJECT_MIN_ZOOM; - } + min_zoom = AVATAR_MIN_ZOOM; + } + else + { + min_zoom = OBJECT_MIN_ZOOM; } } @@ -909,10 +902,7 @@ void LLAgentCamera::cameraZoomIn(const F32 fraction) new_distance = llmax(new_distance, min_zoom); - // Don't zoom too far back - const F32 DIST_FUDGE = 16.f; // meters - F32 max_distance = llmin(mDrawDistance - DIST_FUDGE, - LLWorld::getInstance()->getRegionWidthInMeters() - DIST_FUDGE ); + F32 max_distance = getCameraMaxZoomDistance(); max_distance = llmin(max_distance, current_distance * 4.f); //Scaled max relative to current distance. MAINT-3154 @@ -978,10 +968,7 @@ void LLAgentCamera::cameraOrbitIn(const F32 meters) new_distance = llmax(new_distance, min_zoom); - // Don't zoom too far back - const F32 DIST_FUDGE = 16.f; // meters - F32 max_distance = llmin(mDrawDistance - DIST_FUDGE, - LLWorld::getInstance()->getRegionWidthInMeters() - DIST_FUDGE ); + F32 max_distance = getCameraMaxZoomDistance(); if (new_distance > max_distance) { @@ -1946,6 +1933,13 @@ LLVector3 LLAgentCamera::getCameraOffsetInitial() return convert_from_llsd(mCameraOffsetInitial[mCameraPreset]->get(), TYPE_VEC3, ""); } +F32 LLAgentCamera::getCameraMaxZoomDistance() +{ + // Ignore "DisableCameraConstraints", we don't want to be out of draw range when we focus onto objects or avatars + return llmin(MAX_CAMERA_DISTANCE_FROM_OBJECT, + mDrawDistance - 1, // convenience, don't hit draw limit when focusing on something + LLWorld::getInstance()->getRegionWidthInMeters() - CAMERA_FUDGE_FROM_OBJECT); +} //----------------------------------------------------------------------------- // handleScrollWheel() diff --git a/indra/newview/llagentcamera.h b/indra/newview/llagentcamera.h index ab793ff316..d087de1e2f 100644 --- a/indra/newview/llagentcamera.h +++ b/indra/newview/llagentcamera.h @@ -112,6 +112,8 @@ public: private: /** Determines default camera offset depending on the current camera preset */ LLVector3 getCameraOffsetInitial(); + /** Determines maximum camera distance from target for mouselook, opposite to LAND_MIN_ZOOM */ + F32 getCameraMaxZoomDistance(); /** Camera preset in Third Person Mode */ ECameraPreset mCameraPreset; From 8348e50c7f8f304e6d3733fb5a0a8d7bdb056fef Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 30 May 2018 16:44:14 +0300 Subject: [PATCH 09/68] MAINT-8686 Viewer should report active coroutines at the end of the session --- indra/llcommon/llcoros.cpp | 19 ++++++++++++++++++- indra/llcommon/llcoros.h | 4 ++++ indra/newview/llappviewer.cpp | 2 ++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/indra/llcommon/llcoros.cpp b/indra/llcommon/llcoros.cpp index c5ba23f68c..4bab669046 100644 --- a/indra/llcommon/llcoros.cpp +++ b/indra/llcommon/llcoros.cpp @@ -35,6 +35,7 @@ // external library headers #include // other Linden headers +#include "lltimer.h" #include "llevents.h" #include "llerror.h" #include "stringize.h" @@ -280,6 +281,21 @@ void LLCoros::setStackSize(S32 stacksize) mStackSize = stacksize; } +void LLCoros::printActiveCoroutines() +{ + LL_INFOS("LLCoros") << "-------------- List of active coroutines ------------"; + CoroMap::iterator iter; + CoroMap::iterator end = mCoros.end(); + F64 time = LLTimer::getTotalSeconds(); + for (iter = mCoros.begin(); iter != end; iter++) + { + F64 life_time = time - iter->second->mCreationTime; + LL_CONT << LL_NEWLINE << "Name: " << iter->first << " life: " << life_time; + } + LL_CONT << LL_ENDL; + LL_INFOS("LLCoros") << "-----------------------------------------------------" << LL_ENDL; +} + #if LL_WINDOWS static const U32 STATUS_MSC_EXCEPTION = 0xE06D7363; // compiler specific @@ -375,7 +391,8 @@ LLCoros::CoroData::CoroData(CoroData* prev, const std::string& name, mCoro(boost::bind(toplevel, _1, this, callable), stacksize), // don't consume events unless specifically directed mConsuming(false), - mSelf(0) + mSelf(0), + mCreationTime(LLTimer::getTotalSeconds()) { } diff --git a/indra/llcommon/llcoros.h b/indra/llcommon/llcoros.h index 884d6b159c..8fb27af6a4 100644 --- a/indra/llcommon/llcoros.h +++ b/indra/llcommon/llcoros.h @@ -151,6 +151,9 @@ public: /// for delayed initialization void setStackSize(S32 stacksize); + /// for delayed initialization + void printActiveCoroutines(); + /// get the current coro::self& for those who really really care static coro::self& get_self(); @@ -223,6 +226,7 @@ private: // function signature down to that point -- and of course through every // other caller of every such function. LLCoros::coro::self* mSelf; + F64 mCreationTime; // since epoch }; typedef boost::ptr_map CoroMap; CoroMap mCoros; diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index f705084bdb..59572ea9b6 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1794,6 +1794,8 @@ bool LLAppViewer::cleanup() // (Deleted observers should have already removed themselves) gInventory.cleanupInventory(); + LLCoros::getInstance()->printActiveCoroutines(); + LL_INFOS() << "Cleaning up Selections" << LL_ENDL; // Clean up selection managers after UI is destroyed, as UI may be observing them. From 0e9c0e0daf7c92a90a0b4ed2070cc8c2abe2aeb0 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Mon, 4 Jun 2018 12:21:10 +0300 Subject: [PATCH 10/68] MAINT-8716 Script name should be passed to "Save to file" dialog. --- indra/newview/llpreviewscript.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index d4eecaffce..9431914ba3 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -1741,14 +1741,22 @@ void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAsset buffer[file_length] = 0; preview->mScriptEd->setScriptText(LLStringExplicit(&buffer[0]), TRUE); preview->mScriptEd->mEditor->makePristine(); + + std::string script_name = DEFAULT_SCRIPT_NAME; LLInventoryItem* item = gInventory.getItem(*item_uuid); BOOL is_modifiable = FALSE; - if(item - && gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), - GP_OBJECT_MANIPULATE)) + if (item) { - is_modifiable = TRUE; + if (!item->getName().empty()) + { + script_name = item->getName(); + } + if (gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), GP_OBJECT_MANIPULATE)) + { + is_modifiable = TRUE; + } } + preview->mScriptEd->setScriptName(script_name); preview->mScriptEd->setEnableEditing(is_modifiable); preview->mAssetStatus = PREVIEW_ASSET_LOADED; } From c76f10adcf0cf6e03b393acdc26c448c51ec8ece Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 4 Jun 2018 17:57:49 +0300 Subject: [PATCH 11/68] MAINT-8686 Better http termination logging --- indra/llcorehttp/_httpservice.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/indra/llcorehttp/_httpservice.cpp b/indra/llcorehttp/_httpservice.cpp index 49d865cbfa..0b72b53186 100644 --- a/indra/llcorehttp/_httpservice.cpp +++ b/indra/llcorehttp/_httpservice.cpp @@ -95,10 +95,12 @@ HttpService::~HttpService() if (! mThread->timedJoin(250)) { // Failed to join, expect problems ahead so do a hard termination. - mThread->cancel(); + LL_WARNS(LOG_CORE) << "Destroying HttpService with running thread. Expect problems." << LL_NEWLINE + << "State: " << S32(sState) + << " Last policy: " << U32(mLastPolicy) + << LL_ENDL; - LL_WARNS(LOG_CORE) << "Destroying HttpService with running thread. Expect problems." - << LL_ENDL; + mThread->cancel(); } } } From 30be0b0560a9aa1803872d6c8387587bf97fcbc5 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 4 Jun 2018 19:37:30 +0300 Subject: [PATCH 12/68] MAINT-8686 Mode detailed VBO crash logging --- indra/llrender/llvertexbuffer.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index e3e605d040..1312f6afda 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -192,7 +192,13 @@ volatile U8* LLVBOPool::allocate(U32& name, U32 size, bool for_seed) ret = (U8*) ll_aligned_malloc<64>(size); if (!ret) { - LL_ERRS() << "Failed to allocate for LLVBOPool buffer" << LL_ENDL; + LL_ERRS() << "Failed to allocate "<< size << " bytes for LLVBOPool buffer " << name <<"." << LL_NEWLINE + << "Free list size: " << mFreeList.size() // this happens if we are out of memory so a solution might be to clear some from freelist + << " Allocated Bytes: " << LLVertexBuffer::sAllocatedBytes + << " Allocated Index Bytes: " << LLVertexBuffer::sAllocatedIndexBytes + << " Pooled Bytes: " << sBytesPooled + << " Pooled Index Bytes: " << sIndexBytesPooled + << LL_ENDL; } } } From 546fc96f01298fe16f1cb0454e65569c77c44090 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Mon, 4 Jun 2018 23:18:37 +0300 Subject: [PATCH 13/68] MAINT-8721 Enabled benchmarking for Intel GPUs --- indra/newview/llfeaturemanager.cpp | 11 ++++++++++- indra/newview/llglsandbox.cpp | 9 --------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index bc96ee00f7..8f1641e908 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -407,7 +407,16 @@ bool LLFeatureManager::loadGPUClass() if (!gSavedSettings.getBOOL("SkipBenchmark")) { //get memory bandwidth from benchmark - F32 gbps = gpu_benchmark(); + F32 gbps; + try + { + gbps = gpu_benchmark(); + } + catch (const std::exception& e) + { + gbps = -1.f; + LL_WARNS("RenderInit") << "GPU benchmark failed: " << e.what() << LL_ENDL; + } if (gbps < 0.f) { //couldn't bench, use GLVersion diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 4b0b10dd5a..a9b15fc8b6 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -966,15 +966,6 @@ private: //----------------------------------------------------------------------------- F32 gpu_benchmark() { -#if LL_WINDOWS - if (gGLManager.mIsIntel - && std::string::npos != LLOSInfo::instance().getOSStringSimple().find("Microsoft Windows 8")) // or 8.1 - { // don't run benchmark on Windows 8/8.1 based PCs with Intel GPU (MAINT-8197) - LL_WARNS() << "Skipping gpu_benchmark() for Intel graphics on Windows 8." << LL_ENDL; - return -1.f; - } -#endif - if (!gGLManager.mHasShaderObjects || !gGLManager.mHasTimerQuery) { // don't bother benchmarking the fixed function // or venerable drivers which don't support accurate timing anyway From 1c4decadfef356ebe11f73bb839fac196e1f4fa0 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 7 Jun 2018 01:22:49 +0100 Subject: [PATCH 14/68] Disable name demangling via libc++abi on OS X to avoid malloc abort trap on OS X 10.14 Mojave --- indra/llcommon/llerror.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index f31a054139..e3e2698ba7 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -247,6 +247,13 @@ namespace LLError { std::string Log::demangle(const char* mangled) { + +#if LL_DARWIN + // MAINT-8724 libc++abi demangling causes malloc check failures + // that abort the application on OS X 10.14 Mojave so the easy + // fix is to disable demangling until a better fix can be found. + return mangled; +#else #ifdef __GNUC__ // GCC: type_info::name() returns a mangled class name,st demangle @@ -282,6 +289,7 @@ namespace LLError #else return mangled; +#endif #endif } } // LLError From d98df5ec2b7d3bb25f1f1fcb60cee50049ee0bb8 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 7 Jun 2018 16:33:52 +0300 Subject: [PATCH 15/68] MAINT-8730 Remove unused fetchFeatureTable code --- indra/newview/app_settings/settings.xml | 6 +- indra/newview/llfeaturemanager.cpp | 91 +------------------------ indra/newview/llfeaturemanager.h | 5 -- 3 files changed, 4 insertions(+), 98 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index f0782e0bf7..a01435626f 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3703,13 +3703,13 @@ FeatureManagerHTTPTable Comment - Base directory for HTTP feature/gpu table fetches + Deprecated Persist - 1 + 0 Type String Value - http://viewer-settings.secondlife.com + FPSLogFrequency diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index bc96ee00f7..1a379b86a9 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -62,13 +62,10 @@ #if LL_DARWIN const char FEATURE_TABLE_FILENAME[] = "featuretable_mac.txt"; -const char FEATURE_TABLE_VER_FILENAME[] = "featuretable_mac.%s.txt"; #elif LL_LINUX const char FEATURE_TABLE_FILENAME[] = "featuretable_linux.txt"; -const char FEATURE_TABLE_VER_FILENAME[] = "featuretable_linux.%s.txt"; #else const char FEATURE_TABLE_FILENAME[] = "featuretable.txt"; -const char FEATURE_TABLE_VER_FILENAME[] = "featuretable.%s.txt"; #endif #if 0 // consuming code in #if 0 below @@ -273,33 +270,11 @@ bool LLFeatureManager::loadFeatureTables() app_path += gDirUtilp->getDirDelimiter(); std::string filename; - std::string http_filename; filename = FEATURE_TABLE_FILENAME; - http_filename = llformat(FEATURE_TABLE_VER_FILENAME, LLVersionInfo::getVersion().c_str()); app_path += filename; - // second table is downloaded with HTTP - note that this will only be used on the run _after_ it is downloaded - std::string http_path = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, http_filename); - - // use HTTP table if it exists - std::string path; - bool parse_ok = false; - if (gDirUtilp->fileExists(http_path)) - { - parse_ok = parseFeatureTable(http_path); - if (!parse_ok) - { - // the HTTP table failed to parse, so delete it - LLFile::remove(http_path); - LL_WARNS("RenderInit") << "Removed invalid feature table '" << http_path << "'" << LL_ENDL; - } - } - - if (!parse_ok) - { - parse_ok = parseFeatureTable(app_path); - } + bool parse_ok = parseFeatureTable(app_path); return parse_ok; } @@ -486,70 +461,6 @@ bool LLFeatureManager::loadGPUClass() return true; // indicates that a gpu value was established } -void LLFeatureManager::fetchFeatureTableCoro(std::string tableName) -{ - LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("FeatureManagerHTTPTable", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - - const std::string base = gSavedSettings.getString("FeatureManagerHTTPTable"); - - -#if LL_WINDOWS - std::string os_string = LLOSInfo::instance().getOSStringSimple(); - std::string filename; - - if (os_string.find("Microsoft Windows XP") == 0) - { - filename = llformat(tableName.c_str(), "_xp", LLVersionInfo::getVersion().c_str()); - } - else - { - filename = llformat(tableName.c_str(), "", LLVersionInfo::getVersion().c_str()); - } -#else - const std::string filename = llformat(tableName.c_str(), LLVersionInfo::getVersion().c_str()); -#endif - - std::string url = base + "/" + filename; - // testing url below - //url = "http://viewer-settings.secondlife.com/featuretable.2.1.1.208406.txt"; - const std::string path = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, filename); - - - LL_INFOS() << "LLFeatureManager fetching " << url << " into " << path << LL_ENDL; - - LLSD result = httpAdapter->getRawAndSuspend(httpRequest, url); - - LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; - LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); - - if (status) - { // There was a newer feature table on the server. We've grabbed it and now should write it. - // write to file - const LLSD::Binary &raw = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_RAW].asBinary(); - - LL_INFOS() << "writing feature table to " << path << LL_ENDL; - - S32 size = raw.size(); - if (size > 0) - { - // write to file - LLAPRFile out(path, LL_APR_WB); - out.write(raw.data(), size); - out.close(); - } - } -} - -// fetch table(s) from a website (S3) -void LLFeatureManager::fetchHTTPTables() -{ - LLCoros::instance().launch("LLFeatureManager::fetchFeatureTableCoro", - boost::bind(&LLFeatureManager::fetchFeatureTableCoro, this, FEATURE_TABLE_VER_FILENAME)); -} - void LLFeatureManager::cleanupFeatureTables() { std::for_each(mMaskList.begin(), mMaskList.end(), DeletePairedPointer()); diff --git a/indra/newview/llfeaturemanager.h b/indra/newview/llfeaturemanager.h index 54bd07329a..f77861a1a7 100644 --- a/indra/newview/llfeaturemanager.h +++ b/indra/newview/llfeaturemanager.h @@ -145,9 +145,6 @@ public: // in the skip list if true void applyFeatures(bool skipFeatures); - // load the dynamic GPU/feature table from a website - void fetchHTTPTables(); - LLSD getRecommendedSettingsMap(); protected: @@ -158,8 +155,6 @@ protected: void initBaseMask(); - void fetchFeatureTableCoro(std::string name); - std::map mMaskList; std::set mSkippedFeatures; BOOL mInited; From 88da45148eeae26e1bae11bf3c948796e0f7cfdb Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 7 Jun 2018 22:14:46 +0100 Subject: [PATCH 16/68] Better fix for OSX 10.14 libc++abi demangling crash on mem shenanigans. Silence nagging about running launcher for non-release for download builds. Tweak newview CMake to use executable instead of SL_Launcher and re-enable debugging within Xcode. --- indra/llcommon/llerror.cpp | 32 +++++++------------------------- indra/newview/CMakeLists.txt | 7 ++++++- indra/newview/llappviewer.cpp | 3 +++ 3 files changed, 16 insertions(+), 26 deletions(-) diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index e3e2698ba7..29de79dc64 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -247,32 +247,15 @@ namespace LLError { std::string Log::demangle(const char* mangled) { - -#if LL_DARWIN - // MAINT-8724 libc++abi demangling causes malloc check failures - // that abort the application on OS X 10.14 Mojave so the easy - // fix is to disable demangling until a better fix can be found. - return mangled; -#else #ifdef __GNUC__ // GCC: type_info::name() returns a mangled class name,st demangle - - static size_t abi_name_len = 100; - static char* abi_name_buf = (char*)malloc(abi_name_len); - // warning: above is voodoo inferred from the GCC manual, - // do NOT change - - int status; - // We don't use status, and shouldn't have to pass apointer to it - // but gcc 3.3 libstc++'s implementation of demangling is broken - // and fails without. - - char* name = abi::__cxa_demangle(mangled, - abi_name_buf, &abi_name_len, &status); - // this call can realloc the abi_name_buf pointer (!) - - return name ? name : mangled; - + // passing nullptr, 0 forces allocation of a unique buffer we can free + // fixing MAINT-8724 on OSX 10.14 + int status = -1; + char* name = abi::__cxa_demangle(mangled, nullptr, 0, &status); + std::string result(name ? name : mangled); + free(name); + return result; #elif LL_WINDOWS // DevStudio: type_info::name() includes the text "class " at the start @@ -289,7 +272,6 @@ namespace LLError #else return mangled; -#endif #endif } } // LLError diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 1629c49276..2fc722d4c3 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2057,7 +2057,12 @@ if (DARWIN) # These all get set with PROPERTIES set(product "Second Life") # this is the setting for the Python wrapper, see SL-322 and WRAPPER line in Info-SecondLife.plist - set(MACOSX_WRAPPER_EXECUTABLE_NAME "SL_Launcher") + if (PACKAGE) + set(MACOSX_WRAPPER_EXECUTABLE_NAME "SL_Launcher") + else (PACKAGE) + # force the name of the actual executable to allow running it within Xcode for debugging + set(MACOSX_WRAPPER_EXECUTABLE_NAME "../Resources/Second Life Viewer.app/Contents/MacOS/Second Life") + endif (PACKAGE) set(MACOSX_BUNDLE_INFO_STRING "Second Life Viewer") set(MACOSX_BUNDLE_ICON_FILE "secondlife.icns") set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.secondlife.indra.viewer") diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index ce4aab20c7..115a5fc2fc 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1082,6 +1082,8 @@ bool LLAppViewer::init() } } +// don't nag developers who need to run the executable directly +#if LL_RELEASE_FOR_DOWNLOAD char* PARENT = getenv("PARENT"); if (! (PARENT && std::string(PARENT) == "SL_Launcher")) { @@ -1094,6 +1096,7 @@ bool LLAppViewer::init() // him/herself in the foot. LLNotificationsUtil::add("RunLauncher"); } +#endif #if LL_WINDOWS if (gGLManager.mGLVersion < LLFeatureManager::getInstance()->getExpectedGLVersion()) From d0727e9286649d5ea5b19871239dfb1ae75bc1e1 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 7 Jun 2018 23:12:52 +0100 Subject: [PATCH 17/68] Remove llfloaterauction refs from CMake. --- indra/newview/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 2fc722d4c3..367d4577ca 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -201,7 +201,6 @@ set(viewer_SOURCE_FILES llflickrconnect.cpp llfloaterabout.cpp llfloaterbvhpreview.cpp - llfloaterauction.cpp llfloaterautoreplacesettings.cpp llfloateravatar.cpp llfloateravatarpicker.cpp @@ -823,7 +822,6 @@ set(viewer_HEADER_FILES llflickrconnect.h llfloaterabout.h llfloaterbvhpreview.h - llfloaterauction.h llfloaterautoreplacesettings.h llfloateravatar.h llfloateravatarpicker.h From b26dbf562f43deea780e4ab615b2b5608c3c5d60 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 8 Jun 2018 17:29:56 +0100 Subject: [PATCH 18/68] MAINT-8741 fix compile issue with OSX 10.14 SDK --- indra/llui/llscrolllistctrl.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 212e27477b..ed65b1e45f 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -2784,7 +2784,6 @@ void LLScrollListCtrl::onClickColumn(void *userdata) } // if this column is the primary sort key, reverse the direction - sort_column_t cur_sort_column; if (!parent->mSortColumns.empty() && parent->mSortColumns.back().first == column_index) { ascending = !parent->mSortColumns.back().second; From 1d3266910c5fbcc3c811cf82e0ebfbc7234f8df0 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 8 Jun 2018 20:22:36 +0300 Subject: [PATCH 19/68] MAINT-8742 Crashes at draw and getHandle --- indra/newview/llchathistory.cpp | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 97a71a8802..1099d4bc09 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -528,10 +528,24 @@ public: registrar_enable.add("ObjectIcon.Visible", boost::bind(&LLChatHistoryHeader::onObjectIconContextMenuItemVisible, this, _2)); LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile("menu_avatar_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); - mPopupMenuHandleAvatar = menu->getHandle(); + if (menu) + { + mPopupMenuHandleAvatar = menu->getHandle(); + } + else + { + LL_WARNS() << " Failed to create menu_avatar_icon.xml" << LL_ENDL; + } menu = LLUICtrlFactory::getInstance()->createFromFile("menu_object_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); - mPopupMenuHandleObject = menu->getHandle(); + if (menu) + { + mPopupMenuHandleObject = menu->getHandle(); + } + else + { + LL_WARNS() << " Failed to create menu_object_icon.xml" << LL_ENDL; + } setDoubleClickCallback(boost::bind(&LLChatHistoryHeader::showInspector, this)); @@ -619,7 +633,12 @@ public: } mUserNameFont = style_params.font(); - LLTextBox* user_name = getChild("user_name"); + if (!mUserNameTextBox) + { + mUserNameTextBox = getChild("user_name"); + mTimeBoxTextBox = getChild("time_box"); + } + LLTextBox* user_name = mUserNameTextBox; user_name->setReadOnlyColor(style_params.readonly_color()); user_name->setColor(style_params.color()); From 1a014427a257ba9ba78ab173fc5f2f9621d768a1 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Tue, 12 Jun 2018 17:45:55 +0300 Subject: [PATCH 20/68] MAINT-8727 FIXED Saving snapshot will cause disconnect if you do not choose path in File picker quickly --- indra/newview/llfloatersnapshot.cpp | 10 +- indra/newview/llfloatersnapshot.h | 4 +- indra/newview/lloutfitgallery.cpp | 122 ++++++++++++------------ indra/newview/lloutfitgallery.h | 1 + indra/newview/llpanelsnapshotlocal.cpp | 28 +++--- indra/newview/llsnapshotlivepreview.cpp | 46 ++------- indra/newview/llsnapshotlivepreview.h | 9 +- indra/newview/llviewermenufile.cpp | 34 +++++-- indra/newview/llviewermenufile.h | 5 +- indra/newview/llviewerwindow.cpp | 121 ++++++++++++++--------- indra/newview/llviewerwindow.h | 8 +- 11 files changed, 211 insertions(+), 177 deletions(-) diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 156b2ba7b1..c08aaf3f50 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -1309,17 +1309,15 @@ void LLFloaterSnapshot::saveTexture() previewp->saveTexture(); } -BOOL LLFloaterSnapshot::saveLocal() +void LLFloaterSnapshot::saveLocal(const snapshot_saved_signal_t::slot_type& success_cb, const snapshot_saved_signal_t::slot_type& failure_cb) { LL_DEBUGS() << "saveLocal" << LL_ENDL; LLSnapshotLivePreview* previewp = getPreviewView(); - if (!previewp) + llassert(previewp != NULL); + if (previewp) { - llassert(previewp != NULL); - return FALSE; + previewp->saveLocal(success_cb, failure_cb); } - - return previewp->saveLocal(); } void LLFloaterSnapshotBase::postSave() diff --git a/indra/newview/llfloatersnapshot.h b/indra/newview/llfloatersnapshot.h index 698273ac90..bcba14d63d 100644 --- a/indra/newview/llfloatersnapshot.h +++ b/indra/newview/llfloatersnapshot.h @@ -156,7 +156,9 @@ public: static LLFloaterSnapshot* getInstance(); static LLFloaterSnapshot* findInstance(); /*virtual*/ void saveTexture(); - BOOL saveLocal(); + + typedef boost::signals2::signal snapshot_saved_signal_t; + void saveLocal(const snapshot_saved_signal_t::slot_type& success_cb, const snapshot_saved_signal_t::slot_type& failure_cb); static void setAgentEmail(const std::string& email); BOOL isWaitingState(); diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index dc3b153da2..a90a29a731 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -1166,72 +1166,72 @@ void LLOutfitGallery::refreshTextures(const LLUUID& category_id) void LLOutfitGallery::uploadPhoto(LLUUID outfit_id) { - outfit_map_t::iterator outfit_it = mOutfitMap.find(outfit_id); - if (outfit_it == mOutfitMap.end() || outfit_it->first.isNull()) - { - return; - } + outfit_map_t::iterator outfit_it = mOutfitMap.find(outfit_id); + if (outfit_it == mOutfitMap.end() || outfit_it->first.isNull()) + { + return; + } + (new LLFilePickerReplyThread(boost::bind(&LLOutfitGallery::uploadOutfitImage, this, _1, outfit_id), LLFilePicker::FFLOAD_IMAGE, false))->getFile(); +} - LLFilePicker& picker = LLFilePicker::instance(); - if (picker.getOpenFile(LLFilePicker::FFLOAD_IMAGE)) +void LLOutfitGallery::uploadOutfitImage(const std::vector& filenames, LLUUID outfit_id) +{ + std::string filename = filenames[0]; + LLLocalBitmap* unit = new LLLocalBitmap(filename); + if (unit->getValid()) { - std::string filename = picker.getFirstFile(); - LLLocalBitmap* unit = new LLLocalBitmap(filename); - if (unit->getValid()) + std::string exten = gDirUtilp->getExtension(filename); + U32 codec = LLImageBase::getCodecFromExtension(exten); + + LLImageDimensionsInfo image_info; + std::string image_load_error; + if (!image_info.load(filename, codec)) { - std::string exten = gDirUtilp->getExtension(filename); - U32 codec = LLImageBase::getCodecFromExtension(exten); - - LLImageDimensionsInfo image_info; - std::string image_load_error; - if (!image_info.load(filename, codec)) - { - image_load_error = image_info.getLastError(); - } - - S32 max_width = MAX_OUTFIT_PHOTO_WIDTH; - S32 max_height = MAX_OUTFIT_PHOTO_HEIGHT; - - if ((image_info.getWidth() > max_width) || (image_info.getHeight() > max_height)) - { - LLStringUtil::format_map_t args; - args["WIDTH"] = llformat("%d", max_width); - args["HEIGHT"] = llformat("%d", max_height); - - image_load_error = LLTrans::getString("outfit_photo_load_dimensions_error", args); - } - - if (!image_load_error.empty()) - { - LLSD subst; - subst["REASON"] = image_load_error; - LLNotificationsUtil::add("OutfitPhotoLoadError", subst); - return; - } - - S32 expected_upload_cost = LLGlobalEconomy::getInstance()->getPriceUpload(); // kinda hack - assumes that unsubclassed LLFloaterNameDesc is only used for uploading chargeable assets, which it is right now (it's only used unsubclassed for the sound upload dialog, and THAT should be a subclass). - void *nruserdata = NULL; - nruserdata = (void *)&outfit_id; - - LLViewerInventoryCategory *outfit_cat = gInventory.getCategory(outfit_id); - if (!outfit_cat) return; - updateSnapshotFolderObserver(); - checkRemovePhoto(outfit_id); - std::string upload_pending_name = outfit_id.asString(); - std::string upload_pending_desc = ""; - LLAssetStorage::LLStoreAssetCallback callback = NULL; - LLUUID photo_id = upload_new_resource(filename, // file - upload_pending_name, - upload_pending_desc, - 0, LLFolderType::FT_NONE, LLInventoryType::IT_NONE, - LLFloaterPerms::getNextOwnerPerms("Uploads"), - LLFloaterPerms::getGroupPerms("Uploads"), - LLFloaterPerms::getEveryonePerms("Uploads"), - upload_pending_name, callback, expected_upload_cost, nruserdata); - mOutfitLinkPending = outfit_id; + image_load_error = image_info.getLastError(); } - delete unit; + + S32 max_width = MAX_OUTFIT_PHOTO_WIDTH; + S32 max_height = MAX_OUTFIT_PHOTO_HEIGHT; + + if ((image_info.getWidth() > max_width) || (image_info.getHeight() > max_height)) + { + LLStringUtil::format_map_t args; + args["WIDTH"] = llformat("%d", max_width); + args["HEIGHT"] = llformat("%d", max_height); + + image_load_error = LLTrans::getString("outfit_photo_load_dimensions_error", args); + } + + if (!image_load_error.empty()) + { + LLSD subst; + subst["REASON"] = image_load_error; + LLNotificationsUtil::add("OutfitPhotoLoadError", subst); + return; + } + + S32 expected_upload_cost = LLGlobalEconomy::getInstance()->getPriceUpload(); // kinda hack - assumes that unsubclassed LLFloaterNameDesc is only used for uploading chargeable assets, which it is right now (it's only used unsubclassed for the sound upload dialog, and THAT should be a subclass). + void *nruserdata = NULL; + nruserdata = (void *)&outfit_id; + + LLViewerInventoryCategory *outfit_cat = gInventory.getCategory(outfit_id); + if (!outfit_cat) return; + updateSnapshotFolderObserver(); + checkRemovePhoto(outfit_id); + std::string upload_pending_name = outfit_id.asString(); + std::string upload_pending_desc = ""; + LLAssetStorage::LLStoreAssetCallback callback = NULL; + LLUUID photo_id = upload_new_resource(filename, // file + upload_pending_name, + upload_pending_desc, + 0, LLFolderType::FT_NONE, LLInventoryType::IT_NONE, + LLFloaterPerms::getNextOwnerPerms("Uploads"), + LLFloaterPerms::getGroupPerms("Uploads"), + LLFloaterPerms::getEveryonePerms("Uploads"), + upload_pending_name, callback, expected_upload_cost, nruserdata); + mOutfitLinkPending = outfit_id; } + delete unit; } void LLOutfitGallery::linkPhotoToOutfit(LLUUID photo_id, LLUUID outfit_id) diff --git a/indra/newview/lloutfitgallery.h b/indra/newview/lloutfitgallery.h index 383924a7d6..6dd8a6298f 100644 --- a/indra/newview/lloutfitgallery.h +++ b/indra/newview/lloutfitgallery.h @@ -130,6 +130,7 @@ protected: private: void loadPhotos(); void uploadPhoto(LLUUID outfit_id); + void uploadOutfitImage(const std::vector& filenames, LLUUID outfit_id); void updateSnapshotFolderObserver(); LLUUID getPhotoAssetId(const LLUUID& outfit_id); LLUUID getDefaultPhoto(); diff --git a/indra/newview/llpanelsnapshotlocal.cpp b/indra/newview/llpanelsnapshotlocal.cpp index 77378f8092..57c5915da2 100644 --- a/indra/newview/llpanelsnapshotlocal.cpp +++ b/indra/newview/llpanelsnapshotlocal.cpp @@ -65,6 +65,9 @@ private: void onFormatComboCommit(LLUICtrl* ctrl); void onQualitySliderCommit(LLUICtrl* ctrl); void onSaveFlyoutCommit(LLUICtrl* ctrl); + + void LLPanelSnapshotLocal::onLocalSaved(); + void LLPanelSnapshotLocal::onLocalCanceled(); }; static LLPanelInjector panel_class("llpanelsnapshotlocal"); @@ -164,19 +167,22 @@ void LLPanelSnapshotLocal::onSaveFlyoutCommit(LLUICtrl* ctrl) LLFloaterSnapshot* floater = LLFloaterSnapshot::getInstance(); floater->notify(LLSD().with("set-working", true)); - BOOL saved = floater->saveLocal(); - if (saved) - { - mSnapshotFloater->postSave(); - floater->notify(LLSD().with("set-finished", LLSD().with("ok", true).with("msg", "local"))); - } - else - { - cancel(); - floater->notify(LLSD().with("set-finished", LLSD().with("ok", false).with("msg", "local"))); - } + floater->saveLocal((boost::bind(&LLPanelSnapshotLocal::onLocalSaved, this)), (boost::bind(&LLPanelSnapshotLocal::onLocalCanceled, this))); } +void LLPanelSnapshotLocal::onLocalSaved() +{ + mSnapshotFloater->postSave(); + LLFloaterSnapshot::getInstance()->notify(LLSD().with("set-finished", LLSD().with("ok", true).with("msg", "local"))); +} + +void LLPanelSnapshotLocal::onLocalCanceled() +{ + cancel(); + LLFloaterSnapshot::getInstance()->notify(LLSD().with("set-finished", LLSD().with("ok", false).with("msg", "local"))); +} + + LLSnapshotModel::ESnapshotType LLPanelSnapshotLocal::getSnapshotType() { return LLSnapshotModel::SNAPSHOT_LOCAL; diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp index ee8b2d79c0..d0cff1464b 100644 --- a/indra/newview/llsnapshotlivepreview.cpp +++ b/indra/newview/llsnapshotlivepreview.cpp @@ -70,6 +70,7 @@ S32 BORDER_WIDTH = 6; const S32 MAX_TEXTURE_SIZE = 512 ; //max upload texture size 512 * 512 std::set LLSnapshotLivePreview::sList; +LLPointer LLSnapshotLivePreview::sSaveLocalImage = NULL; LLSnapshotLivePreview::LLSnapshotLivePreview (const LLSnapshotLivePreview::Params& p) : LLView(p), @@ -131,6 +132,7 @@ LLSnapshotLivePreview::~LLSnapshotLivePreview() // gIdleCallbacks.deleteFunction( &LLSnapshotLivePreview::onIdle, (void*)this ); sList.erase(this); + sSaveLocalImage = NULL; } void LLSnapshotLivePreview::setMaxImageSize(S32 size) @@ -1065,53 +1067,19 @@ void LLSnapshotLivePreview::saveTexture(BOOL outfit_snapshot, std::string name) mDataSize = 0; } -BOOL LLSnapshotLivePreview::saveLocal() +void LLSnapshotLivePreview::saveLocal(const snapshot_saved_signal_t::slot_type& success_cb, const snapshot_saved_signal_t::slot_type& failure_cb) { // Update mFormattedImage if necessary getFormattedImage(); // Save the formatted image - BOOL success = saveLocal(mFormattedImage); - - if(success) - { - gViewerWindow->playSnapshotAnimAndSound(); - } - return success; + saveLocal(mFormattedImage, success_cb, failure_cb); } //Check if failed due to insufficient memory -BOOL LLSnapshotLivePreview::saveLocal(LLPointer mFormattedImage) +void LLSnapshotLivePreview::saveLocal(LLPointer image, const snapshot_saved_signal_t::slot_type& success_cb, const snapshot_saved_signal_t::slot_type& failure_cb) { - BOOL insufficient_memory; - BOOL success = gViewerWindow->saveImageNumbered(mFormattedImage, FALSE, insufficient_memory); + sSaveLocalImage = image; - if (insufficient_memory) - { - std::string lastSnapshotDir = LLViewerWindow::getLastSnapshotDir(); - -#ifdef LL_WINDOWS - boost::filesystem::path b_path(utf8str_to_utf16str(lastSnapshotDir)); -#else - boost::filesystem::path b_path(lastSnapshotDir); -#endif - boost::filesystem::space_info b_space = boost::filesystem::space(b_path); - if (b_space.free < mFormattedImage->getDataSize()) - { - LLSD args; - args["PATH"] = lastSnapshotDir; - - std::string needM_bytes_string; - LLResMgr::getInstance()->getIntegerString(needM_bytes_string, (mFormattedImage->getDataSize()) >> 10); - args["NEED_MEMORY"] = needM_bytes_string; - - std::string freeM_bytes_string; - LLResMgr::getInstance()->getIntegerString(freeM_bytes_string, (b_space.free) >> 10); - args["FREE_MEMORY"] = freeM_bytes_string; - - LLNotificationsUtil::add("SnapshotToComputerFailed", args); - return false; - } - } - return success; + gViewerWindow->saveImageNumbered(sSaveLocalImage, FALSE, success_cb, failure_cb); } diff --git a/indra/newview/llsnapshotlivepreview.h b/indra/newview/llsnapshotlivepreview.h index 4ea8d25a5a..683cd016d8 100644 --- a/indra/newview/llsnapshotlivepreview.h +++ b/indra/newview/llsnapshotlivepreview.h @@ -40,8 +40,9 @@ class LLSnapshotLivePreview : public LLView { LOG_CLASS(LLSnapshotLivePreview); public: + typedef boost::signals2::signal snapshot_saved_signal_t; - static BOOL saveLocal(LLPointer); + static void saveLocal(LLPointer image, const snapshot_saved_signal_t::slot_type& success_cb = snapshot_saved_signal_t(), const snapshot_saved_signal_t::slot_type& failure_cb = snapshot_saved_signal_t()); struct Params : public LLInitParam::Block { Params() @@ -101,7 +102,7 @@ public: std::string getFilter() const { return mFilterName; } void updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail = FALSE, F32 delay = 0.f); void saveTexture(BOOL outfit_snapshot = FALSE, std::string name = ""); - BOOL saveLocal(); + void saveLocal(const snapshot_saved_signal_t::slot_type& success_cb, const snapshot_saved_signal_t::slot_type& failure_cb); LLPointer getFormattedImage(); LLPointer getEncodedImage(); @@ -170,7 +171,9 @@ private: LLQuaternion mCameraRot; BOOL mSnapshotActive; LLSnapshotModel::ESnapshotLayerType mSnapshotBufferType; - std::string mFilterName; + std::string mFilterName; + + static LLPointer sSaveLocalImage; public: static std::set sList; diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index dc05d98228..cf1c442ce9 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -203,38 +203,55 @@ void LLFilePickerThread::clearDead() } } -LLFilePickerReplyThread::LLFilePickerReplyThread(const file_picked_signal_t::slot_type& cb, LLFilePicker::ELoadFilter filter, bool get_multiple) +LLFilePickerReplyThread::LLFilePickerReplyThread(const file_picked_signal_t::slot_type& cb, LLFilePicker::ELoadFilter filter, bool get_multiple, const file_picked_signal_t::slot_type& failure_cb) : LLFilePickerThread(filter, get_multiple), mLoadFilter(filter), mSaveFilter(LLFilePicker::FFSAVE_ALL), - mFilePickedSignal(NULL) + mFilePickedSignal(NULL), + mFailureSignal(NULL) { mFilePickedSignal = new file_picked_signal_t(); mFilePickedSignal->connect(cb); + + mFailureSignal = new file_picked_signal_t(); + mFailureSignal->connect(failure_cb); } -LLFilePickerReplyThread::LLFilePickerReplyThread(const file_picked_signal_t::slot_type& cb, LLFilePicker::ESaveFilter filter, const std::string &proposed_name) +LLFilePickerReplyThread::LLFilePickerReplyThread(const file_picked_signal_t::slot_type& cb, LLFilePicker::ESaveFilter filter, const std::string &proposed_name, const file_picked_signal_t::slot_type& failure_cb) : LLFilePickerThread(filter, proposed_name), mLoadFilter(LLFilePicker::FFLOAD_ALL), mSaveFilter(filter), - mFilePickedSignal(NULL) + mFilePickedSignal(NULL), + mFailureSignal(NULL) { mFilePickedSignal = new file_picked_signal_t(); mFilePickedSignal->connect(cb); + + mFailureSignal = new file_picked_signal_t(); + mFailureSignal->connect(failure_cb); } LLFilePickerReplyThread::~LLFilePickerReplyThread() { delete mFilePickedSignal; + delete mFailureSignal; } void LLFilePickerReplyThread::notify(const std::vector& filenames) { - if (filenames.empty()) return; - - if (mFilePickedSignal) + if (filenames.empty()) { - (*mFilePickedSignal)(filenames, mLoadFilter, mSaveFilter); + if (mFailureSignal) + { + (*mFailureSignal)(filenames, mLoadFilter, mSaveFilter); + } + } + else + { + if (mFilePickedSignal) + { + (*mFilePickedSignal)(filenames, mLoadFilter, mSaveFilter); + } } } @@ -592,7 +609,6 @@ class LLFileTakeSnapshotToDisk : public view_listener_t gSavedSettings.getBOOL("RenderUIInSnapshot"), FALSE)) { - gViewerWindow->playSnapshotAnimAndSound(); LLPointer formatted; LLSnapshotModel::ESnapshotFormat fmt = (LLSnapshotModel::ESnapshotFormat) gSavedSettings.getS32("SnapshotFormat"); switch (fmt) diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h index 15bbdd1e2d..35f86f606b 100644 --- a/indra/newview/llviewermenufile.h +++ b/indra/newview/llviewermenufile.h @@ -113,8 +113,8 @@ public: typedef boost::signals2::signal& filenames, LLFilePicker::ELoadFilter load_filter, LLFilePicker::ESaveFilter save_filter)> file_picked_signal_t; - LLFilePickerReplyThread(const file_picked_signal_t::slot_type& cb, LLFilePicker::ELoadFilter filter, bool get_multiple); - LLFilePickerReplyThread(const file_picked_signal_t::slot_type& cb, LLFilePicker::ESaveFilter filter, const std::string &proposed_name); + LLFilePickerReplyThread(const file_picked_signal_t::slot_type& cb, LLFilePicker::ELoadFilter filter, bool get_multiple, const file_picked_signal_t::slot_type& failure_cb = file_picked_signal_t()); + LLFilePickerReplyThread(const file_picked_signal_t::slot_type& cb, LLFilePicker::ESaveFilter filter, const std::string &proposed_name, const file_picked_signal_t::slot_type& failure_cb = file_picked_signal_t()); ~LLFilePickerReplyThread(); virtual void notify(const std::vector& filenames); @@ -123,6 +123,7 @@ private: LLFilePicker::ELoadFilter mLoadFilter; LLFilePicker::ESaveFilter mSaveFilter; file_picked_signal_t* mFilePickedSignal; + file_picked_signal_t* mFailureSignal; }; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index f394d6913f..846b902260 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -193,6 +193,7 @@ #include "llviewerdisplay.h" #include "llspatialpartition.h" #include "llviewerjoystick.h" +#include "llviewermenufile.h" // LLFilePickerReplyThread #include "llviewernetwork.h" #include "llpostprocess.h" #include "llfloaterimnearbychat.h" @@ -4365,77 +4366,101 @@ BOOL LLViewerWindow::mousePointOnLandGlobal(const S32 x, const S32 y, LLVector3d } // Saves an image to the harddrive as "SnapshotX" where X >= 1. -BOOL LLViewerWindow::saveImageNumbered(LLImageFormatted *image, BOOL force_picker, BOOL& insufficient_memory) +void LLViewerWindow::saveImageNumbered(LLImageFormatted *image, BOOL force_picker, const snapshot_saved_signal_t::slot_type& success_cb, const snapshot_saved_signal_t::slot_type& failure_cb) { - insufficient_memory = FALSE; - if (!image) { LL_WARNS() << "No image to save" << LL_ENDL; - return FALSE; + return; } - - LLFilePicker::ESaveFilter pick_type; std::string extension("." + image->getExtension()); - if (extension == ".j2c") - pick_type = LLFilePicker::FFSAVE_J2C; - else if (extension == ".bmp") - pick_type = LLFilePicker::FFSAVE_BMP; - else if (extension == ".jpg") - pick_type = LLFilePicker::FFSAVE_JPEG; - else if (extension == ".png") - pick_type = LLFilePicker::FFSAVE_PNG; - else if (extension == ".tga") - pick_type = LLFilePicker::FFSAVE_TGA; - else - pick_type = LLFilePicker::FFSAVE_ALL; // ??? - - BOOL is_snapshot_name_loc_set = isSnapshotLocSet(); - + LLImageFormatted* formatted_image = image; // Get a base file location if needed. if (force_picker || !isSnapshotLocSet()) { - std::string proposed_name( sSnapshotBaseName ); + std::string proposed_name(sSnapshotBaseName); // getSaveFile will append an appropriate extension to the proposed name, based on the ESaveFilter constant passed in. + LLFilePicker::ESaveFilter pick_type; - // pick a directory in which to save - LLFilePicker& picker = LLFilePicker::instance(); - if (!picker.getSaveFile(pick_type, proposed_name)) - { - // Clicked cancel - return FALSE; - } + if (extension == ".j2c") + pick_type = LLFilePicker::FFSAVE_J2C; + else if (extension == ".bmp") + pick_type = LLFilePicker::FFSAVE_BMP; + else if (extension == ".jpg") + pick_type = LLFilePicker::FFSAVE_JPEG; + else if (extension == ".png") + pick_type = LLFilePicker::FFSAVE_PNG; + else if (extension == ".tga") + pick_type = LLFilePicker::FFSAVE_TGA; + else + pick_type = LLFilePicker::FFSAVE_ALL; - // Copy the directory + file name - std::string filepath = picker.getFirstFile(); - - gSavedPerAccountSettings.setString("SnapshotBaseName", gDirUtilp->getBaseFileName(filepath, true)); - gSavedPerAccountSettings.setString("SnapshotBaseDir", gDirUtilp->getDirName(filepath)); + (new LLFilePickerReplyThread(boost::bind(&LLViewerWindow::onDirectorySelected, this, _1, formatted_image, success_cb, failure_cb), pick_type, proposed_name, + boost::bind(&LLViewerWindow::onSelectionFailure, this, failure_cb)))->getFile(); } - - std::string snapshot_dir = sSnapshotDir; - if(snapshot_dir.empty()) + else { - return FALSE; + saveImageLocal(formatted_image, success_cb, failure_cb); + } +} + +void LLViewerWindow::onDirectorySelected(const std::vector& filenames, LLImageFormatted *image, const snapshot_saved_signal_t::slot_type& success_cb, const snapshot_saved_signal_t::slot_type& failure_cb) +{ + // Copy the directory + file name + std::string filepath = filenames[0]; + + gSavedPerAccountSettings.setString("SnapshotBaseName", gDirUtilp->getBaseFileName(filepath, true)); + gSavedPerAccountSettings.setString("SnapshotBaseDir", gDirUtilp->getDirName(filepath)); + saveImageLocal(image, success_cb, failure_cb); +} + +void LLViewerWindow::onSelectionFailure(const snapshot_saved_signal_t::slot_type& failure_cb) +{ + failure_cb(); +} + + +void LLViewerWindow::saveImageLocal(LLImageFormatted *image, const snapshot_saved_signal_t::slot_type& success_cb, const snapshot_saved_signal_t::slot_type& failure_cb) +{ + std::string lastSnapshotDir = LLViewerWindow::getLastSnapshotDir(); + if (lastSnapshotDir.empty()) + { + failure_cb(); + return; } // Check if there is enough free space to save snapshot #ifdef LL_WINDOWS - boost::filesystem::space_info b_space = boost::filesystem::space(utf8str_to_utf16str(snapshot_dir)); + boost::filesystem::path b_path(utf8str_to_utf16str(lastSnapshotDir)); #else - boost::filesystem::space_info b_space = boost::filesystem::space(snapshot_dir); + boost::filesystem::path b_path(lastSnapshotDir); #endif + boost::filesystem::space_info b_space = boost::filesystem::space(b_path); if (b_space.free < image->getDataSize()) { - insufficient_memory = TRUE; - return FALSE; + LLSD args; + args["PATH"] = lastSnapshotDir; + + std::string needM_bytes_string; + LLResMgr::getInstance()->getIntegerString(needM_bytes_string, (image->getDataSize()) >> 10); + args["NEED_MEMORY"] = needM_bytes_string; + + std::string freeM_bytes_string; + LLResMgr::getInstance()->getIntegerString(freeM_bytes_string, (b_space.free) >> 10); + args["FREE_MEMORY"] = freeM_bytes_string; + + LLNotificationsUtil::add("SnapshotToComputerFailed", args); + + failure_cb(); } + // Look for an unused file name + BOOL is_snapshot_name_loc_set = isSnapshotLocSet(); std::string filepath; S32 i = 1; S32 err = 0; - + std::string extension("." + image->getExtension()); do { filepath = sSnapshotDir; @@ -4457,7 +4482,15 @@ BOOL LLViewerWindow::saveImageNumbered(LLImageFormatted *image, BOOL force_picke && is_snapshot_name_loc_set); // Or stop if we are rewriting. LL_INFOS() << "Saving snapshot to " << filepath << LL_ENDL; - return image->save(filepath); + if (image->save(filepath)) + { + playSnapshotAnimAndSound(); + success_cb(); + } + else + { + failure_cb(); + } } void LLViewerWindow::resetSnapshotLoc() diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index c01921641c..d8d420e6be 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -352,7 +352,13 @@ public: BOOL thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, BOOL show_ui, BOOL do_rebuild, LLSnapshotModel::ESnapshotLayerType type); BOOL isSnapshotLocSet() const; void resetSnapshotLoc() const; - BOOL saveImageNumbered(LLImageFormatted *image, BOOL force_picker, BOOL& insufficient_memory); + + typedef boost::signals2::signal snapshot_saved_signal_t; + + void saveImageNumbered(LLImageFormatted *image, BOOL force_picker, const snapshot_saved_signal_t::slot_type& success_cb, const snapshot_saved_signal_t::slot_type& failure_cb); + void onDirectorySelected(const std::vector& filenames, LLImageFormatted *image, const snapshot_saved_signal_t::slot_type& success_cb, const snapshot_saved_signal_t::slot_type& failure_cb); + void saveImageLocal(LLImageFormatted *image, const snapshot_saved_signal_t::slot_type& success_cb, const snapshot_saved_signal_t::slot_type& failure_cb); + void onSelectionFailure(const snapshot_saved_signal_t::slot_type& failure_cb); // Reset the directory where snapshots are saved. // Client will open directory picker on next snapshot save. From 34cd1b699f49c9af69475b090d10f19e29c3cb27 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 12 Jun 2018 20:35:57 +0200 Subject: [PATCH 21/68] Undo threaded filepickers for snapshots to make room for LL version --- indra/newview/llfloatersnapshot.cpp | 19 +- indra/newview/llfloatersnapshot.h | 5 +- indra/newview/llpanelsnapshotlocal.cpp | 46 +---- indra/newview/llsnapshotlivepreview.cpp | 110 ++++------ indra/newview/llsnapshotlivepreview.h | 8 +- indra/newview/llviewermenufile.cpp | 52 +---- indra/newview/llviewerwindow.cpp | 264 ++++++------------------ indra/newview/llviewerwindow.h | 4 - 8 files changed, 133 insertions(+), 375 deletions(-) diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index eaae58ae38..529bc5ed66 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -1495,30 +1495,17 @@ void LLFloaterSnapshot::saveTexture() previewp->saveTexture(); } -// Threaded filepickers -//BOOL LLFloaterSnapshot::saveLocal() -void LLFloaterSnapshot::saveLocal(boost::function callback) -// +BOOL LLFloaterSnapshot::saveLocal() { LL_DEBUGS() << "saveLocal" << LL_ENDL; LLSnapshotLivePreview* previewp = getPreviewView(); if (!previewp) { llassert(previewp != NULL); - // Threaded filepickers - //return FALSE; - if (callback) - { - callback(false); - } - return; - // + return FALSE; } - // Threaded filepickers - //return previewp->saveLocal(); - previewp->saveLocal(callback); - // + return previewp->saveLocal(); } void LLFloaterSnapshotBase::postSave() diff --git a/indra/newview/llfloatersnapshot.h b/indra/newview/llfloatersnapshot.h index fc99e8b7f7..f57a603601 100644 --- a/indra/newview/llfloatersnapshot.h +++ b/indra/newview/llfloatersnapshot.h @@ -159,10 +159,7 @@ public: static LLFloaterSnapshot* getInstance(); static LLFloaterSnapshot* findInstance(); /*virtual*/ void saveTexture(); - // Threaded filepickers - //BOOL saveLocal(); - void saveLocal(boost::function callback); - // + BOOL saveLocal(); static void setAgentEmail(const std::string& email); BOOL isWaitingState(); diff --git a/indra/newview/llpanelsnapshotlocal.cpp b/indra/newview/llpanelsnapshotlocal.cpp index 4bb7e711ba..511bf94531 100644 --- a/indra/newview/llpanelsnapshotlocal.cpp +++ b/indra/newview/llpanelsnapshotlocal.cpp @@ -63,9 +63,6 @@ private: /*virtual*/ LLSnapshotModel::ESnapshotType getSnapshotType(); /*virtual*/ void updateControls(const LLSD& info); - // Threaded filepickers - void saveLocalCallback(bool success); - S32 mLocalFormat; void onFormatComboCommit(LLUICtrl* ctrl); @@ -185,20 +182,17 @@ void LLPanelSnapshotLocal::onSaveFlyoutCommit(LLUICtrl* ctrl) LLFloaterSnapshot* floater = LLFloaterSnapshot::getInstance(); floater->notify(LLSD().with("set-working", true)); - // Threaded filepickers - //BOOL saved = floater->saveLocal(); - //if (saved) - //{ - // LLFloaterSnapshot::postSave(); - // floater->notify(LLSD().with("set-finished", LLSD().with("ok", true).with("msg", "local"))); - //} - //else - //{ - // cancel(); - // floater->notify(LLSD().with("set-finished", LLSD().with("ok", false).with("msg", "local"))); - //} - floater->saveLocal(boost::bind(&LLPanelSnapshotLocal::saveLocalCallback, this, _1)); - // + BOOL saved = floater->saveLocal(); + if (saved) + { + mSnapshotFloater->postSave(); + floater->notify(LLSD().with("set-finished", LLSD().with("ok", true).with("msg", "local"))); + } + else + { + cancel(); + floater->notify(LLSD().with("set-finished", LLSD().with("ok", false).with("msg", "local"))); + } } // Store settings at logout @@ -208,24 +202,6 @@ LLPanelSnapshotLocal::~LLPanelSnapshotLocal() gSavedSettings.setS32("LastSnapshotToDiskWidth", getTypedPreviewWidth()); gSavedSettings.setS32("LastSnapshotToDiskHeight", getTypedPreviewHeight()); } -// - -// Threaded filepickers -void LLPanelSnapshotLocal::saveLocalCallback(bool success) -{ - LLFloaterSnapshot* floater = LLFloaterSnapshot::getInstance(); - - if (success) - { - mSnapshotFloater->postSave(); - floater->notify(LLSD().with("set-finished", LLSD().with("ok", true).with("msg", "local"))); - } - else - { - LLNotificationsUtil::add("CannotSaveSnapshot"); - floater->notify(LLSD().with("set-ready", true)); - } -} LLSnapshotModel::ESnapshotType LLPanelSnapshotLocal::getSnapshotType() { diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp index de2c6cdc52..f6596e72f1 100644 --- a/indra/newview/llsnapshotlivepreview.cpp +++ b/indra/newview/llsnapshotlivepreview.cpp @@ -1193,77 +1193,53 @@ void LLSnapshotLivePreview::saveTexture(BOOL outfit_snapshot, std::string name) mDataSize = 0; } -// Threaded filepickers -//BOOL LLSnapshotLivePreview::saveLocal() -//{ -// // Update mFormattedImage if necessary -// getFormattedImage(); -// -// // Save the formatted image -// BOOL success = saveLocal(mFormattedImage); -// -// if(success) -// { -// gViewerWindow->playSnapshotAnimAndSound(); -// } -// return success; -//} -// -////Check if failed due to insufficient memory -//BOOL LLSnapshotLivePreview::saveLocal(LLPointer mFormattedImage) -//{ -// BOOL insufficient_memory; -// BOOL success = gViewerWindow->saveImageNumbered(mFormattedImage, FALSE, insufficient_memory); -// -// if (insufficient_memory) -// { -// std::string lastSnapshotDir = LLViewerWindow::getLastSnapshotDir(); -// -//#ifdef LL_WINDOWS -// boost::filesystem::path b_path(utf8str_to_utf16str(lastSnapshotDir)); -//#else -// boost::filesystem::path b_path(lastSnapshotDir); -//#endif -// boost::filesystem::space_info b_space = boost::filesystem::space(b_path); -// if (b_space.free < mFormattedImage->getDataSize()) -// { -// LLSD args; -// args["PATH"] = lastSnapshotDir; -// -// std::string needM_bytes_string; -// LLResMgr::getInstance()->getIntegerString(needM_bytes_string, (mFormattedImage->getDataSize()) >> 10); -// args["NEED_MEMORY"] = needM_bytes_string; -// -// std::string freeM_bytes_string; -// LLResMgr::getInstance()->getIntegerString(freeM_bytes_string, (b_space.free) >> 10); -// args["FREE_MEMORY"] = freeM_bytes_string; -// -// LLNotificationsUtil::add("SnapshotToComputerFailed", args); -// return false; -// } -// } -// return success; -//} - -void LLSnapshotLivePreview::saveLocal(boost::function callback) +BOOL LLSnapshotLivePreview::saveLocal() { - // Update mFormattedImage if necessary - getFormattedImage(); + // Update mFormattedImage if necessary + getFormattedImage(); + + // Save the formatted image + BOOL success = saveLocal(mFormattedImage); - // Save the formatted image - gViewerWindow->saveImageNumbered(mFormattedImage, false, boost::bind(&LLSnapshotLivePreview::saveLocalCallback, this, _1, callback)); -} - -void LLSnapshotLivePreview::saveLocalCallback(bool success, boost::function callback) -{ if(success) { gViewerWindow->playSnapshotAnimAndSound(); } - - if (callback) - { - callback(success); - } + return success; +} + +//Check if failed due to insufficient memory +BOOL LLSnapshotLivePreview::saveLocal(LLPointer mFormattedImage) +{ + BOOL insufficient_memory; + BOOL success = gViewerWindow->saveImageNumbered(mFormattedImage, FALSE, insufficient_memory); + + if (insufficient_memory) + { + std::string lastSnapshotDir = LLViewerWindow::getLastSnapshotDir(); + +#ifdef LL_WINDOWS + boost::filesystem::path b_path(utf8str_to_utf16str(lastSnapshotDir)); +#else + boost::filesystem::path b_path(lastSnapshotDir); +#endif + boost::filesystem::space_info b_space = boost::filesystem::space(b_path); + if (b_space.free < mFormattedImage->getDataSize()) + { + LLSD args; + args["PATH"] = lastSnapshotDir; + + std::string needM_bytes_string; + LLResMgr::getInstance()->getIntegerString(needM_bytes_string, (mFormattedImage->getDataSize()) >> 10); + args["NEED_MEMORY"] = needM_bytes_string; + + std::string freeM_bytes_string; + LLResMgr::getInstance()->getIntegerString(freeM_bytes_string, (b_space.free) >> 10); + args["FREE_MEMORY"] = freeM_bytes_string; + + LLNotificationsUtil::add("SnapshotToComputerFailed", args); + return false; + } + } + return success; } -// diff --git a/indra/newview/llsnapshotlivepreview.h b/indra/newview/llsnapshotlivepreview.h index 10d21102e3..2e514c7925 100644 --- a/indra/newview/llsnapshotlivepreview.h +++ b/indra/newview/llsnapshotlivepreview.h @@ -41,7 +41,7 @@ class LLSnapshotLivePreview : public LLView LOG_CLASS(LLSnapshotLivePreview); public: - //static BOOL saveLocal(LLPointer); // Threaded filepickers + static BOOL saveLocal(LLPointer); struct Params : public LLInitParam::Block { Params() @@ -104,11 +104,7 @@ public: std::string getFilter() const { return mFilterName; } void updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail = FALSE, F32 delay = 0.f); void saveTexture(BOOL outfit_snapshot = FALSE, std::string name = ""); - // Threaded filepickers - //BOOL saveLocal(); - void saveLocal(boost::function callback); - void saveLocalCallback(bool success, boost::function callback); - // + BOOL saveLocal(); LLPointer getFormattedImage(); LLPointer getEncodedImage(); diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index ef1e0cf42c..c531494f99 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -597,18 +597,6 @@ class LLFileCloseAllWindows : public view_listener_t } }; -// Threaded filepickers -LLPointer sFormattedSnapshotImage = NULL; -void take_snapshot_to_disk_callback(bool success) -{ - sFormattedSnapshotImage = NULL; - if (success) - { - gViewerWindow->playSnapshotAnimAndSound(); - } -} -// - class LLFileTakeSnapshotToDisk : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -632,49 +620,27 @@ class LLFileTakeSnapshotToDisk : public view_listener_t gSavedSettings.getBOOL("RenderUIInSnapshot"), FALSE)) { - // Threaded filepickers - //gViewerWindow->playSnapshotAnimAndSound(); - //LLPointer formatted; - //LLSnapshotModel::ESnapshotFormat fmt = (LLSnapshotModel::ESnapshotFormat) gSavedSettings.getS32("SnapshotFormat"); - //switch (fmt) - //{ - //case LLSnapshotModel::SNAPSHOT_FORMAT_JPEG: - // formatted = new LLImageJPEG(gSavedSettings.getS32("SnapshotQuality")); - // break; - //default: - // LL_WARNS() << "Unknown local snapshot format: " << fmt << LL_ENDL; - //case LLSnapshotModel::SNAPSHOT_FORMAT_PNG: - // formatted = new LLImagePNG; - // break; - //case LLSnapshotModel::SNAPSHOT_FORMAT_BMP: - // formatted = new LLImageBMP; - // break; - //} - //formatted->enableOverSize() ; - //formatted->encode(raw, 0); - //formatted->disableOverSize() ; - //LLSnapshotLivePreview::saveLocal(formatted); - + gViewerWindow->playSnapshotAnimAndSound(); + LLPointer formatted; LLSnapshotModel::ESnapshotFormat fmt = (LLSnapshotModel::ESnapshotFormat) gSavedSettings.getS32("SnapshotFormat"); switch (fmt) { case LLSnapshotModel::SNAPSHOT_FORMAT_JPEG: - sFormattedSnapshotImage = new LLImageJPEG(gSavedSettings.getS32("SnapshotQuality")); + formatted = new LLImageJPEG(gSavedSettings.getS32("SnapshotQuality")); break; default: LL_WARNS() << "Unknown local snapshot format: " << fmt << LL_ENDL; case LLSnapshotModel::SNAPSHOT_FORMAT_PNG: - sFormattedSnapshotImage = new LLImagePNG; + formatted = new LLImagePNG; break; case LLSnapshotModel::SNAPSHOT_FORMAT_BMP: - sFormattedSnapshotImage = new LLImageBMP; + formatted = new LLImageBMP; break; } - sFormattedSnapshotImage->enableOverSize() ; - sFormattedSnapshotImage->encode(raw, 0); - sFormattedSnapshotImage->disableOverSize() ; - gViewerWindow->saveImageNumbered(sFormattedSnapshotImage, false, boost::bind(&take_snapshot_to_disk_callback, _1)); - // + formatted->enableOverSize() ; + formatted->encode(raw, 0); + formatted->disableOverSize() ; + LLSnapshotLivePreview::saveLocal(formatted); } return true; } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index c327971945..409b7c1733 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -293,38 +293,6 @@ static LLCachedControl sSnapshotDir(LLCachedControl(gS LLTrace::SampleStatHandle<> LLViewerWindow::sMouseVelocityStat("Mouse Velocity"); -// Threaded filepickers -class FSSnapshotSaveFilePicker : public LLFilePickerThread -{ -public: - FSSnapshotSaveFilePicker(LLFilePicker::ESaveFilter filter, const std::string& default_name, boost::function notify_slot) - : LLFilePickerThread(filter, default_name) - { - mSignal.connect(notify_slot); - } - - virtual void notify(const std::vector& filenames) - { - if (!filenames.empty()) - { - mSignal(filenames[0]); - } - else - { - mSignal(std::string()); - } - } - - static void open(LLFilePicker::ESaveFilter filter, const std::string& default_name, boost::function notify_slot) - { - (new FSSnapshotSaveFilePicker(filter, default_name, notify_slot))->getFile(); - } - -protected: - boost::signals2::signal mSignal; -}; -// - class RecordToChatConsoleRecorder : public LLError::Recorder { public: @@ -5560,106 +5528,15 @@ BOOL LLViewerWindow::mousePointOnLandGlobal(const S32 x, const S32 y, LLVector3d return FALSE; } -// Threaded filepickers -void do_save_image(LLImageFormatted* image, const std::string& snapshot_dir, const std::string& base_name, const std::string& extension, boost::function callback) -{ - if (snapshot_dir.empty() || !LLFile::isdir(snapshot_dir)) - { - if (callback) - { - callback(false); - } - return; - } - -// Check if there is enough free space to save snapshot -#ifdef LL_WINDOWS - boost::filesystem::space_info b_space = boost::filesystem::space(utf8str_to_utf16str(snapshot_dir)); -#else - boost::filesystem::space_info b_space = boost::filesystem::space(snapshot_dir); -#endif - if (b_space.free < image->getDataSize()) - { - if (callback) - { - callback(false); - } - return; - } - - // Look for an unused file name - std::string filepath; - S32 i = 1; - S32 err = 0; - - do - { - filepath = snapshot_dir; - filepath += gDirUtilp->getDirDelimiter(); - filepath += base_name; - filepath += llformat("_%.3d",i); - filepath += extension; - - llstat stat_info; - err = LLFile::stat( filepath, &stat_info ); - i++; - } - while( -1 != err ); // search until the file is not found (i.e., stat() gives an error). - - LL_INFOS() << "Saving snapshot to " << filepath << LL_ENDL; - - if (gSavedSettings.getBOOL("FSLogSnapshotsToLocal")) - { - LLStringUtil::format_map_t args; - args["FILENAME"] = filepath; - report_to_nearby_chat(LLTrans::getString("SnapshotSavedToDisk", args)); - } - - bool success = image->save(filepath); - if (callback) - { - callback(success); - } -} - -void LLViewerWindow::saveImageCallback(const std::string& filename, LLImageFormatted* image, const std::string& extension, boost::function callback) -{ - if (!filename.empty()) - { - gSavedPerAccountSettings.setString("SnapshotBaseName", gDirUtilp->getBaseFileName(filename, true)); - gSavedPerAccountSettings.setString("SnapshotBaseDir", gDirUtilp->getDirName(filename)); - - do_save_image(image, sSnapshotDir, sSnapshotBaseName, extension, callback); - return; - } - - if (callback) - { - callback(false); - } -} -// - // Saves an image to the harddrive as "SnapshotX" where X >= 1. -// Threaded filepickers -//BOOL LLViewerWindow::saveImageNumbered(LLImageFormatted *image, BOOL force_picker, BOOL& insufficient_memory) -void LLViewerWindow::saveImageNumbered(LLImageFormatted *image, bool force_picker, boost::function callback) -// +BOOL LLViewerWindow::saveImageNumbered(LLImageFormatted *image, BOOL force_picker, BOOL& insufficient_memory) { - // Threaded filepickers - //insufficient_memory = FALSE; + insufficient_memory = FALSE; if (!image) { LL_WARNS() << "No image to save" << LL_ENDL; - // Threaded filepickers - //return FALSE; - if (callback) - { - callback(false); - return; - } - // + return FALSE; } LLFilePicker::ESaveFilter pick_type; @@ -5677,87 +5554,74 @@ void LLViewerWindow::saveImageNumbered(LLImageFormatted *image, bool force_picke else pick_type = LLFilePicker::FFSAVE_ALL; // ??? - // Threaded filepickers - //BOOL is_snapshot_name_loc_set = isSnapshotLocSet(); - - //// Get a base file location if needed. - //if (force_picker || !isSnapshotLocSet()) - //{ - // std::string proposed_name( sSnapshotBaseName ); - - // // getSaveFile will append an appropriate extension to the proposed name, based on the ESaveFilter constant passed in. - - // // pick a directory in which to save - // LLFilePicker& picker = LLFilePicker::instance(); - // if (!picker.getSaveFile(pick_type, proposed_name)) - // { - // // Clicked cancel - // return FALSE; - // } - - // // Copy the directory + file name - // std::string filepath = picker.getFirstFile(); - - // gSavedPerAccountSettings.setString("SnapshotBaseName", gDirUtilp->getBaseFileName(filepath, true)); - // gSavedPerAccountSettings.setString("SnapshotBaseDir", gDirUtilp->getDirName(filepath)); - //} - - //std::string snapshot_dir = sSnapshotDir; - //if(snapshot_dir.empty()) - //{ - // return FALSE; - //} - -// Check if there is enough free space to save snapshot -//#ifdef LL_WINDOWS -// boost::filesystem::space_info b_space = boost::filesystem::space(utf8str_to_utf16str(snapshot_dir)); -//#else -// boost::filesystem::space_info b_space = boost::filesystem::space(snapshot_dir); -//#endif -// if (b_space.free < image->getDataSize()) -// { -// insufficient_memory = TRUE; -// return FALSE; -// } - //// Look for an unused file name - //std::string filepath; - //S32 i = 1; - //S32 err = 0; - - //do - //{ - // filepath = sSnapshotDir; - // filepath += gDirUtilp->getDirDelimiter(); - // filepath += sSnapshotBaseName; - - // if (is_snapshot_name_loc_set) - // { - // filepath += llformat("_%.3d",i); - // } - - // filepath += extension; - - // llstat stat_info; - // err = LLFile::stat( filepath, &stat_info ); - // i++; - //} - //while( -1 != err // Search until the file is not found (i.e., stat() gives an error). - // && is_snapshot_name_loc_set); // Or stop if we are rewriting. - - //LL_INFOS() << "Saving snapshot to " << filepath << LL_ENDL; - //return image->save(filepath); + BOOL is_snapshot_name_loc_set = isSnapshotLocSet(); // Get a base file location if needed. - if (force_picker || !isSnapshotLocSet() || !LLFile::isdir(sSnapshotDir())) + if (force_picker || !isSnapshotLocSet()) { std::string proposed_name( sSnapshotBaseName ); - FSSnapshotSaveFilePicker::open(pick_type, proposed_name, boost::bind(&LLViewerWindow::saveImageCallback, this, _1, image, extension, callback)); - return; + // getSaveFile will append an appropriate extension to the proposed name, based on the ESaveFilter constant passed in. + + // pick a directory in which to save + LLFilePicker& picker = LLFilePicker::instance(); + if (!picker.getSaveFile(pick_type, proposed_name)) + { + // Clicked cancel + return FALSE; + } + + // Copy the directory + file name + std::string filepath = picker.getFirstFile(); + + gSavedPerAccountSettings.setString("SnapshotBaseName", gDirUtilp->getBaseFileName(filepath, true)); + gSavedPerAccountSettings.setString("SnapshotBaseDir", gDirUtilp->getDirName(filepath)); } - do_save_image(image, sSnapshotDir, sSnapshotBaseName, extension, callback); - // + std::string snapshot_dir = sSnapshotDir; + if(snapshot_dir.empty()) + { + return FALSE; + } + +// Check if there is enough free space to save snapshot +#ifdef LL_WINDOWS + boost::filesystem::space_info b_space = boost::filesystem::space(utf8str_to_utf16str(snapshot_dir)); +#else + boost::filesystem::space_info b_space = boost::filesystem::space(snapshot_dir); +#endif + if (b_space.free < image->getDataSize()) + { + insufficient_memory = TRUE; + return FALSE; + } + // Look for an unused file name + std::string filepath; + S32 i = 1; + S32 err = 0; + + do + { + filepath = sSnapshotDir; + filepath += gDirUtilp->getDirDelimiter(); + filepath += sSnapshotBaseName; + + if (is_snapshot_name_loc_set) + { + filepath += llformat("_%.3d",i); + } + + filepath += extension; + + llstat stat_info; + err = LLFile::stat( filepath, &stat_info ); + i++; + } + while( -1 != err // Search until the file is not found (i.e., stat() gives an error). + && is_snapshot_name_loc_set); // Or stop if we are rewriting. + + LL_INFOS() << "Saving snapshot to " << filepath << LL_ENDL; + return image->save(filepath); } void LLViewerWindow::resetSnapshotLoc() diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 5f973e832b..ef159e178a 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -353,11 +353,7 @@ public: BOOL thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, BOOL show_ui, BOOL do_rebuild, LLSnapshotModel::ESnapshotLayerType type); BOOL isSnapshotLocSet() const; void resetSnapshotLoc() const; - // Threaded filepickers BOOL saveImageNumbered(LLImageFormatted *image, BOOL force_picker, BOOL& insufficient_memory); - void saveImageNumbered(LLImageFormatted *image, bool force_picker = false, boost::function callback = NULL); - void saveImageCallback(const std::string& filename, LLImageFormatted* image, const std::string& extension, boost::function callback); - // // Reset the directory where snapshots are saved. // Client will open directory picker on next snapshot save. From 5f890af7077157f7a0bf161d5aebf48dceb1a2ac Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 13 Jun 2018 20:28:26 +0300 Subject: [PATCH 22/68] MAINT-8731 Click action to disable clicking objects, per-object in a linkset --- indra/llcommon/indra_constants.h | 1 + indra/newview/llpanelpermissions.cpp | 7 +++++++ indra/newview/llsidepaneltaskinfo.cpp | 2 ++ indra/newview/lltoolpie.cpp | 6 ++++++ indra/newview/skins/default/xui/en/floater_tools.xml | 4 ++++ .../skins/default/xui/en/sidepanel_task_info.xml | 12 ++++++++---- 6 files changed, 28 insertions(+), 4 deletions(-) diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h index fda84aa5a8..a00a82aff0 100644 --- a/indra/llcommon/indra_constants.h +++ b/indra/llcommon/indra_constants.h @@ -323,6 +323,7 @@ const U8 CLICK_ACTION_OPEN = 4; const U8 CLICK_ACTION_PLAY = 5; const U8 CLICK_ACTION_OPEN_MEDIA = 6; const U8 CLICK_ACTION_ZOOM = 7; +const U8 CLICK_ACTION_DISABLED = 8; // DO NOT CHANGE THE SEQUENCE OF THIS LIST!! diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index a7c53a7050..fc44ce340c 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -100,6 +100,10 @@ U8 string_value_to_click_action(std::string p_value) { return CLICK_ACTION_ZOOM; } + if (p_value == "None") + { + return CLICK_ACTION_DISABLED; + } return CLICK_ACTION_TOUCH; } @@ -126,6 +130,9 @@ std::string click_action_to_string_value( U8 action) case CLICK_ACTION_ZOOM: return "Zoom"; break; + case CLICK_ACTION_DISABLED: + return "None"; + break; } } diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index f73722521a..f03c7abc4d 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -1130,6 +1130,8 @@ static U8 string_value_to_click_action(std::string p_value) return CLICK_ACTION_OPEN; if (p_value == "Zoom") return CLICK_ACTION_ZOOM; + if (p_value == "None") + return CLICK_ACTION_DISABLED; return CLICK_ACTION_TOUCH; } diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index f473000657..6a8843cb44 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -300,6 +300,8 @@ BOOL LLToolPie::handleLeftClickPick() } } return TRUE; + case CLICK_ACTION_DISABLED: + return TRUE; default: // nothing break; @@ -463,6 +465,8 @@ ECursorType LLToolPie::cursorFromObject(LLViewerObject* object) case CLICK_ACTION_OPEN_MEDIA: cursor = cursor_from_parcel_media(click_action); break; + case CLICK_ACTION_DISABLED: + break; default: break; } @@ -528,6 +532,8 @@ void LLToolPie::selectionPropertiesReceived() case CLICK_ACTION_OPEN: LLFloaterReg::showInstance("openobject"); break; + case CLICK_ACTION_DISABLED: + break; default: break; } diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index ed3cc26851..bdcf3648fa 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -1115,6 +1115,10 @@ label="Zoom" name="Zoom" value="Zoom" /> + - + + Date: Thu, 14 Jun 2018 18:30:40 +0300 Subject: [PATCH 23/68] MAINT-8395 Rollback part of SL-711 to fix related crashes --- indra/newview/lltexturecache.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 2a0d961952..dd5dce3279 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -2027,13 +2027,15 @@ 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->scaled(w, h); + raw = raw->duplicate(); if (raw->isBufferInvalid()) { LL_WARNS() << "Invalid image duplicate buffer" << LL_ENDL; return false; } + raw->scale(w, h); + discardlevel += i ; } } From 984ea33f7bca79802b5bae7cb782b21793ab978e Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Thu, 14 Jun 2018 18:51:18 +0300 Subject: [PATCH 24/68] MAINT-8750 Add transparency indicator for invisiprims. --- indra/newview/lldrawpoolalpha.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index b0d48abb14..0873300cd2 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -328,6 +328,9 @@ void LLDrawPoolAlpha::render(S32 pass) gGL.diffuseColor4f(0, 0, 1, 1); pushBatches(LLRenderPass::PASS_MATERIAL_ALPHA_MASK, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE); + gGL.diffuseColor4f(0, 1, 0, 1); + pushBatches(LLRenderPass::PASS_INVISIBLE, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE); + if(shaders) { gHighlightProgram.unbind(); From c250ec6629eadf9250240d9f8fe7ff94d98356d8 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Sat, 16 Jun 2018 16:56:30 +0300 Subject: [PATCH 25/68] MAINT-8731 Fixed wrong value --- indra/newview/skins/default/xui/en/sidepanel_task_info.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/sidepanel_task_info.xml b/indra/newview/skins/default/xui/en/sidepanel_task_info.xml index 9f12e50fd1..efedb9559e 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_task_info.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_task_info.xml @@ -299,7 +299,7 @@ + value="None" /> Date: Mon, 18 Jun 2018 12:49:11 +0300 Subject: [PATCH 26/68] MAINT-8751 Add a link to create an account to the viewer login screen --- indra/newview/llpanellogin.cpp | 13 +++++++++++++ indra/newview/llpanellogin.h | 1 + .../skins/default/xui/en/panel_login.xml | 17 ++++++++++++++++- .../skins/default/xui/en/panel_login_first.xml | 15 +++++++++++++++ 4 files changed, 45 insertions(+), 1 deletion(-) diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index ef5ce155b1..142dea83e2 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -204,6 +204,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, // change z sort of clickable text to be behind buttons sendChildToBack(getChildView("forgot_password_text")); + sendChildToBack(getChildView("sign_up_text")); LLComboBox* favorites_combo = getChild("start_location_combo"); updateLocationSelectorsVisibility(); // separate so that it can be called from preferences @@ -271,6 +272,9 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, LLTextBox* forgot_password_text = getChild("forgot_password_text"); forgot_password_text->setClickedCallback(onClickForgotPassword, NULL); + LLTextBox* sign_up_text = getChild("sign_up_text"); + sign_up_text->setClickedCallback(onClickSignUp, NULL); + // get the web browser control LLMediaCtrl* web_browser = getChild("login_html"); web_browser->addObserver(this); @@ -921,6 +925,15 @@ void LLPanelLogin::onClickForgotPassword(void*) } } +//static +void LLPanelLogin::onClickSignUp(void*) +{ + if (sInstance) + { + LLWeb::loadURLExternal(sInstance->getString("sign_up_url")); + } +} + // static void LLPanelLogin::onPassKey(LLLineEditor* caller, void* user_data) { diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index 852195b304..c633582d89 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -99,6 +99,7 @@ private: static void onClickNewAccount(void*); static void onClickVersion(void*); static void onClickForgotPassword(void*); + static void onClickSignUp(void*); static void onPassKey(LLLineEditor* caller, void* user_data); static void updateServerCombo(); diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index 3a34bcbe21..7759d4fdb2 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -12,6 +12,10 @@ name="forgot_password_url"> http://secondlife.com/account/request.php + + https://join.secondlife.com/ + + width="149" /> + + Sign up + http://secondlife.com/account/request.php + + https://join.secondlife.com/ + Forgotten password + + Sign up + Date: Mon, 18 Jun 2018 17:49:49 +0300 Subject: [PATCH 27/68] MAINT-8759 FIXED [Win] Choosing new cache location will cause disconnect if you do not choose desired path in File picker quickly --- indra/newview/llappviewer.cpp | 5 +- indra/newview/lldirpicker.cpp | 153 +++++++++++++++++++++----- indra/newview/lldirpicker.h | 42 ++++++- indra/newview/llfloaterpreference.cpp | 45 ++++---- indra/newview/llfloaterpreference.h | 2 + 5 files changed, 193 insertions(+), 54 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index b9e2657351..acec68f393 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -42,6 +42,7 @@ #include "llagentlanguage.h" #include "llagentui.h" #include "llagentwearables.h" +#include "lldirpicker.h" #include "llfloaterimcontainer.h" #include "llimprocessing.h" #include "llwindow.h" @@ -1985,6 +1986,7 @@ bool LLAppViewer::cleanup() mAppCoreHttp.cleanup(); SUBSYSTEM_CLEANUP(LLFilePickerThread); + SUBSYSTEM_CLEANUP(LLDirPickerThread); //MUST happen AFTER SUBSYSTEM_CLEANUP(LLCurl) delete sTextureCache; @@ -2155,6 +2157,7 @@ bool LLAppViewer::initThreads() gMeshRepo.init(); LLFilePickerThread::initClass(); + LLDirPickerThread::initClass(); // *FIX: no error handling here! return true; @@ -4589,7 +4592,7 @@ void LLAppViewer::idle() LLSmoothInterpolation::updateInterpolants(); LLMortician::updateClass(); LLFilePickerThread::clearDead(); //calls LLFilePickerThread::notify() - + LLDirPickerThread::clearDead(); F32 dt_raw = idle_timer.getElapsedTimeAndResetF32(); // Cap out-of-control frame times diff --git a/indra/newview/lldirpicker.cpp b/indra/newview/lldirpicker.cpp index 5c4f0f4d5d..768b1c2021 100644 --- a/indra/newview/lldirpicker.cpp +++ b/indra/newview/lldirpicker.cpp @@ -77,6 +77,14 @@ LLDirPicker::LLDirPicker() : mFileName(NULL), mLocked(false) { + bi.hwndOwner = NULL; + bi.pidlRoot = NULL; + bi.pszDisplayName = NULL; + bi.lpszTitle = NULL; + bi.ulFlags = BIF_USENEWUI; + bi.lpfn = NULL; + bi.lParam = NULL; + bi.iImage = 0; } LLDirPicker::~LLDirPicker() @@ -84,7 +92,7 @@ LLDirPicker::~LLDirPicker() // nothing } -BOOL LLDirPicker::getDir(std::string* filename) +BOOL LLDirPicker::getDir(std::string filename, bool blocking) { if( mLocked ) { @@ -99,39 +107,39 @@ BOOL LLDirPicker::getDir(std::string* filename) BOOL success = FALSE; - // Modal, so pause agent - send_agent_pause(); + + if (blocking) + { + // Modal, so pause agent + send_agent_pause(); + } - BROWSEINFO bi; - memset(&bi, 0, sizeof(bi)); + bi.hwndOwner = (HWND)gViewerWindow->getPlatformWindow(); - bi.ulFlags = BIF_USENEWUI; - bi.hwndOwner = (HWND)gViewerWindow->getPlatformWindow(); - bi.lpszTitle = NULL; + ::OleInitialize(NULL); + LPITEMIDLIST pIDL = ::SHBrowseForFolder(&bi); - ::OleInitialize(NULL); + if(pIDL != NULL) + { + WCHAR buffer[_MAX_PATH] = {'\0'}; - LPITEMIDLIST pIDL = ::SHBrowseForFolder(&bi); + if(::SHGetPathFromIDList(pIDL, buffer) != 0) + { + // Set the string value. - if(pIDL != NULL) - { - WCHAR buffer[_MAX_PATH] = {'\0'}; + mDir = utf16str_to_utf8str(llutf16string(buffer)); + success = TRUE; + } + // free the item id list + CoTaskMemFree(pIDL); + } - if(::SHGetPathFromIDList(pIDL, buffer) != 0) - { - // Set the string value. + ::OleUninitialize(); - mDir = utf16str_to_utf8str(llutf16string(buffer)); - success = TRUE; - } - - // free the item id list - CoTaskMemFree(pIDL); - } - - ::OleUninitialize(); - - send_agent_resume(); + if (blocking) + { + send_agent_resume(); + } // Account for the fact that the app has been stalled. LLFrameTimer::updateFrameTime(); @@ -267,3 +275,94 @@ std::string LLDirPicker::getDirName() } #endif + + +LLMutex* LLDirPickerThread::sMutex = NULL; +std::queue LLDirPickerThread::sDeadQ; + +void LLDirPickerThread::getFile() +{ +#if LL_WINDOWS + start(); +#else + run(); +#endif +} + +//virtual +void LLDirPickerThread::run() +{ +#if LL_WINDOWS + bool blocking = false; +#else + bool blocking = true; // modal +#endif + + LLDirPicker picker; + + if (picker.getDir(mProposedName, blocking)) + { + mResponses.push_back(picker.getDirName()); + } + + { + LLMutexLock lock(sMutex); + sDeadQ.push(this); + } + +} + +//static +void LLDirPickerThread::initClass() +{ + sMutex = new LLMutex(NULL); +} + +//static +void LLDirPickerThread::cleanupClass() +{ + clearDead(); + + delete sMutex; + sMutex = NULL; +} + +//static +void LLDirPickerThread::clearDead() +{ + if (!sDeadQ.empty()) + { + LLMutexLock lock(sMutex); + while (!sDeadQ.empty()) + { + LLDirPickerThread* thread = sDeadQ.front(); + thread->notify(thread->mResponses); + delete thread; + sDeadQ.pop(); + } + } +} + +LLDirPickerThread::LLDirPickerThread(const dir_picked_signal_t::slot_type& cb, const std::string &proposed_name) + : LLThread("dir picker"), + mFilePickedSignal(NULL) +{ + mFilePickedSignal = new dir_picked_signal_t(); + mFilePickedSignal->connect(cb); +} + +LLDirPickerThread::~LLDirPickerThread() +{ + delete mFilePickedSignal; +} + +void LLDirPickerThread::notify(const std::vector& filenames) +{ + if (!filenames.empty()) + { + if (mFilePickedSignal) + { + (*mFilePickedSignal)(filenames, mProposedName); + } + } +} diff --git a/indra/newview/lldirpicker.h b/indra/newview/lldirpicker.h index 8656b23afd..c1087c70ac 100644 --- a/indra/newview/lldirpicker.h +++ b/indra/newview/lldirpicker.h @@ -33,6 +33,13 @@ #include "stdtypes.h" +#include "llthread.h" +#include + +#if LL_WINDOWS +#include +#endif + #if LL_DARWIN // AssertMacros.h does bad things. @@ -53,7 +60,7 @@ public: // calling this before main() is undefined static LLDirPicker& instance( void ) { return sInstance; } - BOOL getDir(std::string* filename); + BOOL getDir(std::string filename, bool blocking = true); std::string getDirName(); // clear any lists of buffers or whatever, and make sure the dir @@ -76,11 +83,15 @@ private: LLFilePicker *mFilePicker; #endif + std::string* mFileName; std::string mDir; bool mLocked; static LLDirPicker sInstance; +#if LL_WINDOWS + BROWSEINFO bi; +#endif public: // don't call these directly please. @@ -88,4 +99,33 @@ public: ~LLDirPicker(); }; +class LLDirPickerThread : public LLThread +{ +public: + + static std::queue sDeadQ; + static LLMutex* sMutex; + + static void initClass(); + static void cleanupClass(); + static void clearDead(); + + std::vector mResponses; + std::string mProposedName; + + typedef boost::signals2::signal& filenames, std::string proposed_name)> dir_picked_signal_t; + + LLDirPickerThread(const dir_picked_signal_t::slot_type& cb, const std::string &proposed_name); + ~LLDirPickerThread(); + + void getFile(); + + virtual void run(); + + virtual void notify(const std::vector& filenames); + +private: + dir_picked_signal_t* mFilePickedSignal; +}; + #endif diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 9d723bdd9d..4ce35643b1 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1096,16 +1096,15 @@ void LLFloaterPreference::onClickSetCache() std::string proposed_name(cur_name); - LLDirPicker& picker = LLDirPicker::instance(); - if (! picker.getDir(&proposed_name ) ) - { - return; //Canceled! - } + (new LLDirPickerThread(boost::bind(&LLFloaterPreference::changeCachePath, this, _1, _2), proposed_name))->getFile(); +} - std::string dir_name = picker.getDirName(); - if (!dir_name.empty() && dir_name != cur_name) +void LLFloaterPreference::changeCachePath(const std::vector& filenames, std::string proposed_name) +{ + std::string dir_name = filenames[0]; + if (!dir_name.empty() && dir_name != proposed_name) { - std::string new_top_folder(gDirUtilp->getBaseFileName(dir_name)); + std::string new_top_folder(gDirUtilp->getBaseFileName(dir_name)); LLNotificationsUtil::add("CacheWillBeMoved"); gSavedSettings.setString("NewCacheLocation", dir_name); gSavedSettings.setString("NewCacheLocationTopFolder", new_top_folder); @@ -1744,25 +1743,21 @@ void LLFloaterPreference::onClickLogPath() std::string proposed_name(gSavedPerAccountSettings.getString("InstantMessageLogPath")); mPriorInstantMessageLogPath.clear(); - LLDirPicker& picker = LLDirPicker::instance(); - //Launches a directory picker and waits for feedback - if (!picker.getDir(&proposed_name ) ) - { - return; //Canceled! - } - //Gets the path from the directory picker - std::string dir_name = picker.getDirName(); - - //Path changed - if(proposed_name != dir_name) - { - gSavedPerAccountSettings.setString("InstantMessageLogPath", dir_name); - mPriorInstantMessageLogPath = proposed_name; - - // enable/disable 'Delete transcripts button - updateDeleteTranscriptsButton(); + (new LLDirPickerThread(boost::bind(&LLFloaterPreference::changeLogPath, this, _1, _2), proposed_name))->getFile(); } + +void LLFloaterPreference::changeLogPath(const std::vector& filenames, std::string proposed_name) +{ + //Path changed + if (proposed_name != filenames[0]) + { + gSavedPerAccountSettings.setString("InstantMessageLogPath", filenames[0]); + mPriorInstantMessageLogPath = proposed_name; + + // enable/disable 'Delete transcripts button + updateDeleteTranscriptsButton(); + } } bool LLFloaterPreference::moveTranscriptsAndLog() diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 0cd7bac20f..8339a18296 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -133,6 +133,7 @@ public: void setCacheLocation(const LLStringExplicit& location); void onClickSetCache(); + void changeCachePath(const std::vector& filenames, std::string proposed_name); void onClickResetCache(); void onClickSkin(LLUICtrl* ctrl,const LLSD& userdata); void onSelectSkin(); @@ -145,6 +146,7 @@ public: void resetAllIgnored(); void setAllIgnored(); void onClickLogPath(); + void changeLogPath(const std::vector& filenames, std::string proposed_name); bool moveTranscriptsAndLog(); void enableHistory(); void setPersonalInfo(const std::string& visibility, bool im_via_email, bool is_verified_email); From d584d58e13ced5ec18de23fb12f5956a6ae022cf Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Tue, 19 Jun 2018 13:50:22 +0300 Subject: [PATCH 28/68] mac build fixes --- indra/newview/lldirpicker.cpp | 24 ++++++++++++------------ indra/newview/lldirpicker.h | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/indra/newview/lldirpicker.cpp b/indra/newview/lldirpicker.cpp index 768b1c2021..5443afe60c 100644 --- a/indra/newview/lldirpicker.cpp +++ b/indra/newview/lldirpicker.cpp @@ -77,13 +77,13 @@ LLDirPicker::LLDirPicker() : mFileName(NULL), mLocked(false) { - bi.hwndOwner = NULL; - bi.pidlRoot = NULL; - bi.pszDisplayName = NULL; - bi.lpszTitle = NULL; - bi.ulFlags = BIF_USENEWUI; - bi.lpfn = NULL; - bi.lParam = NULL; + bi.hwndOwner = NULL; + bi.pidlRoot = NULL; + bi.pszDisplayName = NULL; + bi.lpszTitle = NULL; + bi.ulFlags = BIF_USENEWUI; + bi.lpfn = NULL; + bi.lParam = NULL; bi.iImage = 0; } @@ -92,7 +92,7 @@ LLDirPicker::~LLDirPicker() // nothing } -BOOL LLDirPicker::getDir(std::string filename, bool blocking) +BOOL LLDirPicker::getDir(std::string* filename, bool blocking) { if( mLocked ) { @@ -175,7 +175,7 @@ void LLDirPicker::reset() //static -BOOL LLDirPicker::getDir(std::string* filename) +BOOL LLDirPicker::getDir(std::string* filename, bool blocking) { LLFilePicker::ELoadFilter filter=LLFilePicker::FFLOAD_DIRECTORY; @@ -209,7 +209,7 @@ void LLDirPicker::reset() mFilePicker->reset(); } -BOOL LLDirPicker::getDir(std::string* filename) +BOOL LLDirPicker::getDir(std::string* filename, bool blocking) { reset(); @@ -264,7 +264,7 @@ void LLDirPicker::reset() { } -BOOL LLDirPicker::getDir(std::string* filename) +BOOL LLDirPicker::getDir(std::string* filename, bool blocking) { return FALSE; } @@ -300,7 +300,7 @@ void LLDirPickerThread::run() LLDirPicker picker; - if (picker.getDir(mProposedName, blocking)) + if (picker.getDir(&mProposedName, blocking)) { mResponses.push_back(picker.getDirName()); } diff --git a/indra/newview/lldirpicker.h b/indra/newview/lldirpicker.h index c1087c70ac..c7dba12130 100644 --- a/indra/newview/lldirpicker.h +++ b/indra/newview/lldirpicker.h @@ -60,7 +60,7 @@ public: // calling this before main() is undefined static LLDirPicker& instance( void ) { return sInstance; } - BOOL getDir(std::string filename, bool blocking = true); + BOOL getDir(std::string* filename, bool blocking = true); std::string getDirName(); // clear any lists of buffers or whatever, and make sure the dir From 253a767fa3ff0ad15bb30044e205d82446d3b0b4 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Tue, 19 Jun 2018 21:20:48 +0300 Subject: [PATCH 29/68] Backed out changeset: 4ce8c663a9a0 STORM-2122: UDP data bandwidth measuring is off by factor 8 --- doc/contributions.txt | 1 - indra/newview/llviewerregion.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index 039d00cbbf..90bbb1c2c6 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -220,7 +220,6 @@ Ansariel Hiller STORM-2151 MAINT-6917 MAINT-8085 - STORM-2122 Aralara Rajal Arare Chantilly CHUIBUG-191 diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index feaafad2e1..52dc3fbb69 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1877,7 +1877,7 @@ void LLViewerRegion::updateNetStats() mLastPacketsLost = mPacketsLost; mPacketsIn = cdp->getPacketsIn(); - mBitsIn = cdp->getBytesIn(); + mBitsIn = 8 * cdp->getBytesIn(); mPacketsOut = cdp->getPacketsOut(); mPacketsLost = cdp->getPacketsLost(); mPingDelay = cdp->getPingDelay(); From 5f8d54d0928ce61eae16f21fc253c8f31acb5de5 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 14 Jun 2018 18:15:12 +0300 Subject: [PATCH 30/68] SL-920 Add new friendship caps to viewer --- indra/newview/llviewermessage.cpp | 180 ++++++++++++++++++++++++------ indra/newview/llviewerregion.cpp | 2 + 2 files changed, 149 insertions(+), 33 deletions(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 0f326efe09..4180da17c2 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -153,6 +153,96 @@ const U8 AU_FLAGS_NONE = 0x00; const U8 AU_FLAGS_HIDETITLE = 0x01; const U8 AU_FLAGS_CLIENT_AUTOPILOT = 0x02; +void accept_friendship_coro(std::string url, LLSD notification) +{ + LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t + httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("friendshipResponceErrorProcessing", httpPolicy)); + LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + if (url.empty()) + { + LL_WARNS() << "Empty capability!" << LL_ENDL; + return; + } + + LLSD payload = notification["payload"]; + url += "?from=" + payload["from_id"].asString(); + url += "&agent_name=\"" + LLURI::escape(gAgentAvatarp->getFullname()) + "\""; + + LLSD result = httpAdapter->getAndSuspend(httpRequest, url); + + LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; + LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); + + if (!status) + { + LL_WARNS() << "HTTP status, " << status.toTerseString() << + ". friendship offer accept failed." << LL_ENDL; + } + else + { + if (!result.has("success") || result["success"].asBoolean() == false) + { + LL_WARNS() << "Server failed to process accepted friendship. " << httpResults << LL_ENDL; + } + else + { + // add friend to recent people list + LLRecentPeople::instance().add(payload["from_id"]); + + LLNotificationsUtil::add("FriendshipAcceptedByMe", + notification["substitutions"], payload); + } + } +} + +void decline_friendship_coro(std::string url, LLSD notification, S32 option) +{ + LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t + httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("friendshipResponceErrorProcessing", httpPolicy)); + LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + if (url.empty()) + { + LL_WARNS() << "Empty capability!" << LL_ENDL; + return; + } + + LLSD payload = notification["payload"]; + url += "?from=" + payload["from_id"].asString(); + + LLSD result = httpAdapter->getAndSuspend(httpRequest, url); + + LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; + LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); + + if (!status) + { + LL_WARNS() << "HTTP status, " << status.toTerseString() << + ". friendship offer decline failed." << LL_ENDL; + } + else + { + if (!result.has("success") || result["success"].asBoolean() == false) + { + LL_WARNS() << "Server failed to process declined friendship. " << httpResults << LL_ENDL; + } + else + { + if (option == 1) + { + LLNotificationsUtil::add("FriendshipDeclinedByMe", + notification["substitutions"], payload); + } + else if (option == 2) + { + // start IM session + LLAvatarActions::startIM(payload["from_id"].asUUID()); + } + } + } +} + bool friendship_offer_callback(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); @@ -163,9 +253,6 @@ bool friendship_offer_callback(const LLSD& notification, const LLSD& response) // this will be skipped if the user offering friendship is blocked if (notification_ptr) { - // add friend to recent people list - LLRecentPeople::instance().add(payload["from_id"]); - switch(option) { case 0: @@ -176,46 +263,73 @@ bool friendship_offer_callback(const LLSD& notification, const LLSD& response) const LLUUID fid = gInventory.findCategoryUUIDForType(LLFolderType::FT_CALLINGCARD); // This will also trigger an onlinenotification if the user is online - msg->newMessageFast(_PREHASH_AcceptFriendship); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->nextBlockFast(_PREHASH_TransactionBlock); - msg->addUUIDFast(_PREHASH_TransactionID, payload["session_id"]); - msg->nextBlockFast(_PREHASH_FolderData); - msg->addUUIDFast(_PREHASH_FolderID, fid); - msg->sendReliable(LLHost(payload["sender"].asString())); + std::string url = gAgent.getRegionCapability("AcceptFriendship"); + if (!url.empty()) + { + LLCoros::instance().launch("LLMessageSystem::acceptFriendshipOffer", + boost::bind(accept_friendship_coro, url, notification)); + } + else if (payload.has("session_id") && payload["session_id"].asUUID().notNull()) + { + msg->newMessageFast(_PREHASH_AcceptFriendship); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->nextBlockFast(_PREHASH_TransactionBlock); + msg->addUUIDFast(_PREHASH_TransactionID, payload["session_id"]); + msg->nextBlockFast(_PREHASH_FolderData); + msg->addUUIDFast(_PREHASH_FolderID, fid); + msg->sendReliable(LLHost(payload["sender"].asString())); - LLSD payload = notification["payload"]; - LLNotificationsUtil::add("FriendshipAcceptedByMe", - notification["substitutions"], payload); + // add friend to recent people list + LLRecentPeople::instance().add(payload["from_id"]); + LLNotificationsUtil::add("FriendshipAcceptedByMe", + notification["substitutions"], payload); + } + else + { + LL_WARNS() << "Failed to accept friendship offer, neither capability nor transaction id are accessible" << LL_ENDL; + } break; } case 1: // Decline - { - LLSD payload = notification["payload"]; - LLNotificationsUtil::add("FriendshipDeclinedByMe", - notification["substitutions"], payload); - } // fall-through case 2: // Send IM - decline and start IM session { // decline // We no longer notify other viewers, but we DO still send - // the rejection to the simulator to delete the pending userop. - msg->newMessageFast(_PREHASH_DeclineFriendship); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->nextBlockFast(_PREHASH_TransactionBlock); - msg->addUUIDFast(_PREHASH_TransactionID, payload["session_id"]); - msg->sendReliable(LLHost(payload["sender"].asString())); + // the rejection to the simulator to delete the pending userop. + std::string url = gAgent.getRegionCapability("DeclineFriendship"); + if (!url.empty()) + { + LLCoros::instance().launch("LLMessageSystem::declineFriendshipOffer", + boost::bind(decline_friendship_coro, url, notification, option)); + } + else if (payload.has("session_id") && payload["session_id"].asUUID().notNull()) + { + msg->newMessageFast(_PREHASH_DeclineFriendship); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->nextBlockFast(_PREHASH_TransactionBlock); + msg->addUUIDFast(_PREHASH_TransactionID, payload["session_id"]); + msg->sendReliable(LLHost(payload["sender"].asString())); - // start IM session - if(2 == option) - { - LLAvatarActions::startIM(payload["from_id"].asUUID()); - } + if (option == 1) // due to fall-through + { + LLNotificationsUtil::add("FriendshipDeclinedByMe", + notification["substitutions"], payload); + } + else if (option == 2) + { + // start IM session + LLAvatarActions::startIM(payload["from_id"].asUUID()); + } + } + else + { + LL_WARNS() << "Failed to decline friendship offer, neither capability nor transaction id are accessible" << LL_ENDL; + } } default: // close button probably, possibly timed out diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 52dc3fbb69..832dcc2dd8 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -2817,6 +2817,7 @@ void LLViewerRegion::unpackRegionHandshake() void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) { capabilityNames.append("AbuseCategories"); + capabilityNames.append("AcceptFriendship"); capabilityNames.append("AgentPreferences"); capabilityNames.append("AgentState"); capabilityNames.append("AttachmentResources"); @@ -2826,6 +2827,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("ChatSessionRequest"); capabilityNames.append("CopyInventoryFromNotecard"); capabilityNames.append("CreateInventoryCategory"); + capabilityNames.append("DeclineFriendship"); capabilityNames.append("DispatchRegionInfo"); capabilityNames.append("DirectDelivery"); capabilityNames.append("EnvironmentSettings"); From 112d3de66f21901c5d0d8b74ed5e10e1dcf34f4f Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Wed, 20 Jun 2018 16:28:53 +0300 Subject: [PATCH 31/68] MAINT-8764 FIXED Crash in LLViewerWindow::saveImageNumbered() --- indra/newview/llviewerwindow.cpp | 9 +++++++++ indra/newview/skins/default/xui/en/notifications.xml | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 846b902260..cef19c9c2d 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4436,6 +4436,15 @@ void LLViewerWindow::saveImageLocal(LLImageFormatted *image, const snapshot_save #else boost::filesystem::path b_path(lastSnapshotDir); #endif + if (!boost::filesystem::is_directory(b_path)) + { + LLSD args; + args["PATH"] = lastSnapshotDir; + LLNotificationsUtil::add("SnapshotToLocalDirNotExist", args); + resetSnapshotLoc(); + failure_cb(); + return; + } boost::filesystem::space_info b_space = boost::filesystem::space(b_path); if (b_space.free < image->getDataSize()) { diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 7f9dc0c41f..8822e9dbc5 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -8260,6 +8260,11 @@ Failed to save appearance to XML. Failed to save snapshot to [PATH]: Disk is full. [NEED_MEMORY]KB is required but only [FREE_MEMORY]KB is free. + +Failed to save snapshot to [PATH]: Directory does not exist. + + Date: Thu, 21 Jun 2018 12:55:43 +0300 Subject: [PATCH 32/68] MAINT-8754 FIXED Premium Voice Morphs subscription renewal sends to wrong location --- indra/newview/llvoicevivox.cpp | 1 + indra/newview/skins/default/xui/en/notifications.xml | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index da4b6a5008..6a3242b43f 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -6193,6 +6193,7 @@ void LLVivoxVoiceClient::expireVoiceFonts() LLSD args; args["URL"] = LLTrans::getString("voice_morphing_url"); + args["PREMIUM_URL"] = LLTrans::getString("premium_voice_morphing_url"); // Give a notification if any voice fonts have expired. if (have_expired) diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 8822e9dbc5..6b164c660a 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -8102,6 +8102,8 @@ Failed to connect to [VOICE_CHANNEL_NAME], please try again later. You will now One or more of your subscribed Voice Morphs has expired. [[URL] Click here] to renew your subscription. + +If you are a Premium Member, [[PREMIUM_URL] click here] to receive your voice morphing perk. fail voice @@ -8115,6 +8117,8 @@ One or more of your subscribed Voice Morphs has expired. The active Voice Morph has expired, your normal voice settings have been applied. [[URL] Click here] to renew your subscription. + +If you are a Premium Member, [[PREMIUM_URL] click here] to receive your voice morphing perk. fail voice @@ -8128,6 +8132,8 @@ The active Voice Morph has expired, your normal voice settings have been applied One or more of your Voice Morphs will expire in less than [INTERVAL] days. [[URL] Click here] to renew your subscription. + +If you are a Premium Member, [[PREMIUM_URL] click here] to receive your voice morphing perk. fail voice From 48f1c0099dd9ba52a0ce9a36a61d3f52d1ab66d5 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 19 Jun 2018 19:02:12 +0300 Subject: [PATCH 33/68] MAINT-4743 Save sounds that arrived too early and use on object update --- indra/newview/llviewermessage.cpp | 150 ++++++++++++++++++++++++++---- 1 file changed, 134 insertions(+), 16 deletions(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 4180da17c2..6cba7dd70c 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3372,6 +3372,110 @@ void send_agent_update(BOOL force_send, BOOL send_reliable) } +// sounds can arrive before objects, store them for a short time +// Note: this is a workaround for MAINT-4743, real fix would be to make +// server send sound along with object update that creates (rezes) the object +class PostponedSoundData +{ +public: + PostponedSoundData() : + mExpirationTime(0) + {} + PostponedSoundData(const LLUUID &object_id, const LLUUID &sound_id, const LLUUID& owner_id, const F32 gain, const U8 flags); + bool hasExpired() { return LLFrameTimer::getTotalSeconds() > mExpirationTime; } + + LLUUID mObjectId; + LLUUID mSoundId; + LLUUID mOwnerId; + F32 mGain; + U8 mFlags; + static const F64 MAXIMUM_PLAY_DELAY; + +private: + F64 mExpirationTime; //seconds since epoch +}; +const F64 PostponedSoundData::MAXIMUM_PLAY_DELAY = 15.0; +static F64 postponed_sounds_update_expiration = 0.0; +static std::map postponed_sounds; + +void set_attached_sound(LLViewerObject *objectp, const LLUUID &object_id, const LLUUID &sound_id, const LLUUID& owner_id, const F32 gain, const U8 flags) +{ + if (LLMuteList::getInstance()->isMuted(object_id)) return; + + if (LLMuteList::getInstance()->isMuted(owner_id, LLMute::flagObjectSounds)) return; + + // Don't play sounds from a region with maturity above current agent maturity + LLVector3d pos = objectp->getPositionGlobal(); + if (!gAgent.canAccessMaturityAtGlobal(pos)) + { + return; + } + + objectp->setAttachedSound(sound_id, owner_id, gain, flags); +} + +PostponedSoundData::PostponedSoundData(const LLUUID &object_id, const LLUUID &sound_id, const LLUUID& owner_id, const F32 gain, const U8 flags) + : + mObjectId(object_id), + mSoundId(sound_id), + mOwnerId(owner_id), + mGain(gain), + mFlags(flags), + mExpirationTime(LLFrameTimer::getTotalSeconds() + MAXIMUM_PLAY_DELAY) +{ +} + +// static +void update_attached_sounds() +{ + if (postponed_sounds.empty()) + { + return; + } + + std::map::iterator iter = postponed_sounds.begin(); + std::map::iterator end = postponed_sounds.end(); + while (iter != end) + { + std::map::iterator cur_iter = iter++; + PostponedSoundData* data = &cur_iter->second; + if (data->hasExpired()) + { + postponed_sounds.erase(cur_iter); + } + else + { + LLViewerObject *objectp = gObjectList.findObject(data->mObjectId); + if (objectp) + { + set_attached_sound(objectp, data->mObjectId, data->mSoundId, data->mOwnerId, data->mGain, data->mFlags); + postponed_sounds.erase(cur_iter); + } + } + } + postponed_sounds_update_expiration = LLFrameTimer::getTotalSeconds() + 2 * PostponedSoundData::MAXIMUM_PLAY_DELAY; +} + +//static +void clear_expired_postponed_sounds() +{ + if (postponed_sounds_update_expiration > LLFrameTimer::getTotalSeconds()) + { + return; + } + std::map::iterator iter = postponed_sounds.begin(); + std::map::iterator end = postponed_sounds.end(); + while (iter != end) + { + std::map::iterator cur_iter = iter++; + PostponedSoundData* data = &cur_iter->second; + if (data->hasExpired()) + { + postponed_sounds.erase(cur_iter); + } + } + postponed_sounds_update_expiration = LLFrameTimer::getTotalSeconds() + 2 * PostponedSoundData::MAXIMUM_PLAY_DELAY; +} // *TODO: Remove this dependency, or figure out a better way to handle // this hack. @@ -3390,7 +3494,12 @@ void process_object_update(LLMessageSystem *mesgsys, void **user_data) } // Update the object... + S32 old_num_objects = gObjectList.mNumNewObjects; gObjectList.processObjectUpdate(mesgsys, user_data, OUT_FULL); + if (old_num_objects != gObjectList.mNumNewObjects) + { + update_attached_sounds(); + } } void process_compressed_object_update(LLMessageSystem *mesgsys, void **user_data) @@ -3406,7 +3515,12 @@ void process_compressed_object_update(LLMessageSystem *mesgsys, void **user_data } // Update the object... + S32 old_num_objects = gObjectList.mNumNewObjects; gObjectList.processCompressedObjectUpdate(mesgsys, user_data, OUT_FULL_COMPRESSED); + if (old_num_objects != gObjectList.mNumNewObjects) + { + update_attached_sounds(); + } } void process_cached_object_update(LLMessageSystem *mesgsys, void **user_data) @@ -3437,7 +3551,12 @@ void process_terse_object_update_improved(LLMessageSystem *mesgsys, void **user_ gObjectData += (U32Bytes)mesgsys->getReceiveSize(); } + S32 old_num_objects = gObjectList.mNumNewObjects; gObjectList.processCompressedObjectUpdate(mesgsys, user_data, OUT_TERSE_IMPROVED); + if (old_num_objects != gObjectList.mNumNewObjects) + { + update_attached_sounds(); + } } static LLTrace::BlockTimerStatHandle FTM_PROCESS_OBJECTS("Process Kill Objects"); @@ -3659,28 +3778,27 @@ void process_attached_sound(LLMessageSystem *msg, void **user_data) msg->getU8Fast(_PREHASH_DataBlock, _PREHASH_Flags, flags); LLViewerObject *objectp = gObjectList.findObject(object_id); - if (!objectp) + if (objectp) { - // we don't know about this object, just bail - return; + set_attached_sound(objectp, object_id, sound_id, owner_id, gain, flags); } - - if (LLMuteList::getInstance()->isMuted(object_id)) return; - - if (LLMuteList::getInstance()->isMuted(owner_id, LLMute::flagObjectSounds)) return; - - - // Don't play sounds from a region with maturity above current agent maturity - LLVector3d pos = objectp->getPositionGlobal(); - if( !gAgent.canAccessMaturityAtGlobal(pos) ) + else if (sound_id.notNull()) { - return; + // we don't know about this object yet, probably it has yet to arrive + // std::map for dupplicate prevention. + postponed_sounds[object_id] = (PostponedSoundData(object_id, sound_id, owner_id, gain, flags)); + clear_expired_postponed_sounds(); + } + else + { + std::map::iterator iter = postponed_sounds.find(object_id); + if (iter != postponed_sounds.end()) + { + postponed_sounds.erase(iter); + } } - - objectp->setAttachedSound(sound_id, owner_id, gain, flags); } - void process_attached_sound_gain_change(LLMessageSystem *mesgsys, void **user_data) { F32 gain = 0; From e76abf22819c9f03f44e8453f2dc09ef20bbd0ea Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Fri, 22 Jun 2018 17:52:17 +0300 Subject: [PATCH 34/68] SL-857 reverted --- indra/newview/CMakeLists.txt | 2 ++ indra/newview/llfloaterland.cpp | 25 ++++++++++++++++--- indra/newview/llviewerfloaterreg.cpp | 2 ++ .../default/xui/en/floater_about_land.xml | 2 +- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 367d4577ca..2fc722d4c3 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -201,6 +201,7 @@ set(viewer_SOURCE_FILES llflickrconnect.cpp llfloaterabout.cpp llfloaterbvhpreview.cpp + llfloaterauction.cpp llfloaterautoreplacesettings.cpp llfloateravatar.cpp llfloateravatarpicker.cpp @@ -822,6 +823,7 @@ set(viewer_HEADER_FILES llflickrconnect.h llfloaterabout.h llfloaterbvhpreview.h + llfloaterauction.h llfloaterautoreplacesettings.h llfloateravatar.h llfloateravatarpicker.h diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 596b04c31c..88b3fb7b96 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -45,6 +45,7 @@ #include "llcombobox.h" #include "llfloaterreg.h" #include "llfloateravatarpicker.h" +#include "llfloaterauction.h" #include "llfloatergroups.h" #include "llfloaterscriptlimits.h" #include "llavataractions.h" @@ -78,7 +79,6 @@ #include "llpanelexperiencelisteditor.h" #include "llpanelexperiencepicker.h" #include "llexperiencecache.h" -#include "llweb.h" #include "llgroupactions.h" @@ -542,6 +542,7 @@ void LLPanelLandGeneral::refresh() mBtnDeedToGroup->setEnabled(FALSE); mBtnSetGroup->setEnabled(FALSE); + mBtnStartAuction->setEnabled(FALSE); mCheckDeedToGroup ->set(FALSE); mCheckDeedToGroup ->setEnabled(FALSE); @@ -639,6 +640,7 @@ void LLPanelLandGeneral::refresh() mTextClaimDate->setEnabled(FALSE); mTextGroup->setText(getString("none_text")); mTextGroup->setEnabled(FALSE); + mBtnStartAuction->setEnabled(FALSE); } else { @@ -690,6 +692,11 @@ void LLPanelLandGeneral::refresh() LLStringUtil::format (claim_date_str, substitution); mTextClaimDate->setText(claim_date_str); mTextClaimDate->setEnabled(is_leased); + + BOOL enable_auction = (gAgent.getGodLevel() >= GOD_LIAISON) + && (owner_id == GOVERNOR_LINDEN_ID) + && (parcel->getAuctionID() == 0); + mBtnStartAuction->setEnabled(enable_auction); } // Display options @@ -1017,8 +1024,20 @@ void LLPanelLandGeneral::onClickBuyPass(void* data) // static void LLPanelLandGeneral::onClickStartAuction(void* data) { - std::string auction_url = "https://places.[GRID]/auctions/"; - LLWeb::loadURLExternal(LLWeb::expandURLSubstitutions(auction_url, LLSD())); + LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data; + LLParcel* parcelp = panelp->mParcel->getParcel(); + if(parcelp) + { + if(parcelp->getForSale()) + { + LLNotificationsUtil::add("CannotStartAuctionAlreadyForSale"); + } + else + { + //LLFloaterAuction::showInstance(); + LLFloaterReg::showInstance("auction"); + } + } } // static diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 55317bdaf5..0ebacddd9b 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -34,6 +34,7 @@ #include "llcompilequeue.h" #include "llfasttimerview.h" #include "llfloaterabout.h" +#include "llfloaterauction.h" #include "llfloaterautoreplacesettings.h" #include "llfloateravatar.h" #include "llfloateravatarpicker.h" @@ -193,6 +194,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("about_land", "floater_about_land.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("appearance", "floater_my_appearance.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("associate_listing", "floater_associate_listing.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("auction", "floater_auction.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("avatar", "floater_avatar.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("avatar_picker", "floater_avatar_picker.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("avatar_render_settings", "floater_avatar_render_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index cf843a07a6..535af317d9 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -502,7 +502,7 @@ name="Buy Land..." width="130" /> + + + + From 08fd73410e9a7ffb64acb15422fc6836230aa588 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 22 Jun 2018 20:49:40 +0300 Subject: [PATCH 36/68] MAINT-8686 Don't log empty list --- indra/llcommon/llcoros.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/indra/llcommon/llcoros.cpp b/indra/llcommon/llcoros.cpp index 3165ce0743..67e9fad1ab 100644 --- a/indra/llcommon/llcoros.cpp +++ b/indra/llcommon/llcoros.cpp @@ -284,17 +284,20 @@ void LLCoros::setStackSize(S32 stacksize) void LLCoros::printActiveCoroutines() { LL_INFOS("LLCoros") << "Number of active coroutines: " << (S32)mCoros.size() << LL_ENDL; - LL_INFOS("LLCoros") << "-------------- List of active coroutines ------------"; - CoroMap::iterator iter; - CoroMap::iterator end = mCoros.end(); - F64 time = LLTimer::getTotalSeconds(); - for (iter = mCoros.begin(); iter != end; iter++) + if (mCoros.size() > 0) { - F64 life_time = time - iter->second->mCreationTime; - LL_CONT << LL_NEWLINE << "Name: " << iter->first << " life: " << life_time; + LL_INFOS("LLCoros") << "-------------- List of active coroutines ------------"; + CoroMap::iterator iter; + CoroMap::iterator end = mCoros.end(); + F64 time = LLTimer::getTotalSeconds(); + for (iter = mCoros.begin(); iter != end; iter++) + { + F64 life_time = time - iter->second->mCreationTime; + LL_CONT << LL_NEWLINE << "Name: " << iter->first << " life: " << life_time; + } + LL_CONT << LL_ENDL; + LL_INFOS("LLCoros") << "-----------------------------------------------------" << LL_ENDL; } - LL_CONT << LL_ENDL; - LL_INFOS("LLCoros") << "-----------------------------------------------------" << LL_ENDL; } #if LL_WINDOWS From 84e05d14a1af01858a2f099d9619e95d6e8e4f3d Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 22 Jun 2018 22:35:28 +0200 Subject: [PATCH 37/68] Build fix ("hyper" is already defined in some Windows API header) --- indra/newview/fsslurl.cpp | 30 +++++++++++++++--------------- indra/newview/fsslurl.h | 10 +++++----- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/indra/newview/fsslurl.cpp b/indra/newview/fsslurl.cpp index 5307651f5b..a07f2700fa 100644 --- a/indra/newview/fsslurl.cpp +++ b/indra/newview/fsslurl.cpp @@ -325,15 +325,15 @@ LLSLURL::LLSLURL(const std::string& slurl) // (or its a slurl.com or maps.secondlife.com URL). std::string probe_grid; - std::string hyper = slurl_uri.hostNameAndPort(); - std::string hyper_trimmed = LLGridManager::getInstance()->trimHypergrid(hyper); - if (hyper != hyper_trimmed) + std::string hypergrid = slurl_uri.hostNameAndPort(); + std::string hyper_trimmed = LLGridManager::getInstance()->trimHypergrid(hypergrid); + if (hypergrid != hyper_trimmed) { mHypergrid = true; - path_array.insert(0,hyper); + path_array.insert(0, hypergrid); } - probe_grid = LLGridManager::getInstance()->getGridByProbing(hyper); + probe_grid = LLGridManager::getInstance()->getGridByProbing(hypergrid); if (probe_grid.empty()) { probe_grid = LLGridManager::getInstance()->getGridByProbing(slurl_uri.hostName()); @@ -479,8 +479,8 @@ LLSLURL::LLSLURL(const std::string& slurl) } // Create a slurl for the middle of the region -LLSLURL::LLSLURL(const std::string& grid, const std::string& region, bool hyper) -: mHypergrid(hyper) +LLSLURL::LLSLURL(const std::string& grid, const std::string& region, bool hypergrid) +: mHypergrid(hypergrid) { mGrid = grid; mRegion = region; @@ -490,8 +490,8 @@ LLSLURL::LLSLURL(const std::string& grid, const std::string& region, bool hyper) // create a slurl given the position. The position will be modded with the region // width handling global positions as well -LLSLURL::LLSLURL(const std::string& grid, const std::string& region, const LLVector3& position, bool hyper) -: mHypergrid(hyper) +LLSLURL::LLSLURL(const std::string& grid, const std::string& region, const LLVector3& position, bool hypergrid) +: mHypergrid(hypergrid) { mGrid = grid; mRegion = region; @@ -516,15 +516,15 @@ LLSLURL::LLSLURL(const std::string& grid, const std::string& region, const LLVec } // create a simstring -LLSLURL::LLSLURL(const std::string& region, const LLVector3& position, bool hyper) -: mHypergrid(hyper) +LLSLURL::LLSLURL(const std::string& region, const LLVector3& position, bool hypergrid) +: mHypergrid(hypergrid) { *this = LLSLURL(LLGridManager::getInstance()->getGrid(), region, position); } // create a slurl from a global position -LLSLURL::LLSLURL(const std::string& grid, const std::string& region, const LLVector3d& global_position, bool hyper) -: mHypergrid(hyper) +LLSLURL::LLSLURL(const std::string& grid, const std::string& region, const LLVector3d& global_position, bool hypergrid) +: mHypergrid(hypergrid) { // Aurora-sim var region teleports //*this = LLSLURL(grid, @@ -540,8 +540,8 @@ LLSLURL::LLSLURL(const std::string& grid, const std::string& region, const LLVec } // create a slurl from a global position -LLSLURL::LLSLURL(const std::string& region, const LLVector3d& global_position, bool hyper) -: mHypergrid(hyper) +LLSLURL::LLSLURL(const std::string& region, const LLVector3d& global_position, bool hypergrid) +: mHypergrid(hypergrid) { *this = LLSLURL(LLGridManager::getInstance()->getGrid(), region, global_position); } diff --git a/indra/newview/fsslurl.h b/indra/newview/fsslurl.h index ef19cda080..e01764190b 100644 --- a/indra/newview/fsslurl.h +++ b/indra/newview/fsslurl.h @@ -70,11 +70,11 @@ public: LLSLURL(): mType(INVALID) { } LLSLURL(const std::string& slurl); - LLSLURL(const std::string& grid, const std::string& region, bool hyper = false); - LLSLURL(const std::string& region, const LLVector3& position, bool hyper = false); - LLSLURL(const std::string& grid, const std::string& region, const LLVector3& position, bool hyper = false); - LLSLURL(const std::string& grid, const std::string& region, const LLVector3d& global_position, bool hyper = false); - LLSLURL(const std::string& region, const LLVector3d& global_position, bool hyper = false); + LLSLURL(const std::string& grid, const std::string& region, bool hypergrid = false); + LLSLURL(const std::string& region, const LLVector3& position, bool hypergrid = false); + LLSLURL(const std::string& grid, const std::string& region, const LLVector3& position, bool hypergrid = false); + LLSLURL(const std::string& grid, const std::string& region, const LLVector3d& global_position, bool hypergrid = false); + LLSLURL(const std::string& region, const LLVector3d& global_position, bool hypergrid = false); LLSLURL(const std::string& command, const LLUUID&id, const std::string& verb); LLSLURL(const LLSD& path_array, bool from_app); From d05113b408492a0c5281b264f9074278996b320e Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 22 Jun 2018 22:58:07 +0200 Subject: [PATCH 38/68] FIRE-5782: Threaded directory pickers for sound cache directory, settings backup path & LSL preprocessor include path --- indra/newview/llfloaterpreference.cpp | 50 ++++++++++++------------ indra/newview/llfloaterpreference.h | 3 ++ indra/newview/llfloaterscriptedprefs.cpp | 18 ++++----- indra/newview/llfloaterscriptedprefs.h | 1 + 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 691acf5eef..0c9d2c0491 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1721,14 +1721,13 @@ void LLFloaterPreference::onClickSetSoundCache() std::string cur_name(gSavedSettings.getString("FSSoundCacheLocation")); std::string proposed_name(cur_name); - LLDirPicker& picker = LLDirPicker::instance(); - if (! picker.getDir(&proposed_name ) ) - { - return; //Canceled! - } + (new LLDirPickerThread(boost::bind(&LLFloaterPreference::changeSoundCachePath, this, _1, _2), proposed_name))->getFile(); +} - std::string dir_name = picker.getDirName(); - if (!dir_name.empty() && dir_name != cur_name) +void LLFloaterPreference::changeSoundCachePath(const std::vector& filenames, std::string proposed_name) +{ + std::string dir_name = filenames[0]; + if (!dir_name.empty() && dir_name != proposed_name) { gSavedSettings.setString("FSSoundCacheLocation", dir_name); setSoundCacheLocation(dir_name); @@ -1830,19 +1829,17 @@ void LLFloaterPreference::onClickClearSpamList() void LLFloaterPreference::setPreprocInclude() { std::string cur_name(gSavedSettings.getString("_NACL_PreProcHDDIncludeLocation")); - std::string proposed_name(cur_name); + + (new LLDirPickerThread(boost::bind(&LLFloaterPreference::changePreprocIncludePath, this, _1, _2), proposed_name))->getFile(); +} - LLDirPicker& picker = LLDirPicker::instance(); - if (! picker.getDir(&proposed_name ) ) +void LLFloaterPreference::changePreprocIncludePath(const std::vector& filenames, std::string proposed_name) +{ + std::string dir_name = filenames[0]; + if (!dir_name.empty() && dir_name != proposed_name) { - return; //Canceled! - } - - std::string dir_name = picker.getDirName(); - if (!dir_name.empty() && dir_name != cur_name) - { - std::string new_top_folder(gDirUtilp->getBaseFileName(dir_name)); + std::string new_top_folder(gDirUtilp->getBaseFileName(dir_name)); gSavedSettings.setString("_NACL_PreProcHDDIncludeLocation", dir_name); } } @@ -4876,16 +4873,17 @@ BOOL FSPanelPreferenceBackup::postBuild() void FSPanelPreferenceBackup::onClickSetBackupSettingsPath() { std::string dir_name = gSavedSettings.getString("SettingsBackupPath"); - LLDirPicker& picker = LLDirPicker::instance(); - if (!picker.getDir(&dir_name)) - { - // canceled - return; - } + (new LLDirPickerThread(boost::bind(&FSPanelPreferenceBackup::changeBackupSettingsPath, this, _1, _2), dir_name))->getFile(); +} - dir_name = picker.getDirName(); - gSavedSettings.setString("SettingsBackupPath", dir_name); - getChild("settings_backup_path")->setValue(dir_name); +void FSPanelPreferenceBackup::changeBackupSettingsPath(const std::vector& filenames, std::string proposed_name) +{ + std::string dir_name = filenames[0]; + if (!dir_name.empty() && dir_name != proposed_name) + { + gSavedSettings.setString("SettingsBackupPath", dir_name); + getChild("settings_backup_path")->setValue(dir_name); + } } void FSPanelPreferenceBackup::onClickBackupSettings() diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 028bf35c20..63a31e385d 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -171,6 +171,7 @@ public: // Sound cache void setSoundCacheLocation(const LLStringExplicit& location); void onClickSetSoundCache(); + void changeSoundCachePath(const std::vector& filenames, std::string proposed_name); void onClickBrowseSoundCache(); void onClickResetSoundCache(); // @@ -196,6 +197,7 @@ public: // void onClickSetSounds(); // Handled centrally now void onClickPreviewUISound(const LLSD& ui_sound_id); // FIRE-8190: Preview function for "UI Sounds" Panel void setPreprocInclude(); + void changePreprocIncludePath(const std::vector& filenames, std::string proposed_name); void onClickEnablePopup(); void onClickDisablePopup(); void resetAllIgnored(); @@ -474,6 +476,7 @@ public: protected: // Backup settings void onClickSetBackupSettingsPath(); + void changeBackupSettingsPath(const std::vector& filenames, std::string proposed_name); void onClickSelectAll(); void onClickDeselectAll(); void onClickBackupSettings(); diff --git a/indra/newview/llfloaterscriptedprefs.cpp b/indra/newview/llfloaterscriptedprefs.cpp index 300061696b..88db416a29 100644 --- a/indra/newview/llfloaterscriptedprefs.cpp +++ b/indra/newview/llfloaterscriptedprefs.cpp @@ -91,17 +91,15 @@ void LLFloaterScriptEdPrefs::getUIColor(LLUICtrl* ctrl, const LLSD& param) void LLFloaterScriptEdPrefs::setPreprocInclude() { std::string cur_name(gSavedSettings.getString("_NACL_PreProcHDDIncludeLocation")); - std::string proposed_name(cur_name); - - LLDirPicker& picker = LLDirPicker::instance(); - if (!picker.getDir(&proposed_name )) - { - return; //Canceled! - } - - std::string dir_name = picker.getDirName(); - if (!dir_name.empty() && dir_name != cur_name) + + (new LLDirPickerThread(boost::bind(&LLFloaterScriptEdPrefs::changePreprocIncludePath, this, _1, _2), proposed_name))->getFile(); +} + +void LLFloaterScriptEdPrefs::changePreprocIncludePath(const std::vector& filenames, std::string proposed_name) +{ + std::string dir_name = filenames[0]; + if (!dir_name.empty() && dir_name != proposed_name) { std::string new_top_folder(gDirUtilp->getBaseFileName(dir_name)); gSavedSettings.setString("_NACL_PreProcHDDIncludeLocation", dir_name); diff --git a/indra/newview/llfloaterscriptedprefs.h b/indra/newview/llfloaterscriptedprefs.h index 8c1a7e0643..87f545caba 100644 --- a/indra/newview/llfloaterscriptedprefs.h +++ b/indra/newview/llfloaterscriptedprefs.h @@ -47,6 +47,7 @@ private: // Port old FS script prefs void setPreprocInclude(); + void changePreprocIncludePath(const std::vector& filenames, std::string proposed_name); LLScriptEditor* mEditor; }; From 762a0eb0a33642cf839501517d1340f9ab3bcafb Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 22 Jun 2018 23:04:23 +0200 Subject: [PATCH 39/68] Update German translation --- indra/newview/skins/default/xui/de/floater_tools.xml | 1 + indra/newview/skins/default/xui/de/notifications.xml | 9 +++++++++ .../newview/skins/default/xui/de/sidepanel_task_info.xml | 1 + 3 files changed, 11 insertions(+) diff --git a/indra/newview/skins/default/xui/de/floater_tools.xml b/indra/newview/skins/default/xui/de/floater_tools.xml index 5918d4991f..6d8fd21199 100644 --- a/indra/newview/skins/default/xui/de/floater_tools.xml +++ b/indra/newview/skins/default/xui/de/floater_tools.xml @@ -227,6 +227,7 @@ + diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml index 281ce77744..39f40061b7 100644 --- a/indra/newview/skins/default/xui/de/notifications.xml +++ b/indra/newview/skins/default/xui/de/notifications.xml @@ -3358,14 +3358,20 @@ Klicken Sie auf 'Akzeptieren ', um dem Chat beizutreten, oder auf &a Ein oder mehrere Ihrer Voice-Morph-Abos ist/sind abgelaufen. [[URL] Hier klicken], um Ihr Abo zu erneuern. + +Falls Sie Premium-Mitglied sind, klicken Sie [[PREMIUM_URL] hier], um Ihren Voice-Morph-Vorteil zu erhalten. Das aktive Voice-Morph-Abo ist abgelaufen. Ihre normalen Voice-Einstellungen werden angewendet. [[URL] Hier klicken], um Ihr Abo zu erneuern. + +Falls Sie Premium-Mitglied sind, klicken Sie [[PREMIUM_URL] hier], um Ihren Voice-Morph-Vorteil zu erhalten. Ein oder mehrere Ihrer Voice-Morph-Abos werden in weniger als [INTERVAL] Tagen ablaufen. [[URL] Hier klicken], um Ihr Abo zu erneuern. + +Falls Sie Premium-Mitglied sind, klicken Sie [[PREMIUM_URL] hier], um Ihren Voice-Morph-Vorteil zu erhalten. Neue Voice-Morph-Effekte sind erhältlich! @@ -3417,6 +3423,9 @@ Diese werden für ein paar Sekunden sicherheitshalber gesperrt. Fehler beim Speichern des Bildes unter [PATH]: Zu wenig Speicherplatz auf dem Medium. [NEED_MEMORY]KB werden benötigt, es stehen jedoch nur [FREE_MEMORY]KB zur Verfügung. + + Fehler beim Speichern des Bildes unter [PATH]: Verzeichnis existiert nicht. + Fehler beim Speichern der Voreinstellung [NAME]. diff --git a/indra/newview/skins/default/xui/de/sidepanel_task_info.xml b/indra/newview/skins/default/xui/de/sidepanel_task_info.xml index 0308bd72a7..005f5b0f55 100644 --- a/indra/newview/skins/default/xui/de/sidepanel_task_info.xml +++ b/indra/newview/skins/default/xui/de/sidepanel_task_info.xml @@ -34,6 +34,7 @@ + Sie können dieses Objekt bearbeiten. From dcab2e1025b5a48632d1dd9414f8c3e091eaae5f Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 22 Jun 2018 23:20:16 +0200 Subject: [PATCH 40/68] FIRE-5782: Threaded file pickers for export floaters --- indra/newview/daeexport.cpp | 17 +++++++++-------- indra/newview/daeexport.h | 1 + indra/newview/fsfloaterexport.cpp | 19 ++++++++++--------- indra/newview/fsfloaterexport.h | 1 + 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/indra/newview/daeexport.cpp b/indra/newview/daeexport.cpp index b024e875d1..aadd2d09b2 100644 --- a/indra/newview/daeexport.cpp +++ b/indra/newview/daeexport.cpp @@ -81,6 +81,7 @@ #include "lltrans.h" #include "llversioninfo.h" #include "llviewercontrol.h" +#include "llviewermenufile.h" #include "llviewernetwork.h" #include "llviewerregion.h" #include "llviewertexturelist.h" @@ -196,14 +197,14 @@ void ColladaExportFloater::updateUI() void ColladaExportFloater::onClickExport() { - LLFilePicker& file_picker = LLFilePicker::instance(); - if (!file_picker.getSaveFile(LLFilePicker::FFSAVE_COLLADA, LLDir::getScrubbedFileName(mObjectName + ".dae"))) - { - LL_INFOS() << "User closed the filepicker, aborting export!" << LL_ENDL; - return; - } - mFilename = file_picker.getFirstFile(); - + (new LLFilePickerReplyThread(boost::bind(&ColladaExportFloater::onExportFileSelected, this, _1), + LLFilePicker::FFSAVE_COLLADA, LLDir::getScrubbedFileName(mObjectName + ".dae")))->getFile(); +} + +void ColladaExportFloater::onExportFileSelected(const std::vector& filenames) +{ + mFilename = filenames[0]; + if (gSavedSettings.getBOOL("DAEExportTextures")) { saveTextures(); diff --git a/indra/newview/daeexport.h b/indra/newview/daeexport.h index 725f764aff..c0719468ad 100644 --- a/indra/newview/daeexport.h +++ b/indra/newview/daeexport.h @@ -131,6 +131,7 @@ private: void refresh(); void dirty(); void onClickExport(); + void onExportFileSelected(const std::vector& filenames); void onTextureExportCheck(); void onCommitTextureType(); void saveTextures(); diff --git a/indra/newview/fsfloaterexport.cpp b/indra/newview/fsfloaterexport.cpp index 40baea6dd9..0daf51d461 100644 --- a/indra/newview/fsfloaterexport.cpp +++ b/indra/newview/fsfloaterexport.cpp @@ -55,8 +55,9 @@ #include "llvfile.h" #include "llviewercontrol.h" #include "llviewerinventory.h" -#include "llviewerpartsource.h" +#include "llviewermenufile.h" #include "llviewernetwork.h" +#include "llviewerpartsource.h" #include "llviewerregion.h" #include "llviewertexturelist.h" #include "llvovolume.h" @@ -1082,14 +1083,14 @@ void FSFloaterObjectExport::updateUI() void FSFloaterObjectExport::onClickExport() { - LLFilePicker& file_picker = LLFilePicker::instance(); - if(!file_picker.getSaveFile(LLFilePicker::FFSAVE_EXPORT, LLDir::getScrubbedFileName(mObjectName + ".oxp"))) - { - LL_INFOS() << "User closed the filepicker, aborting export!" << LL_ENDL; - return; - } - mFilename = file_picker.getFirstFile(); - + (new LLFilePickerReplyThread(boost::bind(&FSFloaterObjectExport::onExportFileSelected, this, _1), + LLFilePicker::FFSAVE_EXPORT, LLDir::getScrubbedFileName(mObjectName + ".oxp")))->getFile(); +} + +void FSFloaterObjectExport::onExportFileSelected(const std::vector& filenames) +{ + mFilename = filenames[0]; + LLUIString title = getString("title_working"); title.setArg("[OBJECT]", mObjectName); setTitle(title); diff --git a/indra/newview/fsfloaterexport.h b/indra/newview/fsfloaterexport.h index c1db65229b..52e3813980 100644 --- a/indra/newview/fsfloaterexport.h +++ b/indra/newview/fsfloaterexport.h @@ -86,6 +86,7 @@ private: void addSelectedObjects(); void populateObjectList(); void onClickExport(); + void onExportFileSelected(const std::vector& filenames); void addTexturePreview(); S32 getNumExportableTextures(); void addObject(const LLViewerObject* prim, const std::string name); From 6270e39990f5d05fbc6ec6f78f8273d932c56758 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sat, 23 Jun 2018 02:32:06 +0200 Subject: [PATCH 41/68] Fix EOL --- indra/newview/daeexport.cpp | 4 ++-- indra/newview/fsfloaterexport.cpp | 4 ++-- indra/newview/llfloaterpreference.cpp | 14 +++++++------- indra/newview/llfloaterpreference.h | 2 +- indra/newview/llfloaterscriptedprefs.cpp | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/indra/newview/daeexport.cpp b/indra/newview/daeexport.cpp index aadd2d09b2..7078c32daf 100644 --- a/indra/newview/daeexport.cpp +++ b/indra/newview/daeexport.cpp @@ -197,8 +197,8 @@ void ColladaExportFloater::updateUI() void ColladaExportFloater::onClickExport() { - (new LLFilePickerReplyThread(boost::bind(&ColladaExportFloater::onExportFileSelected, this, _1), - LLFilePicker::FFSAVE_COLLADA, LLDir::getScrubbedFileName(mObjectName + ".dae")))->getFile(); + (new LLFilePickerReplyThread(boost::bind(&ColladaExportFloater::onExportFileSelected, this, _1), + LLFilePicker::FFSAVE_COLLADA, LLDir::getScrubbedFileName(mObjectName + ".dae")))->getFile(); } void ColladaExportFloater::onExportFileSelected(const std::vector& filenames) diff --git a/indra/newview/fsfloaterexport.cpp b/indra/newview/fsfloaterexport.cpp index 0daf51d461..7ec3d0f649 100644 --- a/indra/newview/fsfloaterexport.cpp +++ b/indra/newview/fsfloaterexport.cpp @@ -1083,8 +1083,8 @@ void FSFloaterObjectExport::updateUI() void FSFloaterObjectExport::onClickExport() { - (new LLFilePickerReplyThread(boost::bind(&FSFloaterObjectExport::onExportFileSelected, this, _1), - LLFilePicker::FFSAVE_EXPORT, LLDir::getScrubbedFileName(mObjectName + ".oxp")))->getFile(); + (new LLFilePickerReplyThread(boost::bind(&FSFloaterObjectExport::onExportFileSelected, this, _1), + LLFilePicker::FFSAVE_EXPORT, LLDir::getScrubbedFileName(mObjectName + ".oxp")))->getFile(); } void FSFloaterObjectExport::onExportFileSelected(const std::vector& filenames) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 0c9d2c0491..7376adfce2 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1721,12 +1721,12 @@ void LLFloaterPreference::onClickSetSoundCache() std::string cur_name(gSavedSettings.getString("FSSoundCacheLocation")); std::string proposed_name(cur_name); - (new LLDirPickerThread(boost::bind(&LLFloaterPreference::changeSoundCachePath, this, _1, _2), proposed_name))->getFile(); + (new LLDirPickerThread(boost::bind(&LLFloaterPreference::changeSoundCachePath, this, _1, _2), proposed_name))->getFile(); } void LLFloaterPreference::changeSoundCachePath(const std::vector& filenames, std::string proposed_name) { - std::string dir_name = filenames[0]; + std::string dir_name = filenames[0]; if (!dir_name.empty() && dir_name != proposed_name) { gSavedSettings.setString("FSSoundCacheLocation", dir_name); @@ -1830,12 +1830,12 @@ void LLFloaterPreference::setPreprocInclude() { std::string cur_name(gSavedSettings.getString("_NACL_PreProcHDDIncludeLocation")); std::string proposed_name(cur_name); - - (new LLDirPickerThread(boost::bind(&LLFloaterPreference::changePreprocIncludePath, this, _1, _2), proposed_name))->getFile(); + + (new LLDirPickerThread(boost::bind(&LLFloaterPreference::changePreprocIncludePath, this, _1, _2), proposed_name))->getFile(); } -void LLFloaterPreference::changePreprocIncludePath(const std::vector& filenames, std::string proposed_name) -{ +void LLFloaterPreference::changePreprocIncludePath(const std::vector& filenames, std::string proposed_name) +{ std::string dir_name = filenames[0]; if (!dir_name.empty() && dir_name != proposed_name) { @@ -4873,7 +4873,7 @@ BOOL FSPanelPreferenceBackup::postBuild() void FSPanelPreferenceBackup::onClickSetBackupSettingsPath() { std::string dir_name = gSavedSettings.getString("SettingsBackupPath"); - (new LLDirPickerThread(boost::bind(&FSPanelPreferenceBackup::changeBackupSettingsPath, this, _1, _2), dir_name))->getFile(); + (new LLDirPickerThread(boost::bind(&FSPanelPreferenceBackup::changeBackupSettingsPath, this, _1, _2), dir_name))->getFile(); } void FSPanelPreferenceBackup::changeBackupSettingsPath(const std::vector& filenames, std::string proposed_name) diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 63a31e385d..ec0f820ce0 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -197,7 +197,7 @@ public: // void onClickSetSounds(); // Handled centrally now void onClickPreviewUISound(const LLSD& ui_sound_id); // FIRE-8190: Preview function for "UI Sounds" Panel void setPreprocInclude(); - void changePreprocIncludePath(const std::vector& filenames, std::string proposed_name); + void changePreprocIncludePath(const std::vector& filenames, std::string proposed_name); void onClickEnablePopup(); void onClickDisablePopup(); void resetAllIgnored(); diff --git a/indra/newview/llfloaterscriptedprefs.cpp b/indra/newview/llfloaterscriptedprefs.cpp index 88db416a29..c7fc91a52e 100644 --- a/indra/newview/llfloaterscriptedprefs.cpp +++ b/indra/newview/llfloaterscriptedprefs.cpp @@ -92,8 +92,8 @@ void LLFloaterScriptEdPrefs::setPreprocInclude() { std::string cur_name(gSavedSettings.getString("_NACL_PreProcHDDIncludeLocation")); std::string proposed_name(cur_name); - - (new LLDirPickerThread(boost::bind(&LLFloaterScriptEdPrefs::changePreprocIncludePath, this, _1, _2), proposed_name))->getFile(); + + (new LLDirPickerThread(boost::bind(&LLFloaterScriptEdPrefs::changePreprocIncludePath, this, _1, _2), proposed_name))->getFile(); } void LLFloaterScriptEdPrefs::changePreprocIncludePath(const std::vector& filenames, std::string proposed_name) From 8602c5827caf40b654e9a6fed0d345fb0eee610b Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Mon, 25 Jun 2018 18:51:34 +0300 Subject: [PATCH 42/68] MAINT-8457 FIXED "Mute" switching cancels the volume settings of Nearby Media --- indra/newview/llpanelnearbymedia.cpp | 6 +++--- indra/newview/llviewermedia.cpp | 15 +++++++++++++++ indra/newview/llviewermedia.h | 2 ++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp index d8ef5b39ad..f3a2ed9408 100644 --- a/indra/newview/llpanelnearbymedia.cpp +++ b/indra/newview/llpanelnearbymedia.cpp @@ -1168,12 +1168,12 @@ void LLPanelNearByMedia::onClickSelectedMediaMute() F32 volume = impl->getVolume(); if(volume > 0.0) { - impl->setVolume(0.0); + impl->setMute(true); } else if (mVolumeSlider->getValueF32() == 0.0) { - impl->setVolume(1.0); - mVolumeSlider->setValue(1.0); + impl->setMute(false); + mVolumeSlider->setValue(impl->getVolume()); } else { diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 4334cbfda3..22a21c9ca3 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1555,6 +1555,7 @@ LLViewerMediaImpl::LLViewerMediaImpl( const LLUUID& texture_id, mNavigateServerRequest(false), mMediaSourceFailed(false), mRequestedVolume(1.0f), + mPreviousVolume(1.0f), mIsMuted(false), mNeedsMuteCheck(false), mPreviousMediaState(MEDIA_NONE), @@ -2081,6 +2082,20 @@ void LLViewerMediaImpl::setVolume(F32 volume) updateVolume(); } +////////////////////////////////////////////////////////////////////////////////////////// +void LLViewerMediaImpl::setMute(bool mute) +{ + if (mute) + { + mPreviousVolume = mRequestedVolume; + setVolume(0.0); + } + else + { + setVolume(mPreviousVolume); + } +} + ////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::updateVolume() { diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index c52960dfcf..e2e758befb 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -216,6 +216,7 @@ public: void skipBack(F32 step_scale); void skipForward(F32 step_scale); void setVolume(F32 volume); + void setMute(bool mute); void updateVolume(); F32 getVolume(); void focus(bool focus); @@ -448,6 +449,7 @@ private: bool mNavigateServerRequest; bool mMediaSourceFailed; F32 mRequestedVolume; + F32 mPreviousVolume; bool mIsMuted; bool mNeedsMuteCheck; int mPreviousMediaState; From 135f02934fa64fe913c710e588ab2f6785224a23 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 26 Jun 2018 00:29:19 +0100 Subject: [PATCH 43/68] Skip updating the sky texture and fog iff we're using atmospherics shaders anyway. --- indra/newview/llvosky.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index c131cb886f..370322cd45 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -1072,7 +1072,7 @@ BOOL LLVOSky::updateSky() LLHeavenBody::setInterpVal( mInterpVal ); calcAtmospherics(); - if (mForceUpdate || total_no_tiles == frame) + if (!gPipeline.canUseWindlightShaders() && mForceUpdate || total_no_tiles == frame) { LLSkyTex::stepCurrent(); From a4c795f87b4a9026e850474cfd51b6b4253e31a4 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Mon, 9 Jul 2018 18:06:16 +0300 Subject: [PATCH 44/68] MAINT-8848 FIXED Object name in the llGiveInventory chat message is represented as a hyperlink --- indra/newview/llviewermessage.cpp | 21 +++++++++++++++++++-- indra/newview/llviewermessage.h | 1 + 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 6cba7dd70c..a89b1220de 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1732,7 +1732,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& //don't spam them if they are getting flooded if (check_offer_throttle(mFromName, true)) { - log_message = chatHistory_string + " " + LLTrans::getString("InvOfferGaveYou") + " " + mDesc + LLTrans::getString("."); + log_message = "" + chatHistory_string + " " + LLTrans::getString("InvOfferGaveYou") + " " + getSanitizedDescription() + LLTrans::getString("."); LLSD args; args["MESSAGE"] = log_message; LLNotificationsUtil::add("SystemMessageTip", args); @@ -1917,7 +1917,7 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const //don't spam them if they are getting flooded if (check_offer_throttle(mFromName, true)) { - log_message = chatHistory_string + " " + LLTrans::getString("InvOfferGaveYou") + " " + mDesc + LLTrans::getString("."); + log_message = "" + chatHistory_string + " " + LLTrans::getString("InvOfferGaveYou") + " " + getSanitizedDescription() + LLTrans::getString("."); LLSD args; args["MESSAGE"] = log_message; LLNotificationsUtil::add("SystemMessageTip", args); @@ -1990,6 +1990,23 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const return false; } +std::string LLOfferInfo::getSanitizedDescription() +{ + // currently we get description from server as: 'Object' ( Location ) + // object name shouldn't be shown as a hyperlink + std::string description = mDesc; + + std::size_t start = mDesc.find_first_of("'"); + std::size_t end = mDesc.find_last_of("'"); + if ((start != std::string::npos) && (end != std::string::npos)) + { + description.insert(start, ""); + description.insert(end + 8, ""); + } + return description; +} + + void LLOfferInfo::initRespondFunctionMap() { if(mRespondFunctions.empty()) diff --git a/indra/newview/llviewermessage.h b/indra/newview/llviewermessage.h index b0eaa37541..424aae1229 100644 --- a/indra/newview/llviewermessage.h +++ b/indra/newview/llviewermessage.h @@ -257,6 +257,7 @@ public: private: void initRespondFunctionMap(); + std::string getSanitizedDescription(); typedef boost::function respond_function_t; typedef std::map respond_function_map_t; From 4e84a7f9517e9e10287490d3b96ed3c9cb24f45e Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Tue, 10 Jul 2018 18:06:52 +0300 Subject: [PATCH 45/68] MAINT-8855 FIXED Location SLURL gets truncated when using Help -> Report Bug to file JIRA --- indra/newview/llviewermenu.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index f7250ffb66..ec851ddaf9 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -134,6 +134,7 @@ #include "llpathfindingmanager.h" #include "llstartup.h" #include "boost/unordered_map.hpp" +#include #include "llcleanup.h" using namespace LLAvatarAppearanceDefines; @@ -8025,7 +8026,12 @@ void handle_report_bug(const LLSD& param) LLUIString url(param.asString()); LLStringUtil::format_map_t replace; - replace["[ENVIRONMENT]"] = LLURI::escape(LLAppViewer::instance()->getViewerInfoString(true)); + std::string environment = LLAppViewer::instance()->getViewerInfoString(true); + boost::regex regex; + regex.assign(""); + std::string stripped_env = boost::regex_replace(environment, regex, ""); + + replace["[ENVIRONMENT]"] = LLURI::escape(stripped_env); LLSLURL location_url; LLAgentUI::buildSLURL(location_url); replace["[LOCATION]"] = LLURI::escape(location_url.getSLURLString()); From 00f89e52ce8333b485c3bf9213b6c6b3ae96e615 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 11 Jul 2018 16:39:22 +0300 Subject: [PATCH 46/68] MAINT-8849 Fixed Viewer displays 'Conneting to region...' screen forever --- indra/newview/llstartup.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 7a4c41779a..cc02642203 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -246,6 +246,7 @@ static bool mLoginStatePastUI = false; const S32 DEFAULT_MAX_AGENT_GROUPS = 42; const S32 ALLOWED_MAX_AGENT_GROUPS = 500; +const F32 STATE_AGENT_WAIT_TIMEOUT = 240; //seconds boost::scoped_ptr LLStartUp::sStateWatcher(new LLEventStream("StartupState")); boost::scoped_ptr LLStartUp::sListener(new LLStartupListener()); @@ -1615,6 +1616,13 @@ bool idle_startup() LLStartUp::setStartupState( STATE_INVENTORY_SEND ); } display_startup(); + + if (!gAgentMovementCompleted && timeout.getElapsedTimeF32() > STATE_AGENT_WAIT_TIMEOUT) + { + LL_WARNS("AppInit") << "Backing up to login screen!" << LL_ENDL; + LLNotificationsUtil::add("LoginPacketNeverReceived", LLSD(), LLSD(), login_alert_status); + reset_login(); + } return FALSE; } From bb904e2f35a87f716ad57cbaf55039f297a0db7c Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Wed, 11 Jul 2018 17:39:39 +0300 Subject: [PATCH 47/68] MAINT-8856 FIXED URL in Group Name is represented as a hyperlink in group notice --- indra/newview/skins/default/xui/en/panel_group_notify.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/skins/default/xui/en/panel_group_notify.xml b/indra/newview/skins/default/xui/en/panel_group_notify.xml index 4121acdfb0..60e5a03d51 100644 --- a/indra/newview/skins/default/xui/en/panel_group_notify.xml +++ b/indra/newview/skins/default/xui/en/panel_group_notify.xml @@ -43,6 +43,7 @@ layout="topleft" left_pad="10" name="title" + parse_urls="false" text_color="GroupNotifyTextColor" top="5" use_ellipses="true" From 14c65a2c9e8c2017a62aacf2e276b42c1f2b0873 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Thu, 12 Jul 2018 17:57:40 +0300 Subject: [PATCH 48/68] MAINT-8862 mailto URIs should be loaded in the external browser --- indra/newview/llweb.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index b816225b07..768db047a4 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -268,6 +268,12 @@ bool LLWeb::useExternalBrowser(const std::string &url) boost::match_results matches; return !(boost::regex_search(uri_string, matches, pattern)); } + else + { + boost::regex pattern = boost::regex("^mailto:", boost::regex::perl | boost::regex::icase); + boost::match_results matches; + return boost::regex_search(url, matches, pattern); + } return false; #endif } From dc0bd05717106522eb350b02dbac663eaebb8eef Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 26 Jun 2018 14:47:30 +0300 Subject: [PATCH 49/68] SL-927 Add new groups caps to viewer (offline messages only) --- .../newview/llfloaternotificationstabbed.cpp | 3 +- indra/newview/llimprocessing.cpp | 11 +- indra/newview/llnotificationlistitem.cpp | 31 +--- indra/newview/llnotificationlistitem.h | 1 + indra/newview/llviewermessage.cpp | 159 +++++++++++++----- indra/newview/llviewermessage.h | 5 + indra/newview/llviewerregion.cpp | 4 +- 7 files changed, 142 insertions(+), 72 deletions(-) diff --git a/indra/newview/llfloaternotificationstabbed.cpp b/indra/newview/llfloaternotificationstabbed.cpp index 4b5fe4989a..d1679fd936 100644 --- a/indra/newview/llfloaternotificationstabbed.cpp +++ b/indra/newview/llfloaternotificationstabbed.cpp @@ -387,7 +387,8 @@ void LLFloaterNotificationsTabbed::onStoreToast(LLPanel* info_panel, LLUUID id) p.notification_name = notify->getName(); p.transaction_id = payload["transaction_id"]; p.group_id = payload["group_id"]; - p.fee = payload["fee"]; + p.fee = payload["fee"]; + p.use_offline_cap = payload["use_offline_cap"].asInteger(); p.subject = payload["subject"].asString(); p.message = payload["message"].asString(); p.sender = payload["sender_name"].asString(); diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index 491671c46f..e76b3d118e 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -814,10 +814,11 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, LLSD payload; payload["transaction_id"] = session_id; - payload["group_id"] = from_id; + payload["group_id"] = from_group ? from_id : aux_id; payload["name"] = name; payload["message"] = message; payload["fee"] = membership_fee; + payload["use_offline_cap"] = session_id.isNull() && (offline == IM_OFFLINE); LLSD args; args["MESSAGE"] = message; @@ -1459,8 +1460,12 @@ void LLIMProcessing::requestOfflineMessages() // Auto-accepted inventory items may require the avatar object // to build a correct name. Likewise, inventory offers from // muted avatars require the mute list to properly mute. - if (cap_url.empty()) + if (cap_url.empty() + || gAgent.getRegionCapability("AcceptFriendship").empty() + || gAgent.getRegionCapability("AcceptGroupInvite").empty()) { + // Offline messages capability provides no session/transaction ids for message AcceptFriendship and IM_GROUP_INVITATION to work + // So make sure we have the caps before using it. requestOfflineMessagesLegacy(); } else @@ -1561,7 +1566,7 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url) message_data["to_agent_id"].asUUID(), IM_OFFLINE, (EInstantMessage)message_data["dialog"].asInteger(), - LLUUID::null, // session id, fix this for friendship offers to work + LLUUID::null, // session id, since there is none we can only use frienship/group invite caps message_data["timestamp"].asInteger(), message_data["from_agent_name"].asString(), message_data["message"].asString(), diff --git a/indra/newview/llnotificationlistitem.cpp b/indra/newview/llnotificationlistitem.cpp index f2de8e54a0..a5bc75e6bd 100644 --- a/indra/newview/llnotificationlistitem.cpp +++ b/indra/newview/llnotificationlistitem.cpp @@ -312,38 +312,15 @@ void LLGroupInviteNotificationListItem::onClickJoinBtn() return; } - if(mParams.fee > 0) - { - LLSD args; - args["COST"] = llformat("%d", mParams.fee); - // Set the fee for next time to 0, so that we don't keep - // asking about a fee. - LLSD next_payload; - next_payload["group_id"]= mParams.group_id; - next_payload["transaction_id"]= mParams.transaction_id; - next_payload["fee"] = 0; - LLNotificationsUtil::add("JoinGroupCanAfford", args, next_payload); - } - else - { - send_improved_im(mParams.group_id, - std::string("name"), - std::string("message"), - IM_ONLINE, - IM_GROUP_INVITATION_ACCEPT, - mParams.transaction_id); - } + send_join_group_response(mParams.group_id, mParams.transaction_id, true, mParams.fee, mParams.use_offline_cap); + LLNotificationListItem::onClickCloseBtn(); } void LLGroupInviteNotificationListItem::onClickDeclineBtn() { - send_improved_im(mParams.group_id, - std::string("name"), - std::string("message"), - IM_ONLINE, - IM_GROUP_INVITATION_DECLINE, - mParams.transaction_id); + send_join_group_response(mParams.group_id, mParams.transaction_id, false, mParams.fee, mParams.use_offline_cap); + LLNotificationListItem::onClickCloseBtn(); } diff --git a/indra/newview/llnotificationlistitem.h b/indra/newview/llnotificationlistitem.h index 3dd52986b0..3d564fed0e 100644 --- a/indra/newview/llnotificationlistitem.h +++ b/indra/newview/llnotificationlistitem.h @@ -56,6 +56,7 @@ public: std::string message; std::string sender; S32 fee; + U8 use_offline_cap; LLDate time_stamp; LLDate received_time; LLSD inventory_offer; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index a89b1220de..211d7b8c64 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -198,15 +198,15 @@ void accept_friendship_coro(std::string url, LLSD notification) void decline_friendship_coro(std::string url, LLSD notification, S32 option) { - LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("friendshipResponceErrorProcessing", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); if (url.empty()) { LL_WARNS() << "Empty capability!" << LL_ENDL; return; } + LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t + httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("friendshipResponceErrorProcessing", httpPolicy)); + LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); LLSD payload = notification["payload"]; url += "?from=" + payload["from_id"].asString(); @@ -724,6 +724,119 @@ void send_sound_trigger(const LLUUID& sound_id, F32 gain) static LLSD sSavedGroupInvite; static LLSD sSavedResponse; +void response_group_invitation_coro(std::string url, LLUUID group_id, bool notify_and_update) +{ + if (url.empty()) + { + LL_WARNS("GroupInvite") << "Empty capability!" << LL_ENDL; + return; + } + + LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t + httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("friendshipResponceErrorProcessing", httpPolicy)); + LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + + LLSD payload; + payload["group"] = group_id; + + LLSD result = httpAdapter->postAndSuspend(httpRequest, url, payload); + + LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; + LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); + + if (!status) + { + LL_WARNS("GroupInvite") << "HTTP status, " << status.toTerseString() << + ". Group " << group_id << " invitation response processing failed." << LL_ENDL; + } + else + { + if (!result.has("success") || result["success"].asBoolean() == false) + { + LL_WARNS("GroupInvite") << "Server failed to process group " << group_id << " invitation response. " << httpResults << LL_ENDL; + } + else + { + LL_DEBUGS("GroupInvite") << "Successfully sent response to group " << group_id << " invitation" << LL_ENDL; + if (notify_and_update) + { + LLNotificationsUtil::add("JoinGroupSuccess"); + gAgent.sendAgentDataUpdateRequest(); + + LLGroupMgr::getInstance()->clearGroupData(group_id); + // refresh the floater for this group, if any. + LLGroupActions::refresh(group_id); + } + } + } +} + +void send_join_group_response(LLUUID group_id, LLUUID transaction_id, bool accept_invite, S32 fee, bool use_offline_cap, LLSD &payload) +{ + if (accept_invite && fee > 0) + { + // If there is a fee to join this group, make + // sure the user is sure they want to join. + LLSD args; + args["COST"] = llformat("%d", fee); + // Set the fee for next time to 0, so that we don't keep + // asking about a fee. + LLSD next_payload = payload; + next_payload["fee"] = 0; + LLNotificationsUtil::add("JoinGroupCanAfford", + args, + next_payload); + } + else if (use_offline_cap) + { + std::string url; + if (accept_invite) + { + url = gAgent.getRegionCapability("AcceptGroupInvite"); + } + else + { + url = gAgent.getRegionCapability("DeclineGroupInvite"); + } + + if (!url.empty()) + { + LLCoros::instance().launch("LLMessageSystem::acceptGroupInvitation", + boost::bind(response_group_invitation_coro, url, group_id, accept_invite)); + } + else + { + // if sim has no this cap, we can do nothing - regular request will fail + LL_WARNS("GroupInvite") << "No capability, can't reply to offline invitation!" << LL_ENDL; + } + } + else + { + EInstantMessage type = accept_invite ? IM_GROUP_INVITATION_ACCEPT : IM_GROUP_INVITATION_DECLINE; + + send_improved_im(group_id, + std::string("name"), + std::string("message"), + IM_ONLINE, + type, + transaction_id); + } +} + +void send_join_group_response(LLUUID group_id, LLUUID transaction_id, bool accept_invite, S32 fee, bool use_offline_cap) +{ + LLSD payload; + if (accept_invite) + { + payload["group_id"] = group_id; + payload["transaction_id"] = transaction_id; + payload["fee"] = fee; + payload["use_offline_cap"] = use_offline_cap; + } + send_join_group_response(group_id, transaction_id, accept_invite, fee, use_offline_cap, payload); +} + bool join_group_response(const LLSD& notification, const LLSD& response) { // A bit of variable saving and restoring is used to deal with the case where your group list is full and you @@ -762,6 +875,7 @@ bool join_group_response(const LLSD& notification, const LLSD& response) std::string name = notification_adjusted["payload"]["name"].asString(); std::string message = notification_adjusted["payload"]["message"].asString(); S32 fee = notification_adjusted["payload"]["fee"].asInteger(); + U8 use_offline_cap = notification_adjusted["payload"]["use_offline_cap"].asInteger(); if (option == 2 && !group_id.isNull()) { @@ -790,42 +904,7 @@ bool join_group_response(const LLSD& notification, const LLSD& response) return false; } } - - if (accept_invite) - { - // If there is a fee to join this group, make - // sure the user is sure they want to join. - if (fee > 0) - { - LLSD args; - args["COST"] = llformat("%d", fee); - // Set the fee for next time to 0, so that we don't keep - // asking about a fee. - LLSD next_payload = notification_adjusted["payload"]; - next_payload["fee"] = 0; - LLNotificationsUtil::add("JoinGroupCanAfford", - args, - next_payload); - } - else - { - send_improved_im(group_id, - std::string("name"), - std::string("message"), - IM_ONLINE, - IM_GROUP_INVITATION_ACCEPT, - transaction_id); - } - } - else - { - send_improved_im(group_id, - std::string("name"), - std::string("message"), - IM_ONLINE, - IM_GROUP_INVITATION_DECLINE, - transaction_id); - } + send_join_group_response(group_id, transaction_id, accept_invite, fee, use_offline_cap, notification_adjusted["payload"]); sSavedGroupInvite[id] = LLSD::emptyMap(); sSavedResponse[id] = LLSD::emptyMap(); diff --git a/indra/newview/llviewermessage.h b/indra/newview/llviewermessage.h index 424aae1229..913abef2be 100644 --- a/indra/newview/llviewermessage.h +++ b/indra/newview/llviewermessage.h @@ -66,6 +66,11 @@ enum InventoryOfferResponse BOOL can_afford_transaction(S32 cost); void give_money(const LLUUID& uuid, LLViewerRegion* region, S32 amount, BOOL is_group = FALSE, S32 trx_type = TRANS_GIFT, const std::string& desc = LLStringUtil::null); +void send_join_group_response(LLUUID group_id, + LLUUID transaction_id, + bool accept_invite, + S32 fee, + bool use_offline_cap); void process_logout_reply(LLMessageSystem* msg, void**); void process_layer_data(LLMessageSystem *mesgsys, void **user_data); diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 832dcc2dd8..e1437e28f7 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -2818,6 +2818,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) { capabilityNames.append("AbuseCategories"); capabilityNames.append("AcceptFriendship"); + capabilityNames.append("AcceptGroupInvite"); // ReadOfflineMsgs recieved messages only!!! capabilityNames.append("AgentPreferences"); capabilityNames.append("AgentState"); capabilityNames.append("AttachmentResources"); @@ -2828,6 +2829,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("CopyInventoryFromNotecard"); capabilityNames.append("CreateInventoryCategory"); capabilityNames.append("DeclineFriendship"); + capabilityNames.append("DeclineGroupInvite"); // ReadOfflineMsgs recieved messages only!!! capabilityNames.append("DispatchRegionInfo"); capabilityNames.append("DirectDelivery"); capabilityNames.append("EnvironmentSettings"); @@ -2878,7 +2880,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("ParcelVoiceInfoRequest"); capabilityNames.append("ProductInfoRequest"); capabilityNames.append("ProvisionVoiceAccountRequest"); - //capabilityNames.append("ReadOfflineMsgs"); + capabilityNames.append("ReadOfflineMsgs"); // Only use with AcceptGroupInvite AcceptFriendship capabilityNames.append("RemoteParcelRequest"); capabilityNames.append("RenderMaterials"); capabilityNames.append("RequestTextureDownload"); From 020757ff0170aa894c56cd719d46413c9e99fde6 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 26 Jun 2018 09:42:26 -0400 Subject: [PATCH 50/68] DRTVWR-453: Update to viewer-manager build 517052 --- autobuild.xml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index fb45343440..04b08dc5bf 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1692,7 +1692,7 @@ darwin archive - + hash 3855bd40f950e3c22739ae8f3ee2afc9 url @@ -1705,10 +1705,10 @@ archive - hash + hash d1521becaf21bf7233173722af63f57d url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/15257/98440/kdu-7.10.4.513518-darwin64-513518.tar.bz2 + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/15257/98440/kdu-7.10.4.513518-darwin64-513518.tar.bz2 name darwin64 @@ -1717,10 +1717,10 @@ archive - hash + hash 43d7a6a69a54534a736f132e9c81795b url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/15255/98451/kdu-7.10.4.513518-linux-513518.tar.bz2 + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/15255/98451/kdu-7.10.4.513518-linux-513518.tar.bz2 name linux @@ -1752,11 +1752,11 @@ windows64 archive - + hash da3b1ea90797b189d80ab5d50fdf05d4 url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/15260/98469/kdu-7.10.4.513518-windows64-513518.tar.bz2 + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/15260/98469/kdu-7.10.4.513518-windows64-513518.tar.bz2 name windows64 @@ -3260,9 +3260,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 9308ad92ea0104bf75034fc607eedc74 + f45c0a5e7b4601b355e163bf62f5718e url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/16517/108862/viewer_manager-1.0.514367-darwin64-514367.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/20587/147509/viewer_manager-1.0.517052-darwin64-517052.tar.bz2 name darwin64 @@ -3284,9 +3284,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 0879d503ad2fe4d46913e80c053d1d1a + d2443caf062697430071d458a965f611 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/16518/108869/viewer_manager-1.0.514367-windows-514367.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/20588/147516/viewer_manager-1.0.517052-windows-517052.tar.bz2 name windows @@ -3297,7 +3297,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors source_type hg version - 1.0.514367 + 1.0.517052 vlc-bin From 41c0a95365428a8486c37a9c175acc29653d9639 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 26 Jun 2018 20:19:38 +0300 Subject: [PATCH 51/68] MAINT-8395 Better loging --- indra/newview/lltexturecache.cpp | 70 ++++++++++++++++++++++++++++++-- indra/newview/lltexturecache.h | 2 +- 2 files changed, 68 insertions(+), 4 deletions(-) diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index dd5dce3279..633e025478 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -615,7 +615,7 @@ bool LLTextureCacheRemoteWorker::doWrite() if(idx >= 0) { // write to the fast cache. - if(!mCache->writeToFastCache(idx, mRawImage, mRawDiscardLevel)) + if(!mCache->writeToFastCache(mID, idx, mRawImage, mRawDiscardLevel)) { LL_WARNS() << "writeToFastCache failed" << LL_ENDL; mDataSize = -1; // failed @@ -1998,8 +1998,48 @@ LLPointer LLTextureCache::readFromFastCache(const LLUUID& id, S32& d return raw; } +#if LL_WINDOWS + +static const U32 STATUS_MSC_EXCEPTION = 0xE06D7363; // compiler specific + +U32 exception_dupe_filter(U32 code, struct _EXCEPTION_POINTERS *exception_infop) +{ + if (code == STATUS_MSC_EXCEPTION) + { + // C++ exception, go on + return EXCEPTION_CONTINUE_SEARCH; + } + else + { + // handle it + return EXCEPTION_EXECUTE_HANDLER; + } +} + +//due to unwinding +void dupe(LLPointer &raw) +{ + raw = raw->duplicate(); +} + +void logExceptionDupplicate(LLPointer &raw) +{ + __try + { + dupe(raw); + } + __except (exception_dupe_filter(GetExceptionCode(), GetExceptionInformation())) + { + // convert to C++ styled exception + char integer_string[32]; + sprintf(integer_string, "SEH, code: %lu\n", GetExceptionCode()); + throw std::exception(integer_string); + } +} +#endif + //return the fast cache location -bool LLTextureCache::writeToFastCache(S32 id, LLPointer raw, S32 discardlevel) +bool LLTextureCache::writeToFastCache(LLUUID image_id, S32 id, LLPointer raw, S32 discardlevel) { //rescale image if needed if (raw.isNull() || raw->isBufferInvalid() || !raw->getData()) @@ -2027,7 +2067,31 @@ 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(); + + try + { +#if LL_WINDOWS + // Temporary diagnostics for scale/duplicate crash + logExceptionDupplicate(raw); +#else + raw = raw->duplicate(); +#endif + } + catch (...) + { + removeFromCache(image_id); + LL_ERRS() << "Failed to cache image: " << image_id + << " local id: " << id + << " Exception: " << boost::current_exception_diagnostic_information() + << " Image new width: " << w + << " Image new height: " << h + << " Image new components: " << c + << " Image discard difference: " << i + << LL_ENDL; + + return false; + } + if (raw->isBufferInvalid()) { LL_WARNS() << "Invalid image duplicate buffer" << LL_ENDL; diff --git a/indra/newview/lltexturecache.h b/indra/newview/lltexturecache.h index 95f9afc2bc..987b9375c0 100644 --- a/indra/newview/lltexturecache.h +++ b/indra/newview/lltexturecache.h @@ -179,7 +179,7 @@ private: void openFastCache(bool first_time = false); void closeFastCache(bool forced = false); - bool writeToFastCache(S32 id, LLPointer raw, S32 discardlevel); + bool writeToFastCache(LLUUID image_id, S32 cache_id, LLPointer raw, S32 discardlevel); private: // Internal From 8b1120b3eca573f07c6c0b3fffa4b138c9597194 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 26 Jun 2018 23:43:06 +0100 Subject: [PATCH 52/68] Fix misspelled convenience func name. --- indra/newview/llvosky.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 370322cd45..d8bf0181ac 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -1072,7 +1072,7 @@ BOOL LLVOSky::updateSky() LLHeavenBody::setInterpVal( mInterpVal ); calcAtmospherics(); - if (!gPipeline.canUseWindlightShaders() && mForceUpdate || total_no_tiles == frame) + if (!gPipeline.canUseWindLightShaders() && mForceUpdate || total_no_tiles == frame) { LLSkyTex::stepCurrent(); From c0bd1cd4321444615ae0e22b132052f8ba24ec94 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 27 Jun 2018 01:38:05 +0100 Subject: [PATCH 53/68] Disambiguate logical op precedence for Clang. --- indra/newview/llvosky.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index d8bf0181ac..00d5dfcc57 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -1072,7 +1072,7 @@ BOOL LLVOSky::updateSky() LLHeavenBody::setInterpVal( mInterpVal ); calcAtmospherics(); - if (!gPipeline.canUseWindLightShaders() && mForceUpdate || total_no_tiles == frame) + if (!gPipeline.canUseWindLightShaders() && (mForceUpdate || total_no_tiles == frame)) { LLSkyTex::stepCurrent(); From 7851e49878ce956726a798b3618cd283576cbe2f Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 29 Jun 2018 22:42:06 +0100 Subject: [PATCH 54/68] MAINT-8260 make TextureLoadFullRes not persistent to avoid issues with accidentally setting it on systems which cannot handle the mem load it implies --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index a01435626f..8e8cce5787 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -12280,7 +12280,7 @@ Comment If TRUE, always load textures at full resolution (discard = 0) Persist - 1 + 0 Type Boolean Value From 5346e7909ff6d462ee3c28504030b33b3e497d0f Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 2 Jul 2018 20:09:36 +0300 Subject: [PATCH 55/68] MAINT-8618 Viewer attempting to edit action when it has no permission --- indra/newview/llpanelpermissions.cpp | 39 ++++++++++++++++++---------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index fc44ce340c..ef16427713 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -1210,23 +1210,34 @@ void LLPanelPermissions::setAllSaleInfo() LLSaleInfo new_sale_info(sale_type, price); LLSelectMgr::getInstance()->selectionSetObjectSaleInfo(new_sale_info); - struct f : public LLSelectedObjectFunctor + // Note: won't work right if a root and non-root are both single-selected (here and other places). + BOOL is_perm_modify = (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode() + && LLSelectMgr::getInstance()->selectGetRootsModify()) + || LLSelectMgr::getInstance()->selectGetModify(); + BOOL is_nonpermanent_enforced = (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode() + && LLSelectMgr::getInstance()->selectGetRootsNonPermanentEnforced()) + || LLSelectMgr::getInstance()->selectGetNonPermanentEnforced(); + + if (is_perm_modify && is_nonpermanent_enforced) { - virtual bool apply(LLViewerObject* object) + struct f : public LLSelectedObjectFunctor { - return object->getClickAction() == CLICK_ACTION_BUY - || object->getClickAction() == CLICK_ACTION_TOUCH; + virtual bool apply(LLViewerObject* object) + { + return object->getClickAction() == CLICK_ACTION_BUY + || object->getClickAction() == CLICK_ACTION_TOUCH; + } + } check_actions; + + // Selection should only contain objects that are of target + // action already or of action we are aiming to remove. + bool default_actions = LLSelectMgr::getInstance()->getSelection()->applyToObjects(&check_actions); + + if (default_actions && old_sale_info.isForSale() != new_sale_info.isForSale()) + { + U8 new_click_action = new_sale_info.isForSale() ? CLICK_ACTION_BUY : CLICK_ACTION_TOUCH; + LLSelectMgr::getInstance()->selectionSetClickAction(new_click_action); } - } check_actions; - - // Selection should only contain objects that are of target - // action already or of action we are aiming to remove. - bool default_actions = LLSelectMgr::getInstance()->getSelection()->applyToObjects(&check_actions); - - if (default_actions && old_sale_info.isForSale() != new_sale_info.isForSale()) - { - U8 new_click_action = new_sale_info.isForSale() ? CLICK_ACTION_BUY : CLICK_ACTION_TOUCH; - LLSelectMgr::getInstance()->selectionSetClickAction(new_click_action); } } From 922c5fe2fcd5ad7e9265606a2c083d2f2a05399b Mon Sep 17 00:00:00 2001 From: eli Date: Mon, 2 Jul 2018 17:11:08 -0700 Subject: [PATCH 56/68] FIX INTL-93 translate Viewer Set51 from viewer-bear, for 9 languages --- .../floater_preferences_graphics_advanced.xml | 11 +++++++++-- .../xui/de/menu_people_blocked_gear.xml | 1 + .../skins/default/xui/de/notifications.xml | 2 +- .../skins/default/xui/de/panel_group_roles.xml | 10 ++++++++++ .../xui/de/panel_preferences_privacy.xml | 2 +- .../default/xui/de/panel_preferences_setup.xml | 4 ++-- .../xui/de/panel_preferences_uploads.xml | 3 +++ .../skins/default/xui/de/role_actions.xml | 18 +++++++++--------- .../floater_preferences_graphics_advanced.xml | 11 +++++++++-- .../xui/es/menu_people_blocked_gear.xml | 1 + .../skins/default/xui/es/notifications.xml | 2 +- .../skins/default/xui/es/panel_group_roles.xml | 10 ++++++++++ .../default/xui/es/panel_preferences_setup.xml | 4 ++-- .../xui/es/panel_preferences_uploads.xml | 3 +++ .../skins/default/xui/es/role_actions.xml | 18 +++++++++--------- .../floater_preferences_graphics_advanced.xml | 11 +++++++++-- .../xui/fr/menu_people_blocked_gear.xml | 1 + .../skins/default/xui/fr/notifications.xml | 2 +- .../skins/default/xui/fr/panel_group_roles.xml | 10 ++++++++++ .../xui/fr/panel_preferences_privacy.xml | 2 +- .../default/xui/fr/panel_preferences_setup.xml | 6 +++--- .../xui/fr/panel_preferences_uploads.xml | 3 +++ .../skins/default/xui/fr/role_actions.xml | 18 +++++++++--------- .../floater_preferences_graphics_advanced.xml | 11 +++++++++-- .../xui/it/menu_people_blocked_gear.xml | 1 + .../skins/default/xui/it/notifications.xml | 2 +- .../skins/default/xui/it/panel_group_roles.xml | 10 ++++++++++ .../xui/it/panel_preferences_privacy.xml | 2 +- .../default/xui/it/panel_preferences_setup.xml | 6 +++--- .../xui/it/panel_preferences_uploads.xml | 3 +++ .../skins/default/xui/it/role_actions.xml | 18 +++++++++--------- .../floater_preferences_graphics_advanced.xml | 11 +++++++++-- .../xui/ja/menu_people_blocked_gear.xml | 1 + .../skins/default/xui/ja/notifications.xml | 2 +- .../skins/default/xui/ja/panel_group_roles.xml | 10 ++++++++++ .../default/xui/ja/panel_preferences_setup.xml | 6 +++--- .../xui/ja/panel_preferences_uploads.xml | 3 +++ .../skins/default/xui/ja/role_actions.xml | 18 +++++++++--------- .../floater_preferences_graphics_advanced.xml | 11 +++++++++-- .../xui/pt/menu_people_blocked_gear.xml | 1 + .../skins/default/xui/pt/notifications.xml | 2 +- .../skins/default/xui/pt/panel_group_roles.xml | 10 ++++++++++ .../default/xui/pt/panel_preferences_setup.xml | 4 ++-- .../xui/pt/panel_preferences_uploads.xml | 3 +++ .../skins/default/xui/pt/role_actions.xml | 18 +++++++++--------- .../floater_preferences_graphics_advanced.xml | 13 ++++++++++--- .../xui/ru/menu_people_blocked_gear.xml | 1 + .../skins/default/xui/ru/notifications.xml | 2 +- .../skins/default/xui/ru/panel_group_roles.xml | 10 ++++++++++ .../default/xui/ru/panel_preferences_setup.xml | 6 +++--- .../xui/ru/panel_preferences_uploads.xml | 3 +++ .../skins/default/xui/ru/role_actions.xml | 18 +++++++++--------- .../floater_preferences_graphics_advanced.xml | 11 +++++++++-- .../xui/tr/menu_people_blocked_gear.xml | 1 + .../skins/default/xui/tr/notifications.xml | 2 +- .../skins/default/xui/tr/panel_group_roles.xml | 10 ++++++++++ .../xui/tr/panel_preferences_privacy.xml | 2 +- .../default/xui/tr/panel_preferences_setup.xml | 4 ++-- .../xui/tr/panel_preferences_uploads.xml | 3 +++ .../skins/default/xui/tr/role_actions.xml | 18 +++++++++--------- .../floater_preferences_graphics_advanced.xml | 11 +++++++++-- .../xui/zh/menu_people_blocked_gear.xml | 1 + .../skins/default/xui/zh/notifications.xml | 2 +- .../skins/default/xui/zh/panel_group_roles.xml | 10 ++++++++++ .../default/xui/zh/panel_preferences_setup.xml | 4 ++-- .../xui/zh/panel_preferences_uploads.xml | 3 +++ .../skins/default/xui/zh/role_actions.xml | 18 +++++++++--------- 67 files changed, 324 insertions(+), 135 deletions(-) diff --git a/indra/newview/skins/default/xui/de/floater_preferences_graphics_advanced.xml b/indra/newview/skins/default/xui/de/floater_preferences_graphics_advanced.xml index 65a7e255f9..1361366bd5 100644 --- a/indra/newview/skins/default/xui/de/floater_preferences_graphics_advanced.xml +++ b/indra/newview/skins/default/xui/de/floater_preferences_graphics_advanced.xml @@ -31,7 +31,7 @@ Niedrig - + Hardware @@ -56,6 +56,9 @@ (Neustart erforderlich) + + Netz + Niedrig @@ -72,6 +75,9 @@ Niedrig + + Shader + @@ -111,5 +117,6 @@