diff options
author | andreykproductengine <akleshchev@productengine.com> | 2016-04-22 18:41:45 +0300 |
---|---|---|
committer | andreykproductengine <akleshchev@productengine.com> | 2016-04-22 18:41:45 +0300 |
commit | e302b6f1f451f8a2388698b3528fb71af9cf41b2 (patch) | |
tree | 3c60c9d670c0297e0ba0dde146d64e4d8b5563b4 /indra/newview/llpreviewtexture.cpp | |
parent | bb719baec5b3000d0e9671283f5b5e9f23e780ac (diff) |
MAINT-2063 Fixed User had ability to delete Notecards and textures from library
Diffstat (limited to 'indra/newview/llpreviewtexture.cpp')
-rwxr-xr-x | indra/newview/llpreviewtexture.cpp | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 2a2c51be40..645a77e42a 100755 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -38,6 +38,7 @@ #include "llimagetga.h" #include "llimagepng.h" #include "llinventory.h" +#include "llinventorymodel.h" #include "llnotificationsutil.h" #include "llresmgr.h" #include "lltrans.h" @@ -120,18 +121,22 @@ BOOL LLPreviewTexture::postBuild() childSetAction("save_tex_btn", LLPreviewTexture::onSaveAsBtn, this); getChildView("save_tex_btn")->setVisible( true); getChildView("save_tex_btn")->setEnabled(canSaveAs()); - - if (!mCopyToInv) - { - const LLInventoryItem* item = getItem(); - - if (item) - { - childSetCommitCallback("desc", LLPreview::onText, this); - getChild<LLUICtrl>("desc")->setValue(item->getDescription()); - getChild<LLLineEditor>("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); - } - } + + const LLInventoryItem* item = getItem(); + if (item) + { + if (!mCopyToInv) + { + childSetCommitCallback("desc", LLPreview::onText, this); + getChild<LLUICtrl>("desc")->setValue(item->getDescription()); + getChild<LLLineEditor>("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); + } + BOOL source_library = mObjectUUID.isNull() && gInventory.isObjectDescendentOf(item->getUUID(), gInventory.getLibraryRootFolderID()); + if (source_library) + { + getChildView("Discard")->setEnabled(false); + } + } // Fill in ratios list with common aspect ratio values mRatiosList.clear(); @@ -526,6 +531,15 @@ void LLPreviewTexture::loadAsset() // check that we can copy inworld items into inventory getChildView("Keep")->setEnabled(mIsCopyable); } + else + { + // check that we can remove item + BOOL source_library = gInventory.isObjectDescendentOf(mItemUUID, gInventory.getLibraryRootFolderID()); + if (source_library) + { + getChildView("Discard")->setEnabled(false); + } + } } LLPreview::EAssetStatus LLPreviewTexture::getAssetStatus() |