From f1375020207a3a365a015f53cefbf7501e487262 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Fri, 5 Apr 2019 04:08:27 -0400 Subject: [PATCH] Make sure to reenable the script and notecard editors when we get errors --- indra/newview/llassetuploadresponders.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index b7fabd8a8..7c58c7c03 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -223,6 +223,27 @@ LLAssetUploadResponder::~LLAssetUploadResponder() } } +void on_failure(const LLAssetType::EType& mAssetType, const LLSD& mPostData, const LLSD& args) +{ + switch (mAssetType) + { + case LLAssetType::AT_NOTECARD: + { + if (LLPreviewNotecard* nc = (LLPreviewNotecard*)LLPreview::find(mPostData["item_id"])) + nc->setEnabled(true); + break; + } + case LLAssetType::AT_SCRIPT: + case LLAssetType::AT_LSL_TEXT: + case LLAssetType::AT_LSL_BYTECODE: + { + if (LLPreviewLSL* lsl = (LLPreviewLSL*)LLPreview::find(mPostData["item_id"])) + lsl->callbackLSLCompileFailed(LLSD().with(0, "Upload Failure:").with(1, args["REASON"])); + break; + } + default: break; + } +} // virtual void LLAssetUploadResponder::httpFailure() { @@ -245,6 +266,7 @@ void LLAssetUploadResponder::httpFailure() LLNotificationsUtil::add("CannotUploadReason", args); break; } + on_failure(mAssetType, mPostData, args); LLUploadDialog::modalUploadFinished(); } @@ -313,6 +335,7 @@ void LLAssetUploadResponder::uploadFailure(const LLSD& content) args["FILE"] = (mFileName.empty() ? mVFileID.asString() : mFileName); args["REASON"] = content["message"].asString(); LLNotificationsUtil::add("CannotUploadReason", args); + on_failure(mAssetType, mPostData, args); } }