summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorybridge.cpp
diff options
context:
space:
mode:
authorJonathan Yap <jhwelch@gmail.com>2014-12-11 18:23:23 -0500
committerJonathan Yap <jhwelch@gmail.com>2014-12-11 18:23:23 -0500
commit9f88029ca63335f4ab9f920412aa42f90dda204d (patch)
tree37e1bebdf0eb754c75f6bf8a05658b6a8d901e0a /indra/newview/llinventorybridge.cpp
parent4422fd381230056cf990129087a131d4c6139120 (diff)
STORM-2092 Add "Copy outfit list to clipboard" for COF folder
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r--indra/newview/llinventorybridge.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 199c90c705..e6cd7b9f95 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -3092,6 +3092,10 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action)
LLAppearanceMgr::instance().takeOffOutfit( cat->getLinkedUUID() );
return;
}
+ else if ("copyoutfittoclipboard" == action)
+ {
+ copyOutfitToClipboard();
+ }
else if ("purge" == action)
{
purgeItem(model, mUUID);
@@ -3249,6 +3253,39 @@ void LLFolderBridge::gatherMessage(std::string& message, S32 depth, LLError::ELe
}
}
+void LLFolderBridge::copyOutfitToClipboard()
+{
+ std::string text;
+
+ LLInventoryModel::cat_array_t* cat_array;
+ LLInventoryModel::item_array_t* item_array;
+ gInventory.getDirectDescendentsOf(mUUID, cat_array, item_array);
+
+ S32 item_count(0);
+ if( item_array )
+ {
+ item_count = item_array->size();
+ }
+
+ if (item_count)
+ {
+ for (S32 i = 0; i < item_count;)
+ {
+ LLSD uuid =item_array->at(i)->getUUID();
+ LLViewerInventoryItem* item = gInventory.getItem(uuid);
+
+ i++;
+ if (item != NULL)
+ {
+ // Append a newline to all but the last line
+ text += i != item_count ? item->getName() + "\n" : item->getName();
+ }
+ }
+ }
+
+ LLClipboard::instance().copyToClipboard(utf8str_to_wstring(text),0,text.size());
+}
+
void LLFolderBridge::openItem()
{
LL_DEBUGS() << "LLFolderBridge::openItem()" << LL_ENDL;
@@ -3847,6 +3884,11 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items
}
}
+ if (model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT) == mUUID)
+ {
+ items.push_back(std::string("Copy outfit list to clipboard"));
+ }
+
//Added by aura to force inventory pull on right-click to display folder options correctly. 07-17-06
mCallingCards = mWearables = FALSE;