summaryrefslogtreecommitdiff
path: root/indra/newview/llselectmgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rwxr-xr-xindra/newview/llselectmgr.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 69c577f445..4fafbf917b 100755
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -620,10 +620,33 @@ bool LLSelectMgr::linkObjects()
bool LLSelectMgr::unlinkObjects()
{
+ S32 min_objects_for_confirm = gSavedSettings.getS32("MinObjectsForUnlinkConfirm");
+ S32 unlink_object_count = mSelectedObjects->getObjectCount(); // clears out nodes with NULL objects
+ if (unlink_object_count >= min_objects_for_confirm
+ && unlink_object_count > mSelectedObjects->getRootObjectCount())
+ {
+ // total count > root count means that there are childer inside and that there are linksets that will be unlinked
+ 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