diff options
| author | Todd Stinson <stinson@lindenlab.com> | 2012-05-31 12:22:47 -0700 | 
|---|---|---|
| committer | Todd Stinson <stinson@lindenlab.com> | 2012-05-31 12:22:47 -0700 | 
| commit | 938f42ded789dd70b31820d29694256cec3a1572 (patch) | |
| tree | 9f3c16e631e2fc2870cc3142311f2a538f8998e4 | |
| parent | d00192c9cbeaace7c1b7c09bfb86a5b5d8dff458 (diff) | |
Reloading the the pathfinding object floaters when the god level is changed.
| -rwxr-xr-x | indra/newview/llagent.cpp | 7 | ||||
| -rw-r--r-- | indra/newview/llagent.h | 10 | ||||
| -rw-r--r-- | indra/newview/llfloaterpathfindingobjects.cpp | 15 | ||||
| -rw-r--r-- | indra/newview/llfloaterpathfindingobjects.h | 3 | 
4 files changed, 35 insertions, 0 deletions
| diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 3870a3be2e..d94e01ee47 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 740770bbdf..72f695d917 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -631,6 +631,16 @@ public:  	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 e8d80c09d8..3f6c4983d5 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 34eb129864..79d241757c 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 @@ private:  	void onScrollListSelectionChanged();  	void onSelectionListChanged();  	void onRegionBoundaryCrossed(); +	void onGodLevelChange(U8 pGodLevel);  	void updateMessagingStatus();  	void updateStateOnListActionControls(); @@ -148,6 +150,7 @@ private:  	boost::signals2::connection        mSelectionUpdateSlot;  	boost::signals2::connection        mRegionBoundaryCrossingSlot; +	LLAgent::god_level_change_slot_t   mGodLevelChangeSlot;  };  #endif // LL_LLFLOATERPATHFINDINGOBJECTS_H | 
