summaryrefslogtreecommitdiff
path: root/indra/newview/llcofwearables.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2020-11-13 18:22:43 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2020-11-13 18:22:43 +0200
commit0bba892bb0b146a2c20597d8cfe6eb0353c17f06 (patch)
tree15d3ad979533feb32114589a5fd4f79e4aa8a5ae /indra/newview/llcofwearables.cpp
parentdfc406f0ff4e03e36c3d877c9bd57d2c18e08d43 (diff)
parent04c473ab46041133ea6a87dbe0d43e662472adf5 (diff)
Merge branch 'master' into DRTVWR-515-maint
# Conflicts: # indra/newview/llfloatereditextdaycycle.cpp # indra/newview/llfloaterfixedenvironment.cpp
Diffstat (limited to 'indra/newview/llcofwearables.cpp')
-rw-r--r--indra/newview/llcofwearables.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp
index 1caefd58ab..b31981b235 100644
--- a/indra/newview/llcofwearables.cpp
+++ b/indra/newview/llcofwearables.cpp
@@ -140,10 +140,31 @@ protected:
{
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
+ registrar.add("Attachment.Touch", boost::bind(handleMultiple, handle_attachment_touch, mUUIDs));
+ registrar.add("Attachment.Edit", boost::bind(handleMultiple, handle_item_edit, mUUIDs));
registrar.add("Attachment.Detach", boost::bind(&LLAppearanceMgr::removeItemsFromAvatar, LLAppearanceMgr::getInstance(), mUUIDs));
+ LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
+ enable_registrar.add("Attachment.OnEnable", boost::bind(&CofAttachmentContextMenu::onEnable, this, _2));
+
return createFromFile("menu_cof_attachment.xml");
}
+
+ bool onEnable(const LLSD& userdata)
+ {
+ const std::string event_name = userdata.asString();
+
+ if ("touch" == event_name)
+ {
+ return (1 == mUUIDs.size()) && (enable_attachment_touch(mUUIDs.front()));
+ }
+ else if ("edit" == event_name)
+ {
+ return (1 == mUUIDs.size()) && (get_is_item_editable(mUUIDs.front()));
+ }
+
+ return true;
+ }
};
//////////////////////////////////////////////////////////////////////////