diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 3870a3be2ecc71d3d5e122e1b5f21ff6c196bbd1..d94e01ee471e4cbfb3d1730cc39dd97cf616ccd7 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -243,6 +243,7 @@ LLAgent::LLAgent() : mbTeleportKeepsLookAt(false), mAgentAccess(new LLAgentAccess(gSavedSettings)), + mGodLevelChangeSignal(), mCanEditParcel(false), mTeleportSourceSLURL(new LLSLURL), mTeleportState( TELEPORT_NONE ), @@ -2434,6 +2435,12 @@ void LLAgent::setAdminOverride(BOOL b) void LLAgent::setGodLevel(U8 god_level) { mAgentAccess->setGodLevel(god_level); + mGodLevelChangeSignal(god_level); +} + +LLAgent::god_level_change_slot_t LLAgent::registerGodLevelChanageListener(god_level_change_callback_t pGodLevelChangeCallback) +{ + return mGodLevelChangeSignal.connect(pGodLevelChangeCallback); } void LLAgent::setAOTransition() diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 740770bbdf26b0cbea117d436f8e38726b16d66f..72f695d9171dc87c2e53d8e1e0fedfdf0981c1c4 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -631,6 +631,16 @@ class LLAgent : public LLOldEvents::LLObservable void requestEnterGodMode(); void requestLeaveGodMode(); + typedef boost::function<void (U8)> god_level_change_callback_t; + typedef boost::signals2::signal<void (U8)> god_level_change_signal_t; + typedef boost::signals2::connection god_level_change_slot_t; + + god_level_change_slot_t registerGodLevelChanageListener(god_level_change_callback_t pGodLevelChangeCallback); + +private: + god_level_change_signal_t mGodLevelChangeSignal; + + //-------------------------------------------------------------------- // Maturity //-------------------------------------------------------------------- diff --git a/indra/newview/llfloaterpathfindingobjects.cpp b/indra/newview/llfloaterpathfindingobjects.cpp index e8d80c09d8d9a6597a63237d969806bd6f2c62d3..3f6c4983d5acf0b927d874c696d61913a0effcf7 100644 --- a/indra/newview/llfloaterpathfindingobjects.cpp +++ b/indra/newview/llfloaterpathfindingobjects.cpp @@ -78,11 +78,21 @@ void LLFloaterPathfindingObjects::onOpen(const LLSD &pKey) mRegionBoundaryCrossingSlot = LLEnvManagerNew::getInstance()->setRegionChangeCallback(boost::bind(&LLFloaterPathfindingObjects::onRegionBoundaryCrossed, this)); } + if (!mGodLevelChangeSlot.connected()) + { + mGodLevelChangeSlot = gAgent.registerGodLevelChanageListener(boost::bind(&LLFloaterPathfindingObjects::onGodLevelChange, this, _1)); + } + requestGetObjects(); } void LLFloaterPathfindingObjects::onClose(bool pIsAppQuitting) { + if (mGodLevelChangeSlot.connected()) + { + mGodLevelChangeSlot.disconnect(); + } + if (mRegionBoundaryCrossingSlot.connected()) { mRegionBoundaryCrossingSlot.disconnect(); @@ -554,6 +564,11 @@ void LLFloaterPathfindingObjects::onRegionBoundaryCrossed() requestGetObjects(); } +void LLFloaterPathfindingObjects::onGodLevelChange(U8 pGodLevel) +{ + requestGetObjects(); +} + void LLFloaterPathfindingObjects::updateMessagingStatus() { std::string statusText(""); diff --git a/indra/newview/llfloaterpathfindingobjects.h b/indra/newview/llfloaterpathfindingobjects.h index 34eb129864c03601c1275271c93d2b0af408f962..79d241757c57948659b4acc77f4c365b82a1587d 100644 --- a/indra/newview/llfloaterpathfindingobjects.h +++ b/indra/newview/llfloaterpathfindingobjects.h @@ -29,6 +29,7 @@ #include <boost/signals2.hpp> +#include "llagent.h" #include "llfloater.h" #include "llpathfindingmanager.h" #include "llpathfindingobject.h" @@ -115,6 +116,7 @@ class LLFloaterPathfindingObjects : public LLFloater void onScrollListSelectionChanged(); void onSelectionListChanged(); void onRegionBoundaryCrossed(); + void onGodLevelChange(U8 pGodLevel); void updateMessagingStatus(); void updateStateOnListActionControls(); @@ -148,6 +150,7 @@ class LLFloaterPathfindingObjects : public LLFloater boost::signals2::connection mSelectionUpdateSlot; boost::signals2::connection mRegionBoundaryCrossingSlot; + LLAgent::god_level_change_slot_t mGodLevelChangeSlot; }; #endif // LL_LLFLOATERPATHFINDINGOBJECTS_H