diff options
author | Todd Stinson <stinson@lindenlab.com> | 2012-04-05 15:59:34 -0700 |
---|---|---|
committer | Todd Stinson <stinson@lindenlab.com> | 2012-04-05 15:59:34 -0700 |
commit | 9d22b22d962321822a6be6a23150e6d5f939cd50 (patch) | |
tree | 0dfeab5f7d33c5de6ef8e67af59695529266dddf /indra/newview/llfloaterpathfindinglinksets.cpp | |
parent | d23fbd0dd0dca9819965b850313dea92da913430 (diff) |
PATH-482: BUGFIX Automatically reloading the character and linksets floaters on region crossing.
Diffstat (limited to 'indra/newview/llfloaterpathfindinglinksets.cpp')
-rw-r--r-- | indra/newview/llfloaterpathfindinglinksets.cpp | 170 |
1 files changed, 91 insertions, 79 deletions
diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp index 547db078b1..c2df53a31d 100644 --- a/indra/newview/llfloaterpathfindinglinksets.cpp +++ b/indra/newview/llfloaterpathfindinglinksets.cpp @@ -51,6 +51,7 @@ #include "llpathfindinglinksetlist.h"
#include "llpathfindingmanager.h"
#include "llnotificationsutil.h"
+#include "llenvmanager.h"
#include <boost/bind.hpp>
#include <boost/signals2.hpp>
@@ -218,10 +219,20 @@ void LLFloaterPathfindingLinksets::onOpen(const LLSD& pKey) {
mSelectionUpdateSlot = LLSelectMgr::getInstance()->mUpdateSignal.connect(boost::bind(&LLFloaterPathfindingLinksets::updateControls, this));
}
+
+ if (!mRegionBoundarySlot.connected())
+ {
+ mRegionBoundarySlot = LLEnvManagerNew::instance().setRegionChangeCallback(boost::bind(&LLFloaterPathfindingLinksets::onRegionBoundaryCross, this));
+ }
}
void LLFloaterPathfindingLinksets::onClose(bool pAppQuitting)
{
+ if (mRegionBoundarySlot.connected())
+ {
+ mRegionBoundarySlot.disconnect();
+ }
+
if (mSelectionUpdateSlot.connected())
{
mSelectionUpdateSlot.disconnect();
@@ -277,16 +288,6 @@ void LLFloaterPathfindingLinksets::openLinksetsEditor() LLFloaterReg::toggleInstanceOrBringToFront("pathfinding_linksets");
}
-LLFloaterPathfindingLinksets::EMessagingState LLFloaterPathfindingLinksets::getMessagingState() const
-{
- return mMessagingState;
-}
-
-bool LLFloaterPathfindingLinksets::isMessagingInProgress() const
-{
- return ((mMessagingState == kMessagingGetRequestSent) || (mMessagingState == kMessagingSetRequestSent));
-}
-
LLFloaterPathfindingLinksets::LLFloaterPathfindingLinksets(const LLSD& pSeed)
: LLFloater(pSeed),
mFilterByName(NULL),
@@ -315,6 +316,7 @@ LLFloaterPathfindingLinksets::LLFloaterPathfindingLinksets(const LLSD& pSeed) mEditD(NULL),
mApplyEditsButton(NULL),
mMessagingState(kMessagingUnknown),
+ mMessagingRequestId(0U),
mLinksetsListPtr(),
mLinksetsSelection(),
mAgentStateSlot(),
@@ -326,6 +328,11 @@ LLFloaterPathfindingLinksets::~LLFloaterPathfindingLinksets() {
}
+LLFloaterPathfindingLinksets::EMessagingState LLFloaterPathfindingLinksets::getMessagingState() const
+{
+ return mMessagingState;
+}
+
void LLFloaterPathfindingLinksets::setMessagingState(EMessagingState pMessagingState)
{
mMessagingState = pMessagingState;
@@ -334,22 +341,66 @@ void LLFloaterPathfindingLinksets::setMessagingState(EMessagingState pMessagingS void LLFloaterPathfindingLinksets::requestGetLinksets()
{
- llassert(!isMessagingInProgress());
- if (!isMessagingInProgress())
+ switch (LLPathfindingManager::getInstance()->requestGetLinksets(++mMessagingRequestId, boost::bind(&LLFloaterPathfindingLinksets::handleNewLinksets, this, _1, _2, _3)))
+ {
+ case LLPathfindingManager::kRequestStarted :
+ setMessagingState(kMessagingGetRequestSent);
+ break;
+ case LLPathfindingManager::kRequestCompleted :
+ clearLinksets();
+ setMessagingState(kMessagingComplete);
+ break;
+ case LLPathfindingManager::kRequestNotEnabled :
+ clearLinksets();
+ setMessagingState(kMessagingNotEnabled);
+ break;
+ case LLPathfindingManager::kRequestError :
+ setMessagingState(kMessagingGetError);
+ break;
+ default :
+ setMessagingState(kMessagingGetError);
+ llassert(0);
+ break;
+ }
+}
+
+void LLFloaterPathfindingLinksets::requestSetLinksets(LLPathfindingLinksetListPtr pLinksetList, LLPathfindingLinkset::ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD)
+{
+ switch (LLPathfindingManager::getInstance()->requestSetLinksets(++mMessagingRequestId, pLinksetList, pLinksetUse, pA, pB, pC, pD, boost::bind(&LLFloaterPathfindingLinksets::handleUpdateLinksets, this, _1, _2, _3)))
+ {
+ case LLPathfindingManager::kRequestStarted :
+ setMessagingState(kMessagingSetRequestSent);
+ break;
+ case LLPathfindingManager::kRequestCompleted :
+ setMessagingState(kMessagingComplete);
+ break;
+ case LLPathfindingManager::kRequestNotEnabled :
+ clearLinksets();
+ setMessagingState(kMessagingNotEnabled);
+ break;
+ case LLPathfindingManager::kRequestError :
+ setMessagingState(kMessagingSetError);
+ break;
+ default :
+ setMessagingState(kMessagingSetError);
+ llassert(0);
+ break;
+ }
+}
+
+void LLFloaterPathfindingLinksets::handleNewLinksets(LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::ERequestStatus pLinksetsRequestStatus, LLPathfindingLinksetListPtr pLinksetsListPtr)
+{
+ llassert(pRequestId <= mMessagingRequestId);
+ if (pRequestId == mMessagingRequestId)
{
- switch (LLPathfindingManager::getInstance()->requestGetLinksets(boost::bind(&LLFloaterPathfindingLinksets::handleNewLinksets, this, _1, _2)))
+ mLinksetsListPtr = pLinksetsListPtr;
+ updateScrollList();
+
+ switch (pLinksetsRequestStatus)
{
- case LLPathfindingManager::kRequestStarted :
- setMessagingState(kMessagingGetRequestSent);
- break;
case LLPathfindingManager::kRequestCompleted :
- clearLinksets();
setMessagingState(kMessagingComplete);
break;
- case LLPathfindingManager::kRequestNotEnabled :
- clearLinksets();
- setMessagingState(kMessagingNotEnabled);
- break;
case LLPathfindingManager::kRequestError :
setMessagingState(kMessagingGetError);
break;
@@ -361,23 +412,26 @@ void LLFloaterPathfindingLinksets::requestGetLinksets() }
}
-void LLFloaterPathfindingLinksets::requestSetLinksets(LLPathfindingLinksetListPtr pLinksetList, LLPathfindingLinkset::ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD)
+void LLFloaterPathfindingLinksets::handleUpdateLinksets(LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::ERequestStatus pLinksetsRequestStatus, LLPathfindingLinksetListPtr pLinksetsListPtr)
{
- llassert(!isMessagingInProgress());
- if (!isMessagingInProgress())
+ llassert(pRequestId <= mMessagingRequestId);
+ if (pRequestId == mMessagingRequestId)
{
- switch (LLPathfindingManager::getInstance()->requestSetLinksets(pLinksetList, pLinksetUse, pA, pB, pC, pD, boost::bind(&LLFloaterPathfindingLinksets::handleUpdateLinksets, this, _1, _2)))
+ if (mLinksetsListPtr == NULL)
+ {
+ mLinksetsListPtr = pLinksetsListPtr;
+ }
+ else
+ {
+ mLinksetsListPtr->update(*pLinksetsListPtr);
+ }
+ updateScrollList();
+
+ switch (pLinksetsRequestStatus)
{
- case LLPathfindingManager::kRequestStarted :
- setMessagingState(kMessagingSetRequestSent);
- break;
case LLPathfindingManager::kRequestCompleted :
setMessagingState(kMessagingComplete);
break;
- case LLPathfindingManager::kRequestNotEnabled :
- clearLinksets();
- setMessagingState(kMessagingNotEnabled);
- break;
case LLPathfindingManager::kRequestError :
setMessagingState(kMessagingSetError);
break;
@@ -389,53 +443,6 @@ void LLFloaterPathfindingLinksets::requestSetLinksets(LLPathfindingLinksetListPt }
}
-void LLFloaterPathfindingLinksets::handleNewLinksets(LLPathfindingManager::ERequestStatus pLinksetsRequestStatus, LLPathfindingLinksetListPtr pLinksetsListPtr)
-{
- mLinksetsListPtr = pLinksetsListPtr;
- updateScrollList();
-
- switch (pLinksetsRequestStatus)
- {
- case LLPathfindingManager::kRequestCompleted :
- setMessagingState(kMessagingComplete);
- break;
- case LLPathfindingManager::kRequestError :
- setMessagingState(kMessagingGetError);
- break;
- default :
- setMessagingState(kMessagingGetError);
- llassert(0);
- break;
- }
-}
-
-void LLFloaterPathfindingLinksets::handleUpdateLinksets(LLPathfindingManager::ERequestStatus pLinksetsRequestStatus, LLPathfindingLinksetListPtr pLinksetsListPtr)
-{
- if (mLinksetsListPtr == NULL)
- {
- mLinksetsListPtr = pLinksetsListPtr;
- }
- else
- {
- mLinksetsListPtr->update(*pLinksetsListPtr);
- }
- updateScrollList();
-
- switch (pLinksetsRequestStatus)
- {
- case LLPathfindingManager::kRequestCompleted :
- setMessagingState(kMessagingComplete);
- break;
- case LLPathfindingManager::kRequestError :
- setMessagingState(kMessagingSetError);
- break;
- default :
- setMessagingState(kMessagingSetError);
- llassert(0);
- break;
- }
-}
-
void LLFloaterPathfindingLinksets::onApplyAllFilters()
{
applyFilters();
@@ -562,6 +569,11 @@ void LLFloaterPathfindingLinksets::onAgentStateCB(LLPathfindingManager::EAgentSt updateControls();
}
+void LLFloaterPathfindingLinksets::onRegionBoundaryCross()
+{
+ requestGetLinksets();
+}
+
void LLFloaterPathfindingLinksets::applyFilters()
{
updateScrollList();
|