From 7029c8ff534419a3bcfd0e5fc39a4739e4cdc19c Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Sat, 9 Jul 2011 14:58:14 -0700 Subject: Fix for SH-2028. Also fixed layout issues with new upload warning and upload price text when floater is resized. --- indra/newview/llfloatermodelpreview.cpp | 15 +++++--- indra/newview/llfloatermodelpreview.h | 2 +- indra/newview/llfloatermodeluploadbase.h | 2 +- indra/newview/llfloatermodelwizard.cpp | 3 +- indra/newview/llfloatermodelwizard.h | 2 +- indra/newview/llmeshrepository.cpp | 6 ++-- indra/newview/lluploadfloaterobservers.h | 2 +- .../skins/default/xui/en/floater_model_preview.xml | 40 +++++++++++++++++----- 8 files changed, 50 insertions(+), 22 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index eb48955a64..1522f041c1 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -5486,18 +5486,23 @@ void LLFloaterModelPreview::toggleCalculateButton(bool visible) { std::string tbd = getString("tbd"); childSetTextArg("weights", "[EQ]", tbd); + childSetTextArg("weights", "[ST]", tbd); + childSetTextArg("weights", "[SIM]", tbd); childSetTextArg("weights", "[PH]", tbd); - childSetTextArg("weights", "[FEE]", tbd); + childSetTextArg("upload_fee", "[FEE]", tbd); } } -void LLFloaterModelPreview::onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url) +void LLFloaterModelPreview::onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) { mUploadModelUrl = upload_url; - childSetTextArg("weights", "[EQ]", llformat("%d", mModelPreview->mResourceCost)); - childSetTextArg("weights", "[PH]", llformat("%.3f", physics)); - childSetTextArg("weights", "[FEE]", llformat("%d", fee)); + childSetTextArg("weights", "[EQ]", llformat("%0.3f", result["resource_cost"].asReal())); + childSetTextArg("weights", "[ST]", llformat("%0.3f", result["model_streaming_cost"].asReal())); + childSetTextArg("weights", "[SIM]", llformat("%0.3f", result["simulation_cost"].asReal())); + childSetTextArg("weights", "[PH]", llformat("%0.3f", result["physics_cost"].asReal())); + childSetTextArg("upload_fee", "[FEE]", llformat("%d", result["upload_price"].asInteger())); childSetVisible("weights", true); + childSetVisible("upload_fee", true); mUploadBtn->setEnabled(mHasUploadPerm && !mUploadModelUrl.empty()); } diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index e252c9a677..fb4a39535d 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -202,7 +202,7 @@ public: // called when error occurs during permissions request /*virtual*/ void setPermissonsErrorStatus(U32 status, const std::string& reason); - /*virtual*/ void onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url); + /*virtual*/ void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url); /*virtual*/ void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason); diff --git a/indra/newview/llfloatermodeluploadbase.h b/indra/newview/llfloatermodeluploadbase.h index 6d1282dbd6..a52bc28687 100644 --- a/indra/newview/llfloatermodeluploadbase.h +++ b/indra/newview/llfloatermodeluploadbase.h @@ -41,7 +41,7 @@ public: virtual void onPermissionsReceived(const LLSD& result) = 0; - virtual void onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url) = 0; + virtual void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) = 0; virtual void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason) = 0; diff --git a/indra/newview/llfloatermodelwizard.cpp b/indra/newview/llfloatermodelwizard.cpp index 7efcdb6145..b517b78e5a 100644 --- a/indra/newview/llfloatermodelwizard.cpp +++ b/indra/newview/llfloatermodelwizard.cpp @@ -488,7 +488,7 @@ void LLFloaterModelWizard::setPermissonsErrorStatus(U32 status, const std::strin } /*virtual*/ -void LLFloaterModelWizard::onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url) +void LLFloaterModelWizard::onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) { swap_controls(mCalculateWeightsBtn, mCalculatingWeightsBtn, true); @@ -498,6 +498,7 @@ void LLFloaterModelWizard::onModelPhysicsFeeReceived(F64 physics, S32 fee, std:: mUploadModelUrl = upload_url; + S32 fee = result["upload_price"].asInteger(); childSetTextArg("review_fee", "[FEE]", llformat("%d", fee)); childSetTextArg("charged_fee", "[FEE]", llformat("%d", fee)); diff --git a/indra/newview/llfloatermodelwizard.h b/indra/newview/llfloatermodelwizard.h index ea60cf5db8..db9b605777 100644 --- a/indra/newview/llfloatermodelwizard.h +++ b/indra/newview/llfloatermodelwizard.h @@ -76,7 +76,7 @@ public: // called when error occurs during permissions request /*virtual*/ void setPermissonsErrorStatus(U32 status, const std::string& reason); - /*virtual*/ void onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url); + /*virtual*/ void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url); /*virtual*/ void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason); diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 9e4b749ea1..6389f08f29 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -369,10 +369,8 @@ public: if (observer) { - S32 fee = cc["upload_price"].asInteger(); - F64 phys = cc["data"]["physics_cost"].asReal(); - - observer->onModelPhysicsFeeReceived(phys, fee, mThread->mWholeModelUploadURL); + cc["data"]["upload_price"] = cc["upload_price"]; + observer->onModelPhysicsFeeReceived(cc["data"], mThread->mWholeModelUploadURL); } } else diff --git a/indra/newview/lluploadfloaterobservers.h b/indra/newview/lluploadfloaterobservers.h index c912c9755a..79aad282d7 100644 --- a/indra/newview/lluploadfloaterobservers.h +++ b/indra/newview/lluploadfloaterobservers.h @@ -53,7 +53,7 @@ public: LLWholeModelFeeObserver() { mWholeModelFeeObserverHandle.bind(this); } virtual ~LLWholeModelFeeObserver() {} - virtual void onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url) = 0; + virtual void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) = 0; virtual void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason) = 0; LLHandle getWholeModelFeeObserverHandle() const { return mWholeModelFeeObserverHandle; } diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml index a5fa7fbf0b..52377b60c5 100644 --- a/indra/newview/skins/default/xui/en/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml @@ -74,28 +74,50 @@ follows="all"/> WARNING: You will not be able to complete the final upload of this model to the Second Life servers. [secondlife:///app/floater/learn_more Find out how] to get enabled for mesh model uploads. + + Test0: [EQ] + + Test: [ST] + +Streaming: [ST] +Simulation: [SIM] +Physics: [PH] +Prim equivs: [EQ] + + + + - Prim equivs: [EQ] Physics: [PH] Upload fee: [FEE] L$ + > + Upload fee: L$ [FEE]