From 22ea223ddd2f2f9ed05a447dda2c4169a77d191e Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Thu, 26 Feb 2015 12:12:08 +0200 Subject: MAINT-4904 FIXED Show confirmation pop-up before unlinking an object. --- indra/newview/llselectmgr.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'indra/newview/llselectmgr.cpp') 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 -- cgit v1.2.3 From 1845816aa2419353ace258b7cfe24bdd08357ebe Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 25 Jun 2015 16:36:38 +0300 Subject: MAINT-5299 FIXED [MAINT-RC] Unlinking individual prims from a linkset no longer works --- indra/newview/llselectmgr.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index cbc00d8b53..47a9353ffa 100755 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -619,22 +619,14 @@ 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++) + 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()) { - 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; - } - } + // 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(); -- cgit v1.2.3