summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorCho <cho@lindenlab.com>2013-04-03 04:12:11 +0100
committerCho <cho@lindenlab.com>2013-04-03 04:12:11 +0100
commite35becd07157f73678415bf2e741d06594acabe8 (patch)
tree13ca853fea7087c7f73bfdc09c9eac795ad80f63 /indra/newview
parent436bccf58be3e5f3dd5f990304b9aa0f8c9c66f4 (diff)
parent2ab6a73c21b5bab7ec75bcc0723fe3a52de8571f (diff)
merge
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llsociallist.cpp27
-rw-r--r--indra/newview/llsociallist.h4
2 files changed, 30 insertions, 1 deletions
diff --git a/indra/newview/llsociallist.cpp b/indra/newview/llsociallist.cpp
index 3d1d256149..2402a7c4b8 100644
--- a/indra/newview/llsociallist.cpp
+++ b/indra/newview/llsociallist.cpp
@@ -31,7 +31,10 @@ sDestroyImmediate
#include "llsociallist.h"
+#include "llavataractions.h"
+#include "llfloaterreg.h"
#include "llavatariconctrl.h"
+#include "llavatarnamecache.h"
#include "lloutputmonitorctrl.h"
#include "lltextutil.h"
@@ -60,7 +63,16 @@ void LLSocialList::refresh()
void LLSocialList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos)
{
LLSocialListItem * item = new LLSocialListItem();
- item->setName(name, mNameFilter);
+ LLAvatarName avatar_name;
+ bool has_avatar_name = id.notNull() && LLAvatarNameCache::get(id, &avatar_name);
+
+ item->mAvatarId = id;
+ if(id.notNull())
+ {
+ item->mIcon->setValue(id);
+ }
+
+ item->setName(has_avatar_name ? avatar_name.mDisplayName + " (" + name + ")" : name, mNameFilter);
addItem(item, id, pos);
}
@@ -97,6 +109,9 @@ BOOL LLSocialListItem::postBuild()
mInfoBtn->setVisible(false);
mProfileBtn->setVisible(false);
+ mInfoBtn->setClickedCallback(boost::bind(&LLSocialListItem::onInfoBtnClick, this));
+ mProfileBtn->setClickedCallback(boost::bind(&LLSocialListItem::onProfileBtnClick, this));
+
return TRUE;
}
@@ -128,3 +143,13 @@ void LLSocialListItem::onMouseLeave(S32 x, S32 y, MASK mask)
LLPanel::onMouseLeave(x, y, mask);
}
+
+void LLSocialListItem::onInfoBtnClick()
+{
+ LLFloaterReg::showInstance("inspect_avatar", LLSD().with("avatar_id", mAvatarId));
+}
+
+void LLSocialListItem::onProfileBtnClick()
+{
+ LLAvatarActions::showProfile(mAvatarId);
+}
diff --git a/indra/newview/llsociallist.h b/indra/newview/llsociallist.h
index 884d6ebd7e..bc667fc400 100644
--- a/indra/newview/llsociallist.h
+++ b/indra/newview/llsociallist.h
@@ -77,6 +77,10 @@ class LLSocialListItem : public LLPanel
void setValue(const LLSD& value);
void onMouseEnter(S32 x, S32 y, MASK mask);
void onMouseLeave(S32 x, S32 y, MASK mask);
+ void onInfoBtnClick();
+ void onProfileBtnClick();
+
+ LLUUID mAvatarId;
LLTextBox * mLabelTextBox;
std::string mLabel;