diff options
| author | Jonathan Yap <none@none> | 2011-06-29 10:28:06 -0400 |
|---|---|---|
| committer | Jonathan Yap <none@none> | 2011-06-29 10:28:06 -0400 |
| commit | 68c8248fb9450cc9adb41f53f0d2f03d5fd4124e (patch) | |
| tree | 7bc314feb88ef71fda8621ecf2cdd9211f17f20f /indra/newview/llpanelwearing.cpp | |
| parent | 3bc99274f19ce0cbc3e600c0010655e2778ab405 (diff) | |
STORM-1459 "Wearing Tab" - Add ability to copy displayed inventory names to clipboard
Diffstat (limited to 'indra/newview/llpanelwearing.cpp')
| -rw-r--r-- | indra/newview/llpanelwearing.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp index 911a9e5dda..e0109675a6 100644 --- a/indra/newview/llpanelwearing.cpp +++ b/indra/newview/llpanelwearing.cpp @@ -38,6 +38,8 @@ #include "llsidetray.h" #include "llviewermenu.h" #include "llwearableitemslist.h" +#include "llsdserialize.h" +#include "llclipboard.h" // Context menu and Gear menu helper. static void edit_outfit() @@ -182,6 +184,7 @@ BOOL LLPanelWearing::postBuild() { mCOFItemsList = getChild<LLWearableItemsList>("cof_items_list"); mCOFItemsList->setRightMouseDownCallback(boost::bind(&LLPanelWearing::onWearableItemsListRightClick, this, _1, _2, _3)); + childSetAction("copy_to_clipboard", boost::bind(&LLPanelWearing::copyToClipboard, this)); LLMenuButton* menu_gear_btn = getChild<LLMenuButton>("options_gear_btn"); @@ -280,4 +283,27 @@ void LLPanelWearing::getSelectedItemsUUIDs(uuid_vec_t& selected_uuids) const mCOFItemsList->getSelectedUUIDs(selected_uuids); } +void LLPanelWearing::copyToClipboard() +{ + std::string text; + bool need_cr = false; + std::vector<LLSD> data; + mCOFItemsList->getValues(data); + for(std::vector<LLSD>::iterator iter = data.begin(); iter != data.end(); iter++) + { + LLSD uuid = (*iter); + LLViewerInventoryItem* item = gInventory.getItem(uuid); + if (!need_cr) + { + text += item->getName(); + need_cr = true; + } + else + { + text += "\n" + item->getName(); + } + } + gClipboard.copyFromString(utf8str_to_wstring(text)); +} + // EOF |
