diff options
| author | Paul Guslisty <pguslisty@productengine.com> | 2009-12-11 21:44:48 +0200 | 
|---|---|---|
| committer | Paul Guslisty <pguslisty@productengine.com> | 2009-12-11 21:44:48 +0200 | 
| commit | fd99f8701cfe4cbcd95f847b77e985703937a581 (patch) | |
| tree | f776f19628845c48697986ecf7a8071a5f01dcaf /indra/newview | |
| parent | 2acb204c4b1bdc4cc11c7af51ebfd09c47c3e231 (diff) | |
Fixed normal bug EXT - 2863 (Group Chat List Names right click do not contain view profile or send private message)
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview')
| -rw-r--r-- | indra/newview/llparticipantlist.cpp | 61 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/menu_participant_list.xml | 15 | 
2 files changed, 61 insertions, 15 deletions
| diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index 6b3f468ff1..47b9f29b48 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -42,6 +42,7 @@  #include "llavatarlist.h"  #include "llspeakers.h"  #include "llviewermenu.h" +#include "llvoiceclient.h"  //LLParticipantList retrieves add, clear and remove events and updates view accordingly   #if LL_MSVC @@ -416,6 +417,14 @@ LLContextMenu* LLParticipantList::LLParticipantListMenu::createMenu()  	registrar.add("ParticipantList.ToggleAllowTextChat", boost::bind(&LLParticipantList::LLParticipantListMenu::toggleAllowTextChat, this, _2));  	registrar.add("ParticipantList.ToggleMuteText", boost::bind(&LLParticipantList::LLParticipantListMenu::toggleMuteText, this, _2)); +	registrar.add("Avatar.Profile",	boost::bind(&LLAvatarActions::showProfile, mUUIDs.front())); +	registrar.add("Avatar.IM", boost::bind(&LLAvatarActions::startIM, mUUIDs.front())); +	registrar.add("Avatar.AddFriend", boost::bind(&LLAvatarActions::requestFriendshipDialog, mUUIDs.front())); +	registrar.add("Avatar.BlockUnblock", boost::bind(&LLParticipantList::LLParticipantListMenu::toggleMuteVoice, this, _2)); +	registrar.add("Avatar.Share", boost::bind(&LLAvatarActions::share, mUUIDs.front())); +	registrar.add("Avatar.Pay",	boost::bind(&LLAvatarActions::pay, mUUIDs.front())); +	registrar.add("Avatar.Call", boost::bind(&LLAvatarActions::startCall, mUUIDs.front())); +  	registrar.add("ParticipantList.ModerateVoice", boost::bind(&LLParticipantList::LLParticipantListMenu::moderateVoice, this, _2));  	enable_registrar.add("ParticipantList.EnableItem", boost::bind(&LLParticipantList::LLParticipantListMenu::enableContextMenuItem,	this, _2)); @@ -604,6 +613,33 @@ bool LLParticipantList::LLParticipantListMenu::enableContextMenuItem(const LLSD&  		{  			return isGroupModerator();  		} +	else if (item == std::string("can_add")) +		{ +			// We can add friends if: +			// - there are selected people +			// - and there are no friends among selection yet. + +			bool result = (mUUIDs.size() > 0); + +			std::vector<LLUUID>::const_iterator +				id = mUUIDs.begin(), +				uuids_end = mUUIDs.end(); + +			for (;id != uuids_end; ++id) +			{ +				if ( LLAvatarActions::isFriend(*id) ) +				{ +					result = false; +					break; +				} +			} +			return result; +		} +	else if (item == "can_call") +	{ +		return LLVoiceClient::voiceEnabled(); +	} +  	return true;  } @@ -611,18 +647,25 @@ bool LLParticipantList::LLParticipantListMenu::checkContextMenuItem(const LLSD&  {  	std::string item = userdata.asString();  	const LLUUID& id = mUUIDs.front(); +  	if (item == "is_muted") -		return LLMuteList::getInstance()->isMuted(id, LLMute::flagTextChat);  -	else -		if (item == "is_allowed_text_chat") -		{ -			LLPointer<LLSpeaker> selected_speakerp = mParent.mSpeakerMgr->findSpeaker(id); +	{ +		return LLMuteList::getInstance()->isMuted(id, LLMute::flagTextChat); +	} +	else if (item == "is_allowed_text_chat") +	{ +		LLPointer<LLSpeaker> selected_speakerp = mParent.mSpeakerMgr->findSpeaker(id); -			if (selected_speakerp.notNull()) -			{ -				return !selected_speakerp->mModeratorMutedText; -			} +		if (selected_speakerp.notNull()) +		{ +			return !selected_speakerp->mModeratorMutedText;  		} +	} +	else if(item == "is_blocked") +	{ +		return LLMuteList::getInstance()->isMuted(id, LLMute::flagVoiceChat); +	} +  	return false;  } diff --git a/indra/newview/skins/default/xui/en/menu_participant_list.xml b/indra/newview/skins/default/xui/en/menu_participant_list.xml index adf4bd70e1..449202aaaa 100644 --- a/indra/newview/skins/default/xui/en/menu_participant_list.xml +++ b/indra/newview/skins/default/xui/en/menu_participant_list.xml @@ -16,7 +16,7 @@          <menu_item_call.on_click           function="Avatar.AddFriend" />          <menu_item_call.on_enable -         function="Avatar.EnableItem" +         function="ParticipantList.EnableItem"           parameter="can_add" />      </menu_item_call>      <menu_item_call @@ -30,11 +30,14 @@       label="Call"       layout="topleft"       name="Call"> -        <menu_item_call.on_click +         <menu_item_call.on_click           function="Avatar.Call" /> +        <menu_item_call.on_enable +         function="ParticipantList.EnableItem" +         parameter="can_call" />      </menu_item_call>      <menu_item_call -     enabled="false" +     enabled="true"       label="Share"       layout="topleft"       name="Share"> @@ -49,16 +52,16 @@           function="Avatar.Pay" />      </menu_item_call>      <menu_item_check -     label="BlockVoice/Unblock" +     label="Block Voice"       layout="topleft"       name="Block/Unblock">          <menu_item_check.on_click           function="Avatar.BlockUnblock" />          <menu_item_check.on_check -         function="Avatar.CheckItem" +         function="ParticipantList.CheckItem"           parameter="is_blocked" />          <menu_item_check.on_enable -         function="Avatar.EnableItem" +         function="ParticipantList.EnableItem"           parameter="can_block" />      </menu_item_check>          <menu_item_separator | 
