summaryrefslogtreecommitdiff
path: root/indra/newview/llpreviewtexture.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2015-04-14 13:46:01 -0700
committerMerov Linden <merov@lindenlab.com>2015-04-14 13:46:01 -0700
commitd631f2fd4daed5e3b10fc6dc290aa16f3d0591f0 (patch)
treeafc5139a2d530bdca9233308d2b6d6d4532bc6c4 /indra/newview/llpreviewtexture.cpp
parent5411f349e5ed8835d5c99dbfb19a0934a6e5e28f (diff)
parenta49e11efd9e249cc6d3cf5bcffaafe1e831f2fa9 (diff)
Pull merge from lindenlab/viewer-tools-update (includes viewer-release)
Diffstat (limited to 'indra/newview/llpreviewtexture.cpp')
-rwxr-xr-xindra/newview/llpreviewtexture.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp
index 5c41c5ad97..f91a18d8d3 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),
@@ -182,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,
@@ -269,7 +264,7 @@ void LLPreviewTexture::draw()
// virtual
BOOL LLPreviewTexture::canSaveAs() const
{
- return mIsCopyable && !mLoadingFullImage && mImage.notNull() && !mImage->isMissingAsset();
+ return mIsFullPerm && !mLoadingFullImage && mImage.notNull() && !mImage->isMissingAsset();
}
@@ -286,6 +281,12 @@ void LLPreviewTexture::saveAs()
// User canceled or we failed to acquire save file.
return;
}
+ if(mPreviewToSave)
+ {
+ mPreviewToSave = FALSE;
+ LLFloaterReg::showTypedInstance<LLPreviewTexture>("preview_texture", item->getUUID());
+ }
+
// remember the user-approved/edited file name.
mSaveFileName = file_picker.getFirstFile();
mLoadingFullImage = TRUE;
@@ -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;
}
}