summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterregioninfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterregioninfo.cpp')
-rw-r--r--indra/newview/llfloaterregioninfo.cpp87
1 files changed, 87 insertions, 0 deletions
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index 7792b3fb40..232b8e9096 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
@@ -566,6 +590,12 @@ bool LLPanelRegionGeneralInfo::refreshFromRegion(LLViewerRegion* region)
getChildView("im_btn")->setEnabled(allow_modify);
getChildView("manage_telehub_btn")->setEnabled(allow_modify);
+ const bool enable_mesh = gSavedSettings.getBOOL("MeshEnabled") &&
+ gAgent.getRegion() &&
+ !gAgent.getRegion()->getCapability("GetMesh").empty() &&
+ !gAgent.getRegion()->getCapability("ObjectAdd").empty();
+ getChildView("mesh_rez_enabled_check")->setVisible(enable_mesh);
+ getChildView("mesh_rez_enabled_check")->setEnabled(getChildView("mesh_rez_enabled_check")->getEnabled() && enable_mesh);
// Data gets filled in by processRegionInfo
return LLPanelRegionInfo::refreshFromRegion(region);
@@ -584,6 +614,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 +722,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 +830,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()) )