summaryrefslogtreecommitdiff
path: root/indra/newview/llavatarlist.cpp
diff options
context:
space:
mode:
authorLeyla Farazha <leyla@lindenlab.com>2010-09-13 14:59:31 -0700
committerLeyla Farazha <leyla@lindenlab.com>2010-09-13 14:59:31 -0700
commita923da7fc78b44cd5368d26652b0204322f064a4 (patch)
tree57c9820872c0d14c919a9d8ccc4f226b6b4c6f70 /indra/newview/llavatarlist.cpp
parent7ca63c963dd6a3015b580ef73e27f3ebb9ebb837 (diff)
DEV-52931 Toggling "View Display Names" doesn't take effect right away in the Friends list
Diffstat (limited to 'indra/newview/llavatarlist.cpp')
-rw-r--r--indra/newview/llavatarlist.cpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp
index 24596e5723..9b1e7c3f45 100644
--- a/indra/newview/llavatarlist.cpp
+++ b/indra/newview/llavatarlist.cpp
@@ -117,6 +117,7 @@ LLAvatarList::LLAvatarList(const Params& p)
, mShowLastInteractionTime(p.show_last_interaction_time)
, mContextMenu(NULL)
, mDirty(true) // to force initial update
+, mNeedUpdateNames(false)
, mLITUpdateTimer(NULL)
, mShowIcons(true)
, mShowInfoBtn(p.show_info_btn)
@@ -134,8 +135,17 @@ LLAvatarList::LLAvatarList(const Params& p)
mLITUpdateTimer->setTimerExpirySec(0); // zero to force initial update
mLITUpdateTimer->start();
}
+
+ LLAvatarNameCache::addUseDisplayNamesCallback(boost::bind(&LLAvatarList::handleDisplayNamesOptionChanged, this));
+}
+
+
+void LLAvatarList::handleDisplayNamesOptionChanged()
+{
+ mNeedUpdateNames = true;
}
+
LLAvatarList::~LLAvatarList()
{
delete mLITUpdateTimer;
@@ -155,6 +165,11 @@ void LLAvatarList::draw()
LLFlatListViewEx::draw();
+ if (mNeedUpdateNames)
+ {
+ updateAvatarNames();
+ }
+
if (mDirty)
refresh();
@@ -218,7 +233,6 @@ void LLAvatarList::addAvalineItem(const LLUUID& item_id, const LLUUID& session_i
//////////////////////////////////////////////////////////////////////////
// PROTECTED SECTION
//////////////////////////////////////////////////////////////////////////
-
void LLAvatarList::refresh()
{
bool have_names = TRUE;
@@ -329,6 +343,20 @@ void LLAvatarList::refresh()
onCommit();
}
+void LLAvatarList::updateAvatarNames()
+{
+ std::vector<LLPanel*> items;
+ getItems(items);
+
+ for( std::vector<LLPanel*>::const_iterator it = items.begin(); it != items.end(); it++)
+ {
+ LLAvatarListItem* item = static_cast<LLAvatarListItem*>(*it);
+ item->updateAvatarName();
+ }
+ mNeedUpdateNames = false;
+}
+
+
bool LLAvatarList::filterHasMatches()
{
uuid_vec_t values = getIDs();