diff options
| author | Rider Linden <rider@lindenlab.com> | 2025-10-10 10:46:07 -0700 |
|---|---|---|
| committer | Rider Linden <rider@lindenlab.com> | 2025-10-10 10:46:07 -0700 |
| commit | c21fda0b79c2e18c0dccf9e88524a716b57b94bf (patch) | |
| tree | d4500ea28b20dcb0aa274b3bbc0ad10585634193 /indra/newview/llpreviewscript.cpp | |
| parent | 5306ad767bc1cc768145074aac25944c6059b3c2 (diff) | |
Allow the viewer to relaunch the external editor. It will reuse the LiveFile unless the file name has changed.
Diffstat (limited to 'indra/newview/llpreviewscript.cpp')
| -rw-r--r-- | indra/newview/llpreviewscript.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index bd1f68da33..b3e53df6d8 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -1113,11 +1113,11 @@ void LLScriptEdCore::doSave( bool close_after_save ) void LLScriptEdCore::openInExternalEditor() { - if (mContainer->mLiveFile) - { - // If already open in an external editor, just return - return; - } + //if (mContainer->mLiveFile) + //{ + // // If already open in an external editor, just return + // return; + //} // Generate a suitable filename std::string script_name = mScriptName; @@ -1141,9 +1141,17 @@ void LLScriptEdCore::openInExternalEditor() writeToFile(filename); } + if (mContainer->mLiveFile && mContainer->mLiveFile->filename() != filename) + { // The name may have changed if we changed the type of scipt being edited. + delete mContainer->mLiveFile; + mContainer->mLiveFile = NULL; + } // Start watching file changes. - mContainer->mLiveFile = new LLLiveLSLFile(filename, boost::bind(&LLScriptEdContainer::onExternalChange, mContainer, _1)); - mContainer->mLiveFile->addToEventTimer(); + if (!mContainer->mLiveFile) + { + mContainer->mLiveFile = new LLLiveLSLFile(filename, boost::bind(&LLScriptEdContainer::onExternalChange, mContainer, _1)); + mContainer->mLiveFile->addToEventTimer(); + } mContainer->startWebsocketServer(); // Open it in external editor. |
