diff options
author | Loren Shih <seraph@lindenlab.com> | 2010-10-21 14:18:29 -0400 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2010-10-21 14:18:29 -0400 |
commit | 525de5554022b946641db446a5b5153f9e670e10 (patch) | |
tree | d7d679724515f6eb839f87161510ba0a0d06c89b /indra/newview/llavatarlistitem.cpp | |
parent | 219cd6ecda60e1c48852f582f0994573fd0e10ae (diff) | |
parent | 71f56a2bc9697989cd012adb57abdc922aa8ae0a (diff) |
Automated merge up from viewer-development
Diffstat (limited to 'indra/newview/llavatarlistitem.cpp')
-rw-r--r-- | indra/newview/llavatarlistitem.cpp | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index c54913a3e1..a56dc129d4 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -35,6 +35,7 @@ #include "lltextutil.h" #include "llagent.h" +#include "llavatarnamecache.h" #include "llavatariconctrl.h" #include "lloutputmonitorctrl.h" @@ -186,11 +187,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); @@ -249,7 +255,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)); } } @@ -335,23 +342,33 @@ const LLUUID& LLAvatarListItem::getAvatarId() const return mAvatarId; } -const std::string LLAvatarListItem::getAvatarName() const +std::string LLAvatarListItem::getAvatarName() const { return mAvatarName->getValue(); } -//== PRIVATE SECTION ========================================================== +std::string LLAvatarListItem::getAvatarToolTip() const +{ + return mAvatarName->getToolTip(); +} + +void LLAvatarListItem::updateAvatarName() +{ + LLAvatarNameCache::get(getAvatarId(), + boost::bind(&LLAvatarListItem::onAvatarNameCache, this, _2)); +} + +//== 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())); |