diff options
Diffstat (limited to 'indra/newview/llfloatermodelwizard.cpp')
| -rw-r--r-- | indra/newview/llfloatermodelwizard.cpp | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/indra/newview/llfloatermodelwizard.cpp b/indra/newview/llfloatermodelwizard.cpp index 8cfd04e461..71baa0fa76 100644 --- a/indra/newview/llfloatermodelwizard.cpp +++ b/indra/newview/llfloatermodelwizard.cpp @@ -162,8 +162,6 @@ void LLFloaterModelWizard::setState(int state) getChildView("cancel")->setVisible(true); mCalculateWeightsBtn->setVisible(false); mCalculatingWeightsBtn->setVisible(false); - - getChildView("upload")->setEnabled(mHasUploadPerm); } if (state == UPLOAD) @@ -414,12 +412,6 @@ BOOL LLFloaterModelWizard::handleScrollWheel(S32 x, S32 y, S32 clicks) } -/*virtual*/ -void LLFloaterModelWizard::onOpen(const LLSD& key) -{ - requestAgentUploadPermissions(); -} - void LLFloaterModelWizard::initDecompControls() { LLSD key; @@ -481,13 +473,11 @@ void LLFloaterModelWizard::initDecompControls() void LLFloaterModelWizard::onPermissionsReceived(const LLSD& result) { std::string upload_status = result["mesh_upload_status"].asString(); - mHasUploadPerm = "valid" == upload_status; + // BAP HACK: handle "" for case that MeshUploadFlag cap is broken. + mHasUploadPerm = (("" == upload_status) || ("valid" == upload_status)); - mHasUploadPerm = true; - - getChildView("upload")->setEnabled(mHasUploadPerm); - getChildView("warning_label")->setVisible(mHasUploadPerm); - getChildView("warning_text")->setVisible(mHasUploadPerm); + getChildView("warning_label")->setVisible(!mHasUploadPerm); + getChildView("warning_text")->setVisible(!mHasUploadPerm); } /*virtual*/ @@ -501,6 +491,10 @@ void LLFloaterModelWizard::onModelPhysicsFeeReceived(F64 physics, S32 fee, std:: { swap_controls(mCalculateWeightsBtn, mCalculatingWeightsBtn, true); + // Enable the "Upload" buton if we have calculated the upload fee + // and have the permission to upload. + getChildView("upload")->setEnabled(mHasUploadPerm); + mUploadModelUrl = upload_url; childSetTextArg("review_fee", "[FEE]", llformat("%d", fee)); @@ -514,6 +508,9 @@ void LLFloaterModelWizard::setModelPhysicsFeeErrorStatus(U32 status, const std:: { swap_controls(mCalculateWeightsBtn, mCalculatingWeightsBtn, true); + // Disable the "Review" step if it has been previously enabled. + modelChangedCallback(); + llwarns << "LLFloaterModelWizard::setModelPhysicsFeeErrorStatus(" << status << " : " << reason << ")" << llendl; } @@ -651,6 +648,7 @@ BOOL LLFloaterModelWizard::postBuild() mModelPreview->setPreviewTarget(16.f); mModelPreview->setDetailsCallback(boost::bind(&LLFloaterModelWizard::setDetails, this, _1, _2, _3, _4, _5)); mModelPreview->setModelLoadedCallback(boost::bind(&LLFloaterModelWizard::modelLoadedCallback, this)); + mModelPreview->setModelUpdatedCallback(boost::bind(&LLFloaterModelWizard::modelChangedCallback, this)); mModelPreview->mViewOption["show_textures"] = true; center(); @@ -663,6 +661,8 @@ BOOL LLFloaterModelWizard::postBuild() initDecompControls(); + requestAgentUploadPermissions(); + return TRUE; } @@ -690,6 +690,20 @@ void LLFloaterModelWizard::modelLoadedCallback() updateButtons(); } +void LLFloaterModelWizard::modelChangedCallback() +{ + // Don't allow to proceed to the "Review" step if the model has changed + // but the new upload fee hasn't been calculated yet. + if (mLastEnabledState > PHYSICS) + { + mLastEnabledState = PHYSICS; + } + + getChildView("upload")->setEnabled(false); + + updateButtons(); +} + void LLFloaterModelWizard::onUpload() { mModelPreview->rebuildUploadData(); |
