diff options
| author | Cinders <cinder.roxley@phoenixviewer.com> | 2013-06-11 18:54:54 -0600 | 
|---|---|---|
| committer | Cinders <cinder.roxley@phoenixviewer.com> | 2013-06-11 18:54:54 -0600 | 
| commit | 4f7b8a7e861ee25f1e0f7b0df2e9c8372254f46d (patch) | |
| tree | 4986ff561e4da70d6864ff04ff8c24375ecb1372 /indra/newview | |
| parent | dcfb18373eca7986a73d8b9a1d34970cc0a23ed9 (diff) | |
STORM-1952: Add a confirmation modal when ejecting a member from a group
Diffstat (limited to 'indra/newview')
| -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 | 
3 files changed, 78 insertions, 16 deletions
| 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" | 
