From 4495dd26f80936f9af15457f1b11ddd502cc71fe Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Thu, 16 Sep 2010 18:25:27 +0300 Subject: STORM-183 FIXED The "Replace Current Outfit" option of the My Outfits gear menu (which is only applicable to outfits) wasn't disabled for selected wearables. --- indra/newview/lloutfitslist.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index cf0b3d94bd..0d27abac17 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -85,7 +85,7 @@ public: registrar.add("Gear.WearAdd", boost::bind(&LLOutfitListGearMenu::onAdd, this)); - enable_registrar.add("Gear.OnEnable", boost::bind(&LLOutfitsList::isActionEnabled, mOutfitList, _2)); + enable_registrar.add("Gear.OnEnable", boost::bind(&LLOutfitListGearMenu::onEnable, this, _2)); enable_registrar.add("Gear.OnVisible", boost::bind(&LLOutfitListGearMenu::onVisible, this, _2)); mMenu = LLUICtrlFactory::getInstance()->createFromFile( @@ -209,6 +209,20 @@ private: LLAgentWearables::createWearable(type, true); } + bool onEnable(LLSD::String param) + { + // Handle the "Wear - Replace Current Outfit" menu option specially + // because LLOutfitList::isActionEnabled() checks whether it's allowed + // to wear selected outfit OR selected items, while we're only + // interested in the outfit (STORM-183). + if ("wear" == param) + { + return LLAppearanceMgr::instance().getCanReplaceCOF(mOutfitList->getSelectedOutfitUUID()); + } + + return mOutfitList->isActionEnabled(param); + } + bool onVisible(LLSD::String param) { const LLUUID& selected_outfit_id = getSelectedOutfitID(); -- cgit v1.2.3