Work on major sub-task EXT-2790 (Complete Voice Control Panel (floater) started by Lynx (LLVoiceControlPanel))

-- Updated title according to voice chat type

--HG--
branch : product-engine
meow-7.2.2
Mike Antipov 2009-11-30 15:27:20 +02:00
parent 288f67e462
commit 3284dec5d9
2 changed files with 39 additions and 6 deletions

View File

@ -46,6 +46,7 @@ LLCallFloater::LLCallFloater(const LLSD& key)
, mSpeakerManager(NULL)
, mPaticipants(NULL)
, mAvatarList(NULL)
, mVoiceType(VC_LOCAL_CHAT)
{
}
@ -110,6 +111,19 @@ void LLCallFloater::updateSession()
if (im_session)
{
mSpeakerManager = LLIMModel::getInstance()->getSpeakerManager(session_id);
switch (im_session->mType)
{
case IM_NOTHING_SPECIAL:
case IM_SESSION_P2P_INVITE:
mVoiceType = VC_PEER_TO_PEER;
break;
case IM_SESSION_CONFERENCE_START:
mVoiceType = VC_AD_HOC_CHAT;
break;
default:
mVoiceType = VC_GROUP_CHAT;
break;
}
}
if (NULL == mSpeakerManager)
@ -117,6 +131,7 @@ void LLCallFloater::updateSession()
// by default let show nearby chat participants
mSpeakerManager = LLLocalSpeakerMgr::getInstance();
lldebugs << "Set DEFAULT speaker manager" << llendl;
mVoiceType = VC_LOCAL_CHAT;
}
updateTitle();
@ -140,16 +155,25 @@ void LLCallFloater::onCurrentChannelChanged(const LLUUID& /*session_id*/)
void LLCallFloater::updateTitle()
{
LLVoiceChannel* voice_channel = LLVoiceChannel::getCurrentVoiceChannel();
if (NULL == voice_channel) return;
std::string title = voice_channel->getSessionName();
if (LLLocalSpeakerMgr::getInstance() == mSpeakerManager)
std::string title;
switch (mVoiceType)
{
case VC_LOCAL_CHAT:
title = getString("title_nearby");
break;
case VC_PEER_TO_PEER:
title = voice_channel->getSessionName();
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);
break;
}
// *TODO: mantipov: update code to use title from xml for other chat types
setTitle(title);
}
//EOF

View File

@ -61,6 +61,14 @@ public:
/*virtual*/ void onOpen(const LLSD& key);
private:
typedef enum e_voice_controls_type
{
VC_LOCAL_CHAT,
VC_GROUP_CHAT,
VC_AD_HOC_CHAT,
VC_PEER_TO_PEER
}EVoiceControls;
/**
* Updates mSpeakerManager and list according to current Voice Channel
*
@ -80,6 +88,7 @@ private:
LLSpeakerMgr* mSpeakerManager;
LLParticipantList* mPaticipants;
LLAvatarList* mAvatarList;
EVoiceControls mVoiceType;
};