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 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'indra/newview/llcallfloater.cpp') 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(); } -- cgit v1.2.3