summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-03-29 19:43:19 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-03-29 19:45:08 +0300
commit05a4485082b07208a3b5b8d5c2070243cb237e42 (patch)
tree0deb296ed1151efebe1ef48e00a180fb50c1f603
parentc10eed08189161bab67cfc296b1891a989d5748d (diff)
SL-19504 Allow using inventory items as thumbnails from clipboard
-rw-r--r--indra/newview/llfloaterchangeitemthumbnail.cpp39
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml2
2 files changed, 34 insertions, 7 deletions
diff --git a/indra/newview/llfloaterchangeitemthumbnail.cpp b/indra/newview/llfloaterchangeitemthumbnail.cpp
index 722adcc254..a10de8ba23 100644
--- a/indra/newview/llfloaterchangeitemthumbnail.cpp
+++ b/indra/newview/llfloaterchangeitemthumbnail.cpp
@@ -429,15 +429,42 @@ void LLFloaterChangeItemThumbnail::onPasteFromClipboard(void *userdata)
LLClipboard::instance().pasteFromClipboard(objects);
if (objects.size() > 0)
{
- LLUUID asset_id = objects[0];
- if (validateAsset(asset_id))
+ LLUUID potential_uuid = objects[0];
+ LLUUID asset_id;
+
+ if (potential_uuid.notNull())
{
- self->setThumbnailId(asset_id);
+ LLViewerInventoryItem* item = gInventory.getItem(potential_uuid);
+ if (item)
+ {
+ // no point checking snapshot?
+ if (item->getType() == LLAssetType::AT_TEXTURE)
+ {
+ asset_id = item->getAssetUUID();
+ }
+ }
+ else
+ {
+ LLPointer<LLViewerFetchedTexture> texturep = LLViewerTextureManager::getFetchedTexture(potential_uuid);
+ if (texturep)
+ {
+ asset_id = potential_uuid;
+ }
+ }
}
- else
+ if (asset_id.notNull())
{
- LLNotificationsUtil::add("ThumbnailDimantionsLimit");
+ // todo: if texture isn't loaded subscribe, or preload it in some way.
+ if (validateAsset(asset_id))
+ {
+ self->setThumbnailId(asset_id);
+ }
+ else
+ {
+ LLNotificationsUtil::add("ThumbnailDimentionsLimit");
+ }
}
+ // else show 'buffer has no texture' warning?
}
}
@@ -559,7 +586,7 @@ void LLFloaterChangeItemThumbnail::onTexturePickerCommit(LLUUID id)
}
else
{
- LLNotificationsUtil::add("ThumbnailDimantionsLimit");
+ LLNotificationsUtil::add("ThumbnailDimentionsLimit");
}
}
}
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 70edd567a1..0ea13e7d63 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -6134,7 +6134,7 @@ Are you sure you want to delete them?
<notification
icon="alertmodal.tga"
- name="ThumbnailDimantionsLimit"
+ name="ThumbnailDimentionsLimit"
type="alertmodal">
<unique/>
Only square images from 64 to 256 pixels per side are allowed.