From 40faef0bf87f764acdad126fd895b14cec8d7eff Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sat, 27 Apr 2019 03:04:11 -0400 Subject: [PATCH] If a setting is LLSD, display it in pretty print xml in debug This should probably get its own TextEditor later on, it'd look better. --- indra/newview/llfloatersettingsdebug.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/indra/newview/llfloatersettingsdebug.cpp b/indra/newview/llfloatersettingsdebug.cpp index 46f45b1e2..aac8e2223 100644 --- a/indra/newview/llfloatersettingsdebug.cpp +++ b/indra/newview/llfloatersettingsdebug.cpp @@ -39,6 +39,7 @@ #include "llfloater.h" #include "llscrolllistctrl.h" #include "llscrolllistitem.h" +#include "llsdserialize.h" #include "llspinctrl.h" #include "lltexteditor.h" #include "lluictrlfactory.h" @@ -215,6 +216,19 @@ void LLFloaterSettingsDebug::onCommitSettings() col4U.mV[VALPHA] = getChild("val_spinner_4")->getValue().asInteger(); mCurrentControlVariable->set(col4U.getValue()); break; + case TYPE_LLSD: + { + auto val = getChild("val_text")->getValue().asString(); + LLSD sd; + if (!val.empty()) + { + std::istringstream str(val); + if (LLSDSerialize::fromXML(sd, str) == LLSDParser::PARSE_FAILURE) + break; + } + mCurrentControlVariable->set(sd); + break; + } default: break; } @@ -522,6 +536,14 @@ void LLFloaterSettingsDebug::updateControl() break; } + case TYPE_LLSD: + getChildView("val_text")->setVisible(true); + { + std::ostringstream str; + LLSDSerialize::toPrettyXML(sd, str); + getChild("val_text")->setValue(str.str()); + } + break; default: mComment->setText(std::string("unknown")); break;