diff options
-rwxr-xr-x | indra/newview/llfloatermodelpreview.cpp | 25 | ||||
-rw-r--r-- | indra/newview/llfloatermodelpreview.h | 4 | ||||
-rw-r--r-- | indra/newview/llfloatermodelwizard.cpp | 24 | ||||
-rw-r--r-- | indra/newview/llmeshrepository.cpp | 13 | ||||
-rw-r--r-- | indra/newview/llmeshrepository.h | 6 |
5 files changed, 44 insertions, 28 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 9ce4b47e19..25b32258ca 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -572,12 +572,10 @@ void LLFloaterModelPreview::onClickCalculateBtn() bool upload_joint_positions = childGetValue("upload_joints").asBoolean(); mUploadModelUrl.clear(); - LLMeshUploadThread* thread = new LLMeshUploadThread(mModelPreview->mUploadData, mModelPreview->mPreviewScale, - childGetValue("upload_textures").asBoolean(), upload_skinweights, upload_joint_positions, mUploadModelUrl, false); - thread->setFeeObserverHandle(getWholeModelFeeObserverHandle()); - - gMeshRepo.mUploadWaitList.push_back(thread); + gMeshRepo.uploadModel(mModelPreview->mUploadData, mModelPreview->mPreviewScale, + childGetValue("upload_textures").asBoolean(), upload_skinweights, upload_joint_positions, mUploadModelUrl, false, + getWholeModelFeeObserverHandle()); toggleCalculateButton(false); mUploadBtn->setEnabled(false); @@ -5354,9 +5352,8 @@ void LLFloaterModelPreview::onUpload(void* user_data) mp->mModelPreview->saveUploadData(upload_skinweights, upload_joint_positions); gMeshRepo.uploadModel(mp->mModelPreview->mUploadData, mp->mModelPreview->mPreviewScale, - mp->childGetValue("upload_textures").asBoolean(), upload_skinweights, upload_joint_positions, mp->mUploadModelUrl); - - mp->closeFloater(false); + mp->childGetValue("upload_textures").asBoolean(), upload_skinweights, upload_joint_positions, mp->mUploadModelUrl, + true, LLHandle<LLWholeModelFeeObserver>(), mp->getWholeModelUploadObserverHandle()); } @@ -5460,6 +5457,18 @@ void LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(U32 status, const std: llwarns << "LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(" << status << " : " << reason << ")" << llendl; } +/*virtual*/ +void LLFloaterModelPreview::onModelUploadSuccess() +{ + closeFloater(false); +} + +/*virtual*/ +void LLFloaterModelPreview::onModelUploadFailure() +{ + toggleCalculateButton(true); +} + S32 LLFloaterModelPreview::DecompRequest::statusCallback(const char* status, S32 p1, S32 p2) { if (mContinue) diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index eccc9ce1b6..119c593221 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -206,6 +206,10 @@ public: /*virtual*/ void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason); + /*virtual*/ void onModelUploadSuccess(); + + /*virtual*/ void onModelUploadFailure(); + protected: friend class LLModelPreview; friend class LLMeshFilePicker; diff --git a/indra/newview/llfloatermodelwizard.cpp b/indra/newview/llfloatermodelwizard.cpp index ad264399d8..ae6b1dd85b 100644 --- a/indra/newview/llfloatermodelwizard.cpp +++ b/indra/newview/llfloatermodelwizard.cpp @@ -271,12 +271,9 @@ void LLFloaterModelWizard::onClickCalculateUploadFee() mModelPreview->rebuildUploadData(); mUploadModelUrl.clear(); - LLMeshUploadThread* thread = new LLMeshUploadThread(mModelPreview->mUploadData, mModelPreview->mPreviewScale, - true, false, false, mUploadModelUrl, false); - thread->setFeeObserverHandle(getWholeModelFeeObserverHandle()); - - gMeshRepo.mUploadWaitList.push_back(thread); + gMeshRepo.uploadModel(mModelPreview->mUploadData, mModelPreview->mPreviewScale, + true, false, false, mUploadModelUrl, false, getWholeModelFeeObserverHandle()); } void LLFloaterModelWizard::loadModel() @@ -526,10 +523,12 @@ void LLFloaterModelWizard::onModelUploadSuccess() /*virtual*/ void LLFloaterModelWizard::onModelUploadFailure() { - // Disable the "Upload complete" step if it has been previously enabled. - if (mLastEnabledState > REVIEW) + // Failure. Make the user recalculate fees + setState(PHYSICS); + // Disable the "Review" step if it has been previously enabled. + if (mLastEnabledState > PHYSICS) { - mLastEnabledState = REVIEW; + mLastEnabledState = PHYSICS; } updateButtons(); @@ -716,12 +715,9 @@ void LLFloaterModelWizard::onUpload() { mModelPreview->rebuildUploadData(); - LLMeshUploadThread* thread = new LLMeshUploadThread(mModelPreview->mUploadData, mModelPreview->mPreviewScale, - true, false, false, mUploadModelUrl, true); - - thread->setUploadObserverHandle(getWholeModelUploadObserverHandle()); - - gMeshRepo.mUploadWaitList.push_back(thread); + gMeshRepo.uploadModel(mModelPreview->mUploadData, mModelPreview->mPreviewScale, + true, false, false, mUploadModelUrl, true, + LLHandle<LLWholeModelFeeObserver>(), getWholeModelUploadObserverHandle()); } void LLFloaterModelWizard::onPreviewLODCommit(LLUICtrl* ctrl) diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index ee899ef613..b915ae5a4f 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -1410,11 +1410,14 @@ bool LLMeshRepoThread::physicsShapeReceived(const LLUUID& mesh_id, U8* data, S32 } LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data, LLVector3& scale, bool upload_textures, - bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload) + bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload, + LLHandle<LLWholeModelFeeObserver> fee_observer, LLHandle<LLWholeModelUploadObserver> upload_observer) : LLThread("mesh upload"), mDiscarded(FALSE), mDoUpload(do_upload), - mWholeModelUploadURL(upload_url) + mWholeModelUploadURL(upload_url), + mFeeObserverHandle(fee_observer), + mUploadObserverHandle(upload_observer) { mInstanceList = data; mUploadTextures = upload_textures; @@ -2896,9 +2899,11 @@ LLSD& LLMeshRepoThread::getMeshHeader(const LLUUID& mesh_id) void LLMeshRepository::uploadModel(std::vector<LLModelInstance>& data, LLVector3& scale, bool upload_textures, - bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload) + bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload, + LLHandle<LLWholeModelFeeObserver> fee_observer, LLHandle<LLWholeModelUploadObserver> upload_observer) { - LLMeshUploadThread* thread = new LLMeshUploadThread(data, scale, upload_textures, upload_skin, upload_joints, upload_url, do_upload); + LLMeshUploadThread* thread = new LLMeshUploadThread(data, scale, upload_textures, upload_skin, upload_joints, upload_url, + do_upload, fee_observer, upload_observer); mUploadWaitList.push_back(thread); } diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index df342facc0..3597b96e13 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -413,7 +413,8 @@ public: std::map<LLViewerFetchedTexture*, LLTextureUploadData> mTextureMap; LLMeshUploadThread(instance_list& data, LLVector3& scale, bool upload_textures, - bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload = true); + bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload = true, + LLHandle<LLWholeModelFeeObserver> fee_observer= (LLHandle<LLWholeModelFeeObserver>()), LLHandle<LLWholeModelUploadObserver> upload_observer = (LLHandle<LLWholeModelUploadObserver>())); ~LLMeshUploadThread(); void uploadTexture(LLTextureUploadData& data); @@ -505,7 +506,8 @@ public: LLSD& getMeshHeader(const LLUUID& mesh_id); void uploadModel(std::vector<LLModelInstance>& data, LLVector3& scale, bool upload_textures, - bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload = true); + bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload = true, + LLHandle<LLWholeModelFeeObserver> fee_observer= (LLHandle<LLWholeModelFeeObserver>()), LLHandle<LLWholeModelUploadObserver> upload_observer = (LLHandle<LLWholeModelUploadObserver>())); S32 getMeshSize(const LLUUID& mesh_id, S32 lod); |