diff --git a/doc/contributions.txt b/doc/contributions.txt index 256c39eb9e0a9b5d8975789c538da340a3f93419..b253a7662d4fad9af742c9fcb4d1335bcf123691 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -449,6 +449,7 @@ Jonathan Yap STORM-1313 STORM-899 STORM-1273 + STORM-1459 Kage Pixel VWR-11 Ken March @@ -690,6 +691,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 911a9e5ddadf064773f4c9ab943ef6ae8d3c5287..e0109675a64cc630c3e1a98682b77626a8ece828 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 diff --git a/indra/newview/llpanelwearing.h b/indra/newview/llpanelwearing.h index 157b2c4c5f0ed35c5d063377897cffa1cdfc7ae3..4c9f5ed079841e297c28622c768a83cf1b0b34fb 100644 --- a/indra/newview/llpanelwearing.h +++ b/indra/newview/llpanelwearing.h @@ -66,6 +66,7 @@ class LLPanelWearing : public LLPanelAppearanceTab private: void onWearableItemsListRightClick(LLUICtrl* ctrl, S32 x, S32 y); + void copyToClipboard(); LLInventoryCategoriesObserver* mCategoriesObserver; LLWearableItemsList* mCOFItemsList; diff --git a/indra/newview/skins/default/xui/en/panel_outfits_wearing.xml b/indra/newview/skins/default/xui/en/panel_outfits_wearing.xml index d85b778db2174ab3f0a7a8cdd59e4c1203998355..eef499184cb25d8646e8a1c573f4e78178a43dd7 100644 --- a/indra/newview/skins/default/xui/en/panel_outfits_wearing.xml +++ b/indra/newview/skins/default/xui/en/panel_outfits_wearing.xml @@ -42,6 +42,15 @@ tool_tip="Show additional options" top="1" width="31" /> + <button + follows="bottom|left|right" + height="25" + layout="topleft" + left_pad="1" + name="copy_to_clipboard" + label="Send to clipboard" + tool_tip="Send current outfit names to clipboard" + width="150" /> <icon follows="bottom|left|right" height="25" @@ -49,6 +58,6 @@ layout="topleft" left_pad="1" name="dummy_icon" - width="274" /> + width="123" /> </panel> </panel>