diff options
author | Nyx (Neal Orman) <nyx@lindenlab.com> | 2011-05-17 12:13:54 -0400 |
---|---|---|
committer | Nyx (Neal Orman) <nyx@lindenlab.com> | 2011-05-17 12:13:54 -0400 |
commit | 8f94ff85f9b0318f959f066a138eac03770838cf (patch) | |
tree | 7b2885af863ae16281f197c61bbedff4f2895e2c /indra/newview/llfloaterregioninfo.cpp | |
parent | 2deea74cf6f08376e14e2f7e5333fc6959d2af19 (diff) | |
parent | a2d8f0cb3308fed1cb2c8d5fa8fb74ec4cefa45b (diff) |
merging up latest mesh-development to nyx-mesh-development
Diffstat (limited to 'indra/newview/llfloaterregioninfo.cpp')
-rw-r--r-- | indra/newview/llfloaterregioninfo.cpp | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 7792b3fb40..34fda49375 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -53,6 +53,7 @@ #include "llfloatertopobjects.h" // added to fix SL-32336 #include "llfloatergroups.h" #include "llfloaterreg.h" +#include "llfloaterregiondebugconsole.h" #include "llfloatertelehub.h" #include "llfloaterwindlight.h" #include "llinventorymodel.h" @@ -159,9 +160,30 @@ bool estate_dispatch_initialized = false; //S32 LLFloaterRegionInfo::sRequestSerial = 0; LLUUID LLFloaterRegionInfo::sRequestInvoice; + +void LLFloaterRegionInfo::onConsoleReplyReceived(const std::string& output) +{ + llwarns << "here is what they're giving us: " << output << llendl; + + if (output.find("FALSE") != std::string::npos) + { + getChild<LLUICtrl>("mesh_rez_enabled_check")->setValue(FALSE); + } + else + { + getChild<LLUICtrl>("mesh_rez_enabled_check")->setValue(TRUE); + } +} + + LLFloaterRegionInfo::LLFloaterRegionInfo(const LLSD& seed) : LLFloater(seed) { + mConsoleReplySignalConnection = LLFloaterRegionDebugConsole::setConsoleReplyCallback( + boost::bind( + &LLFloaterRegionInfo::onConsoleReplyReceived, + this, + _1)); } BOOL LLFloaterRegionInfo::postBuild() @@ -211,12 +233,14 @@ BOOL LLFloaterRegionInfo::postBuild() LLFloaterRegionInfo::~LLFloaterRegionInfo() { + mConsoleReplySignalConnection.disconnect(); } void LLFloaterRegionInfo::onOpen(const LLSD& key) { refreshFromRegion(gAgent.getRegion()); requestRegionInfo(); + requestMeshRezInfo(); } // static @@ -584,6 +608,7 @@ BOOL LLPanelRegionGeneralInfo::postBuild() initCtrl("access_combo"); initCtrl("restrict_pushobject"); initCtrl("block_parcel_search_check"); + initCtrl("mesh_rez_enabled_check"); childSetAction("kick_btn", boost::bind(&LLPanelRegionGeneralInfo::onClickKick, this)); childSetAction("kick_all_btn", onClickKickAll, this); @@ -691,7 +716,42 @@ bool LLPanelRegionGeneralInfo::onMessageCommit(const LLSD& notification, const L return false; } +class ConsoleRequestResponder : public LLHTTPClient::Responder +{ +public: + /*virtual*/ + void error(U32 status, const std::string& reason) + { + llwarns << "requesting mesh_rez_enabled failed" << llendl; + } +}; + + +// called if this request times out. +class ConsoleUpdateResponder : public LLHTTPClient::Responder +{ +public: + /* virtual */ + void error(U32 status, const std::string& reason) + { + llwarns << "Updating mesh enabled region setting failed" << llendl; + } +}; + +void LLFloaterRegionInfo::requestMeshRezInfo() +{ + std::string sim_console_url = gAgent.getRegion()->getCapability("SimConsoleAsync"); + if (!sim_console_url.empty()) + { + std::string request_str = "get mesh_rez_enabled"; + + LLHTTPClient::post( + sim_console_url, + LLSD(request_str), + new ConsoleRequestResponder); + } +} // setregioninfo // strings[0] = 'Y' - block terraform, 'N' - not @@ -764,6 +824,27 @@ BOOL LLPanelRegionGeneralInfo::sendUpdate() sendEstateOwnerMessage(gMessageSystem, "setregioninfo", invoice, strings); } + std::string sim_console_url = gAgent.getRegion()->getCapability("SimConsoleAsync"); + + if (!sim_console_url.empty()) + { + std::string update_str = "set mesh_rez_enabled "; + if (getChild<LLUICtrl>("mesh_rez_enabled_check")->getValue().asBoolean()) + { + update_str += "true"; + } + else + { + update_str += "false"; + } + + LLHTTPClient::post( + sim_console_url, + LLSD(update_str), + new ConsoleUpdateResponder); + } + + // if we changed access levels, tell user about it LLViewerRegion* region = gAgent.getRegion(); if (region && (getChild<LLUICtrl>("access_combo")->getValue().asInteger() != region->getSimAccess()) ) |