summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2013-06-04 14:05:13 -0700
committerGilbert Gonzales <gilbert@lindenlab.com>2013-06-04 14:05:13 -0700
commit6bf2dad1cc8df2769a0833786bc16eea96649d6d (patch)
treede2c5b829070ad2f1fbd28d31d6a879e2d81e85c /indra
parentad7dc22ad5d48d703c2cf20fb77ff69dcf3ae820 (diff)
ACME-484: Right-click menu only has 'Add Friend' and 'View Profile' options. Also multi-select is disabled.
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/llpanelpeople.cpp2
-rwxr-xr-xindra/newview/llpanelpeoplemenus.cpp33
-rwxr-xr-xindra/newview/llpanelpeoplemenus.h13
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_people.xml1
4 files changed, 47 insertions, 2 deletions
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 2a14978a95..5bc645bcfd 100755
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -689,7 +689,7 @@ BOOL LLPanelPeople::postBuild()
mRecentList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
mAllFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
- mSuggestedFriends->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
+ mSuggestedFriends->setContextMenu(&LLPanelPeopleMenus::gSuggestedFriendsContextMenu);
//===Temporary ========================================================================
diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp
index 49f7361c4a..313056f06a 100755
--- a/indra/newview/llpanelpeoplemenus.cpp
+++ b/indra/newview/llpanelpeoplemenus.cpp
@@ -47,6 +47,7 @@ namespace LLPanelPeopleMenus
PeopleContextMenu gPeopleContextMenu;
NearbyPeopleContextMenu gNearbyPeopleContextMenu;
+SuggestedFriendsContextMenu gSuggestedFriendsContextMenu;
//== PeopleContextMenu ===============================================================
@@ -301,4 +302,36 @@ void NearbyPeopleContextMenu::buildContextMenu(class LLMenuGL& menu, U32 flags)
hide_context_entries(menu, items, disabled_items);
}
+//== SuggestedFriendsContextMenu ===============================================================
+
+LLContextMenu* SuggestedFriendsContextMenu::createMenu()
+{
+ // set up the callbacks for all of the avatar menu items
+ LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
+ LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
+ LLContextMenu* menu;
+
+ // Set up for one person selected menu
+ const LLUUID& id = mUUIDs.front();
+ registrar.add("Avatar.Profile", boost::bind(&LLAvatarActions::showProfile, id));
+ registrar.add("Avatar.AddFriend", boost::bind(&LLAvatarActions::requestFriendshipDialog, id));
+
+ // create the context menu from the XUI
+ menu = createFromFile("menu_people_nearby.xml");
+ buildContextMenu(*menu, 0x0);
+
+ return menu;
+}
+
+void SuggestedFriendsContextMenu::buildContextMenu(class LLMenuGL& menu, U32 flags)
+{
+ menuentry_vec_t items;
+ menuentry_vec_t disabled_items;
+
+ items.push_back(std::string("view_profile"));
+ items.push_back(std::string("add_friend"));
+
+ hide_context_entries(menu, items, disabled_items);
+}
+
} // namespace LLPanelPeopleMenus
diff --git a/indra/newview/llpanelpeoplemenus.h b/indra/newview/llpanelpeoplemenus.h
index 0a1dcef303..5367eca0d3 100755
--- a/indra/newview/llpanelpeoplemenus.h
+++ b/indra/newview/llpanelpeoplemenus.h
@@ -58,8 +58,21 @@ protected:
/*virtual*/ void buildContextMenu(class LLMenuGL& menu, U32 flags);
};
+/**
+ * Menu used in the suggested friends list.
+ */
+class SuggestedFriendsContextMenu : public PeopleContextMenu
+{
+public:
+ /*virtual*/ LLContextMenu * createMenu();
+
+protected:
+ /*virtual*/ void buildContextMenu(class LLMenuGL& menu, U32 flags);
+};
+
extern PeopleContextMenu gPeopleContextMenu;
extern NearbyPeopleContextMenu gNearbyPeopleContextMenu;
+extern SuggestedFriendsContextMenu gSuggestedFriendsContextMenu;
} // namespace LLPanelPeopleMenus
diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml
index c21d2abdd7..451095c7d8 100755
--- a/indra/newview/skins/default/xui/en/panel_people.xml
+++ b/indra/newview/skins/default/xui/en/panel_people.xml
@@ -377,7 +377,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
height="173"
layout="topleft"
left="0"
- multi_select="true"
name="suggested_friends"
show_permissions_granted="true"
top="0"