Instantly update names in contact list if display name setting changes
parent
00534008d8
commit
d3eccf7975
|
|
@ -167,6 +167,8 @@ BOOL FSFloaterContacts::postBuild()
|
|||
gSavedSettings.getControl("FSFriendListColumnShowFullName")->getSignal()->connect(boost::bind(&FSFloaterContacts::onColumnDisplayModeChanged, this, "FSFriendListColumnShowFullName"));
|
||||
onColumnDisplayModeChanged();
|
||||
|
||||
LLAvatarNameCache::addUseDisplayNamesCallback(boost::bind(&FSFloaterContacts::onDisplayNameChanged, this));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -1170,6 +1172,20 @@ void FSFloaterContacts::onFullNameFormatChanged()
|
|||
}
|
||||
}
|
||||
|
||||
void FSFloaterContacts::onDisplayNameChanged()
|
||||
{
|
||||
std::vector<LLScrollListItem*> items = mFriendsList->getAllData();
|
||||
for (std::vector<LLScrollListItem*>::iterator it = items.begin(); it != items.end(); ++it)
|
||||
{
|
||||
LLAvatarName av_name;
|
||||
if (LLAvatarNameCache::get((*it)->getUUID(), &av_name))
|
||||
{
|
||||
(*it)->getColumn(LIST_FRIEND_DISPLAY_NAME)->setValue(av_name.getDisplayName());
|
||||
(*it)->getColumn(LIST_FRIEND_NAME)->setValue(getFullName(av_name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::string FSFloaterContacts::getFullName(const LLAvatarName& av_name)
|
||||
{
|
||||
if (av_name.isDisplayNameDefault())
|
||||
|
|
|
|||
|
|
@ -118,6 +118,7 @@ private:
|
|||
static void onAvatarPicked(const uuid_vec_t& ids, const std::vector<LLAvatarName> names);
|
||||
void onColumnDisplayModeChanged(const std::string& settings_name = "");
|
||||
void onFullNameFormatChanged();
|
||||
void onDisplayNameChanged();
|
||||
|
||||
// friend buttons
|
||||
void onViewProfileButtonClicked();
|
||||
|
|
|
|||
Loading…
Reference in New Issue