summaryrefslogtreecommitdiff
path: root/indra/newview/llavatarlistitem.cpp
diff options
context:
space:
mode:
authorAimee Linden <aimee@lindenlab.com>2010-09-03 15:30:16 +0100
committerAimee Linden <aimee@lindenlab.com>2010-09-03 15:30:16 +0100
commit0a74d1593513dc3209fdb29a8dc56b2794b36a29 (patch)
tree1af644fe9ad3c62999c177ae37cbeff2ffe19d62 /indra/newview/llavatarlistitem.cpp
parentce1a0c6bafad092f9687e3b5a6b4865569d96863 (diff)
parent54b9992eaefe2b68d16a6264c1901f12612e99dc (diff)
Merge between james/viewer-identity-evolution and dessie/viewer-public
Diffstat (limited to 'indra/newview/llavatarlistitem.cpp')
-rw-r--r--indra/newview/llavatarlistitem.cpp25
1 files changed, 18 insertions, 7 deletions
diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp
index eead0c9b3e..28550ad728 100644
--- a/indra/newview/llavatarlistitem.cpp
+++ b/indra/newview/llavatarlistitem.cpp
@@ -41,6 +41,7 @@
#include "lltextutil.h"
#include "llagent.h"
+#include "llavatarnamecache.h"
#include "llavatariconctrl.h"
#include "lloutputmonitorctrl.h"
@@ -167,11 +168,16 @@ void LLAvatarListItem::setOnline(bool online)
setState(online ? IS_ONLINE : IS_OFFLINE);
}
-void LLAvatarListItem::setName(const std::string& name)
+void LLAvatarListItem::setAvatarName(const std::string& name)
{
setNameInternal(name, mHighlihtSubstring);
}
+void LLAvatarListItem::setAvatarToolTip(const std::string& tooltip)
+{
+ mAvatarName->setToolTip(tooltip);
+}
+
void LLAvatarListItem::setHighlight(const std::string& highlight)
{
setNameInternal(mAvatarName->getText(), mHighlihtSubstring = highlight);
@@ -230,7 +236,8 @@ void LLAvatarListItem::setAvatarId(const LLUUID& id, const LLUUID& session_id, b
mAvatarIcon->setValue(id);
// Set avatar name.
- gCacheName->get(id, FALSE, boost::bind(&LLAvatarListItem::onNameCache, this, _2, _3));
+ LLAvatarNameCache::get(id,
+ boost::bind(&LLAvatarListItem::onAvatarNameCache, this, _2));
}
}
@@ -323,23 +330,27 @@ const LLUUID& LLAvatarListItem::getAvatarId() const
return mAvatarId;
}
-const std::string LLAvatarListItem::getAvatarName() const
+std::string LLAvatarListItem::getAvatarName() const
{
return mAvatarName->getValue();
}
+std::string LLAvatarListItem::getAvatarToolTip() const
+{
+ return mAvatarName->getToolTip();
+}
+
//== PRIVATE SECITON ==========================================================
void LLAvatarListItem::setNameInternal(const std::string& name, const std::string& highlight)
{
LLTextUtil::textboxSetHighlightedVal(mAvatarName, mAvatarNameStyle, name, highlight);
- mAvatarName->setToolTip(name);
}
-void LLAvatarListItem::onNameCache(const std::string& first_name, const std::string& last_name)
+void LLAvatarListItem::onAvatarNameCache(const LLAvatarName& av_name)
{
- std::string name = first_name + " " + last_name;
- setName(name);
+ setAvatarName(av_name.mDisplayName);
+ setAvatarToolTip(av_name.mUsername);
//requesting the list to resort
notifyParent(LLSD().with("sort", LLSD()));