summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
authorLeyla Farazha <leyla@lindenlab.com>2009-12-15 16:25:11 -0800
committerLeyla Farazha <leyla@lindenlab.com>2009-12-15 16:25:11 -0800
commitb76c4399833c202f6cc8a6fb903fee82e8fcd3f3 (patch)
tree34d7789b2d8781299004f73dab1e059be82e6fcb /indra/newview/llviewermenu.cpp
parent5242a31b5d643adcac1c0bf8318145d2805502a0 (diff)
EXT-2649 Replace 'Advanced > Set Away After 30 Minutes' with Away time options
EXT-2649 [BSI] Confirm on Drop EXT-3416 Can't name a new gesture on creation (and renaming is HARD) reviewed by James
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r--indra/newview/llviewermenu.cpp79
1 files changed, 50 insertions, 29 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 0be0b56bc3..91d305bee7 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -5851,47 +5851,68 @@ void confirm_replace_attachment(S32 option, void* user_data)
}
}
-class LLAttachmentDrop : public view_listener_t
+bool callback_attachment_drop(const LLSD& notification, const LLSD& response)
{
- bool handleEvent(const LLSD& userdata)
+ // Called when the user clicked on an object attached to them
+ // and selected "Drop".
+ LLUUID object_id = notification["payload"]["object_id"].asUUID();
+ LLViewerObject *object = gObjectList.findObject(object_id);
+
+ if (!object)
{
- // Called when the user clicked on an object attached to them
- // and selected "Drop".
- LLViewerObject *object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
- if (!object)
- {
- llwarns << "handle_drop_attachment() - no object to drop" << llendl;
- return true;
- }
+ llwarns << "handle_drop_attachment() - no object to drop" << llendl;
+ return true;
+ }
- LLViewerObject *parent = (LLViewerObject*)object->getParent();
- while (parent)
+ LLViewerObject *parent = (LLViewerObject*)object->getParent();
+ while (parent)
+ {
+ if(parent->isAvatar())
{
- if(parent->isAvatar())
- {
- break;
- }
- object = parent;
- parent = (LLViewerObject*)parent->getParent();
+ break;
}
+ object = parent;
+ parent = (LLViewerObject*)parent->getParent();
+ }
- if (!object)
+ if (!object)
+ {
+ llwarns << "handle_detach() - no object to detach" << llendl;
+ return true;
+ }
+
+ if (object->isAvatar())
+ {
+ llwarns << "Trying to detach avatar from avatar." << llendl;
+ return true;
+ }
+
+ // reselect the object
+ LLSelectMgr::getInstance()->selectObjectAndFamily(object);
+
+ LLSelectMgr::getInstance()->sendDropAttachment();
+
+ return true;
+}
+
+class LLAttachmentDrop : public view_listener_t
+{
+ bool handleEvent(const LLSD& userdata)
+ {
+ LLSD payload;
+ LLViewerObject *object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
+
+ if (object)
{
- llwarns << "handle_detach() - no object to detach" << llendl;
- return true;
+ payload["object_id"] = object->getID();
}
-
- if (object->isAvatar())
+ else
{
- llwarns << "Trying to detach avatar from avatar." << llendl;
+ llwarns << "Drop object not found" << llendl;
return true;
}
- // The sendDropAttachment() method works on the list of selected
- // objects. Thus we need to clear the list, make sure it only
- // contains the object the user clicked, send the message,
- // then clear the list.
- LLSelectMgr::getInstance()->sendDropAttachment();
+ LLNotificationsUtil::add("AttachmentDrop", LLSD(), payload, &callback_attachment_drop);
return true;
}
};