summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llimview.cpp25
-rw-r--r--indra/newview/llimview.h2
-rw-r--r--indra/newview/llvoicechannel.cpp14
-rw-r--r--indra/newview/llvoicechannel.h1
-rw-r--r--indra/newview/skins/default/xui/en/floater_outgoing_call.xml21
5 files changed, 34 insertions, 29 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 9175d0c91c..a94254e17e 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -1108,11 +1108,10 @@ 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())
+ // tell the user which voice channel they are leaving
+ if (!mPayload["old_channel_name"].asString().empty())
{
- childSetTextArg("leaving", "[CURRENT_CHAT]", voice->getSessionName());
+ childSetTextArg("leaving", "[CURRENT_CHAT]", mPayload["old_channel_name"].asString());
}
else
{
@@ -1138,11 +1137,27 @@ void LLOutgoingCallDialog::onOpen(const LLSD& key)
boost::bind(&LLOutgoingCallDialog::getAllowedRect, this, _1)));
}
+
+//static
+void LLOutgoingCallDialog::onCancel(void* user_data)
+{
+ LLOutgoingCallDialog* self = (LLOutgoingCallDialog*)user_data;
+
+ if (!gIMMgr)
+ return;
+
+ LLUUID session_id = self->mPayload["session_id"].asUUID();
+ gIMMgr->endCall(session_id);
+
+ self->closeFloater();
+}
+
+
BOOL LLOutgoingCallDialog::postBuild()
{
BOOL success = LLDockableFloater::postBuild();
- //childSetAction("Reject", onReject, this);
+ childSetAction("Cancel", onCancel, this);
return success;
}
diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h
index 510b5b8b69..62a54bc081 100644
--- a/indra/newview/llimview.h
+++ b/indra/newview/llimview.h
@@ -430,6 +430,8 @@ public:
/*virtual*/ BOOL postBuild();
/*virtual*/ void onOpen(const LLSD& key);
+ static void onCancel(void* user_data);
+
private:
void getAllowedRect(LLRect& rect);
diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp
index 164cb1a51a..b03e6c2426 100644
--- a/indra/newview/llvoicechannel.cpp
+++ b/indra/newview/llvoicechannel.cpp
@@ -306,8 +306,10 @@ void LLVoiceChannel::activate()
// activating the proximal channel between IM calls
LLVoiceChannel* old_channel = sCurrentVoiceChannel;
sCurrentVoiceChannel = this;
+ mCallDialogPayload["old_channel_name"] = "";
if (old_channel)
{
+ mCallDialogPayload["old_channel_name"] = old_channel->getSessionName();
old_channel->deactivate();
}
}
@@ -790,6 +792,9 @@ void LLVoiceChannelP2P::activate()
{
if (callStarted()) return;
+ LLVoiceChannel *voice = LLVoiceChannel::getCurrentVoiceChannel();
+ if (voice && !voice->getSessionName().empty())
+
LLVoiceChannel::activate();
if (callStarted())
@@ -872,16 +877,15 @@ void LLVoiceChannelP2P::setState(EState state)
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;
+ mCallDialogPayload["session_id"] = mSessionID;
+ mCallDialogPayload["session_name"] = mSessionName;
+ mCallDialogPayload["other_user_id"] = mOtherUserID;
if (!mReceivedCall && state == STATE_RINGING)
{
llinfos << "RINGINGGGGGGGG " << mSessionName << llendl;
if (!mSessionName.empty())
{
- LLFloaterReg::showInstance("outgoing_call", payload, TRUE);
+ LLFloaterReg::showInstance("outgoing_call", mCallDialogPayload, TRUE);
}
}
diff --git a/indra/newview/llvoicechannel.h b/indra/newview/llvoicechannel.h
index 20b6157b48..639585de55 100644
--- a/indra/newview/llvoicechannel.h
+++ b/indra/newview/llvoicechannel.h
@@ -109,6 +109,7 @@ protected:
EState mState;
std::string mSessionName;
LLSD mNotifyArgs;
+ LLSD mCallDialogPayload;
BOOL mIgnoreNextSessionLeave;
LLHandle<LLPanel> mLoginNotificationHandle;
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 3d0a86de34..6713700372 100644
--- a/indra/newview/skins/default/xui/en/floater_outgoing_call.xml
+++ b/indra/newview/skins/default/xui/en/floater_outgoing_call.xml
@@ -59,26 +59,9 @@ Leaving [CURRENT_CHAT].
</text>
<button
height="24"
- label="Foo"
- label_selected="Foo"
+ label="Cancel"
layout="topleft"
- left="70"
- name="Foo"
- top="92"
- width="100" />
- <button
- height="24"
- label="Bar"
- label_selected="Bar"
- layout="topleft"
- name="Bar"
- left_pad="10"
- width="100" />
- <button
- height="24"
- label="Baz"
- layout="topleft"
- name="Baz"
+ name="Cancel"
left_pad="10"
width="100" />
</floater>