Adding a simple region debug console.

meow-7.2.2
brad kittenbrink 2010-07-29 19:49:13 -07:00
parent c7624892b2
commit 19d1d57a65
8 changed files with 203 additions and 1 deletions

View File

@ -204,6 +204,7 @@ set(viewer_SOURCE_FILES
llfloaterpostprocess.cpp
llfloaterpreference.cpp
llfloaterproperties.cpp
llfloaterregiondebugconsole.cpp
llfloaterregioninfo.cpp
llfloaterreporter.cpp
llfloaterscriptdebug.cpp
@ -732,6 +733,7 @@ set(viewer_HEADER_FILES
llfloaterpostprocess.h
llfloaterpreference.h
llfloaterproperties.h
llfloaterregiondebugconsole.h
llfloaterregioninfo.h
llfloaterreporter.h
llfloaterscriptdebug.h

View File

@ -0,0 +1,93 @@
/**
* @file llfloaterregiondebugconsole.h
* @author Brad Kittenbrink <brad@lindenlab.com>
* @brief Quick and dirty console for region debug settings
*
* $LicenseInfo:firstyear=2010&license=viewergpl$
*
* Copyright (c) 2010-2010, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#include "llviewerprecompiledheaders.h"
#include "llfloaterregiondebugconsole.h"
#include "llagent.h"
#include "llhttpclient.h"
#include "lllineeditor.h"
#include "lltexteditor.h"
#include "llviewerregion.h"
class Responder : public LLHTTPClient::Responder {
public:
Responder(LLTextEditor *output) : mOutput(output)
{
}
/*virtual*/
void error(U32 status, const std::string& reason)
{
}
/*virtual*/
void result(const LLSD& content)
{
std::string text = mOutput->getText();
text += '\n';
text += content.asString();
text += '\n';
mOutput->setText(text);
};
LLTextEditor * mOutput;
};
LLFloaterRegionDebugConsole::LLFloaterRegionDebugConsole(LLSD const & key)
: LLFloater(key), mOutput(NULL)
{
}
BOOL LLFloaterRegionDebugConsole::postBuild()
{
getChild<LLLineEditor>("region_debug_console_input")->setCommitCallback(boost::bind(&LLFloaterRegionDebugConsole::onInput, this, _1, _2));
mOutput = getChild<LLTextEditor>("region_debug_console_output");
return TRUE;
}
void LLFloaterRegionDebugConsole::onInput(LLUICtrl* ctrl, const LLSD& param)
{
LLLineEditor * input = static_cast<LLLineEditor*>(ctrl);
std::string text = mOutput->getText();
text += "\n\POST: ";
text += input->getText();
mOutput->setText(text);
std::string url = gAgent.getRegion()->getCapability("SimConsole");
LLHTTPClient::post(url, LLSD(input->getText()), new ::Responder(mOutput));
input->setText(std::string(""));
}

View File

@ -0,0 +1,55 @@
/**
* @file llfloaterregiondebugconsole.h
* @author Brad Kittenbrink <brad@lindenlab.com>
* @brief Quick and dirty console for region debug settings
*
* $LicenseInfo:firstyear=2010&license=viewergpl$
*
* Copyright (c) 2010-2010, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#ifndef LL_LLFLOATERREGIONDEBUGCONSOLE_H
#define LL_LLFLOATERREGIONDEBUGCONSOLE_H
#include "llfloater.h"
#include "llhttpclient.h"
class LLTextEditor;
class LLFloaterRegionDebugConsole : public LLFloater, public LLHTTPClient::Responder
{
public:
LLFloaterRegionDebugConsole(LLSD const & key);
// virtual
BOOL postBuild();
void onInput(LLUICtrl* ctrl, const LLSD& param);
LLTextEditor * mOutput;
};
#endif // LL_LLFLOATERREGIONDEBUGCONSOLE_H

View File

@ -87,6 +87,7 @@
#include "llfloaterpostprocess.h"
#include "llfloaterpreference.h"
#include "llfloaterproperties.h"
#include "llfloaterregiondebugconsole.h"
#include "llfloaterregioninfo.h"
#include "llfloaterreporter.h"
#include "llfloaterscriptdebug.h"
@ -238,6 +239,7 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("reporter", "floater_report_abuse.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterReporter>);
LLFloaterReg::add("reset_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterResetQueue>);
LLFloaterReg::add("region_debug_console", "floater_region_debug_console.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterRegionDebugConsole>);
LLFloaterReg::add("region_info", "floater_region_info.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterRegionInfo>);
LLFloaterReg::add("script_debug", "floater_script_debug.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterScriptDebug>);

View File

@ -560,7 +560,7 @@ class LLAdvancedCheckConsole : public view_listener_t
new_value = get_visibility( (void*)gDebugView->mMemoryView );
}
#endif
return new_value;
}
};

View File

@ -1533,6 +1533,7 @@ void LLViewerRegion::setSeedCapability(const std::string& url)
capabilityNames.append("SendUserReport");
capabilityNames.append("SendUserReportWithScreenshot");
capabilityNames.append("ServerReleaseNotes");
capabilityNames.append("SimConsole");
capabilityNames.append("SimulatorFeatures");
capabilityNames.append("StartGroupProposal");
capabilityNames.append("TextureStats");

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater
name="region_debug_console"
title="Region Debug"
layout="topleft"
min_height="300"
min_width="300"
height="400"
width="600">
<text_editor
left="10"
type="string"
length="1"
follows="left|top|right|bottom"
font="Monospace"
height="366"
width="576"
ignore_tab="false"
layout="topleft"
max_length="65536"
name="region_debug_console_output"
show_line_numbers="false"
word_wrap="true">
</text_editor>
<line_editor
border_style="line"
border_thickness="1"
follows="left|top|right"
font="SansSerif"
height="19"
layout="topleft"
bottom_delta="20"
max_length="127"
name="region_debug_console_input"
top_delta="0"
width="394" />
</floater>

View File

@ -2681,6 +2681,18 @@
function="ToggleControl"
parameter="DoubleClickAutoPilot" />
</menu_item_check>
<menu_item_check
label="Region Debug Console"
name="Region Debug Console"
shortcut="control|shift|`"
use_mac_ctrl="true">
<menu_item_check.on_check
function="Floater.Visible"
parameter="region_debug_console" />
<menu_item_check.on_click
function="Floater.Toggle"
parameter="region_debug_console" />
</menu_item_check>
<menu_item_separator />