diff options
author | Mike Antipov <mantipov@productengine.com> | 2009-12-02 18:38:44 +0200 |
---|---|---|
committer | Mike Antipov <mantipov@productengine.com> | 2009-12-02 18:38:44 +0200 |
commit | b2891b732f145ee0d170afd8b116b834a0879973 (patch) | |
tree | f4dcd345af5877668bd89c5a33a8828e145c7b4f /indra/newview/llcallfloater.cpp | |
parent | 34b624f873ce931c6089487d5381d76f99494feb (diff) |
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
Diffstat (limited to 'indra/newview/llcallfloater.cpp')
-rw-r--r-- | indra/newview/llcallfloater.cpp | 75 |
1 files changed, 66 insertions, 9 deletions
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<LLAvatarList>("speakers_list"); childSetAction("leave_call_btn", boost::bind(&LLCallFloater::leaveCall, this)); + mNonAvatarCaller = getChild<LLNonAvatarCaller>("non_avatar_caller"); LLView *anchor_panel = LLBottomTray::getInstance()->getChild<LLView>("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; } |