summaryrefslogtreecommitdiff
path: root/indra/newview/llsociallist.cpp
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2013-04-02 20:10:44 -0700
committerGilbert Gonzales <gilbert@lindenlab.com>2013-04-02 20:10:44 -0700
commit859f7b5484df50bb45e10c8d73517205328b6b9c (patch)
tree15341c5d5250c6736b3906a3d4a5bfa669ca2701 /indra/newview/llsociallist.cpp
parentae4dcb2d1cade521f4cb116e3b7aa79475c38cc6 (diff)
adding support for showing avatar icon and avatar name + facebook name into LLSocialListItem. Also the info button and profile button should now work
Diffstat (limited to 'indra/newview/llsociallist.cpp')
-rw-r--r--indra/newview/llsociallist.cpp27
1 files changed, 26 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);
+}