Skip to content
Snippets Groups Projects
Commit b0950991 authored by maxim_productengine's avatar maxim_productengine
Browse files

MAINT-8274 FIXED Temporary attachments could not be detached via gear menu from Appearance>Wearing

parent 3e56de13
No related branches found
No related tags found
No related merge requests found
......@@ -65,7 +65,7 @@ class LLWearingGearMenu
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 @@ class LLWearingGearMenu
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;
......
......@@ -80,6 +80,7 @@ class LLPanelWearing : public LLPanelAppearanceTab
void onAccordionTabStateChanged();
void setAttachmentDetails(LLSD content);
void requestAttachmentDetails();
void onRemoveItem();
void onEditAttachment();
void onRemoveAttachment();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment