summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Chebotarev <ychebotarev@productengine.com>2010-01-05 16:16:11 +0200
committerYuri Chebotarev <ychebotarev@productengine.com>2010-01-05 16:16:11 +0200
commita2fb58b8dbf29d484888a1bdf5f685630e088628 (patch)
tree0b03f4f0cca8aebc7a001bc8235f52ba6b136654
parentb982437900a7c0f16610053b243aaf75bdb75887 (diff)
parentd9d0a557ba42adce8d97ef618b2ba0752b3f7d48 (diff)
merge
--HG-- branch : product-engine
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/llagent.cpp6
-rw-r--r--indra/newview/llavataractions.cpp2
-rw-r--r--indra/newview/llcallfloater.cpp35
-rw-r--r--indra/newview/llcallfloater.h3
-rw-r--r--indra/newview/llfloatercamera.cpp25
-rw-r--r--indra/newview/llfloatercamera.h4
-rw-r--r--indra/newview/llimview.cpp51
-rw-r--r--indra/newview/llimview.h1
9 files changed, 98 insertions, 40 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index e24e1a8605..5045703233 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -408,6 +408,17 @@
<key>Value</key>
<integer>1</integer>
</map>
+ <key>AvalinePhoneSeparator</key>
+ <map>
+ <key>Comment</key>
+ <string>Separator of phone parts to have Avaline numbers human readable in Voice Control Panel</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>String</string>
+ <key>Value</key>
+ <string>-</string>
+ </map>
<key>AvatarAxisDeadZone0</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index d2a56f65dd..5e2e374df6 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -2812,7 +2812,7 @@ void LLAgent::endAnimationUpdateUI()
LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset);
- LLFloaterCamera::toPrevModeIfInAvatarViewMode();
+ LLFloaterCamera::onLeavingMouseLook();
// Only pop if we have pushed...
if (TRUE == mViewsPushed)
@@ -2915,10 +2915,6 @@ void LLAgent::endAnimationUpdateUI()
// JC - Added for always chat in third person option
gFocusMgr.setKeyboardFocus(NULL);
- //Making sure Camera Controls floater is in the right state
- //when entering Mouse Look using wheel scrolling
- LLFloaterCamera::updateIfNotInAvatarViewMode();
-
LLToolMgr::getInstance()->setCurrentToolset(gMouselookToolset);
mViewsPushed = TRUE;
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 2a8c55e5db..9bed346700 100644
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -595,7 +595,9 @@ void LLAvatarActions::requestFriendship(const LLUUID& target_id, const std::stri
LLSD args;
args["TO_NAME"] = target_name;
+
LLSD payload;
+ payload["from_id"] = target_id;
payload["SESSION_NAME"] = target_name;
payload["SUPPRES_TOST"] = true;
LLNotificationsUtil::add("FriendshipOffered", args, payload);
diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp
index a402f59fa1..1468f6d584 100644
--- a/indra/newview/llcallfloater.cpp
+++ b/indra/newview/llcallfloater.cpp
@@ -47,6 +47,7 @@
#include "llfloaterreg.h"
#include "llparticipantlist.h"
#include "llspeakers.h"
+#include "lltextutil.h"
#include "lltransientfloatermgr.h"
#include "llviewerwindow.h"
#include "llvoicechannel.h"
@@ -76,6 +77,12 @@ public:
return rv;
}
+ void setName(const std::string& name)
+ {
+ const std::string& formatted_phone = LLTextUtil::formatPhoneNumber(name);
+ LLAvatarListItem::setName(formatted_phone);
+ }
+
void setSpeakerId(const LLUUID& id) { mSpeakingIndicator->setSpeakerId(id); }
};
@@ -270,6 +277,11 @@ void LLCallFloater::updateSession()
case IM_NOTHING_SPECIAL:
case IM_SESSION_P2P_INVITE:
mVoiceType = VC_PEER_TO_PEER;
+
+ if (!im_session->mOtherParticipantIsAvatar)
+ {
+ mVoiceType = VC_PEER_TO_PEER_AVALINE;
+ }
break;
case IM_SESSION_CONFERENCE_START:
case IM_SESSION_GROUP_START:
@@ -321,16 +333,13 @@ void LLCallFloater::updateSession()
void LLCallFloater::refreshParticipantList()
{
- bool non_avatar_caller = false;
- if (VC_PEER_TO_PEER == mVoiceType)
+ bool non_avatar_caller = VC_PEER_TO_PEER_AVALINE == mVoiceType;
+
+ if (non_avatar_caller)
{
LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(mSpeakerManager->getSessionID());
- non_avatar_caller = !session->mOtherParticipantIsAvatar;
- if (non_avatar_caller)
- {
- mNonAvatarCaller->setSpeakerId(session->mOtherParticipantID);
- mNonAvatarCaller->setName(session->mName);
- }
+ mNonAvatarCaller->setSpeakerId(session->mOtherParticipantID);
+ mNonAvatarCaller->setName(session->mName);
}
mNonAvatarCaller->setVisible(non_avatar_caller);
@@ -390,9 +399,17 @@ void LLCallFloater::updateTitle()
title = getString("title_nearby");
break;
case VC_PEER_TO_PEER:
+ case VC_PEER_TO_PEER_AVALINE:
{
+ title = voice_channel->getSessionName();
+
+ if (VC_PEER_TO_PEER_AVALINE == mVoiceType)
+ {
+ title = LLTextUtil::formatPhoneNumber(title);
+ }
+
LLStringUtil::format_map_t args;
- args["[NAME]"] = voice_channel->getSessionName();
+ args["[NAME]"] = title;
title = getString("title_peer_2_peer", args);
}
break;
diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h
index 8aba93fc43..2b40225906 100644
--- a/indra/newview/llcallfloater.h
+++ b/indra/newview/llcallfloater.h
@@ -88,7 +88,8 @@ private:
VC_LOCAL_CHAT,
VC_GROUP_CHAT,
VC_AD_HOC_CHAT,
- VC_PEER_TO_PEER
+ VC_PEER_TO_PEER,
+ VC_PEER_TO_PEER_AVALINE
}EVoiceControls;
typedef enum e_speaker_state
diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp
index 764aff68c9..9496e94780 100644
--- a/indra/newview/llfloatercamera.cpp
+++ b/indra/newview/llfloatercamera.cpp
@@ -144,6 +144,11 @@ void LLPanelCameraZoom::onSliderValueChanged()
mSavedSliderVal = val;
}
+void activate_camera_tool()
+{
+ LLToolMgr::getInstance()->setTransientTool(LLToolCamera::getInstance());
+};
+
//
// Member functions
//
@@ -151,7 +156,7 @@ void LLPanelCameraZoom::onSliderValueChanged()
/*static*/ bool LLFloaterCamera::inFreeCameraMode()
{
LLFloaterCamera* floater_camera = LLFloaterCamera::findInstance();
- if (floater_camera && floater_camera->mCurrMode == CAMERA_CTRL_MODE_FREE_CAMERA)
+ if (floater_camera && floater_camera->mCurrMode == CAMERA_CTRL_MODE_FREE_CAMERA && gAgent.getCameraMode() != CAMERA_MODE_MOUSELOOK)
{
return true;
}
@@ -177,27 +182,17 @@ void LLFloaterCamera::update()
}
-/*static*/ void LLFloaterCamera::updateIfNotInAvatarViewMode()
-{
- LLFloaterCamera* floater_camera = LLFloaterCamera::findInstance();
- if (floater_camera && !floater_camera->inAvatarViewMode())
- {
- floater_camera->update();
- }
-}
-
-
void LLFloaterCamera::toPrevMode()
{
switchMode(mPrevMode);
}
-/*static*/ void LLFloaterCamera::toPrevModeIfInAvatarViewMode()
+/*static*/ void LLFloaterCamera::onLeavingMouseLook()
{
LLFloaterCamera* floater_camera = LLFloaterCamera::findInstance();
- if (floater_camera && floater_camera->inAvatarViewMode())
+ if (floater_camera && floater_camera->inFreeCameraMode())
{
- floater_camera->toPrevMode();
+ activate_camera_tool();
}
}
@@ -325,7 +320,7 @@ void LLFloaterCamera::switchMode(ECameraControlMode mode)
break;
case CAMERA_CTRL_MODE_FREE_CAMERA:
- LLToolMgr::getInstance()->setTransientTool(LLToolCamera::getInstance());
+ activate_camera_tool();
break;
case CAMERA_CTRL_MODE_AVATAR_VIEW:
diff --git a/indra/newview/llfloatercamera.h b/indra/newview/llfloatercamera.h
index 5d44b4944d..45d5e9a845 100644
--- a/indra/newview/llfloatercamera.h
+++ b/indra/newview/llfloatercamera.h
@@ -61,7 +61,7 @@ public:
/* callback for camera presets changing */
static void onClickCameraPresets(const LLSD& param);
- static void toPrevModeIfInAvatarViewMode();
+ static void onLeavingMouseLook();
/** resets current camera mode to orbit mode */
static void resetCameraMode();
@@ -69,8 +69,6 @@ public:
/* determines actual mode and updates ui */
void update();
- static void updateIfNotInAvatarViewMode();
-
virtual void onOpen(const LLSD& key);
virtual void onClose(bool app_quitting);
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 7c514cf4e6..8664f4ab4a 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -82,6 +82,7 @@
#include "llfirstuse.h"
#include "llagentui.h"
+#include "lltextutil.h"
const static std::string IM_TIME("time");
const static std::string IM_TEXT("message");
@@ -92,6 +93,7 @@ const static std::string NO_SESSION("(IM Session Doesn't Exist)");
const static std::string ADHOC_NAME_SUFFIX(" Conference");
std::string LLCallDialogManager::sPreviousSessionlName = "";
+LLIMModel::LLIMSession::SType LLCallDialogManager::sPreviousSessionType = LLIMModel::LLIMSession::P2P_SESSION;
std::string LLCallDialogManager::sCurrentSessionlName = "";
LLIMModel::LLIMSession* LLCallDialogManager::sSession = NULL;
LLVoiceChannel::EState LLCallDialogManager::sOldState = LLVoiceChannel::STATE_READY;
@@ -178,6 +180,7 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string&
if (IM_NOTHING_SPECIAL == type || IM_SESSION_P2P_INVITE == type)
{
mVoiceChannel = new LLVoiceChannelP2P(session_id, name, other_participant_id);
+ mOtherParticipantIsAvatar = LLVoiceClient::getInstance()->isParticipantAvatar(mSessionID);
// check if it was AVALINE call
if (!mOtherParticipantIsAvatar)
@@ -227,7 +230,6 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string&
{
mCallBackEnabled = LLVoiceClient::getInstance()->isSessionCallBackPossible(mSessionID);
mTextIMPossible = LLVoiceClient::getInstance()->isSessionTextIMPossible(mSessionID);
- mOtherParticipantIsAvatar = LLVoiceClient::getInstance()->isParticipantAvatar(mSessionID);
}
if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") )
@@ -1363,6 +1365,13 @@ void LLCallDialogManager::onVoiceChannelChanged(const LLUUID &session_id)
sCurrentSessionlName = ""; // Empty string results in "Nearby Voice Chat" after substitution
return;
}
+
+ if (sSession)
+ {
+ // store previous session type to process Avaline calls in dialogs
+ sPreviousSessionType = sSession->mSessionType;
+ }
+
sSession = session;
sSession->mVoiceChannel->setStateChangedCallback(LLCallDialogManager::onVoiceChannelStateChanged);
if(sCurrentSessionlName != session->mName)
@@ -1381,6 +1390,7 @@ void LLCallDialogManager::onVoiceChannelChanged(const LLUUID &session_id)
mCallDialogPayload["session_name"] = sSession->mName;
mCallDialogPayload["other_user_id"] = sSession->mOtherParticipantID;
mCallDialogPayload["old_channel_name"] = sPreviousSessionlName;
+ mCallDialogPayload["old_session_type"] = sPreviousSessionType;
mCallDialogPayload["state"] = LLVoiceChannel::STATE_CALL_STARTED;
mCallDialogPayload["disconnected_channel_name"] = sSession->mName;
mCallDialogPayload["session_type"] = sSession->mSessionType;
@@ -1410,6 +1420,7 @@ void LLCallDialogManager::onVoiceChannelStateChanged(const LLVoiceChannel::EStat
mCallDialogPayload["session_name"] = sSession->mName;
mCallDialogPayload["other_user_id"] = sSession->mOtherParticipantID;
mCallDialogPayload["old_channel_name"] = sPreviousSessionlName;
+ mCallDialogPayload["old_session_type"] = sPreviousSessionType;
mCallDialogPayload["state"] = new_state;
mCallDialogPayload["disconnected_channel_name"] = sSession->mName;
mCallDialogPayload["session_type"] = sSession->mSessionType;
@@ -1424,6 +1435,11 @@ void LLCallDialogManager::onVoiceChannelStateChanged(const LLVoiceChannel::EStat
}
break;
+ case LLVoiceChannel::STATE_HUNG_UP:
+ // this state is coming before session is changed, so, put it into payload map
+ mCallDialogPayload["old_session_type"] = sSession->mSessionType;
+ break;
+
case LLVoiceChannel::STATE_CONNECTED :
ocd = LLFloaterReg::findTypedInstance<LLOutgoingCallDialog>("outgoing_call", LLOutgoingCallDialog::OCD_KEY);
if (ocd)
@@ -1564,7 +1580,15 @@ void LLOutgoingCallDialog::show(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());
+ bool was_avaline_call = LLIMModel::LLIMSession::AVALINE_SESSION == mPayload["old_session_type"].asInteger();
+
+ std::string old_caller_name = mPayload["old_channel_name"].asString();
+ if (was_avaline_call)
+ {
+ old_caller_name = LLTextUtil::formatPhoneNumber(old_caller_name);
+ }
+
+ childSetTextArg("leaving", "[CURRENT_CHAT]", old_caller_name);
}
else
{
@@ -1578,10 +1602,18 @@ void LLOutgoingCallDialog::show(const LLSD& key)
}
std::string callee_name = mPayload["session_name"].asString();
+
+ LLUUID session_id = mPayload["session_id"].asUUID();
+ bool is_avatar = LLVoiceClient::getInstance()->isParticipantAvatar(session_id);
+
if (callee_name == "anonymous")
{
callee_name = getString("anonymous");
}
+ else if (!is_avatar)
+ {
+ callee_name = LLTextUtil::formatPhoneNumber(callee_name);
+ }
setTitle(callee_name);
@@ -1731,16 +1763,21 @@ BOOL LLIncomingCallDialog::postBuild()
call_type = getString(mPayload["notify_box_type"]);
}
+
+ // check to see if this is an Avaline call
+ bool is_avatar = LLVoiceClient::getInstance()->isParticipantAvatar(session_id);
+ childSetVisible("Start IM", is_avatar); // no IM for avaline
+
if (caller_name == "anonymous")
{
caller_name = getString("anonymous");
}
-
- setTitle(caller_name + " " + call_type);
+ else if (!is_avatar)
+ {
+ caller_name = LLTextUtil::formatPhoneNumber(caller_name);
+ }
- // check to see if this is an Avaline call
- bool is_avatar = LLVoiceClient::getInstance()->isParticipantAvatar(session_id);
- childSetVisible("Start IM", is_avatar); // no IM for avaline
+ setTitle(caller_name + " " + call_type);
LLUICtrl* caller_name_widget = getChild<LLUICtrl>("caller name");
caller_name_widget->setValue(caller_name + " " + call_type);
diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h
index 11860d0efb..20d8e28392 100644
--- a/indra/newview/llimview.h
+++ b/indra/newview/llimview.h
@@ -475,6 +475,7 @@ public:
protected:
static std::string sPreviousSessionlName;
+ static LLIMModel::LLIMSession::SType sPreviousSessionType;
static std::string sCurrentSessionlName;
static LLIMModel::LLIMSession* sSession;
static LLVoiceChannel::EState sOldState;