diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfloaterregiondebugconsole.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llfloaterregiondebugconsole.h | 5 | ||||
-rw-r--r-- | indra/newview/llfloaterregioninfo.cpp | 81 | ||||
-rw-r--r-- | indra/newview/llfloaterregioninfo.h | 5 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_region_general.xml | 15 |
5 files changed, 108 insertions, 5 deletions
diff --git a/indra/newview/llfloaterregiondebugconsole.cpp b/indra/newview/llfloaterregiondebugconsole.cpp index ada0dcf569..c7fab2573f 100644 --- a/indra/newview/llfloaterregiondebugconsole.cpp +++ b/indra/newview/llfloaterregiondebugconsole.cpp @@ -58,8 +58,6 @@ namespace { // Signal used to notify the floater of responses from the asynchronous // API. - typedef boost::signals2::signal< - void (const std::string& output)> console_reply_signal_t; console_reply_signal_t sConsoleReplySignal; const std::string PROMPT("\n\n> "); @@ -132,6 +130,11 @@ namespace }; } +boost::signals2::connection LLFloaterRegionDebugConsole::setConsoleReplyCallback(const console_reply_signal_t::slot_type& cb) +{ + return sConsoleReplySignal.connect(cb); +} + LLFloaterRegionDebugConsole::LLFloaterRegionDebugConsole(LLSD const & key) : LLFloater(key), mOutput(NULL) { diff --git a/indra/newview/llfloaterregiondebugconsole.h b/indra/newview/llfloaterregiondebugconsole.h index 3aa525724e..fd3af4152e 100644 --- a/indra/newview/llfloaterregiondebugconsole.h +++ b/indra/newview/llfloaterregiondebugconsole.h @@ -35,6 +35,9 @@ class LLTextEditor; +typedef boost::signals2::signal< + void (const std::string& output)> console_reply_signal_t; + class LLFloaterRegionDebugConsole : public LLFloater, public LLHTTPClient::Responder { public: @@ -48,6 +51,8 @@ public: LLTextEditor * mOutput; + static boost::signals2::connection setConsoleReplyCallback(const console_reply_signal_t::slot_type& cb); + private: void onReplyReceived(const std::string& output); 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()) ) diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index c0758fa92d..2b87c27fcf 100644 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -84,11 +84,16 @@ public: virtual void refresh(); void requestRegionInfo(); + void requestMeshRezInfo(); private: LLFloaterRegionInfo(const LLSD& seed); ~LLFloaterRegionInfo(); + + void onConsoleReplyReceived(const std::string& output); + + boost::signals2::connection mConsoleReplySignalConnection;; protected: void refreshFromRegion(LLViewerRegion* region); diff --git a/indra/newview/skins/default/xui/en/panel_region_general.xml b/indra/newview/skins/default/xui/en/panel_region_general.xml index ca9579284b..e0d9f3f714 100644 --- a/indra/newview/skins/default/xui/en/panel_region_general.xml +++ b/indra/newview/skins/default/xui/en/panel_region_general.xml @@ -114,7 +114,7 @@ layout="topleft" left="10" name="allow_land_resell_check" - top="160" + top="150" width="80" /> <check_box height="20" @@ -122,7 +122,7 @@ layout="topleft" left="10" name="allow_parcel_changes_check" - top="180" + top="170" width="80" /> <check_box height="20" @@ -131,7 +131,16 @@ left="10" name="block_parcel_search_check" tool_tip="Let people see this region and its parcels in search results" - top="200" + top="190" + width="80" /> + <check_box + height="20" + label="Allow Mesh Objects" + layout="topleft" + left="10" + name="mesh_rez_enabled_check" + tool_tip="Let people rez mesh objects on this region" + top="210" width="80" /> <spinner decimal_digits="0" |