diff options
-rwxr-xr-x | doc/contributions.txt | 1 | ||||
-rwxr-xr-x | indra/newview/llpanelgrouproles.cpp | 66 | ||||
-rwxr-xr-x | indra/newview/llpanelgrouproles.h | 1 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/notifications.xml | 27 |
4 files changed, 79 insertions, 16 deletions
diff --git a/doc/contributions.txt b/doc/contributions.txt index 8c5bb3d576..76b162247f 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -301,6 +301,7 @@ Ciaran Laval Cinder Roxley BUG-2326 STORM-1703 + STORM-1952 Clara Young Coaldust Numbers VWR-1095 diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index cfdac11d26..d225a4c324 100755 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -1101,27 +1101,61 @@ void LLPanelGroupMembersSubTab::onEjectMembers(void *userdata) } void LLPanelGroupMembersSubTab::handleEjectMembers() -{ - //send down an eject message - uuid_vec_t selected_members; - +{ std::vector<LLScrollListItem*> selection = mMembersList->getAllSelected(); if (selection.empty()) return; - - std::vector<LLScrollListItem*>::iterator itor; - for (itor = selection.begin() ; - itor != selection.end(); ++itor) + + S32 selection_count = selection.size(); + if (selection_count == 1) { - LLUUID member_id = (*itor)->getUUID(); - selected_members.push_back( member_id ); + LLSD args; + std::string fullname; + gCacheName->getFullName(mMembersList->getValue(), fullname); + args["AVATAR_NAME"] = fullname; + LLSD payload; + LLNotificationsUtil::add("EjectGroupMemberWarning", + args, + payload, + boost::bind(&LLPanelGroupMembersSubTab::handleEjectCallback, this, _1, _2)); } + else + { + LLSD args; + args["COUNT"] = llformat("%d", selection_count); + LLSD payload; + LLNotificationsUtil::add("EjectGroupMembersWarning", + args, + payload, + boost::bind(&LLPanelGroupMembersSubTab::handleEjectCallback, this, _1, _2)); + } +} - mMembersList->deleteSelectedItems(); - - sendEjectNotifications(mGroupID, selected_members); - - LLGroupMgr::getInstance()->sendGroupMemberEjects(mGroupID, - selected_members); +bool LLPanelGroupMembersSubTab::handleEjectCallback(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (0 == option) // Eject button + { + //send down an eject message + uuid_vec_t selected_members; + + std::vector<LLScrollListItem*> selection = mMembersList->getAllSelected(); + if (selection.empty()) return false; + + std::vector<LLScrollListItem*>::iterator itor; + for (itor = selection.begin() ; + itor != selection.end(); ++itor) + { + LLUUID member_id = (*itor)->getUUID(); + selected_members.push_back( member_id ); + } + + mMembersList->deleteSelectedItems(); + + sendEjectNotifications(mGroupID, selected_members); + + LLGroupMgr::getInstance()->sendGroupMemberEjects(mGroupID, selected_members); + } + return false; } void LLPanelGroupMembersSubTab::sendEjectNotifications(const LLUUID& group_id, const uuid_vec_t& selected_members) diff --git a/indra/newview/llpanelgrouproles.h b/indra/newview/llpanelgrouproles.h index 78bb3c57a1..0cf272f3ee 100755 --- a/indra/newview/llpanelgrouproles.h +++ b/indra/newview/llpanelgrouproles.h @@ -167,6 +167,7 @@ public: static void onEjectMembers(void*); void handleEjectMembers(); void sendEjectNotifications(const LLUUID& group_id, const uuid_vec_t& selected_members); + bool handleEjectCallback(const LLSD& notification, const LLSD& response); static void onRoleCheck(LLUICtrl* check, void* user_data); void handleRoleCheck(const LLUUID& role_id, diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 970a11c6c4..620154fe51 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -506,6 +506,33 @@ Add this Ability to '[ROLE_NAME]'? notext="No" yestext="Yes"/> </notification> + + <notification + icon="alertmodal.tga" + name="EjectGroupMemberWarning" + type="alertmodal"> + You are about to eject [AVATAR_NAME] from the group. + <tag>group</tag> + <tag>confirm</tag> + <usetemplate + ignoretext="Confirm ejecting a participant from group" + name="okcancelignore" + notext="Cancel" + yestext="Eject"/> + </notification> + <notification + icon="alertmodal.tga" + name="EjectGroupMembersWarning" + type="alertmodal"> + You are about to eject [COUNT] members from the group. + <tag>group</tag> + <tag>confirm</tag> + <usetemplate + ignoretext="Confirm ejecting multiple members from group" + name="okcancelignore" + notext="Cancel" + yestext="Eject"/> + </notification> <notification icon="alertmodal.tga" |