From cf60c97f6f232f97666884ef692779403fb449f8 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Mon, 14 Aug 2023 17:37:10 -0700 Subject: SL-20109: New, helper version coming together slowly modulo XUI pain --- .../newview/llfloaterinventorythumbnailshelper.cpp | 48 ++++++++++++++++++++++ indra/newview/llfloaterinventorythumbnailshelper.h | 4 ++ .../xui/en/floater_inventory_thumbnails_helper.xml | 5 ++- 3 files changed, 55 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterinventorythumbnailshelper.cpp b/indra/newview/llfloaterinventorythumbnailshelper.cpp index abd5e01e5d..9697fc3d51 100644 --- a/indra/newview/llfloaterinventorythumbnailshelper.cpp +++ b/indra/newview/llfloaterinventorythumbnailshelper.cpp @@ -38,6 +38,7 @@ #include "llinventorymodel.h" #include "llinventoryfunctions.h" #include "lltexteditor.h" +#include "llscrolllistctrl.h" #include "llmediactrl.h" #include "lluuid.h" #include "llaisapi.h" @@ -66,6 +67,10 @@ BOOL LLFloaterInventoryThumbnailsHelper::postBuild() //mMergeItemsTexturesBtn->setCommitCallback(boost::bind(&LLFloaterInventoryThumbnailsHelper::onMergeItemsTextures, this)); //mMergeItemsTexturesBtn->setEnabled(false); + mInventoryThumbnailsList = getChild("inventory_thumbnails_list"); + mInventoryThumbnailsList->setAllowMultipleSelection(true); + mInventoryThumbnailsList->deleteAllItems(); + mWriteThumbnailsBtn = getChild("write_thumbnails_btn"); mWriteThumbnailsBtn->setCommitCallback(boost::bind(&LLFloaterInventoryThumbnailsHelper::onWriteThumbnails, this)); mWriteThumbnailsBtn->setEnabled(false); @@ -91,6 +96,24 @@ void LLFloaterInventoryThumbnailsHelper::recordInventoryItemEntry(LLViewerInvent //id.asString() << std::endl ), false); + + // TODO: use this ID to get name of texture and display that + const LLUUID current_thumbnail_id = item->getThumbnailUUID(); + + std::string texture_display = std::string("Not Present"); + if (!current_thumbnail_id.isNull()) + { + texture_display = current_thumbnail_id.asString(); + } + + LLSD row; + row["columns"][0]["column"] = "name"; + row["columns"][0]["type"] = "text"; + row["columns"][0]["value"] = name; + row["columns"][1]["column"] = "texture"; + row["columns"][1]["type"] = "text"; + row["columns"][1]["value"] = texture_display; + mInventoryThumbnailsList->addElement(row); } else { @@ -238,6 +261,31 @@ void LLFloaterInventoryThumbnailsHelper::onPasteTextures() } mOutputLog->setCursorAndScrollToEnd(); + + populateThumbnailNames(); +} + + +void LLFloaterInventoryThumbnailsHelper::populateThumbnailNames() +{ + std::map::iterator item_iter = mItemNamesIDs.begin(); + + while (item_iter != mItemNamesIDs.end()) + { + std::string item_name = (*item_iter).first; + + std::map::iterator texture_iter = mTextureNamesIDs.find(item_name); + if (texture_iter != mTextureNamesIDs.end()) + { + const bool case_sensitive = true; + LLScrollListItem* entry = mInventoryThumbnailsList->getItemByLabel(item_name, case_sensitive); + + const std::string texture_name = (*texture_iter).first; + entry->getColumn(1)->setValue(LLSD(texture_name)); + } + + ++item_iter; + } } void LLFloaterInventoryThumbnailsHelper::mergeItemsTextures() diff --git a/indra/newview/llfloaterinventorythumbnailshelper.h b/indra/newview/llfloaterinventorythumbnailshelper.h index 3942214fe1..ec83d5b7e0 100644 --- a/indra/newview/llfloaterinventorythumbnailshelper.h +++ b/indra/newview/llfloaterinventorythumbnailshelper.h @@ -30,6 +30,7 @@ #include "llfloater.h" class LLTextEditor; +class LLScrollListCtrl; class LLMediaCtrl; class LLViewerInventoryItem; class LLUUID; @@ -43,6 +44,8 @@ class LLFloaterInventoryThumbnailsHelper: BOOL postBuild() override; ~LLFloaterInventoryThumbnailsHelper(); + LLScrollListCtrl* mInventoryThumbnailsList; + LLUICtrl* mPasteItemsBtn; void onPasteItems(); @@ -58,6 +61,7 @@ class LLFloaterInventoryThumbnailsHelper: void recordInventoryItemEntry(LLViewerInventoryItem* item); void recordTextureItemEntry(LLViewerInventoryItem* item); + void populateThumbnailNames(); std::map mItemNamesIDs; std::map mTextureNamesIDs; diff --git a/indra/newview/skins/default/xui/en/floater_inventory_thumbnails_helper.xml b/indra/newview/skins/default/xui/en/floater_inventory_thumbnails_helper.xml index 62d0417f9e..512bce2475 100644 --- a/indra/newview/skins/default/xui/en/floater_inventory_thumbnails_helper.xml +++ b/indra/newview/skins/default/xui/en/floater_inventory_thumbnails_helper.xml @@ -13,12 +13,13 @@