Add name_system attribute to NameBoxes and NameEditors
Uses the main one by default. Removes old show complete names on profile setting in favor of ProfileNameSystem, which is now offered under Adv. Chat->Chat UI Forces nameui to refresh on name setting update, or should, not important though
This commit is contained in:
@@ -46,29 +46,34 @@
|
||||
// statics
|
||||
std::set<LLNameUI*> LLNameUI::sInstances;
|
||||
|
||||
LLNameUI::LLNameUI(const std::string& loading, bool rlv_sensitive, const LLUUID& id, bool is_group)
|
||||
LLNameUI::LLNameUI(const std::string& loading, bool rlv_sensitive, const LLUUID& id, bool is_group, const std::string& name_system)
|
||||
: mNameID(id), mRLVSensitive(rlv_sensitive), mIsGroup(!is_group), mAllowInteract(false)
|
||||
, mInitialValue(!loading.empty() ? loading : LLTrans::getString("LoadingData"))
|
||||
, mNameSystem(name_system.empty() ? "PhoenixNameSystem" : name_system), mInitialValue(!loading.empty() ? loading : LLTrans::getString("LoadingData"))
|
||||
{
|
||||
setIsGroup(is_group);
|
||||
}
|
||||
|
||||
void LLNameUI::setIsGroup(bool is_group)
|
||||
{
|
||||
// Disconnect active connections if needed
|
||||
for (auto& connection : mConnections)
|
||||
connection.disconnect();
|
||||
|
||||
if (mIsGroup != is_group)
|
||||
{
|
||||
if (mIsGroup = is_group)
|
||||
sInstances.insert(this);
|
||||
else
|
||||
{
|
||||
sInstances.erase(this);
|
||||
mConnections[1] = gSavedSettings.getControl(mNameSystem)->getCommitSignal()->connect(boost::bind(&LLNameUI::setNameText, this));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLNameUI::setNameID(const LLUUID& name_id, bool is_group)
|
||||
{
|
||||
mNameID = name_id;
|
||||
mConnection.disconnect();
|
||||
|
||||
setIsGroup(is_group);
|
||||
|
||||
if (mAllowInteract = mNameID.notNull())
|
||||
@@ -95,9 +100,9 @@ void LLNameUI::setNameText()
|
||||
{
|
||||
LLAvatarName av_name;
|
||||
if (got_name = LLAvatarNameCache::get(mNameID, &av_name))
|
||||
name = mShowCompleteName ? av_name.getCompleteName() : av_name.getNSName();
|
||||
name = mNameSystem.empty() ? av_name.getNSName() : av_name.getNSName(gSavedSettings.getS32(mNameSystem));
|
||||
else
|
||||
mConnection = LLAvatarNameCache::get(mNameID, boost::bind(&LLNameUI::setNameText, this));
|
||||
mConnections[0] = LLAvatarNameCache::get(mNameID, boost::bind(&LLNameUI::setNameText, this));
|
||||
}
|
||||
|
||||
if (!mIsGroup && got_name && mRLVSensitive) // Filter if needed
|
||||
|
||||
Reference in New Issue
Block a user