diff options
author | Oz Linden <oz@lindenlab.com> | 2018-05-29 11:49:46 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2018-05-29 11:49:46 -0400 |
commit | c18a4cb0117b6e865a72a01465606c67a7e3bf6d (patch) | |
tree | 25abf867eabd03b7804a1e36e9c9af2513636cc7 /indra/newview/llpanelwearing.cpp | |
parent | 77344afa8b39b4c1fcebda4de63998a67fd4debb (diff) | |
parent | c70119ebabc4b06e2b0db02aea8c56e01fbc666e (diff) |
merge changes for 5.1.4-release
Diffstat (limited to 'indra/newview/llpanelwearing.cpp')
-rw-r--r-- | indra/newview/llpanelwearing.cpp | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp index 3099a6e039..89cb495db9 100644 --- a/indra/newview/llpanelwearing.cpp +++ b/indra/newview/llpanelwearing.cpp @@ -65,7 +65,7 @@ public: LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar; registrar.add("Gear.Edit", boost::bind(&edit_outfit)); - registrar.add("Gear.TakeOff", boost::bind(&LLWearingGearMenu::onTakeOff, this)); + registrar.add("Gear.TakeOff", boost::bind(&LLPanelWearing::onRemoveItem, mPanelWearing)); registrar.add("Gear.Copy", boost::bind(&LLPanelWearing::copyToClipboard, mPanelWearing)); enable_registrar.add("Gear.OnEnable", boost::bind(&LLPanelWearing::isActionEnabled, mPanelWearing, _2)); @@ -79,13 +79,6 @@ public: private: - void onTakeOff() - { - uuid_vec_t selected_uuids; - mPanelWearing->getSelectedItemsUUIDs(selected_uuids); - LLAppearanceMgr::instance().removeItemsFromAvatar(selected_uuids); - } - LLToggleableMenu* mMenu; LLPanelWearing* mPanelWearing; }; @@ -343,7 +336,18 @@ bool LLPanelWearing::isActionEnabled(const LLSD& userdata) if (command_name == "take_off") { - return hasItemSelected() && canTakeOffSelected(); + if (mWearablesTab->isExpanded()) + { + return hasItemSelected() && canTakeOffSelected(); + } + else + { + LLScrollListItem* item = mTempItemsList->getFirstSelected(); + if (item && item->getUUID().notNull()) + { + return true; + } + } } return false; @@ -524,7 +528,7 @@ void LLPanelWearing::onEditAttachment() void LLPanelWearing::onRemoveAttachment() { LLScrollListItem* item = mTempItemsList->getFirstSelected(); - if (item) + if (item && item->getUUID().notNull()) { LLSelectMgr::getInstance()->deselectAll(); LLSelectMgr::getInstance()->selectObjectAndFamily(mAttachmentsMap[item->getUUID()]); @@ -532,6 +536,21 @@ void LLPanelWearing::onRemoveAttachment() } } +void LLPanelWearing::onRemoveItem() +{ + if (mWearablesTab->isExpanded()) + { + uuid_vec_t selected_uuids; + getSelectedItemsUUIDs(selected_uuids); + LLAppearanceMgr::instance().removeItemsFromAvatar(selected_uuids); + } + else + { + onRemoveAttachment(); + } +} + + void LLPanelWearing::copyToClipboard() { std::string text; |