summaryrefslogtreecommitdiff
path: root/indra/newview/lloutfitslist.cpp
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2010-06-11 17:25:56 +0300
committerVadim Savchuk <vsavchuk@productengine.com>2010-06-11 17:25:56 +0300
commitad048d4b6a114c11848ecf3147f1be93db00abe2 (patch)
treecfa534df543e48a0de37e53c51da5e7bf362ae76 /indra/newview/lloutfitslist.cpp
parenteb1929c8f97f256264cac620871e4b498d985d68 (diff)
EXT-7807 FIXED Hide inappropriate outfit context menu items.
Hide the following outfit context menu items instead of disabling them: * Wear - Replace Current Outfit * Wear - Add to Current Outfit" * Take Off - Remove from Current Outfit * Edit Outfit * Delete Outfit Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/565/ --HG-- branch : product-engine
Diffstat (limited to 'indra/newview/lloutfitslist.cpp')
-rw-r--r--indra/newview/lloutfitslist.cpp30
1 files changed, 19 insertions, 11 deletions
diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp
index bca292fa4a..03df2d2b20 100644
--- a/indra/newview/lloutfitslist.cpp
+++ b/indra/newview/lloutfitslist.cpp
@@ -90,17 +90,33 @@ protected:
registrar.add("Outfit.Delete", boost::bind(deleteOutfit, selected_id));
enable_registrar.add("Outfit.OnEnable", boost::bind(&OutfitContextMenu::onEnable, this, _2));
+ enable_registrar.add("Outfit.OnVisible", boost::bind(&OutfitContextMenu::onVisible, this, _2));
return createFromFile("menu_outfit_tab.xml");
}
- bool onEnable(const LLSD& data)
+ bool onEnable(LLSD::String param)
+ {
+ LLUUID outfit_cat_id = mUUIDs.back();
+
+ if ("rename" == param)
+ {
+ return get_is_category_renameable(&gInventory, outfit_cat_id);
+ }
+
+ return true;
+ }
+
+ bool onVisible(LLSD::String param)
{
- std::string param = data.asString();
LLUUID outfit_cat_id = mUUIDs.back();
bool is_worn = LLAppearanceMgr::instance().getBaseOutfitUUID() == outfit_cat_id;
- if ("wear_replace" == param)
+ if ("edit" == param)
+ {
+ return is_worn;
+ }
+ else if ("wear_replace" == param)
{
return !is_worn;
}
@@ -112,14 +128,6 @@ protected:
{
return is_worn;
}
- else if ("edit" == param)
- {
- return is_worn;
- }
- else if ("rename" == param)
- {
- return get_is_category_renameable(&gInventory, outfit_cat_id);
- }
else if ("delete" == param)
{
return LLAppearanceMgr::instance().getCanRemoveOutfit(outfit_cat_id);