summaryrefslogtreecommitdiff
path: root/indra/newview/llcofwearables.cpp
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2010-05-13 15:47:32 -0700
committerJames Cook <james@lindenlab.com>2010-05-13 15:47:32 -0700
commit8b524549902b780c2833691368bc35bdb1837cd9 (patch)
treeb742a7f5463fb42663fa51e1029c80671ceb881b /indra/newview/llcofwearables.cpp
parent14f423a23c38bf554e9633752074fbcabd92599c (diff)
parentaebb49520b1919e0ac2bcc7373fc2db031e3b7f0 (diff)
merge pull from dessie/viewer-public, picking up SLE code
Diffstat (limited to 'indra/newview/llcofwearables.cpp')
-rw-r--r--indra/newview/llcofwearables.cpp29
1 files changed, 22 insertions, 7 deletions
diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp
index 29c32b6fa2..498aeec682 100644
--- a/indra/newview/llcofwearables.cpp
+++ b/indra/newview/llcofwearables.cpp
@@ -114,7 +114,7 @@ void LLCOFWearables::refresh()
populateAttachmentsAndBodypartsLists(cof_items);
- LLAppearanceMgr::wearables_by_type_t clothing_by_type(WT_COUNT);
+ LLAppearanceMgr::wearables_by_type_t clothing_by_type(LLWearableType::WT_COUNT);
LLAppearanceMgr::getInstance()->divvyWearablesByType(cof_items, clothing_by_type);
populateClothingList(clothing_by_type);
@@ -150,7 +150,7 @@ void LLCOFWearables::populateAttachmentsAndBodypartsLists(const LLInventoryModel
LLPanelInventoryListItemBase* item_panel = NULL;
if (item_type == LLAssetType::AT_OBJECT)
{
- item_panel = LLPanelInventoryListItemBase::create(item);
+ item_panel = buildAttachemntListItem(item);
mAttachments->addItem(item_panel, item->getUUID(), ADD_BOTTOM, false);
}
else if (item_type == LLAssetType::AT_BODYPART)
@@ -232,11 +232,26 @@ LLPanelBodyPartsListItem* LLCOFWearables::buildBodypartListItem(LLViewerInventor
return item_panel;
}
+LLPanelDeletableWearableListItem* LLCOFWearables::buildAttachemntListItem(LLViewerInventoryItem* item)
+{
+ llassert(item);
+ if (!item) return NULL;
+
+ LLPanelDeletableWearableListItem* item_panel = LLPanelDeletableWearableListItem::create(item);
+ if (!item_panel) return NULL;
+
+ //setting callbacks
+ //*TODO move that item panel's inner structure disclosing stuff into the panels
+ item_panel->childSetAction("btn_delete", mCOFCallbacks.mDeleteWearable);
+
+ return item_panel;
+}
+
void LLCOFWearables::populateClothingList(LLAppearanceMgr::wearables_by_type_t& clothing_by_type)
{
- llassert(clothing_by_type.size() == WT_COUNT);
+ llassert(clothing_by_type.size() == LLWearableType::WT_COUNT);
- for (U32 type = WT_SHIRT; type < WT_COUNT; ++type)
+ for (U32 type = LLWearableType::WT_SHIRT; type < LLWearableType::WT_COUNT; ++type)
{
U32 size = clothing_by_type[type].size();
if (!size) continue;
@@ -263,14 +278,14 @@ void LLCOFWearables::populateClothingList(LLAppearanceMgr::wearables_by_type_t&
//adding dummy items for missing wearable types
void LLCOFWearables::addClothingTypesDummies(const LLAppearanceMgr::wearables_by_type_t& clothing_by_type)
{
- llassert(clothing_by_type.size() == WT_COUNT);
+ llassert(clothing_by_type.size() == LLWearableType::WT_COUNT);
- for (U32 type = WT_SHIRT; type < WT_COUNT; type++)
+ for (U32 type = LLWearableType::WT_SHIRT; type < LLWearableType::WT_COUNT; type++)
{
U32 size = clothing_by_type[type].size();
if (size) continue;
- EWearableType w_type = static_cast<EWearableType>(type);
+ LLWearableType::EType w_type = static_cast<LLWearableType::EType>(type);
LLPanelInventoryListItemBase* item_panel = LLPanelDummyClothingListItem::create(w_type);
if(!item_panel) continue;
mClothing->addItem(item_panel, LLUUID::null, ADD_BOTTOM, false);