From d1a2ce75e27f34141eeb8a45ae914c453c419f1b Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 9 Mar 2011 14:18:39 -0600 Subject: SH-587 Make cancel button on physics tabs more responsive. --- indra/newview/llfloatermodelpreview.cpp | 40 +++++++++++++++------- .../skins/default/xui/en/floater_model_preview.xml | 3 ++ 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index e33ce055f6..c2054bf00f 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -773,11 +773,13 @@ void LLFloaterModelPreview::onPhysicsStageExecute(LLUICtrl* ctrl, void* data) if (stage == "Decompose") { + sInstance->setStatusMessage(sInstance->getString("decomposing")); sInstance->childSetVisible("Decompose", false); sInstance->childSetVisible("decompose_cancel", true); } else if (stage == "Simplify") { + sInstance->setStatusMessage(sInstance->getString("simplifying")); sInstance->childSetVisible("Simplify", false); sInstance->childSetVisible("simplify_cancel", true); } @@ -823,6 +825,8 @@ void LLFloaterModelPreview::onPhysicsStageCancel(LLUICtrl* ctrl, void*data) DecompRequest* req = *iter; req->mContinue = 0; } + + sInstance->mCurRequest.clear(); } } @@ -4301,10 +4305,13 @@ void LLFloaterModelPreview::setStatusMessage(const std::string& msg) S32 LLFloaterModelPreview::DecompRequest::statusCallback(const char* status, S32 p1, S32 p2) { - setStatusMessage(llformat("%s: %d/%d", status, p1, p2)); - if (LLFloaterModelPreview::sInstance) + if (mContinue) { - LLFloaterModelPreview::sInstance->setStatusMessage(mStatusMessage); + setStatusMessage(llformat("%s: %d/%d", status, p1, p2)); + if (LLFloaterModelPreview::sInstance) + { + LLFloaterModelPreview::sInstance->setStatusMessage(mStatusMessage); + } } return mContinue; @@ -4312,20 +4319,27 @@ S32 LLFloaterModelPreview::DecompRequest::statusCallback(const char* status, S32 void LLFloaterModelPreview::DecompRequest::completed() { //called from the main thread - mModel->setConvexHullDecomposition(mHull); - - if (sInstance) + if (mContinue) { - if (mContinue) + mModel->setConvexHullDecomposition(mHull); + + if (sInstance) { - if (sInstance->mModelPreview) + if (mContinue) { - sInstance->mModelPreview->mPhysicsMesh[mModel] = mHullMesh; - sInstance->mModelPreview->mDirty = true; - LLFloaterModelPreview::sInstance->mModelPreview->refresh(); + if (sInstance->mModelPreview) + { + sInstance->mModelPreview->mPhysicsMesh[mModel] = mHullMesh; + sInstance->mModelPreview->mDirty = true; + LLFloaterModelPreview::sInstance->mModelPreview->refresh(); + } } - } - sInstance->mCurRequest.erase(this); + sInstance->mCurRequest.erase(this); + } + } + else if (sInstance) + { + llassert(sInstance->mCurRequest.find(this) == sInstance->mCurRequest.end()); } } 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 8a18861e1a..1ebb3b3fb1 100644 --- a/indra/newview/skins/default/xui/en/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml @@ -18,6 +18,9 @@ Level of detail has too many vertices. Missing required level of detail. All + Analyzing... + Simplifying... + Name: -- cgit v1.2.3