diff options
author | Loren Shih <seraph@lindenlab.com> | 2010-01-22 14:44:32 -0500 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2010-01-22 14:44:32 -0500 |
commit | 0283837e56e69c8a6757d8366b82065e04ae966b (patch) | |
tree | 51cab887adca8ddf16ef1e87ab3979de1e9fdcff /indra/newview/llappearancemgr.cpp | |
parent | c64638dc2114a91b8efb17c1e37481ce34df84d5 (diff) |
EXT-4492 : Deleting gestures from the wearing tab causes the viewer to crash
EXT-4660 : Can delete a bodypart from the COF through inventory view or WEARING tab delete key
EXT-4662 : remove leading separator from COF right-click menu
EXT-4633 : AppearanceSP trash button doesn't update enabled state correctly
Bunch of UI fixes related to the trash/delete functionality in InventoryFloater/SP and AppearanceSP "WEARING" tab. The main idea is that we don't want to allow deletion of bodyparts and folder links from the COF by the user.
Diffstat (limited to 'indra/newview/llappearancemgr.cpp')
-rw-r--r-- | indra/newview/llappearancemgr.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 748d8bdfbf..0ff839849f 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -358,7 +358,7 @@ static void onWearableAssetFetch(LLWearable* wearable, void* data) } } -LLUUID LLAppearanceManager::getCOF() +const LLUUID LLAppearanceManager::getCOF() const { return gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT); } @@ -1263,3 +1263,23 @@ void LLAppearanceManager::linkRegisteredAttachments() } mRegisteredAttachments.clear(); } + +BOOL LLAppearanceManager::getIsInCOF(const LLUUID& obj_id) const +{ + return gInventory.isObjectDescendentOf(obj_id, getCOF()); +} + +BOOL LLAppearanceManager::getIsProtectedCOFItem(const LLUUID& obj_id) const +{ + if (!getIsInCOF(obj_id)) return FALSE; + const LLInventoryObject *obj = gInventory.getObject(obj_id); + if (!obj) return FALSE; + + // Can't delete bodyparts, since this would be equivalent to removing the item. + if (obj->getType() == LLAssetType::AT_BODYPART) return TRUE; + + // Can't delete the folder link, since this is saved for bookkeeping. + if (obj->getActualType() == LLAssetType::AT_LINK_FOLDER) return TRUE; + + return FALSE; +} |