RLVa impl updated to that used in v3. Hooked RLVa restrictions back into wearables. New RLVa floater: 'Locks...' Also updated 'Restrictions...' floater.
This commit is contained in:
@@ -15,17 +15,18 @@
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "llagent.h"
|
||||
#include "llcachename.h"
|
||||
#include "llavatarnamecache.h"
|
||||
#include "llclipboard.h"
|
||||
#include "llscrolllistctrl.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "llviewerinventory.h"
|
||||
#include "llviewerjointattachment.h"
|
||||
#include "llviewerobjectlist.h"
|
||||
#include "llvoavatar.h"
|
||||
#include "llvoavatarself.h"
|
||||
#include "lluictrlfactory.h"
|
||||
|
||||
#include "rlvfloaterbehaviour.h"
|
||||
#include "rlvhelper.h"
|
||||
#include "rlvhandler.h"
|
||||
#include "rlvlocks.h"
|
||||
|
||||
// ============================================================================
|
||||
// Helper functions
|
||||
@@ -39,38 +40,277 @@ std::string rlvGetItemNameFromObjID(const LLUUID& idObj, bool fIncludeAttachPt =
|
||||
const LLViewerInventoryItem* pItem = ((pObjRoot) && (pObjRoot->isAttachment())) ? gInventory.getItem(pObjRoot->getAttachmentItemID()) : NULL;
|
||||
|
||||
std::string strItemName = (pItem) ? pItem->getName() : idObj.asString();
|
||||
if ( (!fIncludeAttachPt) || (!pObj) || (!pObj->isAttachment()) || (!gAgentAvatarp) )
|
||||
if ( (!fIncludeAttachPt) || (!pObj) || (!pObj->isAttachment()) || (!isAgentAvatarValid()) )
|
||||
return strItemName;
|
||||
|
||||
const LLViewerJointAttachment* pAttachPt =
|
||||
get_if_there(gAgentAvatarp->mAttachmentPoints, RlvAttachPtLookup::getAttachPointIndex(pObjRoot), (LLViewerJointAttachment*)NULL);
|
||||
std::string strAttachPtName = (pAttachPt) ? pAttachPt->getName() : std::string("Unknown");
|
||||
return llformat("%s (%s, %s)", strItemName.c_str(), strAttachPtName.c_str(), (pObj == pObjRoot) ? "root" : "child");
|
||||
return llformat("%s (%s%s)", strItemName.c_str(), strAttachPtName.c_str(), (pObj == pObjRoot) ? "" : ", child");
|
||||
}
|
||||
|
||||
// Checked: 2011-05-23 (RLVa-1.3.0c) | Added: RLVa-1.3.0c
|
||||
bool rlvGetShowException(ERlvBehaviour eBhvr)
|
||||
{
|
||||
switch (eBhvr)
|
||||
{
|
||||
case RLV_BHVR_RECVCHAT:
|
||||
case RLV_BHVR_RECVEMOTE:
|
||||
case RLV_BHVR_SENDIM:
|
||||
case RLV_BHVR_RECVIM:
|
||||
case RLV_BHVR_TPLURE:
|
||||
case RLV_BHVR_ACCEPTTP:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// RlvFloaterBehaviours member functions
|
||||
|
||||
RlvFloaterBehaviour::RlvFloaterBehaviour(const LLSD& key)
|
||||
// Checked: 2010-04-18 (RLVa-1.3.1c) | Modified: RLVa-1.2.0e
|
||||
void RlvFloaterBehaviours::onOpen()
|
||||
{
|
||||
m_ConnRlvCommand = gRlvHandler.setCommandCallback(boost::bind(&RlvFloaterBehaviours::onCommand, this, _1, _2));
|
||||
|
||||
refreshAll();
|
||||
}
|
||||
|
||||
// Checked: 2010-04-18 (RLVa-1.3.1c) | Modified: RLVa-1.2.0e
|
||||
void RlvFloaterBehaviours::onClose(bool fQuitting)
|
||||
{
|
||||
m_ConnRlvCommand.disconnect();
|
||||
LLFloater::onClose(fQuitting);
|
||||
}
|
||||
|
||||
RlvFloaterBehaviours::RlvFloaterBehaviours(const LLSD& key)
|
||||
: LLFloater(std::string("rlvBehaviours"))
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_rlv_behaviour.xml");
|
||||
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_rlv_behaviours.xml");
|
||||
}
|
||||
|
||||
|
||||
void RlvFloaterBehaviour::show(void*)
|
||||
void RlvFloaterBehaviours::toggle(void*)
|
||||
{
|
||||
RlvFloaterBehaviour::showInstance();
|
||||
RlvFloaterBehaviours::toggleInstance();
|
||||
}
|
||||
|
||||
// Checked: 2010-04-18 (RLVa-1.1.3b) | Modified: RLVa-1.2.0e
|
||||
void RlvFloaterBehaviour::refreshAll()
|
||||
BOOL RlvFloaterBehaviours::visible(void*)
|
||||
{
|
||||
return RlvFloaterBehaviours::instanceVisible();
|
||||
}
|
||||
|
||||
// Checked: 2010-04-18 (RLVa-1.3.1c) | Modified: RLVa-1.2.0e
|
||||
void RlvFloaterBehaviours::onAvatarNameLookup(const LLUUID& idAgent, const LLAvatarName& avName)
|
||||
{
|
||||
uuid_vec_t::iterator itLookup = std::find(m_PendingLookup.begin(), m_PendingLookup.end(), idAgent);
|
||||
if (itLookup != m_PendingLookup.end())
|
||||
m_PendingLookup.erase(itLookup);
|
||||
if (getVisible())
|
||||
refreshAll();
|
||||
}
|
||||
|
||||
// Checked: 2011-05-26 (RLVa-1.3.1c) | Added: RLVa-1.3.1c
|
||||
void RlvFloaterBehaviours::onBtnCopyToClipboard()
|
||||
{
|
||||
std::ostringstream strRestrictions;
|
||||
|
||||
strRestrictions << RlvStrings::getVersion() << "\n";
|
||||
|
||||
const RlvHandler::rlv_object_map_t* pObjects = gRlvHandler.getObjectMap();
|
||||
for (RlvHandler::rlv_object_map_t::const_iterator itObj = pObjects->begin(), endObj = pObjects->end(); itObj != endObj; ++itObj)
|
||||
{
|
||||
strRestrictions << "\n" << rlvGetItemNameFromObjID(itObj->first) << ":\n";
|
||||
|
||||
const rlv_command_list_t* pCommands = itObj->second.getCommandList();
|
||||
for (rlv_command_list_t::const_iterator itCmd = pCommands->begin(), endCmd = pCommands->end(); itCmd != endCmd; ++itCmd)
|
||||
{
|
||||
std::string strOption; LLUUID idOption;
|
||||
if ( (itCmd->hasOption()) && (idOption.set(itCmd->getOption(), FALSE)) && (idOption.notNull()) )
|
||||
{
|
||||
LLAvatarName avName;
|
||||
if (gObjectList.findObject(idOption))
|
||||
strOption = rlvGetItemNameFromObjID(idOption, true);
|
||||
else if (LLAvatarNameCache::get(idOption, &avName))
|
||||
strOption = (!avName.mUsername.empty()) ? avName.mUsername : avName.mDisplayName;
|
||||
else if (!gCacheName->getGroupName(idOption, strOption))
|
||||
strOption = itCmd->getOption();
|
||||
}
|
||||
|
||||
strRestrictions << " -> " << itCmd->asString();
|
||||
if ( (!strOption.empty()) && (strOption != itCmd->getOption()) )
|
||||
strRestrictions << " [" << strOption << "]";
|
||||
if (RLV_RET_SUCCESS != itCmd->getReturnType())
|
||||
strRestrictions << " (" << RlvStrings::getStringFromReturnCode(itCmd->getReturnType()) << ")";
|
||||
strRestrictions << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
LLWString text = utf8str_to_wstring(strRestrictions.str());
|
||||
gClipboard.copyFromSubstring(text,0,text.length());
|
||||
}
|
||||
|
||||
// Checked: 2011-05-23 (RLVa-1.3.1c) | Modified: RLVa-1.3.1c
|
||||
void RlvFloaterBehaviours::onCommand(const RlvCommand& rlvCmd, ERlvCmdRet eRet)
|
||||
{
|
||||
if ( (RLV_TYPE_ADD == rlvCmd.getParamType()) || (RLV_TYPE_REMOVE == rlvCmd.getParamType()) )
|
||||
refreshAll();
|
||||
}
|
||||
|
||||
// Checked: 2011-05-23 (RLVa-1.3.1c) | Added: RLVa-1.3.1c
|
||||
BOOL RlvFloaterBehaviours::postBuild()
|
||||
{
|
||||
getChild<LLUICtrl>("copy_btn")->setCommitCallback(boost::bind(&RlvFloaterBehaviours::onBtnCopyToClipboard, this));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Checked: 2011-05-23 (RLVa-1.3.1c) | Modified: RLVa-1.3.1c
|
||||
void RlvFloaterBehaviours::refreshAll()
|
||||
{
|
||||
LLCtrlListInterface* pBhvrList = childGetListInterface("behaviour_list");
|
||||
if (!pBhvrList)
|
||||
LLCtrlListInterface* pExceptList = childGetListInterface("exception_list");
|
||||
if ( (!pBhvrList) || (!pExceptList) )
|
||||
return;
|
||||
pBhvrList->operateOnAll(LLCtrlListInterface::OP_DELETE);
|
||||
pExceptList->operateOnAll(LLCtrlListInterface::OP_DELETE);
|
||||
|
||||
if (!gAgentAvatarp)
|
||||
if (!isAgentAvatarValid())
|
||||
return;
|
||||
|
||||
//
|
||||
// Set-up a row we can just reuse
|
||||
//
|
||||
LLSD sdBhvrRow; LLSD& sdBhvrColumns = sdBhvrRow["columns"];
|
||||
sdBhvrColumns[0] = LLSD().with("column", "behaviour").with("type", "text");
|
||||
sdBhvrColumns[1] = LLSD().with("column", "issuer").with("type", "text");
|
||||
|
||||
LLSD sdExceptRow; LLSD& sdExceptColumns = sdExceptRow["columns"];
|
||||
sdExceptColumns[0] = LLSD().with("column", "behaviour").with("type", "text");
|
||||
sdExceptColumns[1] = LLSD().with("column", "option").with("type", "text");
|
||||
sdExceptColumns[2] = LLSD().with("column", "issuer").with("type", "text");
|
||||
|
||||
//
|
||||
// List behaviours
|
||||
//
|
||||
const RlvHandler::rlv_object_map_t* pObjects = gRlvHandler.getObjectMap();
|
||||
for (RlvHandler::rlv_object_map_t::const_iterator itObj = pObjects->begin(), endObj = pObjects->end(); itObj != endObj; ++itObj)
|
||||
{
|
||||
const std::string strIssuer = rlvGetItemNameFromObjID(itObj->first);
|
||||
|
||||
const rlv_command_list_t* pCommands = itObj->second.getCommandList();
|
||||
for (rlv_command_list_t::const_iterator itCmd = pCommands->begin(), endCmd = pCommands->end(); itCmd != endCmd; ++itCmd)
|
||||
{
|
||||
std::string strOption; LLUUID idOption;
|
||||
if ( (itCmd->hasOption()) && (idOption.set(itCmd->getOption(), FALSE)) && (idOption.notNull()) )
|
||||
{
|
||||
LLAvatarName avName;
|
||||
if (gObjectList.findObject(idOption))
|
||||
{
|
||||
strOption = rlvGetItemNameFromObjID(idOption, true);
|
||||
}
|
||||
else if (LLAvatarNameCache::get(idOption, &avName))
|
||||
{
|
||||
strOption = (!avName.mUsername.empty()) ? avName.mUsername : avName.mDisplayName;
|
||||
}
|
||||
else if (!gCacheName->getGroupName(idOption, strOption))
|
||||
{
|
||||
if (m_PendingLookup.end() == std::find(m_PendingLookup.begin(), m_PendingLookup.end(), idOption))
|
||||
{
|
||||
LLAvatarNameCache::get(idOption, boost::bind(&RlvFloaterBehaviours::onAvatarNameLookup, this, _1, _2));
|
||||
m_PendingLookup.push_back(idOption);
|
||||
}
|
||||
strOption = itCmd->getOption();
|
||||
}
|
||||
}
|
||||
|
||||
if ( (itCmd->hasOption()) && (rlvGetShowException(itCmd->getBehaviourType())) )
|
||||
{
|
||||
// List under the "Exception" tab
|
||||
sdExceptRow["enabled"] = gRlvHandler.isException(itCmd->getBehaviourType(), idOption);
|
||||
sdExceptColumns[0]["value"] = itCmd->getBehaviour();
|
||||
sdExceptColumns[1]["value"] = strOption;
|
||||
sdExceptColumns[2]["value"] = strIssuer;
|
||||
pExceptList->addElement(sdExceptRow, ADD_BOTTOM);
|
||||
}
|
||||
else
|
||||
{
|
||||
// List under the "Restrictions" tab
|
||||
sdBhvrRow["enabled"] = (RLV_RET_SUCCESS == itCmd->getReturnType());
|
||||
sdBhvrColumns[0]["value"] = (strOption.empty()) ? itCmd->asString() : itCmd->getBehaviour() + ":" + strOption;
|
||||
sdBhvrColumns[1]["value"] = strIssuer;
|
||||
pBhvrList->addElement(sdBhvrRow, ADD_BOTTOM);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// RlvFloaterLocks member functions
|
||||
//
|
||||
|
||||
// Checked: 2010-03-11 (RLVa-1.2.0a) | Added: RLVa-1.2.0a
|
||||
void RlvFloaterLocks::onOpen()
|
||||
{
|
||||
m_ConnRlvCommand = gRlvHandler.setCommandCallback(boost::bind(&RlvFloaterLocks::onRlvCommand, this, _1, _2));
|
||||
|
||||
refreshAll();
|
||||
}
|
||||
|
||||
// Checked: 2010-03-11 (RLVa-1.2.0a) | Added: RLVa-1.2.0a
|
||||
void RlvFloaterLocks::onClose(bool fQuitting)
|
||||
{
|
||||
m_ConnRlvCommand.disconnect();
|
||||
LLFloater::onClose(fQuitting);
|
||||
}
|
||||
|
||||
RlvFloaterLocks::RlvFloaterLocks(const LLSD& key)
|
||||
: LLFloater(std::string("rlvLocks"))
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_rlv_locks.xml");
|
||||
}
|
||||
|
||||
|
||||
void RlvFloaterLocks::toggle(void*)
|
||||
{
|
||||
RlvFloaterLocks::toggleInstance();
|
||||
}
|
||||
|
||||
BOOL RlvFloaterLocks::visible(void*)
|
||||
{
|
||||
return RlvFloaterLocks::instanceVisible();
|
||||
}
|
||||
|
||||
// Checked: 2010-03-11 (RLVa-1.2.0a) | Added: RLVa-1.2.0a
|
||||
void RlvFloaterLocks::onRlvCommand(const RlvCommand& rlvCmd, ERlvCmdRet eRet)
|
||||
{
|
||||
// Refresh on any successful @XXX=y|n command where XXX is any of the attachment or wearable locking behaviours
|
||||
if ( (RLV_RET_SUCCESS == eRet) && ((RLV_TYPE_ADD == rlvCmd.getParamType()) || (RLV_TYPE_REMOVE == rlvCmd.getParamType())) )
|
||||
{
|
||||
switch (rlvCmd.getBehaviourType())
|
||||
{
|
||||
case RLV_BHVR_DETACH:
|
||||
case RLV_BHVR_ADDATTACH:
|
||||
case RLV_BHVR_REMATTACH:
|
||||
case RLV_BHVR_ADDOUTFIT:
|
||||
case RLV_BHVR_REMOUTFIT:
|
||||
refreshAll();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Checked: 2010-03-18 (RLVa-1.2.0a) | Added: RLVa-1.2.0a
|
||||
void RlvFloaterLocks::refreshAll()
|
||||
{
|
||||
LLCtrlListInterface* pLockList = childGetListInterface("lock_list");
|
||||
if (!pLockList)
|
||||
return;
|
||||
pLockList->operateOnAll(LLCtrlListInterface::OP_DELETE);
|
||||
|
||||
if (!isAgentAvatarValid())
|
||||
return;
|
||||
|
||||
//
|
||||
@@ -78,101 +318,84 @@ void RlvFloaterBehaviour::refreshAll()
|
||||
//
|
||||
LLSD sdRow;
|
||||
LLSD& sdColumns = sdRow["columns"];
|
||||
sdColumns[0]["column"] = "behaviour"; sdColumns[0]["type"] = "text";
|
||||
sdColumns[1]["column"] = "name"; sdColumns[1]["type"] = "text";
|
||||
sdColumns[0]["column"] = "lock_type"; sdColumns[0]["type"] = "text";
|
||||
sdColumns[1]["column"] = "lock_addrem"; sdColumns[1]["type"] = "text";
|
||||
sdColumns[2]["column"] = "lock_target"; sdColumns[2]["type"] = "text";
|
||||
sdColumns[3]["column"] = "lock_origin"; sdColumns[3]["type"] = "text";
|
||||
|
||||
//
|
||||
// List behaviours
|
||||
// List attachment locks
|
||||
//
|
||||
const RlvHandler::rlv_object_map_t* pRlvObjects = gRlvHandler.getObjectMap();
|
||||
for (RlvHandler::rlv_object_map_t::const_iterator itObj = pRlvObjects->begin(), endObj = pRlvObjects->end(); itObj != endObj; ++itObj)
|
||||
sdColumns[0]["value"] = "Attachment";
|
||||
sdColumns[1]["value"] = "rem";
|
||||
|
||||
const RlvAttachmentLocks::rlv_attachobjlock_map_t& attachObjRem = gRlvAttachmentLocks.getAttachObjLocks();
|
||||
for (RlvAttachmentLocks::rlv_attachobjlock_map_t::const_iterator itAttachObj = attachObjRem.begin();
|
||||
itAttachObj != attachObjRem.end(); ++itAttachObj)
|
||||
{
|
||||
sdColumns[1]["value"] = rlvGetItemNameFromObjID(itObj->first);
|
||||
sdColumns[2]["value"] = rlvGetItemNameFromObjID(itAttachObj->first);
|
||||
sdColumns[3]["value"] = rlvGetItemNameFromObjID(itAttachObj->second);
|
||||
|
||||
const rlv_command_list_t* pCommands = itObj->second.getCommandList();
|
||||
for (rlv_command_list_t::const_iterator itCmd = pCommands->begin(), endCmd = pCommands->end(); itCmd != endCmd; ++itCmd)
|
||||
{
|
||||
std::string strBhvr = itCmd->asString();
|
||||
|
||||
LLUUID idOption(itCmd->getOption());
|
||||
if (idOption.notNull())
|
||||
{
|
||||
std::string strLookup;
|
||||
if ( (gCacheName->getFullName(idOption, strLookup)) || (gCacheName->getGroupName(idOption, strLookup)) )
|
||||
{
|
||||
if (strLookup.find("???") == std::string::npos)
|
||||
strBhvr.assign(itCmd->getBehaviour()).append(":").append(strLookup);
|
||||
}
|
||||
else if (m_PendingLookup.end() == m_PendingLookup.find(idOption))
|
||||
{
|
||||
m_PendingLookup[idOption] = gCacheName->get(idOption, false, boost::bind(&RlvFloaterBehaviour::onAvatarNameLookup,this,_1));
|
||||
}
|
||||
}
|
||||
pLockList->addElement(sdRow, ADD_BOTTOM);
|
||||
}
|
||||
|
||||
sdColumns[0]["value"] = strBhvr;
|
||||
//
|
||||
// List attachment point locks
|
||||
//
|
||||
sdColumns[0]["value"] = "Attachment Point";
|
||||
|
||||
pBhvrList->addElement(sdRow, ADD_BOTTOM);
|
||||
}
|
||||
sdColumns[1]["value"] = "add";
|
||||
const RlvAttachmentLocks::rlv_attachptlock_map_t& attachPtAdd = gRlvAttachmentLocks.getAttachPtLocks(RLV_LOCK_ADD);
|
||||
for (RlvAttachmentLocks::rlv_attachptlock_map_t::const_iterator itAttachPt = attachPtAdd.begin();
|
||||
itAttachPt != attachPtAdd.end(); ++itAttachPt)
|
||||
{
|
||||
const LLViewerJointAttachment* pAttachPt =
|
||||
get_if_there(gAgentAvatarp->mAttachmentPoints, itAttachPt->first, (LLViewerJointAttachment*)NULL);
|
||||
sdColumns[2]["value"] = pAttachPt->getName();
|
||||
sdColumns[3]["value"] = rlvGetItemNameFromObjID(itAttachPt->second);
|
||||
|
||||
pLockList->addElement(sdRow, ADD_BOTTOM);
|
||||
}
|
||||
|
||||
sdColumns[1]["value"] = "rem";
|
||||
const RlvAttachmentLocks::rlv_attachptlock_map_t& attachPtRem = gRlvAttachmentLocks.getAttachPtLocks(RLV_LOCK_REMOVE);
|
||||
for (RlvAttachmentLocks::rlv_attachptlock_map_t::const_iterator itAttachPt = attachPtRem.begin();
|
||||
itAttachPt != attachPtRem.end(); ++itAttachPt)
|
||||
{
|
||||
const LLViewerJointAttachment* pAttachPt =
|
||||
get_if_there(gAgentAvatarp->mAttachmentPoints, itAttachPt->first, (LLViewerJointAttachment*)NULL);
|
||||
sdColumns[2]["value"] = pAttachPt->getName();
|
||||
sdColumns[3]["value"] = rlvGetItemNameFromObjID(itAttachPt->second);
|
||||
|
||||
pLockList->addElement(sdRow, ADD_BOTTOM);
|
||||
}
|
||||
|
||||
//
|
||||
// List wearable type locks
|
||||
//
|
||||
sdColumns[0]["value"] = "Wearable Type";
|
||||
|
||||
sdColumns[1]["value"] = "add";
|
||||
const RlvWearableLocks::rlv_wearabletypelock_map_t& wearableTypeAdd = gRlvWearableLocks.getWearableTypeLocks(RLV_LOCK_ADD);
|
||||
for (RlvWearableLocks::rlv_wearabletypelock_map_t::const_iterator itWearableType = wearableTypeAdd.begin();
|
||||
itWearableType != wearableTypeAdd.end(); ++itWearableType)
|
||||
{
|
||||
sdColumns[2]["value"] = LLWearableType::getTypeLabel(itWearableType->first);
|
||||
sdColumns[3]["value"] = rlvGetItemNameFromObjID(itWearableType->second);
|
||||
|
||||
pLockList->addElement(sdRow, ADD_BOTTOM);
|
||||
}
|
||||
|
||||
sdColumns[1]["value"] = "rem";
|
||||
const RlvWearableLocks::rlv_wearabletypelock_map_t& wearableTypeRem = gRlvWearableLocks.getWearableTypeLocks(RLV_LOCK_REMOVE);
|
||||
for (RlvWearableLocks::rlv_wearabletypelock_map_t::const_iterator itWearableType = wearableTypeRem.begin();
|
||||
itWearableType != wearableTypeRem.end(); ++itWearableType)
|
||||
{
|
||||
sdColumns[2]["value"] = LLWearableType::getTypeName(itWearableType->first);
|
||||
sdColumns[3]["value"] = rlvGetItemNameFromObjID(itWearableType->second);
|
||||
|
||||
pLockList->addElement(sdRow, ADD_BOTTOM);
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
/*
|
||||
* LLFloater overrides
|
||||
*/
|
||||
|
||||
BOOL RlvFloaterBehaviour::canClose()
|
||||
{
|
||||
return !LLApp::isExiting();
|
||||
}
|
||||
|
||||
void RlvFloaterBehaviour::onOpen()
|
||||
{
|
||||
gRlvHandler.addBehaviourObserver(this);
|
||||
|
||||
refreshAll();
|
||||
}
|
||||
|
||||
void RlvFloaterBehaviour::onClose(bool fQuitting)
|
||||
{
|
||||
LLFloater::setVisible(FALSE);
|
||||
|
||||
gRlvHandler.removeBehaviourObserver(this);
|
||||
|
||||
for (std::map<LLUUID, boost::signals2::connection>::const_iterator itLookup = m_PendingLookup.begin(); itLookup != m_PendingLookup.end(); ++itLookup)
|
||||
{
|
||||
itLookup->second.disconnect();
|
||||
}
|
||||
m_PendingLookup.clear();
|
||||
}
|
||||
|
||||
BOOL RlvFloaterBehaviour::postBuild()
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
/*
|
||||
* RlvBehaviourObserver overrides
|
||||
*/
|
||||
|
||||
void RlvFloaterBehaviour::changed(const RlvCommand& /*rlvCmd*/, bool /*fInternal*/)
|
||||
{
|
||||
refreshAll();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
||||
void RlvFloaterBehaviour::onAvatarNameLookup(const LLUUID& uuid)
|
||||
{
|
||||
std::map<LLUUID, boost::signals2::connection>::iterator itLookup = m_PendingLookup.find(uuid);
|
||||
if (itLookup != m_PendingLookup.end())
|
||||
{
|
||||
itLookup->second.disconnect();
|
||||
m_PendingLookup.erase(itLookup);
|
||||
}
|
||||
|
||||
refreshAll();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user