summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelwearing.cpp
diff options
context:
space:
mode:
authorDebi King (Dessie) <dessie@lindenlab.com>2011-07-29 13:32:51 -0400
committerDebi King (Dessie) <dessie@lindenlab.com>2011-07-29 13:32:51 -0400
commitfb9f092972c915ff77b3866dae302e3433b46224 (patch)
tree03d970b890a2cd6a4f10e5d90e01fe8ed66ce3b1 /indra/newview/llpanelwearing.cpp
parentad96a4ef4706ae39d259281dd993a52034946425 (diff)
parent0e3cea49aaba7fb9e4a75c4a76779ba9273549bf (diff)
reconciled .hgtags
Diffstat (limited to 'indra/newview/llpanelwearing.cpp')
-rw-r--r--indra/newview/llpanelwearing.cpp24
1 files changed, 24 insertions, 0 deletions
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