summaryrefslogtreecommitdiff
path: root/indra/newview
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
parent4422fd381230056cf990129087a131d4c6139120 (diff)
STORM-2092 Add "Copy outfit list to clipboard" for COF folder
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llinventorybridge.cpp42
-rw-r--r--indra/newview/llinventorybridge.h1
-rw-r--r--indra/newview/skins/default/xui/en/menu_inventory.xml8
3 files changed, 51 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;
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index df25e01688..b7d8c9d034 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -344,6 +344,7 @@ protected:
BOOL checkFolderForContentsOfType(LLInventoryModel* model, LLInventoryCollectFunctor& typeToCheck);
void modifyOutfit(BOOL append);
+ void copyOutfitToClipboard();
void determineFolderType();
void dropToFavorites(LLInventoryItem* inv_item);
diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml
index 61002bf1b5..5b8a9413bf 100644
--- a/indra/newview/skins/default/xui/en/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory.xml
@@ -457,6 +457,14 @@
function="Inventory.DoToSelected"
parameter="removefromoutfit" />
</menu_item_call>
+ <menu_item_call
+ label="Copy outfit list to clipboard"
+ layout="topleft"
+ name="Copy outfit list to clipboard">
+ <menu_item_call.on_click
+ function="Inventory.DoToSelected"
+ parameter="copyoutfittoclipboard" />
+ </menu_item_call>
<menu_item_separator
layout="topleft"
name="Outfit Separator" />