summaryrefslogtreecommitdiff
path: root/indra/newview/llpreviewscript.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpreviewscript.cpp')
-rw-r--r--indra/newview/llpreviewscript.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index ffb748baae..8364b7d964 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -2304,6 +2304,23 @@ void LLLiveLSLEditor::callbackLSLCompileFailed(const LLSD& compile_errors)
closeIfNeeded();
}
+void LLLiveLSLEditor::openInExternalEditorWhenReady()
+{
+ if (!mScriptEd)
+ {
+ return;
+ }
+ if (mAssetStatus == PREVIEW_ASSET_LOADED)
+ {
+ if (getIsModifiable())
+ {
+ mScriptEd->openInExternalEditor();
+ }
+ return;
+ }
+ mOpenExternalWhenLoaded = true;
+}
+
void LLLiveLSLEditor::loadAsset()
{
//LL_INFOS() << "LLLiveLSLEditor::loadAsset()" << LL_ENDL;
@@ -2415,6 +2432,11 @@ void LLLiveLSLEditor::onLoadComplete(const LLUUID& asset_id,
instance->mScriptEd->setEnableEditing(true);
instance->mAssetStatus = PREVIEW_ASSET_LOADED;
instance->mScriptEd->setAssetID(asset_id);
+ if (instance->mOpenExternalWhenLoaded && instance->getIsModifiable())
+ {
+ instance->mOpenExternalWhenLoaded = false;
+ instance->mScriptEd->openInExternalEditor();
+ }
}
else
{
@@ -2431,6 +2453,7 @@ void LLLiveLSLEditor::onLoadComplete(const LLUUID& asset_id,
{
LLNotificationsUtil::add("UnableToLoadScript");
}
+ instance->mOpenExternalWhenLoaded = false;
instance->mAssetStatus = PREVIEW_ASSET_ERROR;
}
}