summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdoc/contributions.txt3
-rwxr-xr-xindra/llui/llkeywords.cpp51
-rwxr-xr-xindra/llui/llkeywords.h11
-rwxr-xr-xindra/llui/lltexteditor.cpp24
-rwxr-xr-xindra/llui/lltexteditor.h5
-rwxr-xr-xindra/newview/llfloaterbulkpermission.cpp2
-rwxr-xr-xindra/newview/llpreviewscript.cpp26
-rwxr-xr-xindra/newview/llpreviewscript.h1
-rw-r--r--indra/newview/llsyntaxid.cpp267
-rw-r--r--indra/newview/llsyntaxid.h83
-rwxr-xr-xindra/newview/llviewerregion.cpp1
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_script_ed.xml2
12 files changed, 258 insertions, 218 deletions
diff --git a/doc/contributions.txt b/doc/contributions.txt
index 4ce074506b..03f0194a47 100755
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -514,7 +514,8 @@ Ima Mechanique
VWR-10791
VWR-20553
VWR-19213
- VWR-23739
+ VWR-22401
+ VWR-23739
VWR-24766
VWR-28065
Imnotgoing Sideways
diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp
index 687c2fb31d..6aeaf4798b 100755
--- a/indra/llui/llkeywords.cpp
+++ b/indra/llui/llkeywords.cpp
@@ -198,55 +198,10 @@ LLColor4 LLKeywords::getColorGroup(const std::string key_in)
return LLUIColorTable::instance().getColor(ColourGroup);
}
-BOOL LLKeywords::initialise(ELLPath path, const std::string filename)
+bool LLKeywords::initialise(LLSD SyntaxXML)
{
- mReady = false;
- setFilenameSyntax( gDirUtilp->getExpandedFilename(path, filename) );
-
- if (! loadIntoLLSD(mFilenameSyntax, mSyntax) )
- {
- LL_ERRS("") << "Failed to load syntax data from '" << mFilenameSyntax << "', cannot continue!" << LL_ENDL;
- }
- else
- {
- mReady = true;
- }
- return mReady;
-}
-
-BOOL LLKeywords::loadFromFile()
-{
- processTokens();
- return true;
-}
-
-/**
- * @brief Load xml serialised LLSD
- * @desc Opens the specified filespec and attempts to deserialise the
- * contained data to the specified LLSD object.
- * @return Returns boolean true/false indicating success or failure.
- */
-BOOL LLKeywords::loadIntoLLSD(const std::string& filename, LLSD& data)
-{
- mLoaded = false;
- llifstream file;
- file.open(filename);
- if(file.is_open())
- {
- mLoaded = (BOOL)LLSDSerialize::fromXML(data, file);
- if (!mLoaded)
- {
- LL_WARNS("") << "Unable to deserialise file: " << filename << LL_ENDL;
- }
- else
- {
- LL_INFOS("") << "Deserialised file: " << filename << LL_ENDL;
- }
- }
- else
- {
- LL_WARNS("") << "Unable to open file: " << filename << LL_ENDL;
- }
+ mSyntax = SyntaxXML;
+ mLoaded = true;
return mLoaded;
}
diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h
index 1bd23549d2..074cedfc63 100755
--- a/indra/llui/llkeywords.h
+++ b/indra/llui/llkeywords.h
@@ -110,14 +110,14 @@ public:
~LLKeywords();
void addColorGroup(const std::string key_in, const LLColor4 color);
+ void clearLoaded() { mLoaded = false; }
LLColor4 getColorGroup(const std::string key_in);
BOOL loadFromFile();
BOOL loadFromFile(const std::string& filename);
- BOOL isLoaded() const { return mLoaded; }
- void setFilenameSyntax(const std::string filename) { mFilenameSyntax = filename; }
+ bool isLoaded() const { return mLoaded; }
void findSegments(std::vector<LLTextSegmentPtr> *seg_list, const LLWString& text, const LLColor4 &defaultColor, class LLTextEditor& editor );
- BOOL initialise(ELLPath path, const std::string filename);
+ bool initialise(LLSD SyntaxXML);
std::string processColors();
std::string processColors(LLSD &data, const std::string strGroup);
void processTokens();
@@ -179,7 +179,7 @@ protected:
BOOL loadIntoLLSD( const std::string& filename, LLSD& data );
LLSD mColors;
- BOOL mLoaded;
+ bool mLoaded;
LLSD mSyntax;
word_token_map_t mWordTokenMap;
typedef std::deque<LLKeywordToken*> token_list_t;
@@ -194,9 +194,6 @@ protected:
std::string getArguments(LLSD& args);
private:
- BOOL ready() { return mReady; }
- BOOL mReady;
- std::string mFilenameSyntax;
};
#endif // LL_LLKEYWORDS_H
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 4bab68b339..b6c2e20a9d 100755
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -2502,23 +2502,19 @@ BOOL LLTextEditor::tryToRevertToPristineState()
static LLFastTimer::DeclareTimer FTM_SYNTAX_HIGHLIGHTING("Syntax Highlighting");
-void LLTextEditor::loadKeywords(const std::string& filename,
- const std::vector<std::string>& funcs,
- const std::vector<std::string>& tooltips,
- const LLColor4& color)
+void LLTextEditor::loadKeywords()
{
LLFastTimer ft(FTM_SYNTAX_HIGHLIGHTING);
- if(mKeywords.loadFromFile())
- {
- segment_vec_t segment_list;
- mKeywords.findSegments(&segment_list, getWText(), mDefaultColor.get(), *this);
+ mKeywords.processTokens();
- mSegments.clear();
- segment_set_t::iterator insert_it = mSegments.begin();
- for (segment_vec_t::iterator list_it = segment_list.begin(); list_it != segment_list.end(); ++list_it)
- {
- insert_it = mSegments.insert(insert_it, *list_it);
- }
+ segment_vec_t segment_list;
+ mKeywords.findSegments(&segment_list, getWText(), mDefaultColor.get(), *this);
+
+ mSegments.clear();
+ segment_set_t::iterator insert_it = mSegments.begin();
+ for (segment_vec_t::iterator list_it = segment_list.begin(); list_it != segment_list.end(); ++list_it)
+ {
+ insert_it = mSegments.insert(insert_it, *list_it);
}
}
diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h
index 8cc0e03712..0b4a22b08b 100755
--- a/indra/llui/lltexteditor.h
+++ b/indra/llui/lltexteditor.h
@@ -187,10 +187,7 @@ public:
void getCurrentLineAndColumn( S32* line, S32* col, BOOL include_wordwrap );
LLKeywords mKeywords;
- void loadKeywords(const std::string& filename,
- const std::vector<std::string>& funcs,
- const std::vector<std::string>& tooltips,
- const LLColor4& func_color);
+ void loadKeywords();
LLKeywords::keyword_iterator_t keywordsBegin() { return mKeywords.begin(); }
LLKeywords::keyword_iterator_t keywordsEnd() { return mKeywords.end(); }
diff --git a/indra/newview/llfloaterbulkpermission.cpp b/indra/newview/llfloaterbulkpermission.cpp
index 76f62a7880..c3e9a6f5fb 100755
--- a/indra/newview/llfloaterbulkpermission.cpp
+++ b/indra/newview/llfloaterbulkpermission.cpp
@@ -36,7 +36,7 @@
#include "llviewerobject.h"
#include "llviewerobjectlist.h"
#include "llviewerregion.h"
-#include "lscript_rt_interface.h"
+//#include "lscript_rt_interface.h"
#include "llviewercontrol.h"
#include "llviewerinventory.h"
#include "llviewerobject.h"
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index 5f23249c8d..c662343238 100755
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -34,6 +34,7 @@
#include "llcheckboxctrl.h"
#include "llcombobox.h"
#include "lldir.h"
+#include "llenvmanager.h"
#include "llexternaleditor.h"
#include "llfilepicker.h"
#include "llfloaterreg.h"
@@ -406,18 +407,22 @@ BOOL LLScriptEdCore::postBuild()
initMenu();
-// Make this work ;-)
+ // Intialise keyword highlighting for the current simulator's version of LSL
+ onRegionChangeInitialiseKeywords();
+ // Set up a callback for region changes, so that highlighting is updated to the new region's version of LSL
+ LLEnvManagerNew::getInstance()->setRegionChangeCallback(boost::bind(&LLScriptEdCore::onRegionChangeInitialiseKeywords, this));
+
+ return TRUE;
+}
+
+void LLScriptEdCore::onRegionChangeInitialiseKeywords()
+{
+ mEditor->mKeywords.clearLoaded();
mSyntaxIdLSL.initialise();
- // ...
- mEditor->mKeywords.initialise(LL_PATH_APP_SETTINGS, "keywords_lsl_default.xml");
-// mEditor->mKeywords.initialise(mSyntaxIdLSL.getFullFileSpec());
+ mEditor->mKeywords.initialise(mSyntaxIdLSL.getKeywordsXML());
- // FIX: Refactor LLTextEditor::loadKeywords so these can be removed.
- std::vector<std::string> funcs;
- std::vector<std::string> tooltips;
-
LLColor3 color(0.5f, 0.0f, 0.15f);
- mEditor->loadKeywords(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"keywords.ini"), funcs, tooltips, color);
+ mEditor->loadKeywords();
std::vector<std::string> primary_keywords;
std::vector<std::string> secondary_keywords;
@@ -439,6 +444,7 @@ BOOL LLScriptEdCore::postBuild()
// Case-insensitive dictionary sort for primary keywords. We don't sort the secondary
// keywords. They're intelligently grouped in keywords.ini.
+ // As we don't use keywords.ini, this is no longer true. Do we need to sort now?
std::stable_sort( primary_keywords.begin(), primary_keywords.end(), LLSECKeywordCompare() );
for (std::vector<std::string>::const_iterator iter= primary_keywords.begin();
@@ -452,8 +458,6 @@ BOOL LLScriptEdCore::postBuild()
{
mFunctions->add(*iter);
}
-
- return TRUE;
}
void LLScriptEdCore::initMenu()
diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h
index 73ccaab0b8..2dd5a1b6a7 100755
--- a/indra/newview/llpreviewscript.h
+++ b/indra/newview/llpreviewscript.h
@@ -78,6 +78,7 @@ public:
~LLScriptEdCore();
void initMenu();
+ void onRegionChangeInitialiseKeywords();
virtual void draw();
/*virtual*/ BOOL postBuild();
diff --git a/indra/newview/llsyntaxid.cpp b/indra/newview/llsyntaxid.cpp
index b917134037..66e0777525 100644
--- a/indra/newview/llsyntaxid.cpp
+++ b/indra/newview/llsyntaxid.cpp
@@ -28,58 +28,53 @@
#include "llviewerprecompiledheaders.h"
-#include "llhttpclient.h"
#include "llagent.h"
#include "llappviewer.h"
-#include "llcurl.h"
-#include "llenvmanager.h"
+#include "llhttpclient.h"
#include "llsdserialize.h"
#include "llsyntaxid.h"
+
//-----------------------------------------------------------------------------
// fetchKeywordsFileResponder
//-----------------------------------------------------------------------------
-class fetchKeywordsFileResponder : public LLCurl::Responder
+fetchKeywordsFileResponder::fetchKeywordsFileResponder(std::string filespec)
{
-public:
- std::string mFileSpec;
+ mFileSpec = filespec;
+ LL_WARNS("LSLSyntax")
+ << "Instantiating with file saving to: '" << filespec << "'"
+ << LL_ENDL;
+}
- fetchKeywordsFileResponder(std::string filespec)
- {
- mFileSpec = filespec;
- }
+void fetchKeywordsFileResponder::errorWithContent(U32 status,
+ const std::string& reason,
+ const LLSD& content)
+{
+ LL_WARNS("LSLSyntax")
+ << "fetchKeywordsFileResponder error [status:"
+ << status
+ << "]: "
+ << content
+ << LL_ENDL;
+}
- void errorWithContent(U32 status,
- const std::string& reason,
- const LLSD& content)
- {
- LL_WARNS("")
- << "fetchKeywordsFileResponder error [status:"
- << status
- << "]: "
- << content
- << LL_ENDL;
- }
+void fetchKeywordsFileResponder::result(const LLSD& content_ref)
+{
+ LLSyntaxIdLSL::setKeywordsXml(content_ref);
- void result(const LLSD& content_ref)
- {
- //LLSyntaxIdLSL::setKeywordsXml(content_ref);
- std::stringstream str;
- LLSDSerialize::toPrettyXML(content_ref, str);
-
- LLSD& xml = LLSD::emptyMap();
- LLSDSerialize::deserialize(xml, str, 10485760);
- LL_WARNS("")
- << "fetchKeywordsFileResponder result:" << str.str()
- << "filename: '" << mFileSpec << "'"
- << LL_ENDL;
+ std::stringstream str;
+ LLSDSerialize::toPrettyXML(content_ref, str);
+ const std::string xml = str.str();
+
+ // save the str to disc, usually to the cache.
+ llofstream file(mFileSpec, std::ios_base::out);
+ file.write(xml.c_str(), str.str().size());
+ file.close();
+
+ LL_WARNS("LSLSyntax")
+ << "Syntax file received, saving as: '" << mFileSpec << "'" << LL_ENDL;
+}
- // TODO save the damn str to disc
- //llofstream file(mFileSpec, std::ios_base::out);
- //file.write(str.str(), str.str().size());
- //file.close();
- }
-};
//-----------------------------------------------------------------------------
// LLSyntaxIdLSL
@@ -92,16 +87,36 @@ LLSyntaxIdLSL::LLSyntaxIdLSL() :
mFileNameDefault("keywords_lsl_default.xml"),
mSimulatorFeature("LSLSyntaxId"),
mCapabilityName("LSLSyntax"),
+ mCapabilityURL(""),
mFilePath(LL_PATH_APP_SETTINGS)
{
- mCurrentSyntaxId = LLUUID();
+ mSyntaxIdCurrent = LLUUID();
mFileNameCurrent = mFileNameDefault;
}
-std::string LLSyntaxIdLSL::buildFileName(LLUUID& SyntaxId)
+LLSD LLSyntaxIdLSL::sKeywordsXml;
+
+std::string LLSyntaxIdLSL::buildFileNameNew()
+{
+ std::string filename = "keywords_lsl_";
+ if (!mSyntaxIdNew.isNull())
+ {
+ filename += gLastVersionChannel + "_" + mSyntaxIdNew.asString();
+ }
+ else
+ {
+ filename += mFileNameDefault;
+ }
+ mFileNameNew = filename + ".llsd.xml";
+ return mFileNameNew;
+}
+
+std::string LLSyntaxIdLSL::buildFullFileSpec()
{
- std::string filename = "keywords_lsl_" + SyntaxId.asString() + "_" + gLastVersionChannel + ".llsd.xml";
- return filename;
+ ELLPath path = mSyntaxIdNew.isNull() ? LL_PATH_APP_SETTINGS : LL_PATH_CACHE;
+ buildFileNameNew();
+ mFullFileSpec = gDirUtilp->getExpandedFilename(path, mFileNameNew);
+ return mFullFileSpec;
}
//-----------------------------------------------------------------------------
@@ -114,39 +129,30 @@ bool LLSyntaxIdLSL::checkSyntaxIdChanged()
if (region)
{
- /*
- LL_WARNS("LSLSyntax")
- << "REGION is '" << region->getName() << "'"
- << LL_ENDL;
- */
-
if (!region->capabilitiesReceived())
- { // Shouldn't be possible, but experience shows that it's needed
-// region->setCapabilitiesReceivedCallback(boost::bind(&LLSyntaxIdLSL::checkSyntaxIdChange, this));
+ { // Shouldn't be possible, but experience shows that it may be needed.
LL_WARNS("LSLSyntax")
<< "region '" << region->getName()
- << "' has not received capabilities yet! Setting a callback for when they arrive."
+ << "' has not received capabilities yet! Cannot process SyntaxId."
<< LL_ENDL;
}
else
{
- // get and check the hash
LLSD simFeatures;
+ std::string message;
region->getSimulatorFeatures(simFeatures);
+
+ // get and check the hash
if (simFeatures.has("LSLSyntaxId"))
{
- LLUUID SyntaxId = simFeatures["LSLSyntaxId"].asUUID();
- if (mCurrentSyntaxId != SyntaxId)
+ mSyntaxIdNew = simFeatures["LSLSyntaxId"].asUUID();
+ mCapabilityURL = region->getCapability(mCapabilityName);
+ if (mSyntaxIdCurrent != mSyntaxIdNew)
{
- // set the properties for the fetcher to use
- mFileNameCurrent = buildFileName(SyntaxId);
- mFilePath = LL_PATH_CACHE;
- mCurrentSyntaxId = SyntaxId;
-
LL_WARNS("LSLSyntax")
- << "Region changed to '" << region->getName()
+ << "Region is '" << region->getName()
<< "' it has LSLSyntaxId capability, and the new hash is '"
- << SyntaxId << "'"
+ << mSyntaxIdNew << "'"
<< LL_ENDL;
changed = true;
@@ -154,35 +160,28 @@ bool LLSyntaxIdLSL::checkSyntaxIdChanged()
else
{
LL_WARNS("LSLSyntax")
- << "Region changed to '" << region->getName()
+ << "Region is '" << region->getName()
<< "' it has the same LSLSyntaxId! Leaving hash as '"
- << mCurrentSyntaxId << "'"
+ << mSyntaxIdCurrent << "'"
<< LL_ENDL;
}
+
}
else
{
- // Set the hash to NULL_KEY to indicate use of default keywords file
- if ( mCurrentSyntaxId.isNull() )
+ if ( mSyntaxIdCurrent.isNull() )
{
- LL_WARNS("LSLSyntax")
- << "Region changed to '" << region->getName()
- << " it does not have LSLSyntaxId capability, remaining with default keywords file!"
- << LL_ENDL;
+ message = " it does not have LSLSyntaxId capability, remaining with default keywords file!";
}
else
{
- mCurrentSyntaxId = LLUUID();
- mFileNameCurrent = mFileNameDefault;
- mFilePath = LL_PATH_APP_SETTINGS;
-
- LL_WARNS("LSLSyntax")
- << "Region changed to '" << region->getName()
- << " it does not have LSLSyntaxId capability, using default keywords file!"
- << LL_ENDL;
-
+ // The hash is set to NULL_KEY to indicate use of default keywords file
+ mSyntaxIdNew = LLUUID();
+ message = " it does not have LSLSyntaxId capability, using default keywords file!";
changed = true;
}
+ LL_WARNS("LSLSyntax")
+ << "Region is '" << region->getName() << message << LL_ENDL;
}
}
}
@@ -192,56 +191,114 @@ bool LLSyntaxIdLSL::checkSyntaxIdChanged()
//-----------------------------------------------------------------------------
// fetchKeywordsFile
//-----------------------------------------------------------------------------
-bool LLSyntaxIdLSL::fetchKeywordsFile()
+void LLSyntaxIdLSL::fetchKeywordsFile()
{
- LLViewerRegion* region = gAgent.getRegion();
- bool fetched = false;
-
- std::string cap_url = region->getCapability(mCapabilityName);
- if ( !cap_url.empty() )
+ if ( !mCapabilityURL.empty() )
{
- LLHTTPClient::get(cap_url, new fetchKeywordsFileResponder(mFullFileSpec));
+ LLHTTPClient::get(mCapabilityURL,
+ new fetchKeywordsFileResponder(mFullFileSpec),
+ LLSD(), 30.f
+ );
+ LL_INFOS("LSLSyntax")
+ << "LSLSyntaxId capability URL is: " << mCapabilityURL
+ << ". Filename to use is: '" << mFullFileSpec << "'."
+ << LL_ENDL;
+ }
+ else
+ {
+ LL_WARNS("LSLSyntax")
+ << "LSLSyntaxId capability URL is empty!!" << LL_ENDL;
}
-
- return fetched;
}
void LLSyntaxIdLSL::initialise()
{
if (checkSyntaxIdChanged())
{
- LL_WARNS("LSLSyntax")
- << "Change to syntax, setting up new file."
+ LL_INFOS("LSLSyntax")
+ << "LSL version has changed, getting appropriate file."
<< LL_ENDL;
- setFileNameNew(gDirUtilp->getExpandedFilename(
- mFilePath,
- mFileNameCurrent
- ));
- if ( !mCurrentSyntaxId.isNull() )
+ // Need a full spec regardless of file source, so build it now.
+ buildFullFileSpec();
+ if ( !mSyntaxIdNew.isNull() )
{
- bool success = false;
+ LL_INFOS("LSLSyntax")
+ << "We have an ID for the version, processing it!"
+ << LL_ENDL;
+
if ( !gDirUtilp->fileExists(mFullFileSpec) )
{ // Does not exist, so fetch it from the capability
- success = fetchKeywordsFile();
+ fetchKeywordsFile();
+ LL_INFOS("LSLSyntax")
+ << "File is not cached, we will try to download it!"
+ << LL_ENDL;
+ }
+ else
+ {
+ LL_INFOS("LSLSyntax")
+ << "File is cached, no need to download!"
+ << LL_ENDL;
+ loadKeywordsIntoLLSD();
}
}
- // TODO add a signal here to tell the editor the hash has changed?
+ else
+ { // Need to open the default
+ LL_INFOS("LSLSyntax")
+ << "LSLSyntaxId is null so we will use the default file!"
+ << LL_ENDL;
+ loadKeywordsIntoLLSD();
+ }
+ mFileNameCurrent = mFileNameNew;
+ mSyntaxIdCurrent = mSyntaxIdNew;
}
else
{
- LL_WARNS("LSLSyntax")
- << "Apparently there is no change to Syntax!"
+ LL_INFOS("LSLSyntax")
+ << "No change to Syntax! Nothing to see. Move along now!"
<< LL_ENDL;
-
}
- //LLEnvManagerNew::instance().setRegionChangeCallback(boost::bind(&LLSyntaxIdLSL::checkSyntaxIdChange(), this));
}
//-----------------------------------------------------------------------------
-// openKeywordsFile
+// loadKeywordsFileIntoLLSD
//-----------------------------------------------------------------------------
-void openKeywordsFile()
+/**
+ * @brief Load xml serialised LLSD
+ * @desc Opens the specified filespec and attempts to deserialise the
+ * contained data to the specified LLSD object.
+ * @return Returns boolean true/false indicating success or failure.
+ */
+bool LLSyntaxIdLSL::loadKeywordsIntoLLSD()
{
- ;
+ LL_INFOS("LSLSyntax")
+ << "Trying to open cached or default keyword file ;-)"
+ << LL_ENDL;
+
+ bool loaded = false;
+ LLSD content;
+ llifstream file;
+ file.open(mFullFileSpec);
+ if (file.is_open())
+ {
+ loaded = (bool)LLSDSerialize::fromXML(content, file);
+ if (!loaded)
+ {
+ LL_WARNS("LSLSyntax") << "Unable to deserialise file: " << mFullFileSpec << LL_ENDL;
+
+ // Is this the right thing to do, or should we leave the old content
+ // even if it isn't entirely accurate anymore?
+ sKeywordsXml = LLSD().emptyMap();
+ }
+ else
+ {
+ sKeywordsXml = content;
+ LL_INFOS("LSLSyntax") << "Deserialised file: " << mFullFileSpec << LL_ENDL;
+ }
+ }
+ else
+ {
+ LL_WARNS("LSLSyntax") << "Unable to open file: " << mFullFileSpec << LL_ENDL;
+ }
+ return loaded;
}
diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h
index f7e3d6896e..472e88744f 100644
--- a/indra/newview/llsyntaxid.h
+++ b/indra/newview/llsyntaxid.h
@@ -11,38 +11,40 @@
#include "llhttpclient.h"
#include "llviewerregion.h"
+/**
+ * @file llsyntaxid.h
+ * @brief Handles responses for the LSLSyntax capability's get call.
+ */
+class fetchKeywordsFileResponder : public LLHTTPClient::Responder
+{
+public:
+ std::string mFileSpec;
+
+ /**
+ * @brief fetchKeywordsFileResponder
+ * @param filespec File path and name of where to save the returned data
+ */
+ fetchKeywordsFileResponder(std::string filespec);
+
+ void errorWithContent(U32 status,
+ const std::string& reason,
+ const LLSD& content);
+
+ /**
+ * @brief Saves the returned file to the location provided at instantiation.
+ * @param content_ref The LSL syntax file for the sim.
+ */
+ void result(const LLSD& content_ref);
+};
+
/**
* @file llsyntaxid.h
- * @brief The LLSyntaxIdLSL class
+ * @brief Tracks the file needed to decorate the current sim's version of LSL.
*/
class LLSyntaxIdLSL
{
public:
- LLSyntaxIdLSL();
-
- bool checkSyntaxIdChanged();
- std::string getFileNameCurrent() const { return mFileNameCurrent; }
- ELLPath getFilePath() const { return mFilePath; }
- LLUUID getSyntaxId() const { return mCurrentSyntaxId; }
-
- void initialise();
-
- static void setKeywordsXml(const LLSD& content) { sKeywordsXml = content; }
-
-
-protected:
- std::string buildFileName(LLUUID& SyntaxId);
- bool fetchKeywordsFile();
- void openKeywordsFile();
- void setSyntaxId(LLUUID SyntaxId) { mCurrentSyntaxId = SyntaxId; }
- void setFileNameCurrent(std::string& name) { mFileNameCurrent = name; }
- void setFileNameDefault(std::string& name) { mFileNameDefault = name; }
- void setFileNameNew(std::string& name) { mFileNameNew = name; }
- void setSimulatorFeatureName(const std::string& name) { mSimulatorFeature = name; }
-
-
-//public:
protected:
@@ -51,13 +53,42 @@ protected:
private:
std::string mCapabilityName;
- LLUUID mCurrentSyntaxId;
+ std::string mCapabilityURL;
std::string mFileNameCurrent;
std::string mFileNameDefault;
std::string mFileNameNew;
ELLPath mFilePath;
std::string mFullFileSpec;
std::string mSimulatorFeature;
+ LLUUID mSyntaxIdCurrent;
+ LLUUID mSyntaxIdNew;
static LLSD sKeywordsXml;
+
+
+public:
+ LLSyntaxIdLSL();
+
+ bool checkSyntaxIdChanged();
+ std::string getFileNameCurrent() const { return mFileNameCurrent; }
+ ELLPath getFilePath() const { return mFilePath; }
+ std::string getFileSpec() const { return mFullFileSpec; }
+ LLSD getKeywordsXML() const { return sKeywordsXml; }
+ LLUUID getSyntaxId() const { return mSyntaxIdCurrent; }
+
+ void initialise();
+
+ static void setKeywordsXml(const LLSD& content) { sKeywordsXml = content; }
+
+
+protected:
+ std::string buildFileNameNew();
+ std::string buildFullFileSpec();
+ void fetchKeywordsFile();
+ bool loadKeywordsIntoLLSD();
+ void setSyntaxId(LLUUID SyntaxId) { mSyntaxIdCurrent = SyntaxId; }
+ void setFileNameCurrent(std::string& name) { mFileNameCurrent = name; }
+ void setFileNameDefault(std::string& name) { mFileNameDefault = name; }
+ void setFileNameNew(std::string name) { mFileNameNew = name; }
+ void setSimulatorFeatureName(const std::string& name) { mSimulatorFeature = name; }
};
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 678f24fb3c..854f05f116 100755
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1614,6 +1614,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
capabilityNames.append("GroupProposalBallot");
capabilityNames.append("HomeLocation");
capabilityNames.append("LandResources");
+ capabilityNames.append("LSLSyntax");
capabilityNames.append("MapLayer");
capabilityNames.append("MapLayerGod");
capabilityNames.append("MeshUploadFlag");
diff --git a/indra/newview/skins/default/xui/en/panel_script_ed.xml b/indra/newview/skins/default/xui/en/panel_script_ed.xml
index bcdef96138..d1b35dce9d 100755
--- a/indra/newview/skins/default/xui/en/panel_script_ed.xml
+++ b/indra/newview/skins/default/xui/en/panel_script_ed.xml
@@ -157,7 +157,7 @@
height="376"
ignore_tab="false"
layout="topleft"
- max_length="65536"
+ max_length="262144"
name="Script Editor"
text_readonly_color="DkGray"
width="487"