summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorybridge.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r--indra/newview/llinventorybridge.cpp60
1 files changed, 60 insertions, 0 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 02fa81d5be..1de579d4c3 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -3093,6 +3093,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);
@@ -3250,6 +3254,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;
@@ -3737,6 +3774,15 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items
// This is the lost+found folder.
items.push_back(std::string("Empty Lost And Found"));
+ LLInventoryModel::cat_array_t* cat_array;
+ LLInventoryModel::item_array_t* item_array;
+ gInventory.getDirectDescendentsOf(mUUID, cat_array, item_array);
+ // Enable Empty menu item only when there is something to act upon.
+ if (0 == cat_array->size() && 0 == item_array->size())
+ {
+ disabled_items.push_back(std::string("Empty Lost And Found"));
+ }
+
disabled_items.push_back(std::string("New Folder"));
disabled_items.push_back(std::string("New Script"));
disabled_items.push_back(std::string("New Note"));
@@ -3781,6 +3827,15 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items
{
// This is the trash.
items.push_back(std::string("Empty Trash"));
+
+ LLInventoryModel::cat_array_t* cat_array;
+ LLInventoryModel::item_array_t* item_array;
+ gInventory.getDirectDescendentsOf(mUUID, cat_array, item_array);
+ // Enable Empty menu item only when there is something to act upon.
+ if (0 == cat_array->size() && 0 == item_array->size())
+ {
+ disabled_items.push_back(std::string("Empty Trash"));
+ }
}
else if(isItemInTrash())
{
@@ -3830,6 +3885,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;