summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterchangeitemthumbnail.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-04-04 02:08:23 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-04-04 02:09:23 +0300
commit77753a31aba6123696761aeeb2c535768fd1ea12 (patch)
tree3a89613c5592b57f893915a695b999ecf556c7a1 /indra/newview/llfloaterchangeitemthumbnail.cpp
parentbc285ed41e86e685df07f4039c64c0402833b047 (diff)
SL-19188 Improve legacy gallery thumbnail support
Diffstat (limited to 'indra/newview/llfloaterchangeitemthumbnail.cpp')
-rw-r--r--indra/newview/llfloaterchangeitemthumbnail.cpp32
1 files changed, 24 insertions, 8 deletions
diff --git a/indra/newview/llfloaterchangeitemthumbnail.cpp b/indra/newview/llfloaterchangeitemthumbnail.cpp
index 8f6d984aa9..099ceea821 100644
--- a/indra/newview/llfloaterchangeitemthumbnail.cpp
+++ b/indra/newview/llfloaterchangeitemthumbnail.cpp
@@ -335,7 +335,7 @@ void LLFloaterChangeItemThumbnail::refreshFromObject(LLInventoryObject* obj)
LLViewerInventoryItem* item = dynamic_cast<LLViewerInventoryItem*>(obj);
if (item)
{
- // This floater probably shouldn't be be possible to open
+ // This floater probably shouldn't be possible to open
// for imcomplete items
llassert(item->isFinished());
@@ -369,13 +369,14 @@ void LLFloaterChangeItemThumbnail::refreshFromObject(LLInventoryObject* obj)
}
if (item)
{
- LL_INFOS() << "Setting image from outfit as a thumbnail" << LL_ENDL;
thumbnail_id = item->getAssetUUID();
-
- if (validateAsset(thumbnail_id))
+ if (thumbnail_id.notNull())
{
// per SL-19188, set this image as a thumbnail
- setThumbnailId(thumbnail_id);
+ LL_INFOS() << "Setting image " << thumbnail_id
+ << " from outfit as a thumbnail for inventory object " << obj->getUUID()
+ << LL_ENDL;
+ assignAndValidateAsset(thumbnail_id, true);
}
}
}
@@ -540,11 +541,20 @@ void LLFloaterChangeItemThumbnail::onRemovalConfirmation(const LLSD& notificatio
}
}
-void LLFloaterChangeItemThumbnail::assignAndValidateAsset(const LLUUID &asset_id)
+void LLFloaterChangeItemThumbnail::assignAndValidateAsset(const LLUUID &asset_id, bool silent)
{
LLPointer<LLViewerFetchedTexture> texturep = LLViewerTextureManager::getFetchedTexture(asset_id);
if (texturep->getFullWidth() == 0 && !texturep->isFullyLoaded() && !texturep->isMissingAsset())
{
+ if (silent)
+ {
+ mExpectingAssetId = LLUUID::null;
+ }
+ else
+ {
+ // don't warn user multiple times if some textures took their time
+ mExpectingAssetId = asset_id;
+ }
texturep->setLoadedCallback(onImageLoaded,
MAX_DISCARD_LEVEL, // don't actually need max one, 3 or 4 should be enough
FALSE,
@@ -559,7 +569,7 @@ void LLFloaterChangeItemThumbnail::assignAndValidateAsset(const LLUUID &asset_id
{
setThumbnailId(asset_id);
}
- else
+ else if (!silent)
{
LLNotificationsUtil::add("ThumbnailDimentionsLimit");
}
@@ -567,6 +577,11 @@ void LLFloaterChangeItemThumbnail::assignAndValidateAsset(const LLUUID &asset_id
}
bool LLFloaterChangeItemThumbnail::validateAsset(const LLUUID &asset_id)
{
+ if (asset_id.isNull())
+ {
+ return false;
+ }
+
LLPointer<LLViewerFetchedTexture> texturep = LLViewerTextureManager::findFetchedTexture(asset_id, TEX_LIST_STANDARD);
if (!texturep)
@@ -624,9 +639,10 @@ void LLFloaterChangeItemThumbnail::onImageLoaded(
{
self->setThumbnailId(asset_id);
}
- else
+ else if (self->mExpectingAssetId == asset_id)
{
LLNotificationsUtil::add("ThumbnailDimentionsLimit");
+ self->mExpectingAssetId = LLUUID::null;
}
}
}