summaryrefslogtreecommitdiff
path: root/indra/newview/llpaneloutfitedit.cpp
diff options
context:
space:
mode:
authorMonroe Linden <monroe@lindenlab.com>2010-06-25 16:04:45 -0700
committerMonroe Linden <monroe@lindenlab.com>2010-06-25 16:04:45 -0700
commit8d18056e8296472d58a820fd77a6a66100e70661 (patch)
tree7e8f639e608da651d1a2dd50f15102f603a19b5f /indra/newview/llpaneloutfitedit.cpp
parentaf488c97820121eb7f1e35e8e70b8b433cfd91d5 (diff)
Fix for EXT-8025 ('+' button on My Appearance > Edit Outfit panel does nothing)
Button now gets disabled in the early-exit case in LLPanelOutfitEdit::onInventorySelectionChange(). onInventorySelectionChange() also uses the new predicate get_can_item_be_worn(), which both checks whether the item is already being worn and whether it's of a type that could be worn. Reviewed by Nyx at http://codereview.lindenlab.com/2451030 .
Diffstat (limited to 'indra/newview/llpaneloutfitedit.cpp')
-rw-r--r--indra/newview/llpaneloutfitedit.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp
index 1544717873..ffd879dfd7 100644
--- a/indra/newview/llpaneloutfitedit.cpp
+++ b/indra/newview/llpaneloutfitedit.cpp
@@ -661,10 +661,13 @@ void LLPanelOutfitEdit::onInventorySelectionChange()
getSelectedItemsUUID(selected_items);
if (selected_items.empty())
{
+ mPlusBtn->setEnabled(false);
return;
}
- uuid_vec_t::iterator worn_item = std::find_if(selected_items.begin(), selected_items.end(), boost::bind(&get_is_item_worn, _1));
- bool can_add = ( worn_item == selected_items.end() );
+
+ // If any of the selected items are not wearable (due to already being worn OR being of the wrong type), disable the add button.
+ uuid_vec_t::iterator unwearable_item = std::find_if(selected_items.begin(), selected_items.end(), !boost::bind(& get_can_item_be_worn, _1));
+ bool can_add = ( unwearable_item == selected_items.end() );
mPlusBtn->setEnabled(can_add);