summaryrefslogtreecommitdiff
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
parent2ea45ee2c9924ff7ef8f1153e7f3f669981e70a2 (diff)
MAINT-4904 FIXED Show confirmation pop-up before unlinking an object.
-rwxr-xr-xindra/newview/app_settings/settings.xml11
-rwxr-xr-xindra/newview/llselectmgr.cpp31
-rwxr-xr-xindra/newview/llselectmgr.h2
-rwxr-xr-xindra/newview/skins/default/xui/en/notifications.xml16
4 files changed, 59 insertions, 1 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index e20cc77ed3..e3ab45c53e 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -3444,6 +3444,17 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>MinObjectsForUnlinkConfirm</key>
+ <map>
+ <key>Comment</key>
+ <string>Minimum amount of objects in linkset for showing confirmation dialog</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>S32</string>
+ <key>Value</key>
+ <integer>6</integer>
+ </map>
<key>EffectScriptChatParticles</key>
<map>
<key>Comment</key>
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
diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h
index 23c41e4cc1..316e72b11c 100755
--- a/indra/newview/llselectmgr.h
+++ b/indra/newview/llselectmgr.h
@@ -506,6 +506,8 @@ public:
bool unlinkObjects();
+ void confirmUnlinkObjects(const LLSD& notification, const LLSD& response);
+
bool enableLinkObjects();
bool enableUnlinkObjects();
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 4602a41d52..df4bf6700b 100755
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -5365,7 +5365,21 @@ You cannot undo this action.
notext="Cancel"
yestext="OK"/>
</notification>
-
+
+ <notification
+ icon="alertmodal.tga"
+ name="ConfirmUnlink"
+ type="alertmodal">
+ <unique/>
+ This is a large linkset. If you unlink it, you may not be able to link it again. You may wish to take a copy of the linkset into your inventory as a precaution.
+ <tag>confirm</tag>
+ <usetemplate
+ ignoretext="Confirm when unlinking a linkset"
+ name="okcancelignore"
+ notext="Cancel"
+ yestext="Unlink"/>
+ </notification>
+
<notification
icon="alertmodal.tga"
name="HelpReportAbuseEmailLL"