All Name UI now uses the user's NameSystem selection instead of legacy
This commit is contained in:
@@ -33,7 +33,9 @@
|
|||||||
#include "llviewerprecompiledheaders.h"
|
#include "llviewerprecompiledheaders.h"
|
||||||
|
|
||||||
#include "llnameui.h"
|
#include "llnameui.h"
|
||||||
|
|
||||||
#include "llagentdata.h"
|
#include "llagentdata.h"
|
||||||
|
#include "llavatarnamecache.h"
|
||||||
#include "lltrans.h"
|
#include "lltrans.h"
|
||||||
|
|
||||||
#include "rlvhandler.h"
|
#include "rlvhandler.h"
|
||||||
@@ -45,13 +47,23 @@ LLNameUI::LLNameUI(const std::string& loading, bool rlv_sensitive, const LLUUID&
|
|||||||
: mNameID(id), mRLVSensitive(rlv_sensitive), mIsGroup(is_group), mAllowInteract(false)
|
: mNameID(id), mRLVSensitive(rlv_sensitive), mIsGroup(is_group), mAllowInteract(false)
|
||||||
, mInitialValue(!loading.empty() ? loading : LLTrans::getString("LoadingData"))
|
, mInitialValue(!loading.empty() ? loading : LLTrans::getString("LoadingData"))
|
||||||
{
|
{
|
||||||
sInstances.insert(this);
|
if (mIsGroup) sInstances.insert(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLNameUI::setNameID(const LLUUID& name_id, bool is_group)
|
void LLNameUI::setNameID(const LLUUID& name_id, bool is_group)
|
||||||
{
|
{
|
||||||
mNameID = name_id;
|
mNameID = name_id;
|
||||||
|
mConnection.disconnect();
|
||||||
|
|
||||||
|
if (mIsGroup != is_group)
|
||||||
|
{
|
||||||
|
if (is_group)
|
||||||
|
sInstances.insert(this);
|
||||||
|
else
|
||||||
|
sInstances.erase(this);
|
||||||
|
}
|
||||||
mIsGroup = is_group;
|
mIsGroup = is_group;
|
||||||
|
|
||||||
if (mAllowInteract = mNameID.notNull())
|
if (mAllowInteract = mNameID.notNull())
|
||||||
setNameText();
|
setNameText();
|
||||||
else
|
else
|
||||||
@@ -69,7 +81,9 @@ void LLNameUI::setNameText()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
got_name = gCacheName->getFullName(mNameID, name);
|
got_name = LLAvatarNameCache::getNSName(mNameID, name);
|
||||||
|
if (!got_name)
|
||||||
|
mConnection = LLAvatarNameCache::get(mNameID, boost::bind(&LLNameUI::setNameText, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mIsGroup && got_name && mRLVSensitive) // Filter if needed
|
if (!mIsGroup && got_name && mRLVSensitive) // Filter if needed
|
||||||
|
|||||||
@@ -39,7 +39,13 @@
|
|||||||
struct LLNameUI : public LFIDBearer
|
struct LLNameUI : public LFIDBearer
|
||||||
{
|
{
|
||||||
LLNameUI(const std::string& loading = LLStringUtil::null, bool rlv_sensitive = false, const LLUUID& id = LLUUID::null, bool is_group = false);
|
LLNameUI(const std::string& loading = LLStringUtil::null, bool rlv_sensitive = false, const LLUUID& id = LLUUID::null, bool is_group = false);
|
||||||
virtual ~LLNameUI() { sInstances.erase(this); }
|
virtual ~LLNameUI()
|
||||||
|
{
|
||||||
|
if (mIsGroup)
|
||||||
|
sInstances.erase(this);
|
||||||
|
else
|
||||||
|
mConnection.disconnect();
|
||||||
|
}
|
||||||
|
|
||||||
LLUUID getStringUUIDSelectedItem() const override final { return mNameID; }
|
LLUUID getStringUUIDSelectedItem() const override final { return mNameID; }
|
||||||
uuid_vec_t getSelectedIDs() const override final { return { mNameID }; }
|
uuid_vec_t getSelectedIDs() const override final { return { mNameID }; }
|
||||||
@@ -65,6 +71,7 @@ struct LLNameUI : public LFIDBearer
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::set<LLNameUI*> sInstances;
|
static std::set<LLNameUI*> sInstances;
|
||||||
|
boost::signals2::connection mConnection;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
LLUUID mNameID;
|
LLUUID mNameID;
|
||||||
|
|||||||
Reference in New Issue
Block a user