diff options
author | James Cook <james@lindenlab.com> | 2010-02-11 10:09:23 -0800 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2010-02-11 10:09:23 -0800 |
commit | 9dd7924b19651abf393f7b0dee632904a6b8e52a (patch) | |
tree | b22f8ca3ecdf4ec8e5288102912dccdd7289f51f /indra/newview/llimview.cpp | |
parent | 301f250c1cd77711c0234d8ed4089453712f834e (diff) | |
parent | 39fe664b97b946daf7984b946fede6f04ae731c4 (diff) |
Merge
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r-- | indra/newview/llimview.cpp | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 6338fbd091..8999aab50a 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -77,6 +77,9 @@ const static std::string IM_FROM_ID("from_id"); const static std::string NO_SESSION("(IM Session Doesn't Exist)"); const static std::string ADHOC_NAME_SUFFIX(" Conference"); +const static std::string NEARBY_P2P_BY_OTHER("nearby_P2P_by_other"); +const static std::string NEARBY_P2P_BY_AGENT("nearby_P2P_by_agent"); + std::string LLCallDialogManager::sPreviousSessionlName = ""; LLIMModel::LLIMSession::SType LLCallDialogManager::sPreviousSessionType = LLIMModel::LLIMSession::P2P_SESSION; std::string LLCallDialogManager::sCurrentSessionlName = ""; @@ -1372,7 +1375,7 @@ void LLCallDialogManager::onVoiceChannelChanged(const LLUUID &session_id) } sSession = session; - sSession->mVoiceChannel->setStateChangedCallback(boost::bind(LLCallDialogManager::onVoiceChannelStateChanged, _1, _2, _3)); + sSession->mVoiceChannel->setStateChangedCallback(boost::bind(LLCallDialogManager::onVoiceChannelStateChanged, _1, _2, _3, _4)); if(sCurrentSessionlName != session->mName) { sPreviousSessionlName = sCurrentSessionlName; @@ -1403,7 +1406,7 @@ void LLCallDialogManager::onVoiceChannelChanged(const LLUUID &session_id) } -void LLCallDialogManager::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state, const LLVoiceChannel::EDirection& direction) +void LLCallDialogManager::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state, const LLVoiceChannel::EDirection& direction, bool ended_by_agent) { LLSD mCallDialogPayload; LLOutgoingCallDialog* ocd = NULL; @@ -1423,6 +1426,7 @@ void LLCallDialogManager::onVoiceChannelStateChanged(const LLVoiceChannel::EStat mCallDialogPayload["state"] = new_state; mCallDialogPayload["disconnected_channel_name"] = sSession->mName; mCallDialogPayload["session_type"] = sSession->mSessionType; + mCallDialogPayload["ended_by_agent"] = ended_by_agent; switch(new_state) { @@ -1517,6 +1521,15 @@ void LLCallDialog::draw() } } +// virtual +void LLCallDialog::onOpen(const LLSD& key) +{ + LLDockableFloater::onOpen(key); + + // it should be over the all floaters. EXT-5116 + gFloaterView->bringToFront(this); +} + void LLCallDialog::setIcon(const LLSD& session_id, const LLSD& participant_id) { // *NOTE: 12/28/2009: check avaline calls: LLVoiceClient::isParticipantAvatar returns false for them @@ -1609,7 +1622,16 @@ void LLOutgoingCallDialog::show(const LLSD& key) channel_name = LLTextUtil::formatPhoneNumber(channel_name); } childSetTextArg("nearby", "[VOICE_CHANNEL_NAME]", channel_name); - childSetTextArg("nearby_P2P", "[VOICE_CHANNEL_NAME]", mPayload["disconnected_channel_name"].asString()); + childSetTextArg("nearby_P2P_by_other", "[VOICE_CHANNEL_NAME]", mPayload["disconnected_channel_name"].asString()); + + // skipping "You will now be reconnected to nearby" in notification when call is ended by disabling voice, + // so no reconnection to nearby chat happens (EXT-4397) + bool voice_works = LLVoiceClient::voiceEnabled() && gVoiceClient->voiceWorking(); + std::string reconnect_nearby = voice_works ? LLTrans::getString("reconnect_nearby") : std::string(); + childSetTextArg("nearby", "[RECONNECT_NEARBY]", reconnect_nearby); + + const std::string& nearby_str = mPayload["ended_by_agent"] ? NEARBY_P2P_BY_AGENT : NEARBY_P2P_BY_OTHER; + childSetTextArg(nearby_str, "[RECONNECT_NEARBY]", reconnect_nearby); } std::string callee_name = mPayload["session_name"].asString(); @@ -1643,6 +1665,7 @@ void LLOutgoingCallDialog::show(const LLSD& key) { case LLVoiceChannel::STATE_CALL_STARTED : getChild<LLTextBox>("calling")->setVisible(true); + getChild<LLButton>("Cancel")->setVisible(true); if(show_oldchannel) { getChild<LLTextBox>("leaving")->setVisible(true); @@ -1664,7 +1687,8 @@ void LLOutgoingCallDialog::show(const LLSD& key) case LLVoiceChannel::STATE_HUNG_UP : if (mPayload["session_type"].asInteger() == LLIMModel::LLIMSession::P2P_SESSION) { - getChild<LLTextBox>("nearby_P2P")->setVisible(true); + const std::string& nearby_str = mPayload["ended_by_agent"] ? NEARBY_P2P_BY_AGENT : NEARBY_P2P_BY_OTHER; + getChild<LLTextBox>(nearby_str)->setVisible(true); } else { @@ -1683,7 +1707,8 @@ void LLOutgoingCallDialog::hideAllText() getChild<LLTextBox>("calling")->setVisible(false); getChild<LLTextBox>("leaving")->setVisible(false); getChild<LLTextBox>("connecting")->setVisible(false); - getChild<LLTextBox>("nearby_P2P")->setVisible(false); + getChild<LLTextBox>("nearby_P2P_by_other")->setVisible(false); + getChild<LLTextBox>("nearby_P2P_by_agent")->setVisible(false); getChild<LLTextBox>("nearby")->setVisible(false); getChild<LLTextBox>("noanswer")->setVisible(false); } |