From b198e296cb805f99b93d5b212c5dd288975cef30 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Sun, 7 Sep 2014 17:32:08 -0400 Subject: [PATCH] Allow right clicking avatar lists with multiple avatars selected to invite to group. --- indra/newview/llavataractions.cpp | 14 ++++++++------ indra/newview/llavataractions.h | 3 ++- indra/newview/llpanelavatar.cpp | 2 +- indra/newview/llviewermenu.cpp | 2 +- .../skins/default/xui/en-us/menu_avs_list.xml | 2 +- .../newview/skins/default/xui/en-us/menu_radar.xml | 2 +- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index fae1b7c3d..2af9ee120 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -687,13 +687,18 @@ bool LLAvatarActions::canOfferTeleport(const uuid_vec_t& ids) void LLAvatarActions::inviteToGroup(const LLUUID& id) { - LLFloaterGroupPicker* widget = LLFloaterGroupPicker::showInstance(LLSD(id)); + inviteToGroup(uuid_vec_t(1, id)); +} + +void LLAvatarActions::inviteToGroup(const uuid_vec_t& ids) +{ + LLFloaterGroupPicker* widget = LLFloaterGroupPicker::showInstance(LLSD(ids.front())); if (widget) { widget->center(); widget->setPowersMask(GP_MEMBER_INVITE); widget->removeNoneOption(); - widget->setSelectGroupCallback(boost::bind(callback_invite_to_group, _1, id)); + widget->setSelectGroupCallback(boost::bind(callback_invite_to_group, _1, ids)); } } @@ -767,11 +772,8 @@ void ban_from_group(const uuid_vec_t& ids) // // static -void LLAvatarActions::callback_invite_to_group(LLUUID group_id, LLUUID id) +void LLAvatarActions::callback_invite_to_group(LLUUID group_id, uuid_vec_t& agent_ids) { - uuid_vec_t agent_ids; - agent_ids.push_back(id); - LLFloaterGroupInvite::showForGroup(group_id, &agent_ids); } diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index 3bb613185..5488c34c2 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -155,6 +155,7 @@ public: * Invite avatar to a group. */ static void inviteToGroup(const LLUUID& id); + static void inviteToGroup(const uuid_vec_t& ids); /** * Kick avatar off grid @@ -217,7 +218,7 @@ private: static bool handleKick(const LLSD& notification, const LLSD& response); static bool handleFreeze(const LLSD& notification, const LLSD& response); static bool handleUnfreeze(const LLSD& notification, const LLSD& response); - static void callback_invite_to_group(LLUUID group_id, LLUUID id); + static void callback_invite_to_group(LLUUID group_id, uuid_vec_t& ids); static void on_avatar_name_cache_teleport_request(const LLUUID& id, const LLAvatarName& av_name); public: diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 60e6768e9..f8cecab8c 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -473,7 +473,7 @@ BOOL LLPanelAvatarSecondLife::postBuild(void) getChild("Find on Map")->setCommitCallback(boost::bind(LLAvatarActions::showOnMap, boost::bind(&LLPanelAvatar::getAvatarID, pa))); getChild("Instant Message...")->setCommitCallback(boost::bind(LLAvatarActions::startIM, boost::bind(&LLPanelAvatar::getAvatarID, pa))); - getChild("GroupInvite_Button")->setCommitCallback(boost::bind(LLAvatarActions::inviteToGroup, boost::bind(&LLPanelAvatar::getAvatarID, pa))); + getChild("GroupInvite_Button")->setCommitCallback(boost::bind(static_cast(LLAvatarActions::inviteToGroup), boost::bind(&LLPanelAvatar::getAvatarID, pa))); getChild("Add Friend...")->setCommitCallback(boost::bind(LLAvatarActions::requestFriendshipDialog, boost::bind(&LLPanelAvatar::getAvatarID, pa))); getChild("Pay...")->setCommitCallback(boost::bind(LLAvatarActions::pay, boost::bind(&LLPanelAvatar::getAvatarID, pa))); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 1c671f314..2961a1745 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -9052,7 +9052,7 @@ class ListInviteToGroup : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLAvatarActions::inviteToGroup(get_focused_list_id_selected()); + LLAvatarActions::inviteToGroup(get_focused_list_ids_selected()); return true; } }; diff --git a/indra/newview/skins/default/xui/en-us/menu_avs_list.xml b/indra/newview/skins/default/xui/en-us/menu_avs_list.xml index 2ba08eaaa..feb47745d 100644 --- a/indra/newview/skins/default/xui/en-us/menu_avs_list.xml +++ b/indra/newview/skins/default/xui/en-us/menu_avs_list.xml @@ -42,7 +42,7 @@ - + diff --git a/indra/newview/skins/default/xui/en-us/menu_radar.xml b/indra/newview/skins/default/xui/en-us/menu_radar.xml index 0a9e734aa..2f06bbf3c 100644 --- a/indra/newview/skins/default/xui/en-us/menu_radar.xml +++ b/indra/newview/skins/default/xui/en-us/menu_radar.xml @@ -43,7 +43,7 @@ - +