summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2019-10-15 17:25:26 +0300
committerandreykproductengine <andreykproductengine@lindenlab.com>2019-10-15 17:25:26 +0300
commit48e282947f424701465cae6dc095e73387e3e863 (patch)
treeb751cb1620f1a44d6b8d9d22aa06d4e12daa9961 /indra
parent1b19a88e84241986ef81ddf145288103a7003d27 (diff)
SL-11986 Mesh Uploader does not report Upload cost on fee-failure
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfloatermodelpreview.cpp29
-rw-r--r--indra/newview/llfloatermodelpreview.h4
-rw-r--r--indra/newview/llfloatermodeluploadbase.h2
-rw-r--r--indra/newview/llmeshrepository.cpp4
-rw-r--r--indra/newview/lluploadfloaterobservers.h2
5 files changed, 32 insertions, 9 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 7705c1a76f..74925caed4 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -433,7 +433,7 @@ void LLFloaterModelPreview::initModelPreview()
mModelPreview = new LLModelPreview(512, 512, this );
mModelPreview->setPreviewTarget(16.f);
mModelPreview->setDetailsCallback(boost::bind(&LLFloaterModelPreview::setDetails, this, _1, _2, _3, _4, _5));
- mModelPreview->setModelUpdatedCallback(boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this, _1));
+ mModelPreview->setModelUpdatedCallback(boost::bind(&LLFloaterModelPreview::modelUpdated, this, _1));
}
void LLFloaterModelPreview::onViewOptionChecked(LLUICtrl* ctrl)
@@ -510,7 +510,8 @@ void LLFloaterModelPreview::onClickCalculateBtn()
mModelPreview->getPreviewAvatar()->showAttachmentOverrides();
}
- mUploadModelUrl.clear();
+ mUploadModelUrl.clear();
+ mModelPhysicsFee.clear();
gMeshRepo.uploadModel(mModelPreview->mUploadData, mModelPreview->mPreviewScale,
childGetValue("upload_textures").asBoolean(),
@@ -4439,6 +4440,12 @@ void LLFloaterModelPreview::toggleCalculateButton()
toggleCalculateButton(true);
}
+void LLFloaterModelPreview::modelUpdated(bool calculate_visible)
+{
+ mModelPhysicsFee.clear();
+ toggleCalculateButton(calculate_visible);
+}
+
void LLFloaterModelPreview::toggleCalculateButton(bool visible)
{
mCalculateBtn->setVisible(visible);
@@ -4464,7 +4471,10 @@ void LLFloaterModelPreview::toggleCalculateButton(bool visible)
childSetTextArg("download_weight", "[ST]", tbd);
childSetTextArg("server_weight", "[SIM]", tbd);
childSetTextArg("physics_weight", "[PH]", tbd);
- childSetTextArg("upload_fee", "[FEE]", tbd);
+ if (!mModelPhysicsFee.isMap() || mModelPhysicsFee.emptyMap())
+ {
+ childSetTextArg("upload_fee", "[FEE]", tbd);
+ }
childSetTextArg("price_breakdown", "[STREAMING]", tbd);
childSetTextArg("price_breakdown", "[PHYSICS]", tbd);
childSetTextArg("price_breakdown", "[INSTANCES]", tbd);
@@ -4524,10 +4534,21 @@ void LLFloaterModelPreview::handleModelPhysicsFeeReceived()
mUploadBtn->setEnabled(isModelUploadAllowed());
}
-void LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason)
+void LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason, const LLSD& result)
{
LL_WARNS() << "LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(" << status << " : " << reason << ")" << LL_ENDL;
doOnIdleOneTime(boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this, true));
+
+ if (result.has("upload_price"))
+ {
+ mModelPhysicsFee = result;
+ childSetTextArg("upload_fee", "[FEE]", llformat("%d", result["upload_price"].asInteger()));
+ childSetVisible("upload_fee", true);
+ }
+ else
+ {
+ mModelPhysicsFee.clear();
+ }
}
/*virtual*/
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index edc90d1695..1c66570650 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -125,7 +125,7 @@ public:
/*virtual*/ void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url);
void handleModelPhysicsFeeReceived();
- /*virtual*/ void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason);
+ /*virtual*/ void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason, const LLSD& result);
/*virtual*/ void onModelUploadSuccess();
@@ -208,6 +208,8 @@ private:
void onLoDSourceCommit(S32 lod);
+ void modelUpdated(bool calculate_visible);
+
// Toggles between "Calculate weights & fee" and "Upload" buttons.
void toggleCalculateButton(bool visible);
diff --git a/indra/newview/llfloatermodeluploadbase.h b/indra/newview/llfloatermodeluploadbase.h
index 0d4c834122..721fce059e 100644
--- a/indra/newview/llfloatermodeluploadbase.h
+++ b/indra/newview/llfloatermodeluploadbase.h
@@ -45,7 +45,7 @@ public:
virtual void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) = 0;
- virtual void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason) = 0;
+ virtual void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason, const LLSD& result) = 0;
virtual void onModelUploadSuccess() {};
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 31e3d408d7..95322cce6d 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -2772,7 +2772,7 @@ void LLMeshUploadThread::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResp
if (observer)
{
- observer->setModelPhysicsFeeErrorStatus(status.toULong(), reason);
+ observer->setModelPhysicsFeeErrorStatus(status.toULong(), reason, body["error"]);
}
}
else
@@ -2805,7 +2805,7 @@ void LLMeshUploadThread::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResp
if (observer)
{
- observer->setModelPhysicsFeeErrorStatus(status.toULong(), reason);
+ observer->setModelPhysicsFeeErrorStatus(status.toULong(), reason, body["error"]);
}
}
}
diff --git a/indra/newview/lluploadfloaterobservers.h b/indra/newview/lluploadfloaterobservers.h
index 15c3dad38e..77e950a1c9 100644
--- a/indra/newview/lluploadfloaterobservers.h
+++ b/indra/newview/lluploadfloaterobservers.h
@@ -53,7 +53,7 @@ public:
virtual ~LLWholeModelFeeObserver() {}
virtual void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) = 0;
- virtual void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason) = 0;
+ virtual void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason, const LLSD& result) = 0;
LLHandle<LLWholeModelFeeObserver> getWholeModelFeeObserverHandle() const { return mWholeModelFeeObserverHandle; }