From af2f61af502d483011a8f6722686a2c343bd0f7d Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Thu, 21 Jan 2010 20:34:10 -0500 Subject: EXT-4492 Deleting gestures from the wearing tab causes the viewer to crash Removed "delete" from the COF menu, since it is normally disabled from the inventory view. --- indra/newview/llinventorybridge.cpp | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 099f863dc9..1c88658920 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -574,18 +574,35 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, disabled_items.push_back(std::string("Paste As Link")); } } - items.push_back(std::string("Paste Separator")); + // Don't add a separator unless we have at least one entry beneath it, + // to avoid double separators. + BOOL separator_pasted = FALSE; if (obj && obj->getIsLinkType() && !get_is_item_worn(mUUID)) { + if (!separator_pasted) + { + items.push_back(std::string("Paste Separator")); + separator_pasted = TRUE; + } items.push_back(std::string("Remove Link")); } - items.push_back(std::string("Delete")); - if (!isItemRemovable()) + // Hide the delete button from the COF. Detaching/removing/etc. an item in the COF + // will naturally delete it. This prevents double delete crash possibilities. + if (!isCOFFolder()) { - disabled_items.push_back(std::string("Delete")); + if (!separator_pasted) + { + items.push_back(std::string("Paste Separator")); + separator_pasted = TRUE; + } + items.push_back(std::string("Delete")); + if (!isItemRemovable()) + { + disabled_items.push_back(std::string("Delete")); + } } // If multiple items are selected, disable properties (if it exists). -- cgit v1.2.3 From c64638dc2114a91b8efb17c1e37481ce34df84d5 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 22 Jan 2010 10:48:24 -0500 Subject: EXT-4492 Deleting gestures from the wearing tab causes the viewer to crash Revert removal of "delete" option from last checkin. Now enabling "delete" but checking if *this was deleted within removeItem(). --- indra/newview/llinventorybridge.cpp | 46 ++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 1c88658920..df089cb0f9 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -575,34 +575,17 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, } } - // Don't add a separator unless we have at least one entry beneath it, - // to avoid double separators. - BOOL separator_pasted = FALSE; + items.push_back(std::string("Paste Separator")); if (obj && obj->getIsLinkType() && !get_is_item_worn(mUUID)) { - if (!separator_pasted) - { - items.push_back(std::string("Paste Separator")); - separator_pasted = TRUE; - } items.push_back(std::string("Remove Link")); } - // Hide the delete button from the COF. Detaching/removing/etc. an item in the COF - // will naturally delete it. This prevents double delete crash possibilities. - if (!isCOFFolder()) + items.push_back(std::string("Delete")); + if (!isItemRemovable()) { - if (!separator_pasted) - { - items.push_back(std::string("Paste Separator")); - separator_pasted = TRUE; - } - items.push_back(std::string("Delete")); - if (!isItemRemovable()) - { - disabled_items.push_back(std::string("Delete")); - } + disabled_items.push_back(std::string("Delete")); } // If multiple items are selected, disable properties (if it exists). @@ -3827,8 +3810,25 @@ void LLGestureBridge::openItem() BOOL LLGestureBridge::removeItem() { - // Force close the preview window, if it exists - LLGestureManager::instance().deactivateGesture(mUUID); + // Grab class information locally since *this may be deleted + // within this function. Not a great pattern... + const LLInventoryModel* model = getInventoryModel(); + if(!model) + { + return FALSE; + } + const LLUUID item_id = mUUID; + + // This will also force close the preview window, if it exists. + // This may actually delete *this, if mUUID is in the COF. + LLGestureManager::instance().deactivateGesture(item_id); + + // If deactivateGesture deleted *this, then return out immediately. + if (!model->getObject(item_id)) + { + return TRUE; + } + return LLItemBridge::removeItem(); } -- cgit v1.2.3 From 0283837e56e69c8a6757d8366b82065e04ae966b Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 22 Jan 2010 14:44:32 -0500 Subject: 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. --- indra/newview/llinventorybridge.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index df089cb0f9..a7ce111b18 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -185,6 +185,11 @@ BOOL LLInvFVBridge::isItemRemovable() { return FALSE; } + if (LLAppearanceManager::instance().getIsProtectedCOFItem(mUUID)) + { + return FALSE; + } + const LLInventoryObject *obj = model->getItem(mUUID); if (obj && obj->getIsLinkType()) { @@ -712,14 +717,7 @@ BOOL LLInvFVBridge::isAgentInventory() const BOOL LLInvFVBridge::isCOFFolder() const { - const LLInventoryModel* model = getInventoryModel(); - if(!model) return TRUE; - const LLUUID cof_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT); - if (mUUID == cof_id || model->isObjectDescendentOf(mUUID, cof_id)) - { - return TRUE; - } - return FALSE; + return LLAppearanceManager::instance().getIsInCOF(mUUID); } BOOL LLInvFVBridge::isItemPermissive() const @@ -4622,7 +4620,10 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) getClipboardEntries(true, items, disabled_items, flags); - items.push_back(std::string("Wearable Separator")); + if (!is_sidepanel) + { + items.push_back(std::string("Wearable Separator")); + } items.push_back(std::string("Wearable Edit")); -- cgit v1.2.3