From 4734125659ca7fa5d5f86c306a929a4a12cc80ae Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 2 Dec 2014 19:47:47 +0200 Subject: MAINT-4710 FIXED The 'Copy to inventory' button should be disabled in Texture preview floater when permissions forbid it --- indra/newview/llpreviewtexture.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpreviewtexture.cpp') diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 5c41c5ad97..fed613543f 100755 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -65,6 +65,7 @@ LLPreviewTexture::LLPreviewTexture(const LLSD& key) mShowKeepDiscard(FALSE), mCopyToInv(FALSE), mIsCopyable(FALSE), + mIsFullPerm(FALSE), mUpdateDimensions(TRUE), mLastHeight(0), mLastWidth(0), @@ -269,7 +270,7 @@ void LLPreviewTexture::draw() // virtual BOOL LLPreviewTexture::canSaveAs() const { - return mIsCopyable && !mLoadingFullImage && mImage.notNull() && !mImage->isMissingAsset(); + return mIsFullPerm && !mLoadingFullImage && mImage.notNull() && !mImage->isMissingAsset(); } @@ -516,6 +517,11 @@ void LLPreviewTexture::loadAsset() mUpdateDimensions = TRUE; updateDimensions(); getChildView("save_tex_btn")->setEnabled(canSaveAs()); + if (mObjectUUID.notNull()) + { + // check that we can copy inworld items into inventory + getChildView("Keep")->setEnabled(mIsCopyable); + } } LLPreview::EAssetStatus LLPreviewTexture::getAssetStatus() @@ -580,7 +586,9 @@ void LLPreviewTexture::updateImageID() mShowKeepDiscard = TRUE; mCopyToInv = FALSE; - mIsCopyable = item->checkPermissionsSet(PERM_ITEM_UNRESTRICTED); + LLPermissions perm(item->getPermissions()); + mIsCopyable = perm.allowCopyBy(gAgent.getID(), gAgent.getGroupID()) && perm.allowTransferTo(gAgent.getID()); + mIsFullPerm = item->checkPermissionsSet(PERM_ITEM_UNRESTRICTED); } else // not an item, assume it's an asset id { @@ -588,6 +596,7 @@ void LLPreviewTexture::updateImageID() mShowKeepDiscard = FALSE; mCopyToInv = TRUE; mIsCopyable = TRUE; + mIsFullPerm = TRUE; } } -- cgit v1.2.3 From 015e979632eb1e9d68ee09ad58f937f2523c2a23 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Wed, 10 Dec 2014 12:32:51 +0200 Subject: MAINT-1774 FIXED Don't open preview texture floater if user clicks "Cancel" button. --- indra/newview/llpreviewtexture.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/newview/llpreviewtexture.cpp') diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index fed613543f..f91a18d8d3 100755 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -183,12 +183,6 @@ void LLPreviewTexture::draw() if ( mImage.notNull() ) { - // Automatically bring up SaveAs dialog if we opened this to save the texture. - if (mPreviewToSave) - { - mPreviewToSave = FALSE; - saveAs(); - } // Draw the texture gGL.diffuseColor3f( 1.f, 1.f, 1.f ); gl_draw_scaled_image(interior.mLeft, @@ -287,6 +281,12 @@ void LLPreviewTexture::saveAs() // User canceled or we failed to acquire save file. return; } + if(mPreviewToSave) + { + mPreviewToSave = FALSE; + LLFloaterReg::showTypedInstance("preview_texture", item->getUUID()); + } + // remember the user-approved/edited file name. mSaveFileName = file_picker.getFirstFile(); mLoadingFullImage = TRUE; -- cgit v1.2.3