Shuffle the legacy username options around so stuff gets called in the correct order and updates the contact list properly

Ansariel 2014-08-12 11:50:44 +02:00
parent 599baba65f
commit 587412ef5f
5 changed files with 31 additions and 33 deletions

View File

@ -1167,9 +1167,14 @@ void FSFloaterContacts::onDisplayNameChanged()
LLAvatarName av_name;
if (LLAvatarNameCache::get((*it)->getUUID(), &av_name))
{
(*it)->getColumn(LIST_FRIEND_USER_NAME)->setValue(av_name.getUserNameForDisplay());
(*it)->getColumn(LIST_FRIEND_DISPLAY_NAME)->setValue(av_name.getDisplayName());
(*it)->getColumn(LIST_FRIEND_NAME)->setValue(getFullName(av_name));
}
else
{
LLAvatarNameCache::get((*it)->getUUID(), boost::bind(&FSFloaterContacts::onDisplayNameChanged, this));
}
}
}

View File

@ -67,6 +67,7 @@ public:
LLPanel* getPanelByName(const std::string& panel_name);
void sortFriendList();
void onDisplayNameChanged();
LLPanel* mFriendsTab;
FSContactsFriendsCtrl* mFriendsList;
@ -117,7 +118,6 @@ private:
// misc callbacks
static void onAvatarPicked(const uuid_vec_t& ids, const std::vector<LLAvatarName> names);
void onColumnDisplayModeChanged(const std::string& settings_name = "");
void onDisplayNameChanged();
// friend buttons
void onViewProfileButtonClicked();

View File

@ -237,10 +237,6 @@ bool callback_pick_debug_search(const LLSD& notification, const LLSD& response);
bool callback_growl_not_installed(const LLSD& notification, const LLSD& response);
#endif
// </FS:LO>
// <FS:CR>
void handleLegacyTrimOptionChanged(const LLSD& newvalue);
void handleUsernameFormatOptionChanged(const LLSD& newvalue);
// </FS:CR>
// </Firestorm>
//bool callback_skip_dialogs(const LLSD& notification, const LLSD& response, LLFloaterPreference* floater);
@ -374,24 +370,6 @@ bool callback_pick_debug_search(const LLSD& notification, const LLSD& response)
}
// </FS:AW opensim search support>
// <FS:CR> FIRE-6659: Legacy "Resident" name toggle
void handleLegacyTrimOptionChanged(const LLSD& newvalue)
{
gSavedSettings.setBOOL("FSTrimLegacyNames", newvalue.asBoolean());
LLAvatarName::setTrimResidentSurname(newvalue.asBoolean());
LLAvatarNameCache::cleanupClass();
LLVOAvatar::invalidateNameTags();
}
void handleUsernameFormatOptionChanged(const LLSD& newvalue)
{
gSavedSettings.setBOOL("FSNameTagShowLegacyUsernames", newvalue.asBoolean());
LLAvatarName::setUseLegacyFormat(newvalue.asBoolean());
LLAvatarNameCache::cleanupClass();
LLVOAvatar::invalidateNameTags();
}
// </FS:CR>
/*bool callback_skip_dialogs(const LLSD& notification, const LLSD& response, LLFloaterPreference* floater)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
@ -531,8 +509,6 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)
mCommitCallbackRegistrar.add("Pref.ResetLogPath", boost::bind(&LLFloaterPreference::onClickResetLogPath, this));
// <FS:CR>
gSavedSettings.getControl("FSColorUsername")->getCommitSignal()->connect(boost::bind(&handleNameTagOptionChanged, _2));
gSavedSettings.getControl("FSNameTagShowLegacyUsernames")->getCommitSignal()->connect(boost::bind(&handleUsernameFormatOptionChanged, _2));
gSavedSettings.getControl("FSTrimLegacyNames")->getCommitSignal()->connect(boost::bind(&handleLegacyTrimOptionChanged, _2));
gSavedSettings.getControl("FSUseLegacyClienttags")->getCommitSignal()->connect(boost::bind(&handleNameTagOptionChanged, _2));
gSavedSettings.getControl("FSClientTagsVisibility")->getCommitSignal()->connect(boost::bind(&handleNameTagOptionChanged, _2));
gSavedSettings.getControl("FSColorClienttags")->getCommitSignal()->connect(boost::bind(&handleNameTagOptionChanged, _2));

View File

@ -89,6 +89,7 @@
#include "fsfloaterposestand.h"
#include "fsfloaterteleporthistory.h"
#include "fslslbridge.h"
#include "fsfloatercontacts.h"
// Third party library includes
#include <boost/algorithm/string.hpp>
@ -774,6 +775,26 @@ static void handleDecimalPrecisionChanged(const LLSD& newvalue)
}
}
// <FS:CR> FIRE-6659: Legacy "Resident" name toggle
void handleLegacyTrimOptionChanged(const LLSD& newvalue)
{
gSavedSettings.setBOOL("FSTrimLegacyNames", newvalue.asBoolean());
LLAvatarName::setTrimResidentSurname(newvalue.asBoolean());
LLAvatarNameCache::cleanupClass();
LLVOAvatar::invalidateNameTags();
FSFloaterContacts::getInstance()->onDisplayNameChanged();
}
void handleUsernameFormatOptionChanged(const LLSD& newvalue)
{
gSavedSettings.setBOOL("FSNameTagShowLegacyUsernames", newvalue.asBoolean());
LLAvatarName::setUseLegacyFormat(newvalue.asBoolean());
LLAvatarNameCache::cleanupClass();
LLVOAvatar::invalidateNameTags();
FSFloaterContacts::getInstance()->onDisplayNameChanged();
}
// </FS:CR>
////////////////////////////////////////////////////////////////////////////
void settings_setup_listeners()
@ -970,6 +991,8 @@ void settings_setup_listeners()
gSavedPerAccountSettings.getControl("BridgeIntegrationOC")->getCommitSignal()->connect(boost::bind(&handleExternalIntegrationsOptionChanged));
gSavedPerAccountSettings.getControl("BridgeIntegrationLM")->getCommitSignal()->connect(boost::bind(&handleExternalIntegrationsOptionChanged));
gSavedSettings.getControl("FSNameTagShowLegacyUsernames")->getCommitSignal()->connect(boost::bind(&handleUsernameFormatOptionChanged, _2));
gSavedSettings.getControl("FSTrimLegacyNames")->getCommitSignal()->connect(boost::bind(&handleLegacyTrimOptionChanged, _2));
}
#if TEST_CACHED_CONTROL

View File

@ -365,10 +365,7 @@
name="display_names_check"
width="140"
tool_tip="Check to use display names in chat, IM, name tags, etc."
top_pad="3">
<check_box.commit_callback
function="FS.ToggleSortContacts" />
</check_box>
top_pad="3"/>
<check_box
control_name="FSNameTagShowLegacyUsernames"
enabled_control="NameTagShowUserNames"
@ -403,10 +400,7 @@
name="legacy_trim_check"
width="100"
tool_tip="Trim 'Resident' from legacy names"
top_delta="0">
<check_box.commit_callback
function="FS.ToggleSortContacts" />
</check_box>
top_delta="0"/>
<check_box
control_name="FSLegacyNametagPosition"