diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2009-11-12 14:15:19 +0000 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2009-11-12 14:15:19 +0000 |
commit | 7cf3008da7c44c592af14de7498cf4270afcec31 (patch) | |
tree | ba78953cb882d63195d5b3aa1604687709bfbd84 | |
parent | 095a3d4372bd755c2fbe6bccf1bc25255d59b5ca (diff) |
more work on the outgoing call popup...
-rw-r--r-- | indra/newview/llimview.cpp | 20 | ||||
-rw-r--r-- | indra/newview/llvoicechannel.cpp | 23 | ||||
-rw-r--r-- | indra/newview/llvoiceclient.cpp | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_outgoing_call.xml | 14 |
4 files changed, 35 insertions, 24 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 969e887a89..9c8365930c 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1108,6 +1108,17 @@ void LLOutgoingCallDialog::getAllowedRect(LLRect& rect) void LLOutgoingCallDialog::onOpen(const LLSD& key) { + // prepare to tell the user which voice channel they would be leaving + LLVoiceChannel *voice = LLVoiceChannel::getCurrentVoiceChannel(); + if (voice && !voice->getSessionName().empty()) + { + childSetTextArg("leaving", "[CURRENT_CHAT]", voice->getSessionName()); + } + else + { + childSetTextArg("leaving", "[CURRENT_CHAT]", getString("localchat")); + } + // dock the dialog to the sys well, where other sys messages appear setDockControl(new LLDockControl(LLBottomTray::getInstance()->getSysWell(), this, getDockTongue(), LLDockControl::TOP, @@ -1118,10 +1129,9 @@ BOOL LLOutgoingCallDialog::postBuild() { BOOL success = LLDockableFloater::postBuild(); - LLSD callee_id = mPayload["session_id"];//mPayload["caller_id"]; + LLSD callee_id = mPayload["other_user_id"]; - std::string calling_str = getString("calling"); - std::string callee_name = mPayload["session_name"].asString();//mPayload["caller_name"].asString(); + std::string callee_name = mPayload["session_name"].asString(); if (callee_name == "anonymous") { callee_name = getString("anonymous"); @@ -1129,9 +1139,7 @@ BOOL LLOutgoingCallDialog::postBuild() setTitle(callee_name); - LLUICtrl* callee_name_widget = getChild<LLUICtrl>("callee name"); - // *TODO: substitute callee name properly - callee_name_widget->setValue(calling_str + " " + callee_name); + childSetTextArg("calling", "[CALLEE_NAME]", callee_name); LLAvatarIconCtrl* icon = getChild<LLAvatarIconCtrl>("avatar_icon"); icon->setValue(callee_id); diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index b0ea07946c..164cb1a51a 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -378,18 +378,9 @@ void LLVoiceChannel::setURI(std::string uri) void LLVoiceChannel::setState(EState state) { - LLSD payload; - payload["session_id"] = mSessionID; - payload["session_name"] = mSessionName; - switch(state) { case STATE_RINGING: - llinfos << "RINGINGGGGGGGG " << mSessionName << llendl; - if (!mSessionName.empty()) - { - LLFloaterReg::showInstance("outgoing_call", payload, TRUE); - } gIMMgr->addSystemMessage(mSessionID, "ringing", mNotifyArgs); break; case STATE_CONNECTED: @@ -879,6 +870,20 @@ void LLVoiceChannelP2P::setState(EState state) { // HACK: Open/close the call window if needed. toggleCallWindowIfNeeded(state); + + // *HACK: open outgoing call floater if needed, might be better done elsewhere. + LLSD payload; + payload["session_id"] = mSessionID; + payload["session_name"] = mSessionName; + payload["other_user_id"] = mOtherUserID; + if (!mReceivedCall && state == STATE_RINGING) + { + llinfos << "RINGINGGGGGGGG " << mSessionName << llendl; + if (!mSessionName.empty()) + { + LLFloaterReg::showInstance("outgoing_call", payload, TRUE); + } + } // you only "answer" voice invites in p2p mode // so provide a special purpose message here diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 39d4bb0c02..fe24c30022 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -4273,7 +4273,7 @@ void LLVoiceClient::mediaStreamUpdatedEvent( if(incoming) { // Send the voice chat invite to the GUI layer - // TODO: Question: Should we correlate with the mute list here? + // *TODO: Question: Should we correlate with the mute list here? session->mIMSessionID = LLIMMgr::computeSessionID(IM_SESSION_P2P_INVITE, session->mCallerID); session->mVoiceInvitePending = true; if(session->mName.empty()) diff --git a/indra/newview/skins/default/xui/en/floater_outgoing_call.xml b/indra/newview/skins/default/xui/en/floater_outgoing_call.xml index 3433d95914..3d0a86de34 100644 --- a/indra/newview/skins/default/xui/en/floater_outgoing_call.xml +++ b/indra/newview/skins/default/xui/en/floater_outgoing_call.xml @@ -15,10 +15,6 @@ Local Voice Chat </floater.string> <floater.string - name="calling"> - Calling [CALLEE] - </floater.string> - <floater.string name="anonymous"> anonymous </floater.string> @@ -44,20 +40,22 @@ height="20" layout="topleft" left="77" - name="callee name" + name="calling" top="27" width="315" - word_wrap="true" /> + word_wrap="true"> +Calling [CALLEE_NAME] + </text> <text font="SansSerif" height="50" layout="topleft" left="77" - name="question" + name="leaving" top="52" width="315" word_wrap="true"> - Do you want to leave [CURRENT_CHAT] and join this voice chat? +Leaving [CURRENT_CHAT]. </text> <button height="24" |