summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2015-05-12 14:32:43 -0700
committerRider Linden <rider@lindenlab.com>2015-05-12 14:32:43 -0700
commit723834737dc8bdb608f73c5d7fe5bdebfdaa59e5 (patch)
tree306aba81f7624100c46aa98e19ff3fdd35d86264 /indra/newview
parentdcac06d7d2cf966915779256007e46a6fe6885de (diff)
Added trivial case GET and POST to the CoreHTTP Utils
converted llfloaterregioninfo to use coroutine's and new LLCore::HTTP
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llfloaterregioninfo.cpp64
-rwxr-xr-xindra/newview/llfloaterregioninfo.h3
2 files changed, 8 insertions, 59 deletions
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index a2af9da670..42c03e22eb 100755
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -92,6 +92,7 @@
#include "llagentui.h"
#include "llmeshrepository.h"
#include "llfloaterregionrestarting.h"
+#include "llcorehttputil.h"
const S32 TERRAIN_TEXTURE_COUNT = 4;
const S32 CORNER_COUNT = 4;
@@ -768,30 +769,6 @@ bool LLPanelRegionGeneralInfo::onMessageCommit(const LLSD& notification, const L
return false;
}
-class ConsoleRequestResponder : public LLHTTPClient::Responder
-{
- LOG_CLASS(ConsoleRequestResponder);
-protected:
- /*virtual*/
- void httpFailure()
- {
- LL_WARNS() << "error requesting mesh_rez_enabled " << dumpResponse() << LL_ENDL;
- }
-};
-
-
-// called if this request times out.
-class ConsoleUpdateResponder : public LLHTTPClient::Responder
-{
- LOG_CLASS(ConsoleUpdateResponder);
-protected:
- /* virtual */
- void httpFailure()
- {
- LL_WARNS() << "error updating mesh enabled region setting " << dumpResponse() << LL_ENDL;
- }
-};
-
void LLFloaterRegionInfo::requestMeshRezInfo()
{
std::string sim_console_url = gAgent.getRegion()->getCapability("SimConsoleAsync");
@@ -800,10 +777,8 @@ void LLFloaterRegionInfo::requestMeshRezInfo()
{
std::string request_str = "get mesh_rez_enabled";
- LLHTTPClient::post(
- sim_console_url,
- LLSD(request_str),
- new ConsoleRequestResponder);
+ LLCoreHttpUtil::HttpCoroutineAdapter::genericHttpPost(sim_console_url, LLSD(request_str),
+ "Requested mesh_rez_enabled", "Error requesting mesh_rez_enabled");
}
}
@@ -839,7 +814,8 @@ BOOL LLPanelRegionGeneralInfo::sendUpdate()
body["allow_parcel_changes"] = getChild<LLUICtrl>("allow_parcel_changes_check")->getValue();
body["block_parcel_search"] = getChild<LLUICtrl>("block_parcel_search_check")->getValue();
- LLHTTPClient::post(url, body, new LLHTTPClient::Responder());
+ LLCoreHttpUtil::HttpCoroutineAdapter::genericHttpPost(url, body,
+ "Region info update posted.", "Region info update not posted.");
}
else
{
@@ -2263,36 +2239,6 @@ void LLPanelEstateInfo::getEstateOwner()
}
*/
-class LLEstateChangeInfoResponder : public LLHTTPClient::Responder
-{
- LOG_CLASS(LLEstateChangeInfoResponder);
-public:
- LLEstateChangeInfoResponder(LLPanelEstateInfo* panel)
- {
- mpPanel = panel->getHandle();
- }
-
-protected:
- // if we get a normal response, handle it here
- virtual void httpSuccess()
- {
- LL_INFOS("Windlight") << "Successfully committed estate info" << LL_ENDL;
-
- // refresh the panel from the database
- LLPanelEstateInfo* panel = dynamic_cast<LLPanelEstateInfo*>(mpPanel.get());
- if (panel)
- panel->refresh();
- }
-
- // if we get an error response
- virtual void httpFailure()
- {
- LL_WARNS("Windlight") << dumpResponse() << LL_ENDL;
- }
-private:
- LLHandle<LLPanel> mpPanel;
-};
-
const std::string LLPanelEstateInfo::getOwnerName() const
{
return getChild<LLUICtrl>("estate_owner")->getValue().asString();
diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h
index 792f60ebc8..4042df21c7 100755
--- a/indra/newview/llfloaterregioninfo.h
+++ b/indra/newview/llfloaterregioninfo.h
@@ -36,6 +36,7 @@
#include "llextendedstatus.h"
#include "llenvmanager.h" // for LLEnvironmentSettings
+#include "lleventcoro.h"
class LLAvatarName;
class LLDispatcher;
@@ -103,6 +104,8 @@ private:
LLFloaterRegionInfo(const LLSD& seed);
~LLFloaterRegionInfo();
+
+
protected:
void onTabSelected(const LLSD& param);