diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 2cd5aecc2e33e6a92acd4be19ecd29ef162f568a..7119bf3f3521ba5dc857543fc8bbe5b79971ef16 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -65,6 +65,7 @@ #include "llviewercontrol.h" #include "llvoiceclient.h" #include "llweb.h" +#include "rlvhandler.h" static LLPanelInjector<LLPanelProfileSecondLife> t_panel_profile_secondlife("panel_profile_secondlife"); @@ -249,6 +250,11 @@ LLPanelProfileSecondLife::~LLPanelProfileSecondLife() { mAvatarNameCacheConnection.disconnect(); } + + if (mRlvBehaviorConn.connected()) + { + mRlvBehaviorConn.disconnect(); + } } BOOL LLPanelProfileSecondLife::postBuild() @@ -299,6 +305,8 @@ BOOL LLPanelProfileSecondLife::postBuild() LLVoiceClient::getInstance()->addObserver((LLVoiceClientStatusObserver*)this); mCopyMenuButton->setMenu("menu_name_field.xml", LLMenuButton::MP_BOTTOM_RIGHT); + mRlvBehaviorConn = gRlvHandler.setBehaviourToggleCallback([this](ERlvBehaviour eBhvr, ERlvParamType eParam) { if (eBhvr == RLV_BHVR_SHOWWORLDMAP) updateButtons(); }); + return TRUE; } @@ -737,7 +745,7 @@ void LLPanelProfileSecondLife::updateButtons() mAddFriendButton->setEnabled(true); } - bool enable_map_btn = (is_buddy_online && is_agent_mappable(av_id)) || gAgent.isGodlike(); + bool enable_map_btn = ((is_buddy_online && is_agent_mappable(av_id)) || gAgent.isGodlike()) && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWWORLDMAP); mShowOnMapButton->setEnabled(enable_map_btn); bool enable_block_btn = LLAvatarActions::canBlock(av_id) && !LLAvatarActions::isBlocked(av_id); diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index de25b924707ab7489a2b82b5ca44d4b1063b70df..49e86c399819cdf527bb6ed84b3c1a0830c37086 100644 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -208,6 +208,7 @@ class LLPanelProfileSecondLife bool mVoiceStatus; boost::signals2::connection mAvatarNameCacheConnection; + boost::signals2::connection mRlvBehaviorConn; }; diff --git a/indra/newview/llpanelprofileclassifieds.cpp b/indra/newview/llpanelprofileclassifieds.cpp index 1937e2db1c339171b2f6c0f60809a14724a79a62..825fea7981f81ca6c7c11277261631bce3b66b21 100644 --- a/indra/newview/llpanelprofileclassifieds.cpp +++ b/indra/newview/llpanelprofileclassifieds.cpp @@ -56,6 +56,8 @@ #include "llviewerregion.h" #include "llviewertexture.h" #include "llviewertexture.h" +#include "rlvactions.h" +#include "rlvhandler.h" //*TODO: verify this limit @@ -139,6 +141,10 @@ LLPanelProfileClassifieds::LLPanelProfileClassifieds() LLPanelProfileClassifieds::~LLPanelProfileClassifieds() { + if (mRlvBehaviorConn.connected()) + { + mRlvBehaviorConn.disconnect(); + } } void LLPanelProfileClassifieds::onOpen(const LLSD& key) @@ -203,6 +209,8 @@ BOOL LLPanelProfileClassifieds::postBuild() mNewButton->setCommitCallback(boost::bind(&LLPanelProfileClassifieds::onClickNewBtn, this)); mDeleteButton->setCommitCallback(boost::bind(&LLPanelProfileClassifieds::onClickDelete, this)); + mRlvBehaviorConn = gRlvHandler.setBehaviourToggleCallback([this](ERlvBehaviour eBhvr, ERlvParamType eParam) { if (eBhvr == RLV_BHVR_SHOWLOC) updateButtons(); }); + return TRUE; } @@ -356,7 +364,7 @@ void LLPanelProfileClassifieds::updateData() bool LLPanelProfileClassifieds::canAddNewClassified() { - return (mTabContainer->getTabCount() < MAX_AVATAR_CLASSIFIEDS); + return (mTabContainer->getTabCount() < MAX_AVATAR_CLASSIFIEDS) && RlvActions::canShowLocation(); } bool LLPanelProfileClassifieds::canDeleteClassified() diff --git a/indra/newview/llpanelprofileclassifieds.h b/indra/newview/llpanelprofileclassifieds.h index 31ef1c65b329f8c645979537d786bb06081be0f8..f71fcd5d54c3e725148fa70c836100f6ec3a2d60 100644 --- a/indra/newview/llpanelprofileclassifieds.h +++ b/indra/newview/llpanelprofileclassifieds.h @@ -105,6 +105,8 @@ class LLPanelProfileClassifieds LLUUID mClassifiedToSelectOnLoad; bool mClassifiedEditOnLoad; + + boost::signals2::connection mRlvBehaviorConn; }; diff --git a/indra/newview/llpanelprofilepicks.cpp b/indra/newview/llpanelprofilepicks.cpp index 43a02e2325bb888fd13c3cce6805fd5b4dc18a29..17132fcd3d91b87d1db64017c20a8c356d0e618f 100644 --- a/indra/newview/llpanelprofilepicks.cpp +++ b/indra/newview/llpanelprofilepicks.cpp @@ -50,6 +50,8 @@ #include "llviewergenericmessage.h" // send_generic_message #include "llviewerparcelmgr.h" #include "llviewerregion.h" +#include "rlvactions.h" +#include "rlvhandler.h" static LLPanelInjector<LLPanelProfilePicks> t_panel_profile_picks("panel_profile_picks"); static LLPanelInjector<LLPanelProfilePick> t_panel_profile_pick("panel_profile_pick"); @@ -121,6 +123,10 @@ LLPanelProfilePicks::LLPanelProfilePicks() LLPanelProfilePicks::~LLPanelProfilePicks() { + if (mRlvBehaviorConn.connected()) + { + mRlvBehaviorConn.disconnect(); + } } void LLPanelProfilePicks::onOpen(const LLSD& key) @@ -172,6 +178,8 @@ BOOL LLPanelProfilePicks::postBuild() mNewButton->setCommitCallback(boost::bind(&LLPanelProfilePicks::onClickNewBtn, this)); mDeleteButton->setCommitCallback(boost::bind(&LLPanelProfilePicks::onClickDelete, this)); + mRlvBehaviorConn = gRlvHandler.setBehaviourToggleCallback([this](ERlvBehaviour eBhvr, ERlvParamType eParam) { if (eBhvr == RLV_BHVR_SHOWLOC) updateButtons(); }); + return TRUE; } @@ -346,7 +354,8 @@ void LLPanelProfilePicks::updateData() bool LLPanelProfilePicks::canAddNewPick() { return (!LLAgentPicksInfo::getInstance()->isPickLimitReached() && - mTabContainer->getTabCount() < LLAgentPicksInfo::getInstance()->getMaxNumberOfPicks()); + mTabContainer->getTabCount() < LLAgentPicksInfo::getInstance()->getMaxNumberOfPicks() && + RlvActions::canShowLocation()); } bool LLPanelProfilePicks::canDeletePick() diff --git a/indra/newview/llpanelprofilepicks.h b/indra/newview/llpanelprofilepicks.h index aeaa25bf8bcf06c870c961a72a00b86d7d06f926..558956e809d7425d2d35a3cac0faa0e3c0d79be2 100644 --- a/indra/newview/llpanelprofilepicks.h +++ b/indra/newview/llpanelprofilepicks.h @@ -86,6 +86,8 @@ class LLPanelProfilePicks LLButton* mDeleteButton; LLUUID mPickToSelectOnLoad; + + boost::signals2::connection mRlvBehaviorConn; };