From 9a72f91c5ed4b78f4f131a4ae80338566b863f11 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Mon, 27 Sep 2010 15:40:02 -0700 Subject: hooked up copy to clipboard button --- indra/newview/llpanelprofileview.cpp | 10 +++++++++- indra/newview/llpanelprofileview.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/indra/newview/llpanelprofileview.cpp b/indra/newview/llpanelprofileview.cpp index dfbd355247..bff589c392 100644 --- a/indra/newview/llpanelprofileview.cpp +++ b/indra/newview/llpanelprofileview.cpp @@ -30,6 +30,7 @@ #include "llavatarconstants.h" #include "llavatarnamecache.h" // IDEVO +#include "llclipboard.h" #include "lluserrelations.h" #include "llavatarpropertiesprocessor.h" @@ -129,7 +130,8 @@ BOOL LLPanelProfileView::postBuild() mStatusText->setVisible(false); childSetCommitCallback("back",boost::bind(&LLPanelProfileView::onBackBtnClick,this),NULL); - + childSetCommitCallback("copy_to_clipboard",boost::bind(&LLPanelProfileView::onCopyToClipboard,this),NULL); + return TRUE; } @@ -149,6 +151,12 @@ void LLPanelProfileView::onBackBtnClick() } } +void LLPanelProfileView::onCopyToClipboard() +{ + std::string name = getChild("user_name")->getValue().asString() + " (" + getChild("user_slid")->getValue().asString() + ")"; + gClipboard.copyFromString(utf8str_to_wstring(name)); +} + bool LLPanelProfileView::isGrantedToSeeOnlineStatus() { const LLRelationship* relationship = LLAvatarTracker::instance().getBuddyInfo(getAvatarId()); diff --git a/indra/newview/llpanelprofileview.h b/indra/newview/llpanelprofileview.h index 153496bfd0..c6d921fdc4 100644 --- a/indra/newview/llpanelprofileview.h +++ b/indra/newview/llpanelprofileview.h @@ -74,6 +74,7 @@ public: protected: void onBackBtnClick(); + void onCopyToClipboard(); bool isGrantedToSeeOnlineStatus(); /** -- cgit v1.2.3