diff options
| -rw-r--r-- | indra/newview/app_settings/settings.xml | 2 | ||||
| -rw-r--r-- | indra/newview/llavataractions.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/llimview.cpp | 102 | ||||
| -rw-r--r-- | indra/newview/llimview.h | 22 | ||||
| -rw-r--r-- | indra/newview/llpanelpeople.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/llviewerfloaterreg.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/llvoicechannel.cpp | 15 | ||||
| -rw-r--r-- | indra/newview/llvoicechannel.h | 1 | ||||
| -rw-r--r-- | indra/newview/llvoiceclient.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/floater_incoming_call.xml | 40 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/floater_outgoing_call.xml | 67 | 
11 files changed, 235 insertions, 22 deletions
| diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 0f82165b6e..eb4148f92f 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5523,7 +5523,7 @@        <key>Type</key>        <string>Boolean</string>        <key>Value</key> -      <integer>0</integer> +      <integer>1</integer>      </map>      <key>QAMode</key>      <map> diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index f631978565..ee4a9df15f 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -192,7 +192,7 @@ void LLAvatarActions::startIM(const LLUUID& id)  // static  void LLAvatarActions::startCall(const LLUUID& id)  { -	if (id.isNull() || isCalling(id)) +	if (id.isNull())  	{  		return;  	} diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index be5fbdbbf8..a94254e17e 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -46,6 +46,7 @@  #include "llagent.h"  #include "llavatariconctrl.h" +#include "llbottomtray.h"  #include "llcallingcard.h"  #include "llchat.h"  #include "llresmgr.h" @@ -73,6 +74,7 @@  #include "llvoicechannel.h"  #include "lltrans.h"  #include "llrecentpeople.h" +#include "llsyswellwindow.h"  #include "llfirstuse.h"  #include "llagentui.h" @@ -1091,16 +1093,90 @@ LLIMMgr::onConfirmForceCloseError(  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLOutgoingCallDialog +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LLOutgoingCallDialog::LLOutgoingCallDialog(const LLSD& payload) : +	LLDockableFloater(NULL, false, payload), +	mPayload(payload) +{ +} + +void LLOutgoingCallDialog::getAllowedRect(LLRect& rect) +{ +	rect = gViewerWindow->getWorldViewRectRaw(); +} + +void LLOutgoingCallDialog::onOpen(const LLSD& key) +{ +	// tell the user which voice channel they are leaving +	if (!mPayload["old_channel_name"].asString().empty()) +	{ +		childSetTextArg("leaving", "[CURRENT_CHAT]", mPayload["old_channel_name"].asString()); +	} +	else +	{ +		childSetTextArg("leaving", "[CURRENT_CHAT]", getString("localchat")); +	} + +	std::string callee_name = mPayload["session_name"].asString(); +	if (callee_name == "anonymous") +	{ +		callee_name = getString("anonymous"); +	} +	 +	setTitle(callee_name); + +	LLSD callee_id = mPayload["other_user_id"]; +	childSetTextArg("calling", "[CALLEE_NAME]", callee_name); +	LLAvatarIconCtrl* icon = getChild<LLAvatarIconCtrl>("avatar_icon"); +	icon->setValue(callee_id); + +	// dock the dialog to the sys well, where other sys messages appear +	setDockControl(new LLDockControl(LLBottomTray::getInstance()->getSysWell(), +					 this, getDockTongue(), LLDockControl::TOP, +					 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("Cancel", onCancel, this); + +	return success; +} + + + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  // Class LLIncomingCallDialog  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  LLIncomingCallDialog::LLIncomingCallDialog(const LLSD& payload) : -	LLModalDialog(payload), +	LLDockableFloater(NULL, false, payload),  	mPayload(payload)  {  }  BOOL LLIncomingCallDialog::postBuild()  { +	LLDockableFloater::postBuild(); +  	LLSD caller_id = mPayload["caller_id"];  	EInstantMessage type = (EInstantMessage)mPayload["type"].asInteger(); @@ -1132,6 +1208,30 @@ BOOL LLIncomingCallDialog::postBuild()  	return TRUE;  } +void LLIncomingCallDialog::getAllowedRect(LLRect& rect) +{ +	rect = gViewerWindow->getWorldViewRectRaw(); +} + +void LLIncomingCallDialog::onOpen(const LLSD& key) +{ +	// tell the user which voice channel they would be leaving +	LLVoiceChannel *voice = LLVoiceChannel::getCurrentVoiceChannel(); +	if (voice && !voice->getSessionName().empty()) +	{ +		childSetTextArg("question", "[CURRENT_CHAT]", voice->getSessionName()); +	} +	else +	{ +		childSetTextArg("question", "[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, +									 boost::bind(&LLIncomingCallDialog::getAllowedRect, this, _1))); +} +  //static  void LLIncomingCallDialog::onAccept(void* user_data)  { diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index c566b111ca..62a54bc081 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -34,9 +34,11 @@  #define LL_LLIMVIEW_H  #include "lldarray.h" +#include "lldockablefloater.h"  #include "llspeakers.h" //for LLIMSpeakerMgr  #include "llimpanel.h" //for voice channels  #include "llmodaldialog.h" +#include "lldockablefloater.h"  #include "llinstantmessage.h"  #include "lluuid.h"  #include "llmultifloater.h" @@ -401,12 +403,13 @@ private:  	LLSD mPendingAgentListUpdates;  }; -class LLIncomingCallDialog : public LLModalDialog +class LLIncomingCallDialog : public LLDockableFloater  {  public:  	LLIncomingCallDialog(const LLSD& payload);  	/*virtual*/ BOOL postBuild(); +	/*virtual*/ void onOpen(const LLSD& key);  	static void onAccept(void* user_data);  	static void onReject(void* user_data); @@ -414,6 +417,23 @@ public:  private:  	void processCallResponse(S32 response); +	void getAllowedRect(LLRect& rect); + +	LLSD mPayload; +}; + +class LLOutgoingCallDialog : public LLDockableFloater +{ +public: +	LLOutgoingCallDialog(const LLSD& payload); + +	/*virtual*/ BOOL postBuild(); +	/*virtual*/ void onOpen(const LLSD& key); + +	static void onCancel(void* user_data); + +private: +	void getAllowedRect(LLRect& rect);  	LLSD mPayload;  }; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 9ba94c8ca9..2bbb2b7153 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1193,7 +1193,7 @@ void LLPanelPeople::onCallButtonClicked()  	if (selected_uuids.size() == 1)  	{  		// initiate a P2P voice chat with the selected user -		LLAvatarActions::startCall(selected_uuids[0]); +		LLAvatarActions::startCall(getCurrentItemID());  	}  	else if (selected_uuids.size() > 1)  	{ diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 964d3bc2fa..7772f613f0 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -197,7 +197,7 @@ void LLViewerFloaterReg::registerFloaters()  	LLFloaterReg::add("notifications_console", "floater_notifications_console.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterNotificationConsole>);  	LLFloaterReg::add("openobject", "floater_openobject.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterOpenObject>); -	 +	LLFloaterReg::add("outgoing_call", "floater_outgoing_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLOutgoingCallDialog>);  	LLFloaterReg::add("parcel_info", "floater_preview_url.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterParcelInfo>);  	LLFloaterPayUtil::registerFloater(); diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index 89649407ff..d93913b944 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();  		}  	} @@ -870,6 +872,19 @@ 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. +	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", mCallDialogPayload, TRUE); +		} +	}  	// you only "answer" voice invites in p2p mode  	// so provide a special purpose message here 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/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_incoming_call.xml b/indra/newview/skins/default/xui/en/floater_incoming_call.xml index 16873df310..9c2898945b 100644 --- a/indra/newview/skins/default/xui/en/floater_incoming_call.xml +++ b/indra/newview/skins/default/xui/en/floater_incoming_call.xml @@ -4,13 +4,17 @@   can_close="false"   can_minimize="false"   can_tear_off="false" - height="200" + height="125"   layout="topleft"   name="incoming call"   help_topic="incoming_call"   title="UNKNOWN PERSON IS CALLING" - width="240"> -     <floater.string + width="410"> +    <floater.string +     name="localchat"> +        Local Voice Chat +    </floater.string> +    <floater.string       name="anonymous">          anonymous      </floater.string> @@ -31,18 +35,26 @@       left_delta="19"       top="35"       width="36" /> -    <text_editor -     font="SansSerif" -     height="64" -     border_visible="false" +    <text +     font="SansSerifLarge" +     height="20"       layout="topleft"       left="77" -     max_length="2147483647"       name="caller name" -     read_only="true" -     top="21" -     width="163" +     top="27" +     width="315"       word_wrap="true" /> +    <text +     font="SansSerif" +     height="50" +     layout="topleft" +     left="77" +     name="question" +     top="52" +     width="315" +     word_wrap="true"> +     Do you want to leave [CURRENT_CHAT] and join this voice chat? +    </text>      <button       height="24"       label="Accept" @@ -57,16 +69,14 @@       label="Reject"       label_selected="Reject"       layout="topleft" -     left_delta="0"       name="Reject" -     top_pad="12" +     left_pad="10"       width="100" />      <button       height="24"       label="Start IM"       layout="topleft" -     left_delta="0"       name="Start IM" -     top_pad="12" +     left_pad="10"       width="100" />  </floater> diff --git a/indra/newview/skins/default/xui/en/floater_outgoing_call.xml b/indra/newview/skins/default/xui/en/floater_outgoing_call.xml new file mode 100644 index 0000000000..6713700372 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_outgoing_call.xml @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + legacy_header_height="18" + can_close="false" + can_minimize="false" + can_tear_off="false" + height="125" + layout="topleft" + name="outgoing call" + help_topic="outgoing_call" + title="CALLING" + width="410"> +    <floater.string +     name="localchat"> +        Local Voice Chat +    </floater.string> +    <floater.string +     name="anonymous"> +        anonymous +    </floater.string> +    <floater.string +     name="VoiceInviteP2P"> +        is calling. +    </floater.string> +    <floater.string +     name="VoiceInviteAdHoc"> +        has joined a Voice Chat call with a conference chat. +    </floater.string> +    <avatar_icon +     enabled="false" +     follows="left|top" +     height="36" +     image_name="icon_avatar_online.tga" +     layout="topleft" +     left_delta="19" +     top="35" +     width="36" /> +    <text +     font="SansSerifLarge" +     height="20" +     layout="topleft" +     left="77" +     name="calling" +     top="27" +     width="315" +     word_wrap="true"> +Calling [CALLEE_NAME] +    </text> +    <text +     font="SansSerif" +     height="50" +     layout="topleft" +     left="77" +     name="leaving" +     top="52" +     width="315" +     word_wrap="true"> +Leaving [CURRENT_CHAT]. +    </text> +    <button +     height="24" +     label="Cancel" +     layout="topleft" +     name="Cancel" +     left_pad="10" +     width="100" /> +</floater> | 
