summaryrefslogtreecommitdiff
path: root/indra/newview/llpreviewscript.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpreviewscript.cpp')
-rwxr-xr-xindra/newview/llpreviewscript.cpp212
1 files changed, 97 insertions, 115 deletions
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index e533be7f24..9411b8265b 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"
@@ -50,11 +51,9 @@
#include "llscrolllistctrl.h"
#include "llscrolllistitem.h"
#include "llscrolllistcell.h"
+#include "llsdserialize.h"
#include "llslider.h"
#include "lscript_rt_interface.h"
-#include "lscript_library.h"
-#include "lscript_export.h"
-#include "lltextbox.h"
#include "lltooldraganddrop.h"
#include "llvfile.h"
@@ -70,6 +69,7 @@
#include "llkeyboard.h"
#include "llscrollcontainer.h"
#include "llcheckboxctrl.h"
+#include "llscripteditor.h"
#include "llselectmgr.h"
#include "lltooldraganddrop.h"
#include "llscrolllistctrl.h"
@@ -78,7 +78,6 @@
#include "lldir.h"
#include "llcombobox.h"
#include "llviewerstats.h"
-#include "llviewertexteditor.h"
#include "llviewerwindow.h"
#include "lluictrlfactory.h"
#include "llmediactrl.h"
@@ -192,11 +191,11 @@ public:
private:
LLScriptEdCore* mEditorCore;
-
static LLFloaterScriptSearch* sInstance;
protected:
LLLineEditor* mSearchBox;
+ LLLineEditor* mReplaceBox;
void onSearchBoxCommit();
};
@@ -205,6 +204,7 @@ LLFloaterScriptSearch* LLFloaterScriptSearch::sInstance = NULL;
LLFloaterScriptSearch::LLFloaterScriptSearch(LLScriptEdCore* editor_core)
: LLFloater(LLSD()),
mSearchBox(NULL),
+ mReplaceBox(NULL),
mEditorCore(editor_core)
{
buildFromFile("floater_script_search.xml");
@@ -227,6 +227,7 @@ LLFloaterScriptSearch::LLFloaterScriptSearch(LLScriptEdCore* editor_core)
BOOL LLFloaterScriptSearch::postBuild()
{
+ mReplaceBox = getChild<LLLineEditor>("replace_text");
mSearchBox = getChild<LLLineEditor>("search_text");
mSearchBox->setCommitCallback(boost::bind(&LLFloaterScriptSearch::onSearchBoxCommit, this));
mSearchBox->setCommitOnFocusLost(FALSE);
@@ -242,8 +243,12 @@ BOOL LLFloaterScriptSearch::postBuild()
//static
void LLFloaterScriptSearch::show(LLScriptEdCore* editor_core)
{
+ LLSD::String search_text;
+ LLSD::String replace_text;
if (sInstance && sInstance->mEditorCore && sInstance->mEditorCore != editor_core)
{
+ search_text=sInstance->mSearchBox->getValue().asString();
+ replace_text=sInstance->mReplaceBox->getValue().asString();
sInstance->closeFloater();
delete sInstance;
}
@@ -252,6 +257,8 @@ void LLFloaterScriptSearch::show(LLScriptEdCore* editor_core)
{
// sInstance will be assigned in the constructor.
new LLFloaterScriptSearch(editor_core);
+ sInstance->mSearchBox->setValue(search_text);
+ sInstance->mReplaceBox->setValue(replace_text);
}
sInstance->openFloater();
@@ -272,7 +279,7 @@ void LLFloaterScriptSearch::onBtnSearch(void *userdata)
void LLFloaterScriptSearch::handleBtnSearch()
{
LLCheckBoxCtrl* caseChk = getChild<LLCheckBoxCtrl>("case_text");
- mEditorCore->mEditor->selectNext(getChild<LLUICtrl>("search_text")->getValue().asString(), caseChk->get());
+ mEditorCore->mEditor->selectNext(mSearchBox->getValue().asString(), caseChk->get());
}
// static
@@ -285,7 +292,7 @@ void LLFloaterScriptSearch::onBtnReplace(void *userdata)
void LLFloaterScriptSearch::handleBtnReplace()
{
LLCheckBoxCtrl* caseChk = getChild<LLCheckBoxCtrl>("case_text");
- mEditorCore->mEditor->replaceText(getChild<LLUICtrl>("search_text")->getValue().asString(), getChild<LLUICtrl>("replace_text")->getValue().asString(), caseChk->get());
+ mEditorCore->mEditor->replaceText(mSearchBox->getValue().asString(), mReplaceBox->getValue().asString(), caseChk->get());
}
// static
@@ -298,7 +305,7 @@ void LLFloaterScriptSearch::onBtnReplaceAll(void *userdata)
void LLFloaterScriptSearch::handleBtnReplaceAll()
{
LLCheckBoxCtrl* caseChk = getChild<LLCheckBoxCtrl>("case_text");
- mEditorCore->mEditor->replaceTextAll(getChild<LLUICtrl>("search_text")->getValue().asString(), getChild<LLUICtrl>("replace_text")->getValue().asString(), caseChk->get());
+ mEditorCore->mEditor->replaceTextAll(mSearchBox->getValue().asString(), mReplaceBox->getValue().asString(), caseChk->get());
}
bool LLFloaterScriptSearch::hasAccelerators() const
@@ -329,7 +336,7 @@ void LLFloaterScriptSearch::onSearchBoxCommit()
if (mEditorCore && mEditorCore->mEditor)
{
LLCheckBoxCtrl* caseChk = getChild<LLCheckBoxCtrl>("case_text");
- mEditorCore->mEditor->selectNext(getChild<LLUICtrl>("search_text")->getValue().asString(), caseChk->get());
+ mEditorCore->mEditor->selectNext(mSearchBox->getValue().asString(), caseChk->get());
}
}
@@ -353,6 +360,7 @@ LLScriptEdCore::LLScriptEdCore(
void (*save_callback)(void*, BOOL),
void (*search_replace_callback) (void* userdata),
void* userdata,
+ bool live,
S32 bottom_pad)
:
LLPanel(),
@@ -367,6 +375,7 @@ LLScriptEdCore::LLScriptEdCore(
mLiveHelpHistorySize(0),
mEnableSave(FALSE),
mLiveFile(NULL),
+ mLive(live),
mContainer(container),
mHasScriptData(FALSE)
{
@@ -390,17 +399,21 @@ LLScriptEdCore::~LLScriptEdCore()
}
delete mLiveFile;
+ if (mSyntaxIDConnection.connected())
+ {
+ mSyntaxIDConnection.disconnect();
+ }
}
BOOL LLScriptEdCore::postBuild()
{
mErrorList = getChild<LLScrollListCtrl>("lsl errors");
- mFunctions = getChild<LLComboBox>( "Insert...");
+ mFunctions = getChild<LLComboBox>("Insert...");
childSetCommitCallback("Insert...", &LLScriptEdCore::onBtnInsertFunction, this);
- mEditor = getChild<LLViewerTextEditor>("Script Editor");
+ mEditor = getChild<LLScriptEditor>("Script Editor");
childSetCommitCallback("lsl errors", &LLScriptEdCore::onErrorList, this);
childSetAction("Save_btn", boost::bind(&LLScriptEdCore::doSave,this,FALSE));
@@ -408,51 +421,30 @@ BOOL LLScriptEdCore::postBuild()
initMenu();
+ mSyntaxIDConnection = LLSyntaxIdLSL::getInstance()->addSyntaxIDCallback(boost::bind(&LLScriptEdCore::processKeywords, this));
- std::vector<std::string> funcs;
- std::vector<std::string> tooltips;
- for (std::vector<LLScriptLibraryFunction>::const_iterator i = gScriptLibrary.mFunctions.begin();
- i != gScriptLibrary.mFunctions.end(); ++i)
- {
- // Make sure this isn't a god only function, or the agent is a god.
- if (!i->mGodOnly || gAgent.isGodlike())
- {
- std::string name = i->mName;
- funcs.push_back(name);
-
- std::string desc_name = "LSLTipText_";
- desc_name += name;
- std::string desc = LLTrans::getString(desc_name);
-
- F32 sleep_time = i->mSleepTime;
- if( sleep_time )
- {
- desc += "\n";
-
- LLStringUtil::format_map_t args;
- args["[SLEEP_TIME]"] = llformat("%.1f", sleep_time );
- desc += LLTrans::getString("LSLTipSleepTime", args);
- }
-
- // A \n linefeed is not part of xml. Let's add one to keep all
- // the tips one-per-line in strings.xml
- LLStringUtil::replaceString( desc, "\\n", "\n" );
-
- tooltips.push_back(desc);
- }
- }
-
- LLColor3 color(0.5f, 0.0f, 0.15f);
- mEditor->loadKeywords(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"keywords.ini"), funcs, tooltips, color);
+ // Intialise keyword highlighting for the current simulator's version of LSL
+ LLSyntaxIdLSL::getInstance()->initialize();
+ processKeywords();
+
+ return TRUE;
+}
- std::vector<std::string> primary_keywords;
- std::vector<std::string> secondary_keywords;
+void LLScriptEdCore::processKeywords()
+{
+ LL_DEBUGS("SyntaxLSL") << "Processing keywords" << LL_ENDL;
+ mEditor->clearSegments();
+ mEditor->initKeywords();
+ mEditor->loadKeywords();
+
+ string_vec_t primary_keywords;
+ string_vec_t secondary_keywords;
LLKeywordToken *token;
LLKeywords::keyword_iterator_t token_it;
for (token_it = mEditor->keywordsBegin(); token_it != mEditor->keywordsEnd(); ++token_it)
{
token = token_it->second;
- if (token->getColor() == color) // Wow, what a disgusting hack.
+ if (token->getType() == LLKeywordToken::TT_FUNCTION)
{
primary_keywords.push_back( wstring_to_utf8str(token->getToken()) );
}
@@ -461,24 +453,16 @@ BOOL LLScriptEdCore::postBuild()
secondary_keywords.push_back( wstring_to_utf8str(token->getToken()) );
}
}
-
- // Case-insensitive dictionary sort for primary keywords. We don't sort the secondary
- // keywords. They're intelligently grouped in keywords.ini.
- std::stable_sort( primary_keywords.begin(), primary_keywords.end(), LLSECKeywordCompare() );
-
- for (std::vector<std::string>::const_iterator iter= primary_keywords.begin();
- iter!= primary_keywords.end(); ++iter)
+ for (string_vec_t::const_iterator iter = primary_keywords.begin();
+ iter!= primary_keywords.end(); ++iter)
{
mFunctions->add(*iter);
}
-
- for (std::vector<std::string>::const_iterator iter= secondary_keywords.begin();
- iter!= secondary_keywords.end(); ++iter)
+ for (string_vec_t::const_iterator iter = secondary_keywords.begin();
+ iter!= secondary_keywords.end(); ++iter)
{
mFunctions->add(*iter);
}
-
- return TRUE;
}
void LLScriptEdCore::initMenu()
@@ -518,6 +502,10 @@ void LLScriptEdCore::initMenu()
menuItem->setClickCallback(boost::bind(&LLTextEditor::selectAll, mEditor));
menuItem->setEnableCallback(boost::bind(&LLTextEditor::canSelectAll, mEditor));
+ menuItem = getChild<LLMenuItemCallGL>("Deselect");
+ menuItem->setClickCallback(boost::bind(&LLTextEditor::deselect, mEditor));
+ menuItem->setEnableCallback(boost::bind(&LLTextEditor::canDeselect, mEditor));
+
menuItem = getChild<LLMenuItemCallGL>("Search / Replace...");
menuItem->setClickCallback(boost::bind(&LLFloaterScriptSearch::show, this));
@@ -552,14 +540,14 @@ bool LLScriptEdCore::loadScriptText(const std::string& filename)
{
if (filename.empty())
{
- llwarns << "Empty file name" << llendl;
+ LL_WARNS() << "Empty file name" << LL_ENDL;
return false;
}
LLFILE* file = LLFile::fopen(filename, "rb"); /*Flawfinder: ignore*/
if (!file)
{
- llwarns << "Error opening " << filename << llendl;
+ LL_WARNS() << "Error opening " << filename << LL_ENDL;
return false;
}
@@ -571,7 +559,7 @@ bool LLScriptEdCore::loadScriptText(const std::string& filename)
size_t nread = fread(buffer, 1, file_length, file);
if (nread < file_length)
{
- llwarns << "Short read" << llendl;
+ LL_WARNS() << "Short read" << LL_ENDL;
}
buffer[nread] = '\0';
fclose(file);
@@ -587,7 +575,7 @@ bool LLScriptEdCore::writeToFile(const std::string& filename)
LLFILE* fp = LLFile::fopen(filename, "wb");
if (!fp)
{
- llwarns << "Unable to write to " << filename << llendl;
+ LL_WARNS() << "Unable to write to " << filename << LL_ENDL;
LLSD row;
row["columns"][0]["value"] = "Error writing to local file. Is your hard drive full?";
@@ -680,7 +668,7 @@ void LLScriptEdCore::updateDynamicHelp(BOOL immediate)
std::vector<LLTextSegmentPtr>::iterator segment_iter;
for (segment_iter = selected_segments.begin(); segment_iter != selected_segments.end(); ++segment_iter)
{
- if((*segment_iter)->getToken() && (*segment_iter)->getToken()->getType() == LLKeywordToken::WORD)
+ if((*segment_iter)->getToken() && (*segment_iter)->getToken()->getType() == LLKeywordToken::TT_WORD)
{
segment = *segment_iter;
break;
@@ -691,7 +679,7 @@ void LLScriptEdCore::updateDynamicHelp(BOOL immediate)
if (!segment)
{
const LLTextSegmentPtr test_segment = mEditor->getPreviousSegment();
- if(test_segment->getToken() && test_segment->getToken()->getType() == LLKeywordToken::WORD)
+ if(test_segment->getToken() && test_segment->getToken()->getType() == LLKeywordToken::TT_WORD)
{
segment = test_segment;
}
@@ -967,7 +955,7 @@ void LLScriptEdCore::onBtnInsertFunction(LLUICtrl *ui, void* userdata)
void LLScriptEdCore::doSave( BOOL close_after_save )
{
- LLViewerStats::getInstance()->incStat( LLViewerStats::ST_LSL_SAVE_COUNT );
+ add(LLStatViewer::LSL_SAVES, 1);
if( mSaveCallback )
{
@@ -1042,8 +1030,8 @@ void LLScriptEdCore::onErrorList(LLUICtrl*, void* user_data)
LLStringUtil::replaceChar(line, ',',' ');
LLStringUtil::replaceChar(line, ')',' ');
sscanf(line.c_str(), "%d %d", &row, &column);
- //llinfos << "LLScriptEdCore::onErrorList() - " << row << ", "
- //<< column << llendl;
+ //LL_INFOS() << "LLScriptEdCore::onErrorList() - " << row << ", "
+ //<< column << LL_ENDL;
self->mEditor->setCursor(row, column);
self->mEditor->setFocus(TRUE);
}
@@ -1090,15 +1078,15 @@ struct LLEntryAndEdCore
void LLScriptEdCore::deleteBridges()
{
- S32 count = mBridges.count();
+ S32 count = mBridges.size();
LLEntryAndEdCore* eandc;
for(S32 i = 0; i < count; i++)
{
- eandc = mBridges.get(i);
+ eandc = mBridges.at(i);
delete eandc;
mBridges[i] = NULL;
}
- mBridges.reset();
+ mBridges.clear();
}
// virtual
@@ -1171,8 +1159,7 @@ void LLScriptEdCore::onBtnLoadFromFile( void* data )
void LLScriptEdCore::onBtnSaveToFile( void* userdata )
{
-
- LLViewerStats::getInstance()->incStat( LLViewerStats::ST_LSL_SAVE_COUNT );
+ add(LLStatViewer::LSL_SAVES, 1);
LLScriptEdCore* self = (LLScriptEdCore*) userdata;
@@ -1216,8 +1203,8 @@ bool LLScriptEdCore::enableLoadFromFileMenu(void* userdata)
/// LLScriptEdContainer
/// ---------------------------------------------------------------------------
-LLScriptEdContainer::LLScriptEdContainer(const LLSD& key)
-: LLPreview(key)
+LLScriptEdContainer::LLScriptEdContainer(const LLSD& key) :
+ LLPreview(key)
, mScriptEd(NULL)
{
}
@@ -1279,8 +1266,8 @@ void* LLPreviewLSL::createScriptEdPanel(void* userdata)
LLPreviewLSL::onSave,
LLPreviewLSL::onSearchReplace,
self,
+ false,
0);
-
return self->mScriptEd;
}
@@ -1295,7 +1282,7 @@ LLPreviewLSL::LLPreviewLSL(const LLSD& key )
// virtual
BOOL LLPreviewLSL::postBuild()
{
- const LLInventoryItem* item = getItem();
+ const LLInventoryItem* item = getItem();
llassert(item);
if (item)
@@ -1311,7 +1298,7 @@ BOOL LLPreviewLSL::postBuild()
// virtual
void LLPreviewLSL::callbackLSLCompileSucceeded()
{
- llinfos << "LSL Bytecode saved" << llendl;
+ LL_INFOS() << "LSL Bytecode saved" << LL_ENDL;
mScriptEd->mErrorList->setCommentText(LLTrans::getString("CompileSuccessful"));
mScriptEd->mErrorList->setCommentText(LLTrans::getString("SaveComplete"));
closeIfNeeded();
@@ -1320,7 +1307,7 @@ void LLPreviewLSL::callbackLSLCompileSucceeded()
// virtual
void LLPreviewLSL::callbackLSLCompileFailed(const LLSD& compile_errors)
{
- llinfos << "Compile failed!" << llendl;
+ LL_INFOS() << "Compile failed!" << LL_ENDL;
for(LLSD::array_const_iterator line = compile_errors.beginArray();
line < compile_errors.endArray();
@@ -1435,7 +1422,7 @@ void LLPreviewLSL::onSave(void* userdata, BOOL close_after_save)
// fails, go ahead and save the text anyway.
void LLPreviewLSL::saveIfNeeded(bool sync /*= true*/)
{
- // llinfos << "LLPreviewLSL::saveIfNeeded()" << llendl;
+ // LL_INFOS() << "LLPreviewLSL::saveIfNeeded()" << LL_ENDL;
if(!mScriptEd->hasChanged())
{
return;
@@ -1481,7 +1468,7 @@ void LLPreviewLSL::uploadAssetViaCaps(const std::string& url,
const std::string& filename,
const LLUUID& item_id)
{
- llinfos << "Update Agent Inventory via capability" << llendl;
+ LL_INFOS() << "Update Agent Inventory via capability" << LL_ENDL;
LLSD body;
body["item_id"] = item_id;
body["target"] = "lsl2";
@@ -1514,7 +1501,7 @@ void LLPreviewLSL::uploadAssetLegacy(const std::string& filename,
asset_id.asString().c_str(),
gAgent.isGodlike()))
{
- llinfos << "Compile failed!" << llendl;
+ LL_INFOS() << "Compile failed!" << LL_ENDL;
//char command[256];
//sprintf(command, "type %s\n", err_filename.c_str());
//system(command);
@@ -1552,7 +1539,7 @@ void LLPreviewLSL::uploadAssetLegacy(const std::string& filename,
}
else
{
- llinfos << "Compile worked!" << llendl;
+ LL_INFOS() << "Compile worked!" << LL_ENDL;
if(gAssetStorage)
{
getWindow()->incBusyCount();
@@ -1594,8 +1581,8 @@ void LLPreviewLSL::onSaveComplete(const LLUUID& asset_uuid, void* user_data, S32
}
else
{
- llwarns << "Inventory item for script " << info->mItemUUID
- << " is no longer in agent inventory." << llendl;
+ LL_WARNS() << "Inventory item for script " << info->mItemUUID
+ << " is no longer in agent inventory." << LL_ENDL;
}
// Find our window and close it if requested.
@@ -1614,7 +1601,7 @@ void LLPreviewLSL::onSaveComplete(const LLUUID& asset_uuid, void* user_data, S32
}
else
{
- llwarns << "Problem saving script: " << status << llendl;
+ LL_WARNS() << "Problem saving script: " << status << LL_ENDL;
LLSD args;
args["REASON"] = std::string(LLAssetStorage::getErrorString(status));
LLNotificationsUtil::add("SaveScriptFailReason", args);
@@ -1652,7 +1639,7 @@ void LLPreviewLSL::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* user_d
}
else
{
- llwarns << "Problem saving LSL Bytecode (Preview)" << llendl;
+ LL_WARNS() << "Problem saving LSL Bytecode (Preview)" << LL_ENDL;
LLSD args;
args["REASON"] = std::string(LLAssetStorage::getErrorString(status));
LLNotificationsUtil::add("SaveBytecodeFailReason", args);
@@ -1664,8 +1651,8 @@ void LLPreviewLSL::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* user_d
void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAssetType::EType type,
void* user_data, S32 status, LLExtStat ext_status)
{
- lldebugs << "LLPreviewLSL::onLoadComplete: got uuid " << asset_uuid
- << llendl;
+ LL_DEBUGS() << "LLPreviewLSL::onLoadComplete: got uuid " << asset_uuid
+ << LL_ENDL;
LLUUID* item_uuid = (LLUUID*)user_data;
LLPreviewLSL* preview = LLFloaterReg::findTypedInstance<LLPreviewLSL>("preview_script", *item_uuid);
if( preview )
@@ -1695,8 +1682,6 @@ void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAsset
}
else
{
- LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED );
-
if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status ||
LL_ERR_FILE_EMPTY == status)
{
@@ -1712,7 +1697,7 @@ void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAsset
}
preview->mAssetStatus = PREVIEW_ASSET_ERROR;
- llwarns << "Problem loading script: " << status << llendl;
+ LL_WARNS() << "Problem loading script: " << status << LL_ENDL;
}
}
delete item_uuid;
@@ -1727,7 +1712,6 @@ void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAsset
//static
void* LLLiveLSLEditor::createScriptEdPanel(void* userdata)
{
-
LLLiveLSLEditor *self = (LLLiveLSLEditor*)userdata;
self->mScriptEd = new LLScriptEdCore(
@@ -1738,8 +1722,8 @@ void* LLLiveLSLEditor::createScriptEdPanel(void* userdata)
&LLLiveLSLEditor::onSave,
&LLLiveLSLEditor::onSearchReplace,
self,
+ true,
0);
-
return self->mScriptEd;
}
@@ -1779,7 +1763,7 @@ void LLLiveLSLEditor::callbackLSLCompileSucceeded(const LLUUID& task_id,
const LLUUID& item_id,
bool is_script_running)
{
- lldebugs << "LSL Bytecode saved" << llendl;
+ LL_DEBUGS() << "LSL Bytecode saved" << LL_ENDL;
mScriptEd->mErrorList->setCommentText(LLTrans::getString("CompileSuccessful"));
mScriptEd->mErrorList->setCommentText(LLTrans::getString("SaveComplete"));
closeIfNeeded();
@@ -1788,7 +1772,7 @@ void LLLiveLSLEditor::callbackLSLCompileSucceeded(const LLUUID& task_id,
// virtual
void LLLiveLSLEditor::callbackLSLCompileFailed(const LLSD& compile_errors)
{
- lldebugs << "Compile failed!" << llendl;
+ LL_DEBUGS() << "Compile failed!" << LL_ENDL;
for(LLSD::array_const_iterator line = compile_errors.beginArray();
line < compile_errors.endArray();
line++)
@@ -1807,7 +1791,7 @@ void LLLiveLSLEditor::callbackLSLCompileFailed(const LLSD& compile_errors)
void LLLiveLSLEditor::loadAsset()
{
- //llinfos << "LLLiveLSLEditor::loadAsset()" << llendl;
+ //LL_INFOS() << "LLLiveLSLEditor::loadAsset()" << LL_ENDL;
if(!mIsNew)
{
LLViewerObject* object = gObjectList.findObject(mObjectUUID);
@@ -1819,7 +1803,7 @@ void LLLiveLSLEditor::loadAsset()
|| gAgent.isGodlike()))
{
mItem = new LLViewerInventoryItem(item);
- //llinfos << "asset id " << mItem->getAssetUUID() << llendl;
+ //LL_INFOS() << "asset id " << mItem->getAssetUUID() << LL_ENDL;
}
if(!gAgent.isGodlike()
@@ -1867,7 +1851,7 @@ void LLLiveLSLEditor::loadAsset()
mIsModifiable = item && gAgent.allowOperation(PERM_MODIFY,
item->getPermissions(),
GP_OBJECT_MANIPULATE);
-
+
// This is commented out, because we don't completely
// handle script exports yet.
/*
@@ -1911,8 +1895,8 @@ void LLLiveLSLEditor::onLoadComplete(LLVFS *vfs, const LLUUID& asset_id,
LLAssetType::EType type,
void* user_data, S32 status, LLExtStat ext_status)
{
- lldebugs << "LLLiveLSLEditor::onLoadComplete: got uuid " << asset_id
- << llendl;
+ LL_DEBUGS() << "LLLiveLSLEditor::onLoadComplete: got uuid " << asset_id
+ << LL_ENDL;
LLUUID* xored_id = (LLUUID*)user_data;
LLLiveLSLEditor* instance = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", *xored_id);
@@ -1927,8 +1911,6 @@ void LLLiveLSLEditor::onLoadComplete(LLVFS *vfs, const LLUUID& asset_id,
}
else
{
- LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED );
-
if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status ||
LL_ERR_FILE_EMPTY == status)
{
@@ -1959,7 +1941,7 @@ void LLLiveLSLEditor::loadScriptText(LLVFS *vfs, const LLUUID &uuid, LLAssetType
if (file.getLastBytesRead() != file_length ||
file_length <= 0)
{
- llwarns << "Error reading " << uuid << ":" << type << llendl;
+ LL_WARNS() << "Error reading " << uuid << ":" << type << LL_ENDL;
}
buffer[file_length] = '\0';
@@ -2182,7 +2164,7 @@ void LLLiveLSLEditor::uploadAssetViaCaps(const std::string& url,
const LLUUID& item_id,
BOOL is_running)
{
- llinfos << "Update Task Inventory via capability " << url << llendl;
+ LL_INFOS() << "Update Task Inventory via capability " << url << LL_ENDL;
LLSD body;
body["task_id"] = task_id;
body["item_id"] = item_id;
@@ -2221,7 +2203,7 @@ void LLLiveLSLEditor::uploadAssetLegacy(const std::string& filename,
gAgent.isGodlike()))
{
// load the error file into the error scrolllist
- llinfos << "Compile failed!" << llendl;
+ LL_INFOS() << "Compile failed!" << LL_ENDL;
if(NULL != (fp = LLFile::fopen(err_filename, "r")))
{
char buffer[MAX_STRING]; /*Flawfinder: ignore*/
@@ -2259,12 +2241,12 @@ void LLLiveLSLEditor::uploadAssetLegacy(const std::string& filename,
}
else
{
- llinfos << "Compile worked!" << llendl;
+ LL_INFOS() << "Compile worked!" << LL_ENDL;
mScriptEd->mErrorList->setCommentText(LLTrans::getString("CompileSuccessfulSaving"));
if(gAssetStorage)
{
- llinfos << "LLLiveLSLEditor::saveAsset "
- << mItem->getAssetUUID() << llendl;
+ LL_INFOS() << "LLLiveLSLEditor::saveAsset "
+ << mItem->getAssetUUID() << LL_ENDL;
getWindow()->incBusyCount();
mPendingUploads++;
LLLiveLSLSaveData* data = NULL;
@@ -2297,7 +2279,7 @@ void LLLiveLSLEditor::onSaveTextComplete(const LLUUID& asset_uuid, void* user_da
if (status)
{
- llwarns << "Unable to save text for a script." << llendl;
+ LL_WARNS() << "Unable to save text for a script." << LL_ENDL;
LLSD args;
args["REASON"] = std::string(LLAssetStorage::getErrorString(status));
LLNotificationsUtil::add("CompileQueueSaveText", args);
@@ -2328,7 +2310,7 @@ void LLLiveLSLEditor::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* use
return;
if(0 ==status)
{
- llinfos << "LSL Bytecode saved" << llendl;
+ LL_INFOS() << "LSL Bytecode saved" << LL_ENDL;
LLLiveLSLEditor* self = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", data->mItem->getUUID()); // ^ data->mSaveObjectID
if (self)
{
@@ -2354,8 +2336,8 @@ void LLLiveLSLEditor::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* use
}
else
{
- llinfos << "Problem saving LSL Bytecode (Live Editor)" << llendl;
- llwarns << "Unable to save a compiled script." << llendl;
+ LL_INFOS() << "Problem saving LSL Bytecode (Live Editor)" << LL_ENDL;
+ LL_WARNS() << "Unable to save a compiled script." << LL_ENDL;
LLSD args;
args["REASON"] = std::string(LLAssetStorage::getErrorString(status));