summaryrefslogtreecommitdiff
path: root/indra/newview/llcallfloater.cpp
diff options
context:
space:
mode:
authorAndrew Dyukov <adyukov@productengine.com>2009-12-01 20:10:18 +0200
committerAndrew Dyukov <adyukov@productengine.com>2009-12-01 20:10:18 +0200
commit3385ce87f14f71d739a3834fbf3436a962fbdd9d (patch)
tree0b59bf4ed68f96613cfa90349a14b3eb6526c1b5 /indra/newview/llcallfloater.cpp
parent279942b7bf78483fb8b2866e79782cc7e1cf260e (diff)
Implemented major task EXT-2986 (Add "Leave Call" button in Voice Control Panel
for all voice chats except nearby). --HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llcallfloater.cpp')
-rw-r--r--indra/newview/llcallfloater.cpp14
1 files changed, 14 insertions, 0 deletions
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<LLAvatarList>("speakers_list");
+ childSetAction("leave_call_btn", boost::bind(&LLCallFloater::leaveCall, this));
LLView *anchor_panel = LLBottomTray::getInstance()->getChild<LLView>("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();
}