From 3385ce87f14f71d739a3834fbf3436a962fbdd9d Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Tue, 1 Dec 2009 20:10:18 +0200 Subject: Implemented major task EXT-2986 (Add "Leave Call" button in Voice Control Panel for all voice chats except nearby). --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 14 +++++++++++ indra/newview/llcallfloater.h | 6 +++-- .../default/xui/en/floater_voice_controls.xml | 27 ++++++++++++++++++++-- 3 files changed, 43 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 7db709086f..d6ae4603b4 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -64,6 +64,7 @@ BOOL LLCallFloater::postBuild() { LLDockableFloater::postBuild(); mAvatarList = getChild("speakers_list"); + childSetAction("leave_call_btn", boost::bind(&LLCallFloater::leaveCall, this)); LLView *anchor_panel = LLBottomTray::getInstance()->getChild("speak_panel"); @@ -90,6 +91,14 @@ void LLCallFloater::onOpen(const LLSD& /*key*/) ////////////////////////////////////////////////////////////////////////// /// PRIVATE SECTION ////////////////////////////////////////////////////////////////////////// + +void LLCallFloater::leaveCall() +{ + LLVoiceChannel* voice_channel = LLVoiceChannel::getCurrentVoiceChannel(); + if (voice_channel && voice_channel->isActive()) + voice_channel->deactivate(); +} + void LLCallFloater::updateSession() { LLVoiceChannel* voice_channel = LLVoiceChannel::getCurrentVoiceChannel(); @@ -139,6 +148,11 @@ void LLCallFloater::updateSession() } updateTitle(); + + //hide "Leave Call" button for nearby chat + bool isLocalChat = mVoiceType == VC_LOCAL_CHAT; + childSetVisible("leave_btn_panel", !isLocalChat); + refreshPartisipantList(); } diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h index 3112b8e81b..d0a2ca5303 100644 --- a/indra/newview/llcallfloater.h +++ b/indra/newview/llcallfloater.h @@ -48,8 +48,8 @@ class LLSpeakerMgr; * the Resident's own microphone input volume, the audible volume of each of the other participants, * the Resident's own Voice Morphing settings (if she has subscribed to enable the feature), and Voice Recording. * - * When the Resident is engaged in Group Voice Chat, the Voice Control Panel also provides an - * 'End Call' button to allow the Resident to leave that voice channel. + * When the Resident is engaged in any chat except Nearby Chat, the Voice Control Panel also provides an + * 'Leave Call' button to allow the Resident to leave that voice channel. */ class LLCallFloater : public LLDockableFloater { @@ -69,6 +69,8 @@ private: VC_PEER_TO_PEER }EVoiceControls; + void leaveCall(); + /** * Updates mSpeakerManager and list according to current Voice Channel * diff --git a/indra/newview/skins/default/xui/en/floater_voice_controls.xml b/indra/newview/skins/default/xui/en/floater_voice_controls.xml index 04696ca2e7..c59d97457e 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_controls.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_controls.xml @@ -74,6 +74,7 @@ width="20" /> @@ -98,9 +101,11 @@ + width="138"> + width="138" /> + + +