diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 8589cfb7349681ba57763a30221aa37eb6da72fa..a1a402f28325f77b73d1b70a18d5b1f160704767 100755 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -279,7 +279,12 @@ LLFloaterLand::LLFloaterLand(const LLSD& seed) } BOOL LLFloaterLand::postBuild() -{ +{ + if (!mParcelMsgSignalSlot.connected()) + { + mParcelMsgSignalSlot = LLViewerParcelMgr::getInstance()->addParcelMsgCallback( + boost::bind(&LLFloaterLand::selectiveRefresh, this)); + } setVisibleCallback(boost::bind(&LLFloaterLand::onVisibilityChanged, this, _2)); LLTabContainer* tab = getChild<LLTabContainer>("landtab"); @@ -298,6 +303,9 @@ BOOL LLFloaterLand::postBuild() // virtual LLFloaterLand::~LLFloaterLand() { + if (mParcelMsgSignalSlot.connected()) + mParcelMsgSignalSlot.disconnect(); + LLViewerParcelMgr::getInstance()->removeObserver( sObserver ); delete sObserver; sObserver = NULL; @@ -315,6 +323,13 @@ void LLFloaterLand::refresh() mPanelExperiences->refresh(); } +// public +void LLFloaterLand::selectiveRefresh() +{ + mPanelAccess->refresh(); + mPanelGeneral->refresh(); +} + // static void* LLFloaterLand::createPanelLandGeneral(void* data) { diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index 369cb2e7ab051f2f94c2d64f9477f8c92530e98f..1b9c2777cc8fea497a90d91d6d82f8616f4e226b 100755 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -30,7 +30,6 @@ #include "llfloater.h" #include "llpointer.h" // LLPointer<> -//#include "llviewertexturelist.h" #include "llsafehandle.h" typedef std::set<LLUUID, lluuid_less> uuid_list_t; @@ -87,10 +86,13 @@ private: virtual ~LLFloaterLand(); void onVisibilityChanged(const LLSD& visible); + + boost::signals2::connection mParcelMsgSignalSlot; protected: /*virtual*/ void refresh(); + void selectiveRefresh(); static void* createPanelLandGeneral(void* data); static void* createPanelLandCovenant(void* data); diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index ab99df8674722c542164cd5003a9381f944c2dcf..7a25a492dc993e70ce055e7cca3947f64b3ef731 100755 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -1866,7 +1866,7 @@ void LLViewerParcelMgr::processParcelAccessListReply(LLMessageSystem *msg, void parcel->unpackAccessEntries(msg, &(parcel->mRenterList) ); }*/ - LLViewerParcelMgr::getInstance()->notifyObservers(); + LLViewerParcelMgr::getInstance()->mParcelMsgSignal(); } @@ -1888,7 +1888,7 @@ void LLViewerParcelMgr::processParcelDwellReply(LLMessageSystem* msg, void**) if (local_id == LLViewerParcelMgr::getInstance()->mCurrentParcel->getLocalID()) { LLViewerParcelMgr::getInstance()->mSelectedDwell = dwell; - LLViewerParcelMgr::getInstance()->notifyObservers(); + LLViewerParcelMgr::getInstance()->mParcelMsgSignal(); } } diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index c2d976e74670396eb9fe6d95443fea5f9e746a51..dbb5d687a17b64f4fa185b267d2bdf867bc71266 100755 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -128,6 +128,10 @@ public: void addObserver(LLParcelObserver* observer); void removeObserver(LLParcelObserver* observer); void notifyObservers(); + + typedef boost::signals2::signal<void()> parcel_msg_signal_t; + boost::signals2::connection addParcelMsgCallback(const parcel_msg_signal_t::slot_type& cb) + { return mParcelMsgSignal.connect(cb); } void setSelectionVisible(BOOL visible) { mRenderSelection = visible; } @@ -332,6 +336,8 @@ private: LLVector3d mHoverEastNorth; std::vector<LLParcelObserver*> mObservers; + + parcel_msg_signal_t mParcelMsgSignal; BOOL mTeleportInProgress; LLVector3d mTeleportInProgressPosition;