summaryrefslogtreecommitdiff
path: root/indra/newview/llpreviewtexture.cpp
diff options
context:
space:
mode:
authorandreykproductengine <akleshchev@productengine.com>2016-04-22 18:41:45 +0300
committerandreykproductengine <akleshchev@productengine.com>2016-04-22 18:41:45 +0300
commite302b6f1f451f8a2388698b3528fb71af9cf41b2 (patch)
tree3c60c9d670c0297e0ba0dde146d64e4d8b5563b4 /indra/newview/llpreviewtexture.cpp
parentbb719baec5b3000d0e9671283f5b5e9f23e780ac (diff)
MAINT-2063 Fixed User had ability to delete Notecards and textures from library
Diffstat (limited to 'indra/newview/llpreviewtexture.cpp')
-rwxr-xr-xindra/newview/llpreviewtexture.cpp38
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()