summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterinventorythumbnailshelper.cpp
diff options
context:
space:
mode:
authorCallum Prentice <callum@lindenlab.com>2023-08-14 17:37:10 -0700
committerCallum Prentice <callum@lindenlab.com>2023-08-14 17:37:10 -0700
commitcf60c97f6f232f97666884ef692779403fb449f8 (patch)
treeca7c36a64b9186d78947a191f507a76631f227ee /indra/newview/llfloaterinventorythumbnailshelper.cpp
parentabb8d0402c8498dc5ce8dfec1438f2fedbaecce9 (diff)
SL-20109: New, helper version coming together slowly modulo XUI pain
Diffstat (limited to 'indra/newview/llfloaterinventorythumbnailshelper.cpp')
-rw-r--r--indra/newview/llfloaterinventorythumbnailshelper.cpp48
1 files changed, 48 insertions, 0 deletions
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<LLScrollListCtrl>("inventory_thumbnails_list");
+ mInventoryThumbnailsList->setAllowMultipleSelection(true);
+ mInventoryThumbnailsList->deleteAllItems();
+
mWriteThumbnailsBtn = getChild<LLUICtrl>("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<std::string, LLUUID>::iterator item_iter = mItemNamesIDs.begin();
+
+ while (item_iter != mItemNamesIDs.end())
+ {
+ std::string item_name = (*item_iter).first;
+
+ std::map<std::string, LLUUID>::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()