diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfloatermodelwizard.cpp | 25 | ||||
-rw-r--r-- | indra/newview/llfloatermodelwizard.h | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_model_wizard.xml | 1 |
3 files changed, 24 insertions, 3 deletions
diff --git a/indra/newview/llfloatermodelwizard.cpp b/indra/newview/llfloatermodelwizard.cpp index a3db22dbc6..f0e4e99d82 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) @@ -484,7 +482,6 @@ void LLFloaterModelWizard::onPermissionsReceived(const LLSD& result) // BAP HACK: handle "" for case that MeshUploadFlag cap is broken. mHasUploadPerm = (("" == upload_status) || ("valid" == upload_status)); - getChildView("upload")->setEnabled(mHasUploadPerm); getChildView("warning_label")->setVisible(!mHasUploadPerm); getChildView("warning_text")->setVisible(!mHasUploadPerm); } @@ -500,6 +497,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)); @@ -513,6 +514,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; } @@ -637,6 +641,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(); @@ -676,6 +681,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(); diff --git a/indra/newview/llfloatermodelwizard.h b/indra/newview/llfloatermodelwizard.h index 0b6ee451e1..6821e8b908 100644 --- a/indra/newview/llfloatermodelwizard.h +++ b/indra/newview/llfloatermodelwizard.h @@ -69,6 +69,7 @@ public: void setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, F32 physics_cost); void modelLoadedCallback(); + void modelChangedCallback(); void initDecompControls(); // shows warning message if agent has no permissions to upload model diff --git a/indra/newview/skins/default/xui/en/floater_model_wizard.xml b/indra/newview/skins/default/xui/en/floater_model_wizard.xml index 89736363b9..9e1bd9c349 100644 --- a/indra/newview/skins/default/xui/en/floater_model_wizard.xml +++ b/indra/newview/skins/default/xui/en/floater_model_wizard.xml @@ -792,6 +792,7 @@ Buildings</text> name="calculating" label="Calculating... " /> <button + enabled="false" top_delta="0" right="-150" width="90" |