From 658ccc3e85487f9f24ff3b5926e60d6cce7f42e0 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Wed, 7 Apr 2010 11:08:04 -0700 Subject: Re-insert backed out SLE checkin so we can fix it --- indra/newview/llimview.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'indra/newview/llimview.cpp') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index e0f155a6a9..5201f92dbc 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -344,13 +344,13 @@ LLIMModel::LLIMSession::~LLIMSession() mSpeakers = NULL; // End the text IM session if necessary - if(gVoiceClient && mOtherParticipantID.notNull()) + if(LLVoiceClient::getInstance() && mOtherParticipantID.notNull()) { switch(mType) { case IM_NOTHING_SPECIAL: case IM_SESSION_P2P_INVITE: - gVoiceClient->endUserIMSession(mOtherParticipantID); + LLVoiceClient::getInstance()->endUserIMSession(mOtherParticipantID); break; default: @@ -925,7 +925,7 @@ void LLIMModel::sendMessage(const std::string& utf8_text, if((offline == IM_OFFLINE) && (LLVoiceClient::getInstance()->isOnlineSIP(other_participant_id))) { // User is online through the OOW connector, but not with a regular viewer. Try to send the message via SLVoice. - sent = gVoiceClient->sendTextMessage(other_participant_id, utf8_text); + sent = LLVoiceClient::getInstance()->sendTextMessage(other_participant_id, utf8_text); } if(!sent) @@ -1717,7 +1717,7 @@ void LLOutgoingCallDialog::show(const LLSD& key) // 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(); + bool voice_works = LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking(); std::string reconnect_nearby = voice_works ? LLTrans::getString("reconnect_nearby") : std::string(); childSetTextArg("nearby", "[RECONNECT_NEARBY]", reconnect_nearby); @@ -1843,7 +1843,11 @@ LLCallDialog(payload) void LLIncomingCallDialog::onLifetimeExpired() { // check whether a call is valid or not - if (LLVoiceClient::getInstance()->findSession(mPayload["caller_id"].asUUID())) + LLVoiceChannel* channelp = LLVoiceChannel::getChannelByID(mPayload["session_id"].asUUID()); + if(channelp && + (channelp->getState() != LLVoiceChannel::STATE_NO_CHANNEL_INFO) && + (channelp->getState() != LLVoiceChannel::STATE_ERROR) && + (channelp->getState() != LLVoiceChannel::STATE_HUNG_UP)) { // restart notification's timer if call is still valid mLifetimeTimer.start(); @@ -2077,10 +2081,10 @@ void LLIncomingCallDialog::processCallResponse(S32 response) { if (type == IM_SESSION_P2P_INVITE) { - if(gVoiceClient) + if(LLVoiceClient::getInstance()) { std::string s = mPayload["session_handle"].asString(); - gVoiceClient->declineInvite(s); + LLVoiceClient::getInstance()->declineInvite(s); } } else @@ -2168,11 +2172,8 @@ bool inviteUserResponse(const LLSD& notification, const LLSD& response) { if (type == IM_SESSION_P2P_INVITE) { - if(gVoiceClient) - { - std::string s = payload["session_handle"].asString(); - gVoiceClient->declineInvite(s); - } + std::string s = payload["session_handle"].asString(); + LLVoiceClient::getInstance()->declineInvite(s); } else { @@ -3078,7 +3079,7 @@ public: return; } - if(!LLVoiceClient::voiceEnabled()) + if(!LLVoiceClient::getInstance()->voiceEnabled()) { // Don't display voice invites unless the user has voice enabled. return; -- cgit v1.3 From d66c242fea8a846f087562d5ae2b32c50a3f5ef1 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Wed, 14 Apr 2010 17:21:44 -0700 Subject: DEV-48904 - p2p acceptance dialog vanishes too quickly DEV-48903 - malformed names in p2p dialogs for Diamondware In the merge there were some changes that didn't get propagated that resulted in some failures with respect to diamondware name processing. THe determination as to whether a p2p session was with an avatar or with an alcatel (pbx) wasn't propagated into the diamondware code. I fixed that by merging the changes to the vivox module with respect to that into the diamondware module. Also, the acceptance dialog was vanishing too quickly as the determination as to whether there was still a p2p invite pending was not updated when the calling code was updated. The calling code initially was changed to look into vivox state which isn't really valid. that was changed in the 'trunk' to another mechanism, but that still assumed visibility into the voice code. I fixed that by creating an API call to ask whether a call was pending. CR: Karina --- indra/newview/llimview.cpp | 8 ++------ indra/newview/llvoiceclient.cpp | 12 ++++++++++++ indra/newview/llvoiceclient.h | 4 +++- indra/newview/llvoicevivox.cpp | 13 ++++++++----- indra/newview/llvoicevivox.h | 1 + 5 files changed, 26 insertions(+), 12 deletions(-) (limited to 'indra/newview/llimview.cpp') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index cf83d02b09..247f5b879a 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1847,12 +1847,8 @@ LLCallDialog(payload) void LLIncomingCallDialog::onLifetimeExpired() { - // check whether a call is valid or not - LLVoiceChannel* channelp = LLVoiceChannel::getChannelByID(mPayload["session_id"].asUUID()); - if(channelp && - (channelp->getState() != LLVoiceChannel::STATE_NO_CHANNEL_INFO) && - (channelp->getState() != LLVoiceChannel::STATE_ERROR) && - (channelp->getState() != LLVoiceChannel::STATE_HUNG_UP)) + std::string session_handle = mPayload["session_handle"].asString(); + if (LLVoiceClient::getInstance()->invitePending(session_handle)) { // restart notification's timer if call is still valid mLifetimeTimer.start(); diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index e067754e3e..35753178f7 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -385,6 +385,18 @@ void LLVoiceClient::callUser(const LLUUID &uuid) if (mVoiceModule) mVoiceModule->callUser(uuid); } +bool LLVoiceClient::invitePending(std::string &channelHandle) +{ + if (mVoiceModule) + { + return mVoiceModule->invitePending(channelHandle); + } + else + { + return false; + } +} + bool LLVoiceClient::answerInvite(std::string &channelHandle) { if (mVoiceModule) diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index f1a7d3dbec..d4b4f07651 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -176,6 +176,7 @@ public: //@{ // start a voice channel with the specified user virtual void callUser(const LLUUID &uuid)=0; + virtual bool invitePending(std::string& channelHandle)=0; virtual bool answerInvite(std::string &channelHandle)=0; virtual void declineInvite(std::string &channelHandle)=0; //@} @@ -324,7 +325,8 @@ static const F32 OVERDRIVEN_POWER_LEVEL; // NOTE that it will return an empty string if it's in the process of joining a channel. std::string getCurrentChannel(); // start a voice channel with the specified user - void callUser(const LLUUID &uuid); + void callUser(const LLUUID &uuid); + bool invitePending(std::string& channelHandle); bool answerInvite(std::string &channelHandle); void declineInvite(std::string &channelHandle); void leaveChannel(void); // call this on logout or teleport begin diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index f65b87c55b..9d74e7c7ac 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -4582,7 +4582,11 @@ void LLVivoxVoiceClient::endUserIMSession(const LLUUID &uuid) LL_DEBUGS("Voice") << "Session not found for participant ID " << uuid << LL_ENDL; } } - +bool LLVivoxVoiceClient::invitePending(std::string &sessionHandle) +{ + return(findSession(sessionHandle) != NULL); + +} bool LLVivoxVoiceClient::answerInvite(std::string &sessionHandle) { // this is only ever used to answer incoming p2p call invites. @@ -6217,12 +6221,10 @@ void LLVivoxVoiceClient::avatarNameResolved(const LLUUID &id, const std::string { mFriendsListDirty = true; } - // Iterate over all sessions. for(sessionIterator iter = sessionsBegin(); iter != sessionsEnd(); iter++) { sessionState *session = *iter; - // Check for this user as a participant in this session participantState *participant = session->findParticipantByID(id); if(participant) @@ -6249,13 +6251,14 @@ void LLVivoxVoiceClient::avatarNameResolved(const LLUUID &id, const std::string session->mVoiceInvitePending = false; gIMMgr->inviteToSession( - LLIMMgr::computeSessionID(IM_SESSION_P2P_INVITE, session->mCallerID), + session->mIMSessionID, session->mName, session->mCallerID, session->mName, IM_SESSION_P2P_INVITE, LLIMMgr::INVITATION_TYPE_VOICE, - session->mHandle); + session->mHandle, + session->mSIPURI); } } diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index 10577254e8..39759a399a 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -166,6 +166,7 @@ public: //@{ // start a voice channel with the specified user virtual void callUser(const LLUUID &uuid); + virtual bool invitePending(std::string &channelHandle); virtual bool answerInvite(std::string &channelHandle); virtual void declineInvite(std::string &channelHandle); //@} -- cgit v1.3 From 6823879c1ad2260e553bc6a641975ca478848f3b Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Mon, 19 Apr 2010 12:52:43 -0700 Subject: CR Changes from Aimee --- indra/newview/llimview.cpp | 2 +- indra/newview/llvoiceclient.cpp | 4 ++-- indra/newview/llvoiceclient.h | 4 ++-- indra/newview/llvoicevivox.cpp | 2 +- indra/newview/llvoicevivox.h | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/newview/llimview.cpp') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 247f5b879a..109090a75a 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1848,7 +1848,7 @@ LLCallDialog(payload) void LLIncomingCallDialog::onLifetimeExpired() { std::string session_handle = mPayload["session_handle"].asString(); - if (LLVoiceClient::getInstance()->invitePending(session_handle)) + if (LLVoiceClient::getInstance()->isValidChannel(session_handle)) { // restart notification's timer if call is still valid mLifetimeTimer.start(); diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 35753178f7..9b311bbb81 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -385,11 +385,11 @@ void LLVoiceClient::callUser(const LLUUID &uuid) if (mVoiceModule) mVoiceModule->callUser(uuid); } -bool LLVoiceClient::invitePending(std::string &channelHandle) +bool LLVoiceClient::isValidChannel(std::string &session_handle) { if (mVoiceModule) { - return mVoiceModule->invitePending(channelHandle); + return mVoiceModule->isValidChannel(session_handle); } else { diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index d4b4f07651..7427ea323f 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -176,7 +176,7 @@ public: //@{ // start a voice channel with the specified user virtual void callUser(const LLUUID &uuid)=0; - virtual bool invitePending(std::string& channelHandle)=0; + virtual bool isValidChannel(std::string& channelHandle)=0; virtual bool answerInvite(std::string &channelHandle)=0; virtual void declineInvite(std::string &channelHandle)=0; //@} @@ -326,7 +326,7 @@ static const F32 OVERDRIVEN_POWER_LEVEL; std::string getCurrentChannel(); // start a voice channel with the specified user void callUser(const LLUUID &uuid); - bool invitePending(std::string& channelHandle); + bool isValidChannel(std::string& channelHandle); bool answerInvite(std::string &channelHandle); void declineInvite(std::string &channelHandle); void leaveChannel(void); // call this on logout or teleport begin diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 9d74e7c7ac..bb657841c4 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -4582,7 +4582,7 @@ void LLVivoxVoiceClient::endUserIMSession(const LLUUID &uuid) LL_DEBUGS("Voice") << "Session not found for participant ID " << uuid << LL_ENDL; } } -bool LLVivoxVoiceClient::invitePending(std::string &sessionHandle) +bool LLVivoxVoiceClient::isValidChannel(std::string &sessionHandle) { return(findSession(sessionHandle) != NULL); diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index 39759a399a..9f6c6232fd 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -166,7 +166,7 @@ public: //@{ // start a voice channel with the specified user virtual void callUser(const LLUUID &uuid); - virtual bool invitePending(std::string &channelHandle); + virtual bool isValidChannel(std::string &channelHandle); virtual bool answerInvite(std::string &channelHandle); virtual void declineInvite(std::string &channelHandle); //@} -- cgit v1.3 From 09a58b804bfcc055ce7722bf5aa8a05bfd6ed890 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Wed, 19 May 2010 01:20:39 +0300 Subject: EXT-7158 FIXED Moved lltextutil from newview to llui library. Reviewed by Richard Nelson and Mike Antipov at https://codereview.productengine.com/secondlife/r/363/ --HG-- branch : product-engine --- indra/llui/CMakeLists.txt | 4 +- indra/llui/llaccordionctrltab.cpp | 2 +- indra/llui/lltextutil.cpp | 79 ++++++++++++++++++++++++++++++++ indra/llui/lltextutil.h | 72 +++++++++++++++++++++++++++++ indra/newview/CMakeLists.txt | 2 - indra/newview/llavatarlist.cpp | 8 ++-- indra/newview/llavatarlistitem.cpp | 2 +- indra/newview/llgrouplist.cpp | 2 +- indra/newview/llimview.cpp | 2 +- indra/newview/llinventoryitemslist.cpp | 2 +- indra/newview/llpanelteleporthistory.cpp | 2 +- 11 files changed, 164 insertions(+), 13 deletions(-) create mode 100644 indra/llui/lltextutil.cpp create mode 100644 indra/llui/lltextutil.h (limited to 'indra/newview/llimview.cpp') diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index 88a1652671..12df9ccae4 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -91,6 +91,7 @@ set(llui_SOURCE_FILES lltextbox.cpp lltexteditor.cpp lltextparser.cpp + lltextutil.cpp lltextvalidate.cpp lltransutil.cpp lltoggleablemenu.cpp @@ -101,7 +102,6 @@ set(llui_SOURCE_FILES lluictrlfactory.cpp lluiimage.cpp lluistring.cpp - lluitextutil.cpp llundo.cpp llurlaction.cpp llurlentry.cpp @@ -186,6 +186,7 @@ set(llui_HEADER_FILES lltextbox.h lltexteditor.h lltextparser.h + lltextutil.h lltextvalidate.h lltoggleablemenu.h lltooltip.h @@ -198,7 +199,6 @@ set(llui_HEADER_FILES llui.h lluiimage.h lluistring.h - lluitextutil.h llundo.h llurlaction.h llurlentry.h diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp index 0db2dca615..b09c108ec3 100644 --- a/indra/llui/llaccordionctrltab.cpp +++ b/indra/llui/llaccordionctrltab.cpp @@ -37,8 +37,8 @@ #include "lllocalcliprect.h" #include "llscrollbar.h" #include "lltextbox.h" +#include "lltextutil.h" #include "lluictrl.h" -#include "lluitextutil.h" static const std::string DD_BUTTON_NAME = "dd_button"; static const std::string DD_TEXTBOX_NAME = "dd_textbox"; diff --git a/indra/llui/lltextutil.cpp b/indra/llui/lltextutil.cpp new file mode 100644 index 0000000000..c5f3929fb1 --- /dev/null +++ b/indra/llui/lltextutil.cpp @@ -0,0 +1,79 @@ +/** + * @file lltextutil.cpp + * @brief Misc text-related auxiliary methods + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "lltextutil.h" + +#include "lluicolor.h" +#include "lltextbox.h" + + +void LLTextUtil::textboxSetHighlightedVal(LLTextBox *txtbox, const LLStyle::Params& normal_style, const std::string& text, const std::string& hl) +{ + static LLUIColor sFilterTextColor = LLUIColorTable::instance().getColor("FilterTextColor", LLColor4::green); + + std::string text_uc = text; + LLStringUtil::toUpper(text_uc); + + size_t hl_begin = 0, hl_len = hl.size(); + + if (hl_len == 0 || (hl_begin = text_uc.find(hl)) == std::string::npos) + { + txtbox->setText(text, normal_style); + return; + } + + LLStyle::Params hl_style = normal_style; + hl_style.color = sFilterTextColor; + + txtbox->setText(LLStringUtil::null); // clear text + txtbox->appendText(text.substr(0, hl_begin), false, normal_style); + txtbox->appendText(text.substr(hl_begin, hl_len), false, hl_style); + txtbox->appendText(text.substr(hl_begin + hl_len), false, normal_style); +} + +const std::string& LLTextUtil::formatPhoneNumber(const std::string& phone_str) +{ + static const std::string PHONE_SEPARATOR = LLUI::sSettingGroups["config"]->getString("AvalinePhoneSeparator"); + static const S32 PHONE_PART_LEN = 2; + + static std::string formatted_phone_str; + formatted_phone_str = phone_str; + S32 separator_pos = (S32)(formatted_phone_str.size()) - PHONE_PART_LEN; + for (; separator_pos >= PHONE_PART_LEN; separator_pos -= PHONE_PART_LEN) + { + formatted_phone_str.insert(separator_pos, PHONE_SEPARATOR); + } + + return formatted_phone_str; +} + +// EOF diff --git a/indra/llui/lltextutil.h b/indra/llui/lltextutil.h new file mode 100644 index 0000000000..325c3c5b7c --- /dev/null +++ b/indra/llui/lltextutil.h @@ -0,0 +1,72 @@ +/** + * @file lltextutil.h + * @brief Misc text-related auxiliary methods + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLTEXTUTIL_H +#define LL_LLTEXTUTIL_H + +#include "llstyle.h" + +class LLTextBox; + +namespace LLTextUtil +{ + + /** + * Set value for text box, highlighting substring hl_uc. + * + * Used to highlight filter matches. + * + * @param txtbox Text box to set value for + * @param normal_style Style to use for non-highlighted text + * @param text Text to set + * @param hl Upper-cased string to highlight + */ + void textboxSetHighlightedVal( + LLTextBox *txtbox, + const LLStyle::Params& normal_style, + const std::string& text, + const std::string& hl); + + /** + * Formats passed phone number to be more human readable. + * + * It just divides the number on parts by two digits from right to left. The first left part + * can have 2 or 3 digits, i.e. +44-33-33-44-55-66 or 12-34-56-78-90. Separator is set in + * application settings (AvalinePhoneSeparator) + * + * @param[in] phone_str string with original phone number + * @return reference to string with formatted phone number + */ + const std::string& formatPhoneNumber(const std::string& phone_str); +} + +#endif // LL_LLTEXTUTIL_H diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index f2bed843c9..d77d53f6af 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -421,7 +421,6 @@ set(viewer_SOURCE_FILES lltexturestats.cpp lltexturestatsuploader.cpp lltextureview.cpp - lltextutil.cpp lltoast.cpp lltoastalertpanel.cpp lltoastgroupnotifypanel.cpp @@ -935,7 +934,6 @@ set(viewer_HEADER_FILES lltexturestats.h lltexturestatsuploader.h lltextureview.h - lltextutil.h lltoast.h lltoastalertpanel.h lltoastgroupnotifypanel.h diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 72ee289c91..24290ac089 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -32,19 +32,21 @@ #include "llviewerprecompiledheaders.h" +#include "llavatarlist.h" + // common #include "lltrans.h" #include "llcommonutils.h" -#include "llavatarlist.h" -#include "llagentdata.h" // for comparator +// llui +#include "lltextutil.h" // newview +#include "llagentdata.h" // for comparator #include "llavatariconctrl.h" #include "llcallingcard.h" // for LLAvatarTracker #include "llcachename.h" #include "llrecentpeople.h" -#include "lltextutil.h" #include "lluuid.h" #include "llvoiceclient.h" #include "llviewercontrol.h" // for gSavedSettings diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 656274cb7a..5a8ad73c83 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -38,7 +38,7 @@ #include "llbutton.h" #include "llfloaterreg.h" -#include "lluitextutil.h" +#include "lltextutil.h" #include "llagent.h" #include "llavatariconctrl.h" diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index 3224ac6d9b..da5196df45 100644 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -39,8 +39,8 @@ #include "lliconctrl.h" #include "llmenugl.h" #include "lltextbox.h" +#include "lltextutil.h" #include "lltrans.h" -#include "lluitextutil.h" // newview #include "llagent.h" diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index c143ac9dea..039df69454 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -43,6 +43,7 @@ #include "llhttpclient.h" #include "llsdutil_math.h" #include "llstring.h" +#include "lltextutil.h" #include "lltrans.h" #include "lluictrlfactory.h" @@ -65,7 +66,6 @@ #include "llnearbychat.h" #include "llspeakers.h" //for LLIMSpeakerMgr #include "lltextbox.h" -#include "lltextutil.h" #include "llviewercontrol.h" #include "llviewerparcelmgr.h" diff --git a/indra/newview/llinventoryitemslist.cpp b/indra/newview/llinventoryitemslist.cpp index 9b592e79af..f94515d242 100644 --- a/indra/newview/llinventoryitemslist.cpp +++ b/indra/newview/llinventoryitemslist.cpp @@ -42,7 +42,7 @@ // llui #include "lliconctrl.h" -#include "lluitextutil.h" +#include "lltextutil.h" #include "llcallbacklist.h" #include "llinventoryfunctions.h" diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 4dd03e04a9..e8b6c6bfe5 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -38,7 +38,7 @@ #include "llsidetray.h" #include "llworldmap.h" #include "llteleporthistorystorage.h" -#include "lluitextutil.h" +#include "lltextutil.h" #include "llaccordionctrl.h" #include "llaccordionctrltab.h" -- cgit v1.3 From a1b973fc2a5d28e64dcf010e3652beda78745d35 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Fri, 28 May 2010 00:03:08 +0300 Subject: EXT-7118 FIXED Changed text in group call invite. - Changed group invite string from "has joined a Voice Chat call with the group [GROUP]" to "just joined '[GROUP]' voice channel." - Added special string for group invite question saying "Would you like to leave [CURRENT_CHAT] and join the call with '[GROUP]'"? - Hooked up this string in code. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/458/ --HG-- branch : product-engine --- indra/newview/llimview.cpp | 17 +++++++++++++++-- .../skins/default/xui/en/floater_incoming_call.xml | 10 +++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) (limited to 'indra/newview/llimview.cpp') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 039df69454..2c1983b6d2 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1941,15 +1941,24 @@ void LLIncomingCallDialog::onOpen(const LLSD& key) { LLCallDialog::onOpen(key); + LLStringUtil::format_map_t args; + LLGroupData data; + // if it's a group call, retrieve group name to use it in question + if (gAgent.getGroupData(key["session_id"].asUUID(), data)) + { + args["[GROUP]"] = data.mName; + } // 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()); + args["[CURRENT_CHAT]"] = voice->getSessionName(); + childSetText("question", getString(key["question_type"].asString(), args)); } else { - childSetTextArg("question", "[CURRENT_CHAT]", getString("localchat")); + args["[CURRENT_CHAT]"] = getString("localchat"); + childSetText("question", getString(key["question_type"].asString(), args)); } } @@ -2480,6 +2489,8 @@ void LLIMMgr::inviteToSession( } std::string notify_box_type; + // voice invite question is different from default only for group call (EXT-7118) + std::string question_type = "VoiceInviteQuestionDefault"; BOOL ad_hoc_invite = FALSE; if(type == IM_SESSION_P2P_INVITE) @@ -2491,6 +2502,7 @@ void LLIMMgr::inviteToSession( { //only really old school groups have voice invitations notify_box_type = "VoiceInviteGroup"; + question_type = "VoiceInviteQuestionGroup"; } else if ( inv_type == INVITATION_TYPE_VOICE ) { @@ -2515,6 +2527,7 @@ void LLIMMgr::inviteToSession( payload["session_handle"] = session_handle; payload["session_uri"] = session_uri; payload["notify_box_type"] = notify_box_type; + payload["question_type"] = question_type; LLVoiceChannel* channelp = LLVoiceChannel::getChannelByID(session_id); if (channelp && channelp->callStarted()) 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 1d67123726..24fff6d4ae 100644 --- a/indra/newview/skins/default/xui/en/floater_incoming_call.xml +++ b/indra/newview/skins/default/xui/en/floater_incoming_call.xml @@ -32,7 +32,15 @@ - has joined a Voice Chat call with the group [GROUP]. + just joined '[GROUP]' voice channel. + + + Would you like to leave [CURRENT_CHAT] and join the call with '[GROUP]'? + + + Do you want to leave [CURRENT_CHAT] and join this voice chat?