summaryrefslogtreecommitdiff
path: root/indra/newview/llselectmgr.cpp
diff options
context:
space:
mode:
authorMnikolenko ProductEngine <mnikolenko@productengine.com>2015-02-26 12:12:08 +0200
committerMnikolenko ProductEngine <mnikolenko@productengine.com>2015-02-26 12:12:08 +0200
commit22ea223ddd2f2f9ed05a447dda2c4169a77d191e (patch)
tree513ba00dab703d9ffdb09b91faae98a9bf25ccb0 /indra/newview/llselectmgr.cpp
parent2ea45ee2c9924ff7ef8f1153e7f3f669981e70a2 (diff)
MAINT-4904 FIXED Show confirmation pop-up before unlinking an object.
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rwxr-xr-xindra/newview/llselectmgr.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index b13c30b6d4..2fb26a3a4d 100755
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -622,10 +622,41 @@ bool LLSelectMgr::linkObjects()
bool LLSelectMgr::unlinkObjects()
{
+ LLViewerObject *object = mSelectedObjects->getFirstRootObject();
+ if (!object) return false;
+
+ S32 min_objects_for_confirm = gSavedSettings.getS32("MinObjectsForUnlinkConfirm");
+ for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); iter != getSelection()->root_end(); iter++)
+ {
+ object = (*iter)->getObject();
+ if(object)
+ {
+ S32 objects_in_linkset = object->numChildren() + 1;
+ if(objects_in_linkset >= min_objects_for_confirm)
+ {
+ LLNotificationsUtil::add("ConfirmUnlink", LLSD(), LLSD(), boost::bind(&LLSelectMgr::confirmUnlinkObjects, this, _1, _2));
+ return true;
+ }
+ }
+ }
+
LLSelectMgr::getInstance()->sendDelink();
return true;
}
+void LLSelectMgr::confirmUnlinkObjects(const LLSD& notification, const LLSD& response)
+{
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+ // if Cancel pressed
+ if (option == 1)
+ {
+ return;
+ }
+
+ LLSelectMgr::getInstance()->sendDelink();
+ return;
+}
+
// in order to link, all objects must have the same owner, and the
// agent must have the ability to modify all of the objects. However,
// we're not answering that question with this method. The question