summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorPaul Guslisty <pguslisty@productengine.com>2010-02-15 14:26:30 +0200
committerPaul Guslisty <pguslisty@productengine.com>2010-02-15 14:26:30 +0200
commitc9fabaca4e759c2d6231176f9dc7847e461c4865 (patch)
treeadbb7d04ec7d79dcc3801fecfac1dc46745be5cf /indra/newview
parent8ba5e0155ff0cbc2355ac4daf468d291fae84afa (diff)
Fixed low bug EXT - 5187 (Remove Friend should be in friends list context menu)
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llpanelpeoplemenus.cpp24
-rw-r--r--indra/newview/skins/default/xui/en/menu_people_nearby.xml10
-rw-r--r--indra/newview/skins/default/xui/en/menu_people_nearby_multiselect.xml10
3 files changed, 42 insertions, 2 deletions
diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp
index 7e184c78a8..900d28adca 100644
--- a/indra/newview/llpanelpeoplemenus.cpp
+++ b/indra/newview/llpanelpeoplemenus.cpp
@@ -121,6 +121,7 @@ LLContextMenu* NearbyMenu::createMenu()
const LLUUID& id = mUUIDs.front();
registrar.add("Avatar.Profile", boost::bind(&LLAvatarActions::showProfile, id));
registrar.add("Avatar.AddFriend", boost::bind(&LLAvatarActions::requestFriendshipDialog, id));
+ registrar.add("Avatar.RemoveFriend", boost::bind(&LLAvatarActions::removeFriendDialog, id));
registrar.add("Avatar.IM", boost::bind(&LLAvatarActions::startIM, id));
registrar.add("Avatar.Call", boost::bind(&LLAvatarActions::startCall, id));
registrar.add("Avatar.OfferTeleport", boost::bind(&NearbyMenu::offerTeleport, this));
@@ -143,6 +144,7 @@ LLContextMenu* NearbyMenu::createMenu()
// registrar.add("Avatar.AddFriend", boost::bind(&LLAvatarActions::requestFriendshipDialog, mUUIDs)); // *TODO: unimplemented
registrar.add("Avatar.IM", boost::bind(&LLAvatarActions::startConference, mUUIDs));
registrar.add("Avatar.Call", boost::bind(&LLAvatarActions::startAdhocCall, mUUIDs));
+ registrar.add("Avatar.RemoveFriend",boost::bind(&LLAvatarActions::removeFriendsDialog, mUUIDs));
// registrar.add("Avatar.Share", boost::bind(&LLAvatarActions::startIM, mUUIDs)); // *TODO: unimplemented
// registrar.add("Avatar.Pay", boost::bind(&LLAvatarActions::pay, mUUIDs)); // *TODO: unimplemented
enable_registrar.add("Avatar.EnableItem", boost::bind(&NearbyMenu::enableContextMenuItem, this, _2));
@@ -191,8 +193,26 @@ bool NearbyMenu::enableContextMenuItem(const LLSD& userdata)
}
else if (item == std::string("can_delete"))
{
- const LLUUID& id = mUUIDs.front();
- return LLAvatarActions::isFriend(id);
+ // We can remove friends if:
+ // - there are selected people
+ // - and there are only friends among selection.
+
+ bool result = (mUUIDs.size() > 0);
+
+ std::vector<LLUUID>::const_iterator
+ id = mUUIDs.begin(),
+ uuids_end = mUUIDs.end();
+
+ for (;id != uuids_end; ++id)
+ {
+ if ( !LLAvatarActions::isFriend(*id) )
+ {
+ result = false;
+ break;
+ }
+ }
+
+ return result;
}
else if (item == std::string("can_call"))
{
diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby.xml b/indra/newview/skins/default/xui/en/menu_people_nearby.xml
index c4da1df017..9d2ccba4da 100644
--- a/indra/newview/skins/default/xui/en/menu_people_nearby.xml
+++ b/indra/newview/skins/default/xui/en/menu_people_nearby.xml
@@ -20,6 +20,16 @@
parameter="can_add" />
</menu_item_call>
<menu_item_call
+ label="Remove Friend"
+ layout="topleft"
+ name="Remove Friend">
+ <menu_item_call.on_click
+ function="Avatar.RemoveFriend" />
+ <menu_item_call.on_enable
+ function="Avatar.EnableItem"
+ parameter="can_delete" />
+ </menu_item_call>
+ <menu_item_call
label="IM"
layout="topleft"
name="IM">
diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby_multiselect.xml b/indra/newview/skins/default/xui/en/menu_people_nearby_multiselect.xml
index 0d3dd3366d..588342595e 100644
--- a/indra/newview/skins/default/xui/en/menu_people_nearby_multiselect.xml
+++ b/indra/newview/skins/default/xui/en/menu_people_nearby_multiselect.xml
@@ -14,6 +14,16 @@
parameter="can_add" />
</menu_item_call>
<menu_item_call
+ label="Remove Friends"
+ layout="topleft"
+ name="Remove Friend">
+ <menu_item_call.on_click
+ function="Avatar.RemoveFriend" />
+ <menu_item_call.on_enable
+ function="Avatar.EnableItem"
+ parameter="can_delete" />
+ </menu_item_call>
+ <menu_item_call
label="IM"
layout="topleft"
name="IM">