summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-01-20 17:12:24 -0800
committerTodd Stinson <stinson@lindenlab.com>2012-01-20 17:12:24 -0800
commitdd7cb6392683f4dfa536ef72e13919a082157a04 (patch)
tree80e16214bc96c6752dabf5c711f55570915e735e /indra
parent1aa9408215d395122e1b79b8bced08d3dd9a3067 (diff)
PATH-187: Starting to refactor the capability service for querying/editing linksets.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfloaterpathfindinglinksets.cpp118
-rw-r--r--indra/newview/llfloaterpathfindinglinksets.h28
-rw-r--r--indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml20
3 files changed, 97 insertions, 69 deletions
diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp
index 99465466e1..9d8f99902b 100644
--- a/indra/newview/llfloaterpathfindinglinksets.cpp
+++ b/indra/newview/llfloaterpathfindinglinksets.cpp
@@ -704,7 +704,7 @@ BOOL LLFloaterPathfindingLinksets::postBuild()
mApplyEdits->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onApplyChangesClicked, this));
setEnableEditFields(false);
- setFetchState(kFetchInitial);
+ setMessagingState(kMessagingInitial);
return LLFloater::postBuild();
}
@@ -719,20 +719,23 @@ void LLFloaterPathfindingLinksets::openLinksetsEditor()
LLFloaterReg::toggleInstanceOrBringToFront("pathfinding_linksets");
}
-LLFloaterPathfindingLinksets::EFetchState LLFloaterPathfindingLinksets::getFetchState() const
+LLFloaterPathfindingLinksets::EMessagingState LLFloaterPathfindingLinksets::getMessagingState() const
{
- return mFetchState;
+ return mMessagingState;
}
-BOOL LLFloaterPathfindingLinksets::isFetchInProgress() const
+BOOL LLFloaterPathfindingLinksets::isMessagingInProgress() const
{
BOOL retVal;
- switch (getFetchState())
+ switch (getMessagingState())
{
- case kFetchStarting :
- case kFetchRequestSent :
- case kFetchRequestSent_MultiRequested :
- case kFetchReceived :
+ case kMessagingFetchStarting :
+ case kMessagingFetchRequestSent :
+ case kMessagingFetchRequestSent_MultiRequested :
+ case kMessagingFetchReceived :
+ case kMessagingModifyStarting :
+ case kMessagingModifyRequestSent :
+ case kMessagingModifyReceived :
retVal = true;
break;
default :
@@ -746,7 +749,7 @@ BOOL LLFloaterPathfindingLinksets::isFetchInProgress() const
LLFloaterPathfindingLinksets::LLFloaterPathfindingLinksets(const LLSD& pSeed)
: LLFloater(pSeed),
mPathfindingLinksets(),
- mFetchState(kFetchInitial),
+ mMessagingState(kMessagingInitial),
mLinksetsScrollList(NULL),
mLinksetsStatus(NULL),
mFilterByName(NULL),
@@ -778,28 +781,28 @@ LLFloaterPathfindingLinksets::~LLFloaterPathfindingLinksets()
void LLFloaterPathfindingLinksets::sendNavMeshDataGetRequest()
{
- if (isFetchInProgress())
+ if (isMessagingInProgress())
{
- if (getFetchState() == kFetchRequestSent)
+ if (getMessagingState() == kMessagingFetchRequestSent)
{
- setFetchState(kFetchRequestSent_MultiRequested);
+ setMessagingState(kMessagingFetchRequestSent_MultiRequested);
}
}
else
{
- setFetchState(kFetchStarting);
+ setMessagingState(kMessagingFetchStarting);
mPathfindingLinksets.clearLinksets();
updateLinksetsList();
std::string navMeshDataURL = getCapabilityURL();
if (navMeshDataURL.empty())
{
- setFetchState(kFetchComplete);
+ setMessagingState(kMessagingComplete);
llwarns << "cannot query object navmesh properties from current region '" << getRegionName() << "'" << llendl;
}
else
{
- setFetchState(kFetchRequestSent);
+ setMessagingState(kMessagingFetchRequestSent);
LLHTTPClient::get(navMeshDataURL, new NavMeshDataGetResponder(navMeshDataURL, this));
}
}
@@ -807,28 +810,31 @@ void LLFloaterPathfindingLinksets::sendNavMeshDataGetRequest()
void LLFloaterPathfindingLinksets::sendNavMeshDataPutRequest(const LLSD& pPostData)
{
- std::string navMeshDataURL = getCapabilityURL();
- if (navMeshDataURL.empty())
+ if (!isMessagingInProgress())
{
- llwarns << "cannot put object navmesh properties for current region '" << getRegionName() << "'" << llendl;
- }
- else
- {
- LLHTTPClient::put(navMeshDataURL, pPostData, new NavMeshDataPutResponder(navMeshDataURL, this));
+ std::string navMeshDataURL = getCapabilityURL();
+ if (navMeshDataURL.empty())
+ {
+ llwarns << "cannot put object navmesh properties for current region '" << getRegionName() << "'" << llendl;
+ }
+ else
+ {
+ LLHTTPClient::put(navMeshDataURL, pPostData, new NavMeshDataPutResponder(navMeshDataURL, this));
+ }
}
}
void LLFloaterPathfindingLinksets::handleNavMeshDataGetReply(const LLSD& pNavMeshData)
{
- setFetchState(kFetchReceived);
+ setMessagingState(kMessagingFetchReceived);
mPathfindingLinksets.setNavMeshData(pNavMeshData);
updateLinksetsList();
- setFetchState(kFetchComplete);
+ setMessagingState(kMessagingComplete);
}
void LLFloaterPathfindingLinksets::handleNavMeshDataGetError(const std::string& pURL, const std::string& pErrorReason)
{
- setFetchState(kFetchError);
+ setMessagingState(kMessagingFetchError);
mPathfindingLinksets.clearLinksets();
updateLinksetsList();
llwarns << "Error fetching object navmesh properties from URL '" << pURL << "' because " << pErrorReason << llendl;
@@ -836,17 +842,15 @@ void LLFloaterPathfindingLinksets::handleNavMeshDataGetError(const std::string&
void LLFloaterPathfindingLinksets::handleNavMeshDataPutReply(const LLSD& pModifiedData)
{
- setFetchState(kFetchReceived);
+ setMessagingState(kMessagingModifyReceived);
mPathfindingLinksets.updateNavMeshData(pModifiedData);
updateLinksetsList();
- setFetchState(kFetchComplete);
+ setMessagingState(kMessagingComplete);
}
void LLFloaterPathfindingLinksets::handleNavMeshDataPutError(const std::string& pURL, const std::string& pErrorReason)
{
- setFetchState(kFetchError);
- mPathfindingLinksets.clearLinksets();
- updateLinksetsList();
+ setMessagingState(kMessagingModifyError);
llwarns << "Error putting object navmesh properties to URL '" << pURL << "' because " << pErrorReason << llendl;
}
@@ -876,9 +880,9 @@ std::string LLFloaterPathfindingLinksets::getCapabilityURL() const
return navMeshDataURL;
}
-void LLFloaterPathfindingLinksets::setFetchState(EFetchState pFetchState)
+void LLFloaterPathfindingLinksets::setMessagingState(EMessagingState pMessagingState)
{
- mFetchState = pFetchState;
+ mMessagingState = pMessagingState;
updateLinksetsStatusMessage();
}
@@ -1051,28 +1055,44 @@ void LLFloaterPathfindingLinksets::updateLinksetsStatusMessage()
std::string statusText("");
LLStyle::Params styleParams;
- switch (getFetchState())
+ switch (getMessagingState())
{
- case kFetchStarting :
- statusText = getString("linksets_fetching_starting");
+ case kMessagingInitial:
+ statusText = getString("linksets_messaging_initial");
+ break;
+ case kMessagingFetchStarting :
+ statusText = getString("linksets_messaging_fetch_starting");
break;
- case kFetchRequestSent :
- statusText = getString("linksets_fetching_inprogress");
+ case kMessagingFetchRequestSent :
+ statusText = getString("linksets_messaging_fetch_inprogress");
break;
- case kFetchRequestSent_MultiRequested :
- statusText = getString("linksets_fetching_inprogress_multi_request");
+ case kMessagingFetchRequestSent_MultiRequested :
+ statusText = getString("linksets_messaging_fetch_inprogress_multi_request");
break;
- case kFetchReceived :
- statusText = getString("linksets_fetching_received");
+ case kMessagingFetchReceived :
+ statusText = getString("linksets_messaging_fetch_received");
break;
- case kFetchError :
- statusText = getString("linksets_fetching_error");
+ case kMessagingFetchError :
+ statusText = getString("linksets_messaging_fetch_error");
styleParams.color = warningColor;
break;
- case kFetchComplete :
+ case kMessagingModifyStarting :
+ statusText = getString("linksets_messaging_modify_starting");
+ break;
+ case kMessagingModifyRequestSent :
+ statusText = getString("linksets_messaging_modify_inprogress");
+ break;
+ case kMessagingModifyReceived :
+ statusText = getString("linksets_messaging_modify_received");
+ break;
+ case kMessagingModifyError :
+ statusText = getString("linksets_messaging_modify_error");
+ styleParams.color = warningColor;
+ break;
+ case kMessagingComplete :
if (mLinksetsScrollList->isEmpty())
{
- statusText = getString("linksets_fetching_done_none_found");
+ statusText = getString("linksets_messaging_complete_none_found");
}
else
{
@@ -1089,12 +1109,12 @@ void LLFloaterPathfindingLinksets::updateLinksetsStatusMessage()
LLStringUtil::format_map_t string_args;
string_args["[NUM_SELECTED]"] = numSelectedItemsString;
string_args["[NUM_TOTAL]"] = numItemsString;
- statusText = getString("linksets_fetching_done_available", string_args);
+ statusText = getString("linksets_messaging_complete_available", string_args);
}
break;
- case kFetchInitial:
default:
- statusText = getString("linksets_fetching_initial");
+ statusText = getString("linksets_messaging_initial");
+ llassert(0);
break;
}
diff --git a/indra/newview/llfloaterpathfindinglinksets.h b/indra/newview/llfloaterpathfindinglinksets.h
index 48ea99df7d..11750a2ca0 100644
--- a/indra/newview/llfloaterpathfindinglinksets.h
+++ b/indra/newview/llfloaterpathfindinglinksets.h
@@ -178,28 +178,32 @@ class LLFloaterPathfindingLinksets
public:
typedef enum
{
- kFetchInitial,
- kFetchStarting,
- kFetchRequestSent,
- kFetchRequestSent_MultiRequested,
- kFetchReceived,
- kFetchError,
- kFetchComplete
- } EFetchState;
+ kMessagingInitial,
+ kMessagingFetchStarting,
+ kMessagingFetchRequestSent,
+ kMessagingFetchRequestSent_MultiRequested,
+ kMessagingFetchReceived,
+ kMessagingFetchError,
+ kMessagingModifyStarting,
+ kMessagingModifyRequestSent,
+ kMessagingModifyReceived,
+ kMessagingModifyError,
+ kMessagingComplete
+ } EMessagingState;
virtual BOOL postBuild();
virtual void onOpen(const LLSD& pKey);
static void openLinksetsEditor();
- EFetchState getFetchState() const;
- BOOL isFetchInProgress() const;
+ EMessagingState getMessagingState() const;
+ BOOL isMessagingInProgress() const;
protected:
private:
PathfindingLinksets mPathfindingLinksets;
- EFetchState mFetchState;
+ EMessagingState mMessagingState;
LLScrollListCtrl *mLinksetsScrollList;
LLTextBase *mLinksetsStatus;
LLLineEditor *mFilterByName;
@@ -238,7 +242,7 @@ private:
std::string getRegionName() const;
std::string getCapabilityURL() const;
- void setFetchState(EFetchState pFetchState);
+ void setMessagingState(EMessagingState pMessagingState);
void onApplyFiltersClicked();
void onClearFiltersClicked();
diff --git a/indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml b/indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml
index 81d9376fee..e5d06481e5 100644
--- a/indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml
+++ b/indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml
@@ -11,14 +11,18 @@
single_instance="true"
title="Pathfinding linksets"
width="950">
- <floater.string name="linksets_fetching_initial"></floater.string>
- <floater.string name="linksets_fetching_starting">Building query for pathfinding linksets ...</floater.string>
- <floater.string name="linksets_fetching_inprogress">Querying for pathfinding linksets ...</floater.string>
- <floater.string name="linksets_fetching_inprogress_multi_request">Querying for pathfinding linksets (already in progress) ...</floater.string>
- <floater.string name="linksets_fetching_received">Loading pathfinding linksets data from response ...</floater.string>
- <floater.string name="linksets_fetching_error">Error detected while querying for pathfinding linksets</floater.string>
- <floater.string name="linksets_fetching_done_none_found">No pathfinding linksets</floater.string>
- <floater.string name="linksets_fetching_done_available">[NUM_SELECTED] linksets selected out of [NUM_TOTAL]</floater.string>
+ <floater.string name="linksets_messaging_initial"></floater.string>
+ <floater.string name="linksets_messaging_fetch_starting">Building query for pathfinding linksets ...</floater.string>
+ <floater.string name="linksets_messaging_fetch_inprogress">Querying for pathfinding linksets ...</floater.string>
+ <floater.string name="linksets_messaging_fetch_inprogress_multi_request">Querying for pathfinding linksets (already in progress) ...</floater.string>
+ <floater.string name="linksets_messaging_fetch_received">Loading pathfinding linksets data from response ...</floater.string>
+ <floater.string name="linksets_messaging_fetch_error">Error detected while querying for pathfinding linksets</floater.string>
+ <floater.string name="linksets_messaging_modify_starting">Building modify message for selected pathfinding linksets ...</floater.string>
+ <floater.string name="linksets_messaging_modify_inprogress">Modifying selected pathfinding linksets ...</floater.string>
+ <floater.string name="linksets_messaging_modify_received">Loading modified pathfinding linksets data from response ...</floater.string>
+ <floater.string name="linksets_messaging_modify_error">Error detected while modifying for pathfinding linksets</floater.string>
+ <floater.string name="linksets_messaging_complete_none_found">No pathfinding linksets</floater.string>
+ <floater.string name="linksets_messaging_complete_available">[NUM_SELECTED] linksets selected out of [NUM_TOTAL]</floater.string>
<floater.string name="linkset_path_state_walkable">Walkable</floater.string>
<floater.string name="linkset_path_state_obstacle">Obstacle</floater.string>
<floater.string name="linkset_path_state_ignored">Ignored</floater.string>