summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorandreykproductengine <akleshchev@productengine.com>2014-10-14 19:59:18 +0300
committerandreykproductengine <akleshchev@productengine.com>2014-10-14 19:59:18 +0300
commit73c1e41ae57ff80ff143d4784e7b1dc5e7b5c37f (patch)
tree0a04fef7ca544023ec98cae91d7d72a62cb04a26 /indra/newview
parentbafcec7dee9b243c75e67349b9bff3e93bd87381 (diff)
MAINT-4301 FIXED failed script upload makes the wait cursor stick
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llassetuploadresponders.cpp41
-rwxr-xr-xindra/newview/skins/default/xui/en/strings.xml1
2 files changed, 35 insertions, 7 deletions
diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp
index a98ff64d0a..466677b8be 100755
--- a/indra/newview/llassetuploadresponders.cpp
+++ b/indra/newview/llassetuploadresponders.cpp
@@ -229,21 +229,34 @@ void LLAssetUploadResponder::httpFailure()
{
// *TODO: Add adaptive retry policy?
LL_WARNS() << dumpResponse() << LL_ENDL;
- LLSD args;
+ std::string reason;
if (isHttpClientErrorStatus(getStatus()))
{
- args["FILE"] = (mFileName.empty() ? mVFileID.asString() : mFileName);
- args["REASON"] = "Error in upload request. Please visit "
+ reason = "Error in upload request. Please visit "
"http://secondlife.com/support for help fixing this problem.";
- LLNotificationsUtil::add("CannotUploadReason", args);
}
else
{
- args["FILE"] = (mFileName.empty() ? mVFileID.asString() : mFileName);
- args["REASON"] = "The server is experiencing unexpected "
+ reason = "The server is experiencing unexpected "
"difficulties.";
- LLNotificationsUtil::add("CannotUploadReason", args);
}
+ LLSD args;
+ args["FILE"] = (mFileName.empty() ? mVFileID.asString() : mFileName);
+ args["REASON"] = reason;
+ LLNotificationsUtil::add("CannotUploadReason", args);
+
+ // unfreeze script preview
+ if(mAssetType == LLAssetType::AT_LSL_TEXT)
+ {
+ LLPreviewLSL* preview = LLFloaterReg::findTypedInstance<LLPreviewLSL>("preview_script", mPostData["item_id"]);
+ if (preview)
+ {
+ LLSD errors;
+ errors.append(LLTrans::getString("UploadFailed") + reason);
+ preview->callbackLSLCompileFailed(errors);
+ }
+ }
+
LLUploadDialog::modalUploadFinished();
LLFilePicker::instance().reset(); // unlock file picker when bulk upload fails
}
@@ -298,8 +311,22 @@ void LLAssetUploadResponder::uploadUpload(const LLSD& content)
void LLAssetUploadResponder::uploadFailure(const LLSD& content)
{
LL_WARNS() << dumpResponse() << LL_ENDL;
+
+ // unfreeze script preview
+ if(mAssetType == LLAssetType::AT_LSL_TEXT)
+ {
+ LLPreviewLSL* preview = LLFloaterReg::findTypedInstance<LLPreviewLSL>("preview_script", mPostData["item_id"]);
+ if (preview)
+ {
+ LLSD errors;
+ errors.append(LLTrans::getString("UploadFailed") + content["message"].asString());
+ preview->callbackLSLCompileFailed(errors);
+ }
+ }
+
// remove the "Uploading..." message
LLUploadDialog::modalUploadFinished();
+
LLFloater* floater_snapshot = LLFloaterReg::findInstance("snapshot");
if (floater_snapshot)
{
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 5dcb8e2cdf..cc2f645b8e 100755
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2509,6 +2509,7 @@ The [[MARKETPLACE_CREATE_STORE_URL] Marketplace store] is returning errors.
<string name="CompileSuccessful">Compile successful!</string>
<string name="CompileSuccessfulSaving">Compile successful, saving...</string>
<string name="SaveComplete">Save complete.</string>
+ <string name="UploadFailed">File upload failed: </string>
<string name="ObjectOutOfRange">Script (object out of range)</string>
<!-- god tools -->