summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorCho <cho@lindenlab.com>2013-03-14 01:28:40 +0100
committerCho <cho@lindenlab.com>2013-03-14 01:28:40 +0100
commit8b388922434e431c49b9e7f2c9d1e8d90d15ed21 (patch)
treea8498490c757ea5760b1152fa667be9d9a4608c8 /indra/newview
parentd81226f1707a93b6be52264fc00cae9c60057cc5 (diff)
CHUI-700 FIX [CHUIBUG]"Zoom in" feature for avatars has disappeared
Added "Zoom In" context menu item to Nearby Chat list in People floater and Conversation floater
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llconversationloglist.cpp2
-rw-r--r--indra/newview/llconversationmodel.cpp2
-rw-r--r--indra/newview/llfloaterimcontainer.cpp6
-rw-r--r--indra/newview/llpanelpeople.cpp13
-rw-r--r--indra/newview/llpanelpeoplemenus.cpp114
-rw-r--r--indra/newview/llpanelpeoplemenus.h20
-rw-r--r--indra/newview/skins/default/xui/en/menu_conversation.xml9
-rw-r--r--indra/newview/skins/default/xui/en/menu_im_conversation.xml7
-rw-r--r--indra/newview/skins/default/xui/en/menu_people_nearby.xml40
-rw-r--r--indra/newview/skins/default/xui/en/menu_people_nearby_multiselect.xml14
10 files changed, 178 insertions, 49 deletions
diff --git a/indra/newview/llconversationloglist.cpp b/indra/newview/llconversationloglist.cpp
index b202cfc9d3..5ab108b39f 100644
--- a/indra/newview/llconversationloglist.cpp
+++ b/indra/newview/llconversationloglist.cpp
@@ -390,7 +390,7 @@ bool LLConversationLogList::isActionEnabled(const LLSD& userdata)
{
return is_p2p && LLAvatarActions::canOfferTeleport(selected_id);
}
- else if ("can_show_on_map")
+ else if ("can_show_on_map" == command_name)
{
return is_p2p && ((LLAvatarTracker::instance().isBuddyOnline(selected_id) && is_agent_mappable(selected_id)) || gAgent.isGodlike());
}
diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp
index 009fce0a92..c74ce24872 100644
--- a/indra/newview/llconversationmodel.cpp
+++ b/indra/newview/llconversationmodel.cpp
@@ -139,6 +139,8 @@ void LLConversationItem::buildParticipantMenuOptions(menuentry_vec_t& items, U32
items.push_back(std::string("remove_friend"));
items.push_back(std::string("invite_to_group"));
items.push_back(std::string("separator_invite_to_group"));
+ if (static_cast<LLConversationItem*>(mParent)->getType() == CONV_SESSION_NEARBY)
+ items.push_back(std::string("zoom_in"));
items.push_back(std::string("map"));
items.push_back(std::string("share"));
items.push_back(std::string("pay"));
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index 7437dd8cda..53daaabe3d 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -1036,6 +1036,10 @@ void LLFloaterIMContainer::doToParticipants(const std::string& command, uuid_vec
{
LLAvatarActions::inviteToGroup(userID);
}
+ else if ("zoom_in" == command)
+ {
+ handle_zoom_to_object(userID);
+ }
else if ("map" == command)
{
LLAvatarActions::showOnMap(userID);
@@ -1227,7 +1231,7 @@ bool LLFloaterIMContainer::enableContextMenuItem(const std::string& item, uuid_v
}
// Handle all other options
- if (("can_invite" == item) || ("can_chat_history" == item) || ("can_share" == item) || ("can_pay" == item))
+ if (("can_invite" == item) || ("can_chat_history" == item) || ("can_share" == item) || ("can_pay" == item) || ("can_zoom_in" == item))
{
// Those menu items are enable only if a single avatar is selected
return is_single_select;
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index c5283404f1..4138558bad 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -611,10 +611,10 @@ BOOL LLPanelPeople::postBuild()
mGroupList->setNoItemsMsg(getString("no_groups_msg"));
mGroupList->setNoFilteredItemsMsg(getString("no_filtered_groups_msg"));
- mNearbyList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu);
- mRecentList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu);
- mAllFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu);
- mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu);
+ mNearbyList->setContextMenu(&LLPanelPeopleMenus::gNearbyPeopleContextMenu);
+ mRecentList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
+ mAllFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
+ mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
setSortOrder(mRecentList, (ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"), false);
setSortOrder(mAllFriendList, (ESortOrder)gSavedSettings.getU32("FriendsSortOrder"), false);
@@ -1143,7 +1143,10 @@ void LLPanelPeople::onGearButtonClicked(LLUICtrl* btn)
uuid_vec_t selected_uuids;
getCurrentItemIDs(selected_uuids);
// Spawn at bottom left corner of the button.
- LLPanelPeopleMenus::gNearbyMenu.show(btn, selected_uuids, 0, 0);
+ if (getActiveTabName() == NEARBY_TAB_NAME)
+ LLPanelPeopleMenus::gNearbyPeopleContextMenu.show(btn, selected_uuids, 0, 0);
+ else
+ LLPanelPeopleMenus::gPeopleContextMenu.show(btn, selected_uuids, 0, 0);
}
void LLPanelPeople::onImButtonClicked()
diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp
index 47d6b49a50..aa14b74869 100644
--- a/indra/newview/llpanelpeoplemenus.cpp
+++ b/indra/newview/llpanelpeoplemenus.cpp
@@ -39,15 +39,17 @@
#include "llcallingcard.h" // for LLAvatarTracker
#include "lllogchat.h"
#include "llviewermenu.h" // for gMenuHolder
+#include "llconversationmodel.h"
namespace LLPanelPeopleMenus
{
-NearbyMenu gNearbyMenu;
+PeopleContextMenu gPeopleContextMenu;
+NearbyPeopleContextMenu gNearbyPeopleContextMenu;
-//== NearbyMenu ===============================================================
+//== PeopleContextMenu ===============================================================
-LLContextMenu* NearbyMenu::createMenu()
+LLContextMenu* PeopleContextMenu::createMenu()
{
// set up the callbacks for all of the avatar menu items
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
@@ -64,7 +66,8 @@ LLContextMenu* NearbyMenu::createMenu()
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));
+ registrar.add("Avatar.OfferTeleport", boost::bind(&PeopleContextMenu::offerTeleport, this));
+ registrar.add("Avatar.ZoomIn", boost::bind(&handle_zoom_to_object, id));
registrar.add("Avatar.ShowOnMap", boost::bind(&LLAvatarActions::showOnMap, id));
registrar.add("Avatar.Share", boost::bind(&LLAvatarActions::share, id));
registrar.add("Avatar.Pay", boost::bind(&LLAvatarActions::pay, id));
@@ -72,33 +75,72 @@ LLContextMenu* NearbyMenu::createMenu()
registrar.add("Avatar.InviteToGroup", boost::bind(&LLAvatarActions::inviteToGroup, id));
registrar.add("Avatar.Calllog", boost::bind(&LLAvatarActions::viewChatHistory, id));
- enable_registrar.add("Avatar.EnableItem", boost::bind(&NearbyMenu::enableContextMenuItem, this, _2));
- enable_registrar.add("Avatar.CheckItem", boost::bind(&NearbyMenu::checkContextMenuItem, this, _2));
+ enable_registrar.add("Avatar.EnableItem", boost::bind(&PeopleContextMenu::enableContextMenuItem, this, _2));
+ enable_registrar.add("Avatar.CheckItem", boost::bind(&PeopleContextMenu::checkContextMenuItem, this, _2));
// create the context menu from the XUI
menu = createFromFile("menu_people_nearby.xml");
+ buildContextMenu(*menu, 0x0);
}
else
{
// Set up for multi-selected People
// registrar.add("Avatar.AddFriend", boost::bind(&LLAvatarActions::requestFriendshipDialog, mUUIDs)); // *TODO: unimplemented
- registrar.add("Avatar.IM", boost::bind(&LLAvatarActions::startConference, mUUIDs, LLUUID::null));
- registrar.add("Avatar.Call", boost::bind(&LLAvatarActions::startAdhocCall, mUUIDs, LLUUID::null));
- registrar.add("Avatar.OfferTeleport", boost::bind(&NearbyMenu::offerTeleport, this));
- registrar.add("Avatar.RemoveFriend",boost::bind(&LLAvatarActions::removeFriendsDialog, mUUIDs));
+ registrar.add("Avatar.IM", boost::bind(&LLAvatarActions::startConference, mUUIDs, LLUUID::null));
+ registrar.add("Avatar.Call", boost::bind(&LLAvatarActions::startAdhocCall, mUUIDs, LLUUID::null));
+ registrar.add("Avatar.OfferTeleport", boost::bind(&PeopleContextMenu::offerTeleport, this));
+ 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));
+ // registrar.add("Avatar.Pay", boost::bind(&LLAvatarActions::pay, mUUIDs)); // *TODO: unimplemented
+
+ enable_registrar.add("Avatar.EnableItem", boost::bind(&PeopleContextMenu::enableContextMenuItem, this, _2));
// create the context menu from the XUI
menu = createFromFile("menu_people_nearby_multiselect.xml");
+ buildContextMenu(*menu, ITEM_IN_MULTI_SELECTION);
}
return menu;
}
-bool NearbyMenu::enableContextMenuItem(const LLSD& userdata)
+void PeopleContextMenu::buildContextMenu(class LLMenuGL& menu, U32 flags)
+{
+ menuentry_vec_t items;
+ menuentry_vec_t disabled_items;
+
+ if (flags & ITEM_IN_MULTI_SELECTION)
+ {
+ items.push_back(std::string("add_friends"));
+ items.push_back(std::string("remove_friends"));
+ items.push_back(std::string("im"));
+ items.push_back(std::string("call"));
+ items.push_back(std::string("share"));
+ items.push_back(std::string("pay"));
+ items.push_back(std::string("offer_teleport"));
+ }
+ else
+ {
+ items.push_back(std::string("view_profile"));
+ items.push_back(std::string("im"));
+ items.push_back(std::string("offer_teleport"));
+ items.push_back(std::string("voice_call"));
+ items.push_back(std::string("chat_history"));
+ items.push_back(std::string("separator_chat_history"));
+ items.push_back(std::string("add_friend"));
+ items.push_back(std::string("remove_friend"));
+ items.push_back(std::string("invite_to_group"));
+ items.push_back(std::string("separator_invite_to_group"));
+ items.push_back(std::string("map"));
+ items.push_back(std::string("share"));
+ items.push_back(std::string("pay"));
+ items.push_back(std::string("block_unblock"));
+ }
+
+ hide_context_entries(menu, items, disabled_items);
+}
+
+bool PeopleContextMenu::enableContextMenuItem(const LLSD& userdata)
{
if(gAgent.getID() == mUUIDs.front())
{
@@ -186,14 +228,15 @@ bool NearbyMenu::enableContextMenuItem(const LLSD& userdata)
return LLLogChat::isTranscriptExist(mUUIDs.front());
}
else if (item == std::string("can_im") || item == std::string("can_invite") ||
- item == std::string("can_share") || item == std::string("can_pay"))
+ item == std::string("can_share") || item == std::string("can_pay") ||
+ item == std::string("can_zoom_in"))
{
return true;
}
return false;
}
-bool NearbyMenu::checkContextMenuItem(const LLSD& userdata)
+bool PeopleContextMenu::checkContextMenuItem(const LLSD& userdata)
{
std::string item = userdata.asString();
const LLUUID& id = mUUIDs.front();
@@ -206,11 +249,50 @@ bool NearbyMenu::checkContextMenuItem(const LLSD& userdata)
return false;
}
-void NearbyMenu::offerTeleport()
+void PeopleContextMenu::offerTeleport()
{
// boost::bind cannot recognize overloaded method LLAvatarActions::offerTeleport(),
// so we have to use a wrapper.
LLAvatarActions::offerTeleport(mUUIDs);
}
+//== NearbyPeopleContextMenu ===============================================================
+
+void NearbyPeopleContextMenu::buildContextMenu(class LLMenuGL& menu, U32 flags)
+{
+ menuentry_vec_t items;
+ menuentry_vec_t disabled_items;
+
+ if (flags & ITEM_IN_MULTI_SELECTION)
+ {
+ items.push_back(std::string("add_friends"));
+ items.push_back(std::string("remove_friends"));
+ items.push_back(std::string("im"));
+ items.push_back(std::string("call"));
+ items.push_back(std::string("share"));
+ items.push_back(std::string("pay"));
+ items.push_back(std::string("offer_teleport"));
+ }
+ else
+ {
+ items.push_back(std::string("view_profile"));
+ items.push_back(std::string("im"));
+ items.push_back(std::string("offer_teleport"));
+ items.push_back(std::string("voice_call"));
+ items.push_back(std::string("chat_history"));
+ items.push_back(std::string("separator_chat_history"));
+ items.push_back(std::string("add_friend"));
+ items.push_back(std::string("remove_friend"));
+ items.push_back(std::string("invite_to_group"));
+ items.push_back(std::string("separator_invite_to_group"));
+ items.push_back(std::string("zoom_in"));
+ items.push_back(std::string("map"));
+ items.push_back(std::string("share"));
+ items.push_back(std::string("pay"));
+ items.push_back(std::string("block_unblock"));
+ }
+
+ hide_context_entries(menu, items, disabled_items);
+}
+
} // namespace LLPanelPeopleMenus
diff --git a/indra/newview/llpanelpeoplemenus.h b/indra/newview/llpanelpeoplemenus.h
index d51eaec716..0a1dcef303 100644
--- a/indra/newview/llpanelpeoplemenus.h
+++ b/indra/newview/llpanelpeoplemenus.h
@@ -33,19 +33,33 @@ namespace LLPanelPeopleMenus
{
/**
- * Menu used in the nearby people list.
+ * Menu used in the people lists.
*/
-class NearbyMenu : public LLListContextMenu
+class PeopleContextMenu : public LLListContextMenu
{
public:
/*virtual*/ LLContextMenu* createMenu();
+
+protected:
+ virtual void buildContextMenu(class LLMenuGL& menu, U32 flags);
+
private:
bool enableContextMenuItem(const LLSD& userdata);
bool checkContextMenuItem(const LLSD& userdata);
void offerTeleport();
};
-extern NearbyMenu gNearbyMenu;
+/**
+ * Menu used in the nearby people list.
+ */
+class NearbyPeopleContextMenu : public PeopleContextMenu
+{
+protected:
+ /*virtual*/ void buildContextMenu(class LLMenuGL& menu, U32 flags);
+};
+
+extern PeopleContextMenu gPeopleContextMenu;
+extern NearbyPeopleContextMenu gNearbyPeopleContextMenu;
} // namespace LLPanelPeopleMenus
diff --git a/indra/newview/skins/default/xui/en/menu_conversation.xml b/indra/newview/skins/default/xui/en/menu_conversation.xml
index fd5c86b3ca..5a13ef0a59 100644
--- a/indra/newview/skins/default/xui/en/menu_conversation.xml
+++ b/indra/newview/skins/default/xui/en/menu_conversation.xml
@@ -89,7 +89,14 @@
<on_click function="Avatar.DoToSelected" parameter="invite_to_group" />
<on_enable function="Avatar.EnableItem" parameter="can_invite" />
</menu_item_call>
- <menu_item_separator layout="topleft" name="separator_invite_to_group"/>
+ <menu_item_separator layout="topleft" name="separator_invite_to_group"/>
+ <menu_item_call
+ label="Zoom In"
+ layout="topleft"
+ name="zoom_in">
+ <on_click function="Avatar.DoToSelected" parameter="zoom_in" />
+ <on_enable function="Avatar.EnableItem" parameter="can_zoom_in" />
+ </menu_item_call>
<menu_item_call
label="Map"
layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/menu_im_conversation.xml b/indra/newview/skins/default/xui/en/menu_im_conversation.xml
index 8882d0a7d8..43287c6ec3 100644
--- a/indra/newview/skins/default/xui/en/menu_im_conversation.xml
+++ b/indra/newview/skins/default/xui/en/menu_im_conversation.xml
@@ -50,6 +50,13 @@
<menu_item_separator
layout="topleft"/>
<menu_item_call
+ label="Zoom In"
+ layout="topleft"
+ name="zoom_in">
+ <on_click function="Avatar.DoToSelected" parameter="zoom_in" />
+ <on_enable function="Avatar.EnableItem" parameter="can_zoom_in" />
+ </menu_item_call>
+ <menu_item_call
label="Map"
layout="topleft"
name="map">
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 60a6c98514..3abb5f7bc8 100644
--- a/indra/newview/skins/default/xui/en/menu_people_nearby.xml
+++ b/indra/newview/skins/default/xui/en/menu_people_nearby.xml
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<context_menu
layout="topleft"
- name="Avatar Context Menu">
+ name="Nearby People Context Menu">
<menu_item_call
label="View Profile"
layout="topleft"
- name="View Profile">
+ name="view_profile">
<menu_item_call.on_click
function="Avatar.Profile" />
</menu_item_call>
<menu_item_call
label="IM"
layout="topleft"
- name="IM">
+ name="im">
<menu_item_call.on_click
function="Avatar.IM" />
<menu_item_call.on_enable
@@ -21,7 +21,7 @@
</menu_item_call>
<menu_item_call
label="Offer Teleport"
- name="teleport">
+ name="offer_teleport">
<menu_item_call.on_click
function="Avatar.OfferTeleport"/>
<menu_item_call.on_enable
@@ -31,7 +31,7 @@
<menu_item_call
label="Voice call"
layout="topleft"
- name="Call">
+ name="voice_call">
<menu_item_call.on_click
function="Avatar.Call" />
<menu_item_call.on_enable
@@ -42,18 +42,18 @@
<menu_item_call
label="View chat history..."
layout="topleft"
- name="Chat history">
+ name="chat_history">
<menu_item_call.on_click
function="Avatar.Calllog" />
<menu_item_call.on_enable
function="Avatar.EnableItem"
parameter="can_callog"/>
</menu_item_call>
- <menu_item_separator />
+ <menu_item_separator name="separator_chat_history"/>
<menu_item_call
label="Add Friend"
layout="topleft"
- name="Add Friend">
+ name="add_friend">
<menu_item_call.on_click
function="Avatar.AddFriend" />
<menu_item_call.on_visible
@@ -63,7 +63,7 @@
<menu_item_call
label="Remove Friend"
layout="topleft"
- name="Remove Friend">
+ name="remove_friend">
<menu_item_call.on_click
function="Avatar.RemoveFriend" />
<menu_item_call.on_enable
@@ -73,18 +73,28 @@
<menu_item_call
label="Invite to group..."
layout="topleft"
- name="Invite">
+ name="invite_to_group">
<menu_item_call.on_click
function="Avatar.InviteToGroup" />
<menu_item_call.on_enable
function="Avatar.EnableItem"
parameter="can_invite"/>
</menu_item_call>
- <menu_item_separator />
+ <menu_item_separator name="separator_invite_to_group"/>
+ <menu_item_call
+ label="Zoom In"
+ layout="topleft"
+ name="zoom_in">
+ <menu_item_call.on_click
+ function="Avatar.ZoomIn" />
+ <menu_item_call.on_enable
+ function="Avatar.EnableItem"
+ parameter="can_zoom_in"/>
+ </menu_item_call>
<menu_item_call
label="Map"
layout="topleft"
- name="Map">
+ name="map">
<menu_item_call.on_click
function="Avatar.ShowOnMap" />
<menu_item_call.on_enable
@@ -94,7 +104,7 @@
<menu_item_call
label="Share"
layout="topleft"
- name="Share">
+ name="share">
<menu_item_call.on_click
function="Avatar.Share" />
<menu_item_call.on_enable
@@ -104,7 +114,7 @@
<menu_item_call
label="Pay"
layout="topleft"
- name="Pay">
+ name="pay">
<menu_item_call.on_click
function="Avatar.Pay" />
<menu_item_call.on_enable
@@ -114,7 +124,7 @@
<menu_item_check
label="Block/Unblock"
layout="topleft"
- name="Block/Unblock">
+ name="block_unblock">
<menu_item_check.on_click
function="Avatar.BlockUnblock" />
<menu_item_check.on_check
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 5d58a9d289..5f973088fd 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
@@ -6,7 +6,7 @@
enabled="false"
label="Add Friends"
layout="topleft"
- name="Add Friends">
+ name="add_friends">
<on_click
function="Avatar.AddFriends" />
<on_enable
@@ -16,7 +16,7 @@
<menu_item_call
label="Remove Friends"
layout="topleft"
- name="Remove Friend">
+ name="remove_friends">
<menu_item_call.on_click
function="Avatar.RemoveFriend" />
<menu_item_call.on_enable
@@ -26,7 +26,7 @@
<menu_item_call
label="IM"
layout="topleft"
- name="IM">
+ name="im">
<on_click
function="Avatar.IM" />
</menu_item_call>
@@ -34,7 +34,7 @@
enabled="false"
label="Call"
layout="topleft"
- name="Call">
+ name="call">
<on_click
function="Avatar.Call" />
<on_enable
@@ -45,7 +45,7 @@
enabled="false"
label="Share"
layout="topleft"
- name="Share">
+ name="share">
<on_click
function="Avatar.Share" />
</menu_item_call>
@@ -53,13 +53,13 @@
enabled="false"
label="Pay"
layout="topleft"
- name="Pay">
+ name="pay">
<on_click
function="Avatar.Pay" />
</menu_item_call>
<menu_item_call
label="Offer Teleport"
- name="teleport">
+ name="offer_teleport">
<menu_item_call.on_click
function="Avatar.OfferTeleport"/>
<menu_item_call.on_enable