From b0950991988ddd56bec9074316d883a00b0cae4c Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Fri, 9 Feb 2018 18:06:00 +0200 Subject: MAINT-8274 FIXED Temporary attachments could not be detached via gear menu from Appearance>Wearing --- indra/newview/llpanelwearing.cpp | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) (limited to 'indra/newview/llpanelwearing.cpp') diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp index 3099a6e039..75c8765c5b 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,14 @@ bool LLPanelWearing::isActionEnabled(const LLSD& userdata) if (command_name == "take_off") { - return hasItemSelected() && canTakeOffSelected(); + if (mWearablesTab->isExpanded()) + { + return hasItemSelected() && canTakeOffSelected(); + } + else + { + return mTempItemsList->hasSelectedItem(); + } } return false; @@ -532,6 +532,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; -- cgit v1.2.3 From 8617e974272c71c768942e8e25e7e1761c003fb9 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Tue, 6 Mar 2018 11:32:28 +0200 Subject: MAINT-8342 FIXED [maint-viewer] Viewer crash when click Take off in Temporary attachments --- indra/newview/llpanelwearing.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelwearing.cpp') diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp index 75c8765c5b..89cb495db9 100644 --- a/indra/newview/llpanelwearing.cpp +++ b/indra/newview/llpanelwearing.cpp @@ -342,7 +342,11 @@ bool LLPanelWearing::isActionEnabled(const LLSD& userdata) } else { - return mTempItemsList->hasSelectedItem(); + LLScrollListItem* item = mTempItemsList->getFirstSelected(); + if (item && item->getUUID().notNull()) + { + return true; + } } } @@ -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()]); -- cgit v1.2.3