summaryrefslogtreecommitdiff
path: root/indra/newview/llwearableitemslist.cpp
diff options
context:
space:
mode:
authorMike Antipov <mantipov@productengine.com>2010-07-27 16:46:37 +0300
committerMike Antipov <mantipov@productengine.com>2010-07-27 16:46:37 +0300
commit17fdce0ef24b863c6922f18d6e29d2b55d43b1b5 (patch)
treedbbd8aba567b6daeb1eecb7264a49fbd8bf531d8 /indra/newview/llwearableitemslist.cpp
parent0fde0686744b2c17c0ea4c0163da45e8e4648381 (diff)
parent8c2ccb5ed3b2acdf562acf0c1a180215d49742c8 (diff)
Merge with head.
Resolved conflict in indra/newview/lloutfitslist.cpp to use changes from viewer-release. Rejected changes in that file coming with 10f02c59761c (EXT-7015 FIXED Avoided wearing item moved to trash.) It will be refixed in a separate commit. --HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llwearableitemslist.cpp')
-rw-r--r--indra/newview/llwearableitemslist.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp
index fe8c09e329..98ebd68564 100644
--- a/indra/newview/llwearableitemslist.cpp
+++ b/indra/newview/llwearableitemslist.cpp
@@ -769,6 +769,9 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu
U32 n_links = 0; // number of links among the selected items
U32 n_editable = 0; // number of editable items among the selected ones
+ bool item_in_trash = false;
+ const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
+
for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it)
{
LLUUID id = *it;
@@ -804,16 +807,22 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu
{
++n_already_worn;
}
+
+ // if any in trash
+ if (!item_in_trash)
+ {
+ item_in_trash = gInventory.isObjectDescendentOf(item->getLinkedUUID(), trash_id);
+ }
} // for
bool standalone = mParent ? mParent->isStandalone() : false;
// *TODO: eliminate multiple traversals over the menu items
- setMenuItemVisible(menu, "wear_wear", n_already_worn == 0 && n_worn == 0);
+ setMenuItemVisible(menu, "wear_wear", n_already_worn == 0 && n_worn == 0 && !item_in_trash);
setMenuItemEnabled(menu, "wear_wear", n_already_worn == 0 && n_worn == 0);
- setMenuItemVisible(menu, "wear_add", mask == MASK_CLOTHING && n_worn == 0 && n_already_worn != 0);
+ setMenuItemVisible(menu, "wear_add", mask == MASK_CLOTHING && n_worn == 0 && n_already_worn != 0 && !item_in_trash);
setMenuItemEnabled(menu, "wear_add", n_items == 1 && canAddWearable(ids.front()) && n_already_worn != 0);
- setMenuItemVisible(menu, "wear_replace", n_worn == 0 && n_already_worn != 0);
+ setMenuItemVisible(menu, "wear_replace", n_worn == 0 && n_already_worn != 0 && !item_in_trash);
//visible only when one item selected and this item is worn
setMenuItemVisible(menu, "edit", !standalone && mask & (MASK_CLOTHING|MASK_BODYPART) && n_worn == n_items && n_worn == 1);
setMenuItemEnabled(menu, "edit", n_editable == 1 && n_worn == 1 && n_items == 1);