diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llpreview.h | 2 | ||||
-rw-r--r-- | indra/newview/llpreviewtexture.cpp | 58 | ||||
-rw-r--r-- | indra/newview/llpreviewtexture.h | 3 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_preview_texture.xml | 6 |
5 files changed, 55 insertions, 23 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index f68550d8fd..4f02812cc6 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2617,14 +2617,17 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) mItems.push_back(std::string("New Gesture")); mItems.push_back(std::string("New Clothes")); mItems.push_back(std::string("New Body Parts")); - mItems.push_back(std::string("Change Type")); - LLViewerInventoryCategory *cat = getCategory(); + // Changing folder types is just a debug feature; this is fairly unsupported + // and can lead to unexpected behavior if enabled. +#if !LL_RELEASE_FOR_DOWNLOAD + mItems.push_back(std::string("Change Type")); + const LLViewerInventoryCategory *cat = getCategory(); if (cat && LLFolderType::lookupIsProtectedType(cat->getPreferredType())) { mDisabledItems.push_back(std::string("Change Type")); } - +#endif getClipboardEntries(false, mItems, mDisabledItems, flags); } else diff --git a/indra/newview/llpreview.h b/indra/newview/llpreview.h index 3b9f7f9882..551e247d8c 100644 --- a/indra/newview/llpreview.h +++ b/indra/newview/llpreview.h @@ -74,7 +74,7 @@ public: /*virtual*/ BOOL postBuild(); - void setObjectID(const LLUUID& object_id); + virtual void setObjectID(const LLUUID& object_id); void setItem( LLInventoryItem* item ); void setAssetId(const LLUUID& asset_id); diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 028807a6bd..dfc67d0126 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -74,22 +74,10 @@ LLPreviewTexture::LLPreviewTexture(const LLSD& key) mLastHeight(0), mLastWidth(0), mAspectRatio(0.f), - mPreviewToSave(FALSE) + mPreviewToSave(FALSE), + mImage(NULL) { - const LLViewerInventoryItem *item = static_cast<const LLViewerInventoryItem*>(getItem()); - if(item) - { - mShowKeepDiscard = item->getPermissions().getCreator() != gAgent.getID(); - mImageID = item->getAssetUUID(); - mIsCopyable = item->checkPermissionsSet(PERM_ITEM_UNRESTRICTED); - } - else // not an item, assume it's an asset id - { - mImageID = mItemUUID; - mCopyToInv = TRUE; - mIsCopyable = TRUE; - } - + updateImageID(); if (key.has("save_as")) { mPreviewToSave = TRUE; @@ -97,7 +85,6 @@ LLPreviewTexture::LLPreviewTexture(const LLSD& key) //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_texture.xml", FALSE); } - LLPreviewTexture::~LLPreviewTexture() { if( mLoadingFullImage ) @@ -493,3 +480,42 @@ LLPreview::EAssetStatus LLPreviewTexture::getAssetStatus() } return mAssetStatus; } + +void LLPreviewTexture::updateImageID() +{ + const LLViewerInventoryItem *item = static_cast<const LLViewerInventoryItem*>(getItem()); + if(item) + { + mImageID = item->getAssetUUID(); + mShowKeepDiscard = item->getPermissions().getCreator() != gAgent.getID(); + mCopyToInv = FALSE; + mIsCopyable = item->checkPermissionsSet(PERM_ITEM_UNRESTRICTED); + } + else // not an item, assume it's an asset id + { + mImageID = mItemUUID; + mShowKeepDiscard = FALSE; + mCopyToInv = TRUE; + mIsCopyable = TRUE; + } + +} + +/* virtual */ +void LLPreviewTexture::setObjectID(const LLUUID& object_id) +{ + mObjectUUID = object_id; + + const LLUUID old_image_id = mImageID; + + // Update what image we're pointing to, such as if we just specified the mObjectID + // that this mItemID is part of. + updateImageID(); + + // If the imageID has changed, start over and reload the new image. + if (mImageID != old_image_id) + { + mAssetStatus = PREVIEW_ASSET_UNLOADED; + loadAsset(); + } +} diff --git a/indra/newview/llpreviewtexture.h b/indra/newview/llpreviewtexture.h index 980aecee6d..7cd2adad56 100644 --- a/indra/newview/llpreviewtexture.h +++ b/indra/newview/llpreviewtexture.h @@ -69,6 +69,8 @@ public: void openToSave(); static void onSaveAsBtn(void* data); + + /*virtual*/ void setObjectID(const LLUUID& object_id); protected: void init(); /* virtual */ BOOL postBuild(); @@ -76,6 +78,7 @@ protected: static void onAspectRatioCommit(LLUICtrl*,void* userdata); private: + void updateImageID(); // set what image is being uploaded. void updateDimensions(); LLUUID mImageID; LLPointer<LLViewerFetchedTexture> mImage; diff --git a/indra/newview/skins/default/xui/en/floater_preview_texture.xml b/indra/newview/skins/default/xui/en/floater_preview_texture.xml index 0d155fb01e..fc6f06ffd4 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_texture.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_texture.xml @@ -114,7 +114,7 @@ left="6" name="Keep" top_pad="5" - width="100" /> + width="110" /> <button follows="right|bottom" height="22" @@ -123,7 +123,7 @@ left_pad="5" name="Discard" top_delta="0" - width="100" /> + width="110" /> <button follows="right|bottom" height="22" @@ -132,5 +132,5 @@ left_pad="5" name="save_tex_btn" top_delta="0" - width="100" /> + width="110" /> </floater> |