From 279942b7bf78483fb8b2866e79782cc7e1cf260e Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Tue, 1 Dec 2009 19:42:42 +0200 Subject: Fixed critical bug EXT-2990 (Viewer crashes after openning "Voice Control" on IM floater) -- added disconnecting from subscribed signals while destroying participant list -- added disconnecting from subscribed signals while destroying Voice controls -- added nullifying of the pointer to speaker manager when channel is changed --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview/llcallfloater.cpp') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 1b929eca0e..7db709086f 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -54,6 +54,7 @@ LLCallFloater::LLCallFloater(const LLSD& key) LLCallFloater::~LLCallFloater() { + mChannelChangedConnection.disconnect(); delete mPaticipants; mPaticipants = NULL; } @@ -77,7 +78,7 @@ BOOL LLCallFloater::postBuild() updateSession(); // subscribe to to be notified Voice Channel is changed - LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&LLCallFloater::onCurrentChannelChanged, this, _1)); + mChannelChangedConnection = LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&LLCallFloater::onCurrentChannelChanged, this, _1)); return TRUE; } @@ -157,6 +158,8 @@ void LLCallFloater::refreshPartisipantList() void LLCallFloater::onCurrentChannelChanged(const LLUUID& /*session_id*/) { + // Forget speaker manager from the previous session to avoid using it after session was destroyed. + mSpeakerManager = NULL; updateSession(); } -- cgit v1.2.3 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 From 09d6eeceb8367879c0ce158e20eae9732909596c Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Wed, 2 Dec 2009 10:41:53 +0200 Subject: Minor changes to EXT-2986 (Add "Leave Call" button in Voice Control Panel for all voice chats except nearby) implementation. --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/llcallfloater.cpp') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index d6ae4603b4..d82c088997 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -96,7 +96,9 @@ void LLCallFloater::leaveCall() { LLVoiceChannel* voice_channel = LLVoiceChannel::getCurrentVoiceChannel(); if (voice_channel && voice_channel->isActive()) + { voice_channel->deactivate(); + } } void LLCallFloater::updateSession() @@ -150,8 +152,8 @@ void LLCallFloater::updateSession() updateTitle(); //hide "Leave Call" button for nearby chat - bool isLocalChat = mVoiceType == VC_LOCAL_CHAT; - childSetVisible("leave_btn_panel", !isLocalChat); + bool is_local_chat = mVoiceType == VC_LOCAL_CHAT; + childSetVisible("leave_btn_panel", !is_local_chat); refreshPartisipantList(); } -- cgit v1.2.3 From b2891b732f145ee0d170afd8b116b834a0879973 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Wed, 2 Dec 2009 18:38:44 +0200 Subject: Implemented major task EXT-2985 (Implement Avaline calls processing in Voice Control Panel) -- improved Voice Control Panel to show avaline caller number as its name. Separate instance of derived from LLAvatarListItem class was provided --HG-- branch : product-engine --- indra/newview/llcallfloater.cpp | 75 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 66 insertions(+), 9 deletions(-) (limited to 'indra/newview/llcallfloater.cpp') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index d82c088997..ad59c780f3 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -42,14 +42,45 @@ #include "llspeakers.h" +class LLNonAvatarCaller : public LLAvatarListItem +{ +public: + LLNonAvatarCaller() : LLAvatarListItem(false) + { + + } + BOOL postBuild() + { + BOOL rv = LLAvatarListItem::postBuild(); + + if (rv) + { + setOnline(true); + showLastInteractionTime(false); + setShowProfileBtn(false); + setShowInfoBtn(false); + } + return rv; + } + + void setSpeakerId(const LLUUID& id) { mSpeakingIndicator->setSpeakerId(id); } +}; + + +static void* create_non_avatar_caller(void*) +{ + return new LLNonAvatarCaller; +} + LLCallFloater::LLCallFloater(const LLSD& key) : LLDockableFloater(NULL, key) , mSpeakerManager(NULL) , mPaticipants(NULL) , mAvatarList(NULL) +, mNonAvatarCaller(NULL) , mVoiceType(VC_LOCAL_CHAT) { - + mFactoryMap["non_avatar_caller"] = LLCallbackMap(create_non_avatar_caller, NULL); } LLCallFloater::~LLCallFloater() @@ -66,6 +97,7 @@ BOOL LLCallFloater::postBuild() mAvatarList = getChild("speakers_list"); childSetAction("leave_call_btn", boost::bind(&LLCallFloater::leaveCall, this)); + mNonAvatarCaller = getChild("non_avatar_caller"); LLView *anchor_panel = LLBottomTray::getInstance()->getChild("speak_panel"); @@ -161,14 +193,33 @@ void LLCallFloater::updateSession() void LLCallFloater::refreshPartisipantList() { delete mPaticipants; + mPaticipants = NULL; mAvatarList->clear(); - bool do_not_use_context_menu_in_local_chat = LLLocalSpeakerMgr::getInstance() != mSpeakerManager; - mPaticipants = new LLParticipantList(mSpeakerManager, mAvatarList, do_not_use_context_menu_in_local_chat); + bool non_avatar_caller = false; + if (VC_PEER_TO_PEER == mVoiceType) + { + LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(mSpeakerManager->getSessionID()); + non_avatar_caller = !session->mOtherParticipantIsAvatar; + if (non_avatar_caller) + { + mNonAvatarCaller->setSpeakerId(session->mOtherParticipantID); + mNonAvatarCaller->setName(session->mName); + } + } + + mNonAvatarCaller->setVisible(non_avatar_caller); + mAvatarList->setVisible(!non_avatar_caller); - if (!do_not_use_context_menu_in_local_chat) + if (!non_avatar_caller) { - mAvatarList->setNoItemsCommentText(getString("no_one_near")); + bool do_not_use_context_menu_in_local_chat = LLLocalSpeakerMgr::getInstance() != mSpeakerManager; + mPaticipants = new LLParticipantList(mSpeakerManager, mAvatarList, do_not_use_context_menu_in_local_chat); + + if (!do_not_use_context_menu_in_local_chat) + { + mAvatarList->setNoItemsCommentText(getString("no_one_near")); + } } } @@ -189,15 +240,21 @@ void LLCallFloater::updateTitle() title = getString("title_nearby"); break; case VC_PEER_TO_PEER: - title = voice_channel->getSessionName(); + { + LLStringUtil::format_map_t args; + args["[NAME]"] = voice_channel->getSessionName(); + title = getString("title_peer_2_peer", args); + } break; case VC_AD_HOC_CHAT: title = getString("title_adhoc"); break; case VC_GROUP_CHAT: - LLStringUtil::format_map_t args; - args["[GROUP]"] = voice_channel->getSessionName(); - title = getString("title_group", args); + { + LLStringUtil::format_map_t args; + args["[GROUP]"] = voice_channel->getSessionName(); + title = getString("title_group", args); + } break; } -- cgit v1.2.3