diff options
-rw-r--r-- | doc/contributions.txt | 3 | ||||
-rw-r--r-- | indra/newview/llpanelwearing.cpp | 24 | ||||
-rw-r--r-- | indra/newview/llpanelwearing.h | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_wearing_gear.xml | 7 |
4 files changed, 36 insertions, 0 deletions
diff --git a/doc/contributions.txt b/doc/contributions.txt index 6269f928cb..b0ab6f2542 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -103,6 +103,7 @@ Ales Beaumont Alexandrea Fride STORM-255 STORM-960 + STORM-1459 Alissa Sabre VWR-81 VWR-83 @@ -449,6 +450,7 @@ Jonathan Yap STORM-899 STORM-1273 STORM-1462 + STORM-1459 Kage Pixel VWR-11 Ken March @@ -690,6 +692,7 @@ Robin Cornelius STORM-1019 STORM-1095 STORM-1128 + STORM-1459 VWR-2488 VWR-9557 VWR-10579 diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp index 0645fd8a54..f19b54c1d4 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() @@ -58,6 +60,7 @@ public: registrar.add("Gear.Edit", boost::bind(&edit_outfit)); registrar.add("Gear.TakeOff", boost::bind(&LLWearingGearMenu::onTakeOff, this)); + registrar.add("Gear.Copy", boost::bind(&LLPanelWearing::copyToClipboard, mPanelWearing)); enable_registrar.add("Gear.OnEnable", boost::bind(&LLPanelWearing::isActionEnabled, mPanelWearing, _2)); @@ -280,4 +283,25 @@ void LLPanelWearing::getSelectedItemsUUIDs(uuid_vec_t& selected_uuids) const mCOFItemsList->getSelectedUUIDs(selected_uuids); } +void LLPanelWearing::copyToClipboard() +{ + std::string text; + std::vector<LLSD> data; + mCOFItemsList->getValues(data); + + for(std::vector<LLSD>::const_iterator iter = data.begin(); iter != data.end();) + { + LLSD uuid = (*iter); + LLViewerInventoryItem* item = gInventory.getItem(uuid); + + iter++; + if (item != NULL) + { + // Append a newline to all but the last line + text += iter != data.end() ? item->getName() + "\n" : item->getName(); + } + } + + gClipboard.copyFromString(utf8str_to_wstring(text)); +} // EOF diff --git a/indra/newview/llpanelwearing.h b/indra/newview/llpanelwearing.h index 157b2c4c5f..9a212b3cca 100644 --- a/indra/newview/llpanelwearing.h +++ b/indra/newview/llpanelwearing.h @@ -60,6 +60,8 @@ public: /*virtual*/ void getSelectedItemsUUIDs(uuid_vec_t& selected_uuids) const; + /*virtual*/ void copyToClipboard(); + boost::signals2::connection setSelectionChangeCallback(commit_callback_t cb); bool hasItemSelected(); diff --git a/indra/newview/skins/default/xui/en/menu_wearing_gear.xml b/indra/newview/skins/default/xui/en/menu_wearing_gear.xml index 0ac2c14253..0e858ccf10 100644 --- a/indra/newview/skins/default/xui/en/menu_wearing_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_wearing_gear.xml @@ -20,4 +20,11 @@ function="Gear.OnEnable" parameter="take_off" /> </menu_item_call> + <menu_item_call + label="Copy outfit list to clipboard" + layout="topleft" + name="copy"> + <on_click + function="Gear.Copy" /> + </menu_item_call> </toggleable_menu> |