From 73a53aa64328f1b48fa09286120609b7297985e3 Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 17 May 2010 09:13:46 -0700 Subject: DEV-50013 Rename "SLID" to "Username" at Product's request --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/skins/default/xui/en/panel_login.xml | 2 +- indra/newview/skins/default/xui/en/panel_preferences_general.xml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index f8ad1c2dac..6a68f72bb5 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7340,7 +7340,7 @@ NameTagShowSLIDs Comment - Show Second Life IDs in name labels + Show usernames in avatar name tags Persist 1 Type diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index 21846f6e87..88c264c649 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -60,7 +60,7 @@ name="username_text" top="20" left="20" width="150"> -Second Life ID or Name: +Username: Date: Mon, 17 May 2010 15:01:52 -0700 Subject: DEV-50013 Display name for inbound voice calls --- indra/newview/llimview.cpp | 15 +++++++++++++-- indra/newview/llvoicechannel.h | 3 +++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 356f194c81..23ad308a82 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1746,8 +1746,19 @@ void LLOutgoingCallDialog::show(const LLSD& key) setTitle(callee_name); LLSD callee_id = mPayload["other_user_id"]; - childSetTextArg("calling", "[CALLEE_NAME]", callee_name); - childSetTextArg("connecting", "[CALLEE_NAME]", callee_name); + // Beautification: Since SLID is in the title bar, and you probably + // recognize this person's voice, just show display name + std::string final_callee_name = callee_name; + if (is_avatar) + { + LLAvatarName av_name; + if (LLAvatarNameCache::get(callee_id, &av_name)) + { + final_callee_name = av_name.mDisplayName; + } + } + childSetTextArg("calling", "[CALLEE_NAME]", final_callee_name); + childSetTextArg("connecting", "[CALLEE_NAME]", final_callee_name); // for outgoing group calls callee_id == group id == session id setIcon(callee_id, callee_id); diff --git a/indra/newview/llvoicechannel.h b/indra/newview/llvoicechannel.h index 573fab1f4f..1784ceaa12 100644 --- a/indra/newview/llvoicechannel.h +++ b/indra/newview/llvoicechannel.h @@ -82,6 +82,9 @@ public: virtual void getChannelInfo(); virtual BOOL isActive(); virtual BOOL callStarted(); + + // Session name is a UI label used for feedback about which person, + // group, or phone number you are talking to const std::string& getSessionName() const { return mSessionName; } boost::signals2::connection setStateChangedCallback(const state_changed_signal_t::slot_type& callback) -- cgit v1.2.3 From 40adb9599cd7eac1fd8062e4629a0e8b8c031638 Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 17 May 2010 15:44:29 -0700 Subject: DEV-50013 New documentation URL for display names changes --- indra/newview/skins/default/xui/en/notifications.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index b0f5daef14..7839d61299 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -3170,7 +3170,7 @@ Thanks for updating your name! Just like in real life, it takes a while for everyone to learn about a new name. Please allow [HOURS] hours for your name to update in object ownership, scripts, search, etc. -See http://wiki.secondlife.com/wiki/Display_Names for details. +See http://wiki.secondlife.com/wiki/Setting_your_display_name for details. Date: Mon, 17 May 2010 16:33:16 -0700 Subject: DEV-50013 Display name for inbound voice calls (Last commit was actually for outbound). Reviewed with Leyla --- indra/newview/llimview.cpp | 29 +++++++++++++++++----- indra/newview/llimview.h | 9 ++++++- indra/newview/llvoicevivox.cpp | 9 +++++++ .../skins/default/xui/en/floater_incoming_call.xml | 2 +- 4 files changed, 41 insertions(+), 8 deletions(-) diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 23ad308a82..b17dca68f6 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1915,21 +1915,21 @@ BOOL LLIncomingCallDialog::postBuild() if (caller_name == "anonymous") { caller_name = getString("anonymous"); + setCallerName(caller_name, caller_name, call_type); } else if (!is_avatar) { caller_name = LLTextUtil::formatPhoneNumber(caller_name); + setCallerName(caller_name, caller_name, call_type); } else { - // IDEVO - caller_name = LLCacheName::cleanFullName(caller_name); + // Get the full name information + LLAvatarNameCache::get(caller_id, + boost::bind(&LLIncomingCallDialog::onAvatarNameCache, + this, _1, _2, call_type)); } - setTitle(caller_name + " " + call_type); - - LLUICtrl* caller_name_widget = getChild("caller name"); - caller_name_widget->setValue(caller_name + " " + call_type); setIcon(session_id, caller_id); childSetAction("Accept", onAccept, this); @@ -1953,6 +1953,23 @@ BOOL LLIncomingCallDialog::postBuild() return TRUE; } +void LLIncomingCallDialog::setCallerName(const std::string& ui_title, + const std::string& ui_label, + const std::string& call_type) +{ + setTitle(ui_title + " " + call_type); + + LLUICtrl* caller_name_widget = getChild("caller name"); + caller_name_widget->setValue(ui_label + " " + call_type); +} + +void LLIncomingCallDialog::onAvatarNameCache(const LLUUID& agent_id, + const LLAvatarName& av_name, + const std::string& call_type) +{ + std::string title = av_name.getNameAndSLID(); + setCallerName(title, av_name.mDisplayName, call_type); +} void LLIncomingCallDialog::onOpen(const LLSD& key) { diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 758ea667ef..c132ac328f 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -41,7 +41,7 @@ #include "llvoicechannel.h" - +class LLAvatarName; class LLFriendObserver; class LLCallDialogManager; class LLIMSpeakerMgr; @@ -540,6 +540,13 @@ public: static void onStartIM(void* user_data); private: + void setCallerName(const std::string& ui_title, + const std::string& ui_label, + const std::string& call_type); + void onAvatarNameCache(const LLUUID& agent_id, + const LLAvatarName& av_name, + const std::string& call_type); + /*virtual*/ void onLifetimeExpired(); void processCallResponse(S32 response); }; diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index a457bd1fe6..4a0b0f12a4 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -37,6 +37,8 @@ #include "llsdutil.h" +// Linden library includes +#include "llavatarnamecache.h" #include "llvoavatarself.h" #include "llbufferstream.h" #include "llfile.h" @@ -52,6 +54,8 @@ #include "llviewercontrol.h" #include "llkeyboard.h" #include "llappviewer.h" // for gDisconnected, gDisableVoice + +// Viewer includes #include "llmutelist.h" // to check for muted avatars #include "llagent.h" #include "llcachename.h" @@ -6178,6 +6182,11 @@ void LLVivoxVoiceClient::lookupName(const LLUUID &id) { BOOL is_group = FALSE; gCacheName->get(id, is_group, &LLVivoxVoiceClient::onAvatarNameLookup); + + // Peformance boost: We're going to need the display name later when + // we show the call request floater, so get the request going now + LLAvatarName unused; + LLAvatarNameCache::get(id, &unused); } //static 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..420ba172e8 100644 --- a/indra/newview/skins/default/xui/en/floater_incoming_call.xml +++ b/indra/newview/skins/default/xui/en/floater_incoming_call.xml @@ -8,7 +8,7 @@ layout="topleft" name="incoming call" help_topic="incoming_call" - title="UNKNOWN PERSON IS CALLING" + title="Incoming call" width="410"> -- cgit v1.2.3 From f4148502e484d516b42c4a88603eee6889d45697 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 18 May 2010 16:00:45 -0700 Subject: Rename mSLID to mUsername to match the name of the field in the UI Product made a late-breaking request to change the name of this field. The wire protocol for People API has not yet changed. --- indra/llcommon/llavatarname.cpp | 16 +++++++++------- indra/llcommon/llavatarname.h | 2 +- indra/llmessage/llavatarnamecache.cpp | 8 ++++---- indra/llui/llurlentry.cpp | 8 ++++---- indra/newview/llavatarlistitem.cpp | 2 +- indra/newview/llchathistory.cpp | 4 ++-- indra/newview/llimview.cpp | 2 +- indra/newview/llinspectavatar.cpp | 2 +- indra/newview/llinventorybridge.cpp | 2 +- indra/newview/llpanelme.cpp | 2 +- indra/newview/llpanelprofileview.cpp | 2 +- indra/newview/lltoolpie.cpp | 2 +- indra/newview/llviewerdisplayname.cpp | 2 +- indra/newview/llvoavatar.cpp | 2 +- 14 files changed, 29 insertions(+), 27 deletions(-) diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp index 7415acadd4..de51a7f2aa 100644 --- a/indra/llcommon/llavatarname.cpp +++ b/indra/llcommon/llavatarname.cpp @@ -46,7 +46,7 @@ static const std::string IS_DISPLAY_NAME_DEFAULT("is_display_name_default"); static const std::string DISPLAY_NAME_EXPIRES("display_name_expires"); LLAvatarName::LLAvatarName() -: mSLID(), +: mUsername(), mDisplayName(), mIsDisplayNameDefault(false), mIsDummy(false), @@ -55,16 +55,18 @@ LLAvatarName::LLAvatarName() bool LLAvatarName::operator<(const LLAvatarName& rhs) const { - if (mSLID == rhs.mSLID) + if (mUsername == rhs.mUsername) return mDisplayName < rhs.mDisplayName; else - return mSLID < rhs.mSLID; + return mUsername < rhs.mUsername; } LLSD LLAvatarName::asLLSD() const { LLSD sd; - sd[SL_ID] = mSLID; + // Due to a late-breaking change request from Product, we renamed + // "SLID" to "Username", but it was too late to change the wire format. + sd[SL_ID] = mUsername; sd[DISPLAY_NAME] = mDisplayName; sd[IS_DISPLAY_NAME_DEFAULT] = mIsDisplayNameDefault; sd[DISPLAY_NAME_EXPIRES] = LLDate(mExpires); @@ -73,7 +75,7 @@ LLSD LLAvatarName::asLLSD() const void LLAvatarName::fromLLSD(const LLSD& sd) { - mSLID = sd[SL_ID].asString(); + mUsername = sd[SL_ID].asString(); // see asLLSD() above mDisplayName = sd[DISPLAY_NAME].asString(); mIsDisplayNameDefault = sd[IS_DISPLAY_NAME_DEFAULT].asBoolean(); LLDate expires = sd[DISPLAY_NAME_EXPIRES]; @@ -83,9 +85,9 @@ void LLAvatarName::fromLLSD(const LLSD& sd) std::string LLAvatarName::getNameAndSLID() const { std::string name; - if (!mSLID.empty()) + if (!mUsername.empty()) { - name = mDisplayName + " (" + mSLID + ")"; + name = mDisplayName + " (" + mUsername + ")"; } else { diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h index 87750210c6..39071ec4c7 100644 --- a/indra/llcommon/llavatarname.h +++ b/indra/llcommon/llavatarname.h @@ -54,7 +54,7 @@ public: std::string getNameAndSLID() const; // "bobsmith123" or "james.linden", US-ASCII only - std::string mSLID; + std::string mUsername; // "Jose' Sanchez" or "James Linden", UTF-8 encoded Unicode // Contains data whether or not user has explicitly set diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index 2fc92ff36f..4b41c7e5b1 100644 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -208,7 +208,7 @@ public: // Some avatars don't have explicit display names set if (av_name.mDisplayName.empty()) { - av_name.mDisplayName = av_name.mSLID; + av_name.mDisplayName = av_name.mUsername; } // cache it and fire signals @@ -221,7 +221,7 @@ public: { const std::string DUMMY_NAME("\?\?\?"); LLAvatarName av_name; - av_name.mSLID = DUMMY_NAME; + av_name.mUsername = DUMMY_NAME; av_name.mDisplayName = DUMMY_NAME; av_name.mIsDisplayNameDefault = false; av_name.mIsDummy = true; @@ -247,7 +247,7 @@ public: // *NOTE: "??" starts trigraphs in C/C++, escape the question marks. const std::string DUMMY_NAME("\?\?\?"); LLAvatarName av_name; - av_name.mSLID = DUMMY_NAME; + av_name.mUsername = DUMMY_NAME; av_name.mDisplayName = DUMMY_NAME; av_name.mIsDisplayNameDefault = false; av_name.mIsDummy = true; @@ -561,7 +561,7 @@ void LLAvatarNameCache::buildLegacyName(const std::string& full_name, LLAvatarName* av_name) { llassert(av_name); - av_name->mSLID = ""; + av_name->mUsername = ""; av_name->mDisplayName = full_name; av_name->mIsDisplayNameDefault = true; av_name->mIsDummy = true; diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index d3c866a854..aeb02aef1c 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -353,9 +353,9 @@ void LLUrlEntryAgent::onAvatarNameCache(const LLUUID& id, const LLAvatarName& av_name) { std::string label = av_name.mDisplayName; - if (!av_name.mSLID.empty()) + if (!av_name.mUsername.empty()) { - label += " (" + av_name.mSLID + ")"; + label += " (" + av_name.mUsername + ")"; } // received the agent name from the server - tell our observers callObservers(id.asString(), label, mIcon); @@ -418,9 +418,9 @@ std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCa if (LLAvatarNameCache::get(agent_id, &av_name)) { std::string label = av_name.mDisplayName; - if (!av_name.mSLID.empty()) + if (!av_name.mUsername.empty()) { - label += " (" + av_name.mSLID + ")"; + label += " (" + av_name.mUsername + ")"; } // handle suffixes like /mute or /offerteleport label = localize_slapp_label(url, label); diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index c458930a62..a59ad306d7 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -340,7 +340,7 @@ void LLAvatarListItem::setNameInternal(const std::string& name, const std::strin void LLAvatarListItem::onAvatarNameCache(const LLAvatarName& av_name) { setName(av_name.mDisplayName); - mAvatarName->setToolTip(av_name.mSLID); + mAvatarName->setToolTip(av_name.mUsername); //requesting the list to resort notifyParent(LLSD().with("sort", LLSD())); diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 5bf3d7b913..6d98afbc58 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -330,8 +330,8 @@ public: LLTextBox* user_name = getChild("user_name"); user_name->setValue( LLSD(av_name.mDisplayName ) ); - user_name->setToolTip( av_name.mSLID ); - setToolTip( av_name.mSLID ); + user_name->setToolTip( av_name.mUsername ); + setToolTip( av_name.mUsername ); } protected: diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index b17dca68f6..0c88b9f3a1 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -2075,7 +2075,7 @@ void LLIncomingCallDialog::processCallResponse(S32 response) if (LLAvatarNameCache::useDisplayNames() && LLAvatarNameCache::get(caller_id, &av_name)) { - correct_session_name = av_name.mDisplayName + " (" + av_name.mSLID + ")"; + correct_session_name = av_name.mDisplayName + " (" + av_name.mUsername + ")"; } correct_session_name.append(ADHOC_NAME_SUFFIX); } diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 3cbde2bb9c..74bf6e378d 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -642,7 +642,7 @@ void LLInspectAvatar::onAvatarNameCache( if (agent_id == mAvatarID) { getChild("user_name")->setValue(av_name.mDisplayName); - getChild("user_slid")->setValue(av_name.mSLID); + getChild("user_slid")->setValue(av_name.mUsername); } } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 14e5c8b93c..9e3f80e464 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3634,7 +3634,7 @@ void LLCallingCardBridge::performAction(LLInventoryModel* model, std::string act if (LLAvatarNameCache::useDisplayNames() && LLAvatarNameCache::get(item->getCreatorUUID(), &av_name)) { - callingcard_name = av_name.mDisplayName + " (" + av_name.mSLID + ")"; + callingcard_name = av_name.mDisplayName + " (" + av_name.mUsername + ")"; } LLUUID session_id = gIMMgr->addSession(callingcard_name, IM_NOTHING_SPECIAL, item->getCreatorUUID()); if (session_id != LLUUID::null) diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index f38c8859ef..c1d02fae39 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -242,7 +242,7 @@ void LLPanelMyProfileEdit::processProfileProperties(const LLAvatarData* avatar_d void LLPanelMyProfileEdit::onNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) { getChild("user_name")->setValue( av_name.mDisplayName ); - getChild("user_slid")->setValue( av_name.mSLID ); + getChild("user_slid")->setValue( av_name.mUsername ); } BOOL LLPanelMyProfileEdit::postBuild() diff --git a/indra/newview/llpanelprofileview.cpp b/indra/newview/llpanelprofileview.cpp index 1afe2b9d44..d22d8d2718 100644 --- a/indra/newview/llpanelprofileview.cpp +++ b/indra/newview/llpanelprofileview.cpp @@ -207,7 +207,7 @@ void LLPanelProfileView::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) { getChild("user_name")->setValue( av_name.mDisplayName ); - getChild("user_slid")->setValue( av_name.mSLID ); + getChild("user_slid")->setValue( av_name.mUsername ); } // EOF diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 67db778bdb..ebef28fd64 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -881,7 +881,7 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l if (LLAvatarNameCache::useDisplayNames() && LLAvatarNameCache::get(hover_object->getID(), &av_name)) { - final_name = av_name.mDisplayName + " (" + av_name.mSLID + ")"; + final_name = av_name.mDisplayName + " (" + av_name.mUsername + ")"; } else { diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp index ec80129f8a..a783cb03d8 100644 --- a/indra/newview/llviewerdisplayname.cpp +++ b/indra/newview/llviewerdisplayname.cpp @@ -185,7 +185,7 @@ class LLDisplayNameUpdate : public LLHTTPNode { LLSD args; args["OLD_NAME"] = old_display_name; - args["SLID"] = av_name.mSLID; + args["SLID"] = av_name.mUsername; args["NEW_NAME"] = av_name.mDisplayName; LLNotificationsUtil::add("DisplayNameUpdate", args); } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 5e6f294071..e7721d6068 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2880,7 +2880,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) { // JAMESDEBUG HACK LLColor4 slid_color = name_tag_color * 0.83f; - addNameTagLine(av_name.mSLID, slid_color, LLFontGL::NORMAL, + addNameTagLine(av_name.mUsername, slid_color, LLFontGL::NORMAL, LLFontGL::getFontSansSerifSmall()); } } -- cgit v1.2.3 From 09f0758f2fce699659a6ebc63962d4f9493f0098 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 18 May 2010 17:30:54 -0700 Subject: DEV-50177 IM Session window title bar shows SLID for receiving party Reviewed with Leyla --- indra/newview/llimfloater.cpp | 36 ++++++++++++++++++++++++++++++------ indra/newview/llimfloater.h | 7 +++++++ 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index d25aa37e16..804cc75f75 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -38,6 +38,7 @@ #include "llagent.h" #include "llappviewer.h" +#include "llavatarnamecache.h" #include "llbutton.h" #include "llbottomtray.h" #include "llchannelmanager.h" @@ -275,12 +276,6 @@ BOOL LLIMFloater::postBuild() mInputEditor->setReplaceNewlinesWithSpaces( FALSE ); mInputEditor->setPassDelete( TRUE ); - std::string session_name(LLIMModel::instance().getName(mSessionID)); - - mInputEditor->setLabel(LLTrans::getString("IM_to_label") + " " + session_name); - - setTitle(session_name); - childSetCommitCallback("chat_editor", onSendMsg, this); mChatHistory = getChild("chat_history"); @@ -298,6 +293,19 @@ BOOL LLIMFloater::postBuild() mInputEditor->setLabel(LLTrans::getString("IM_unavailable_text_label")); } + if ( im_session && im_session->isP2PSessionType()) + { + // look up display name for window title + LLAvatarNameCache::get(im_session->mOtherParticipantID, + boost::bind(&LLIMFloater::onAvatarNameCache, + this, _1, _2)); + } + else + { + std::string session_name(LLIMModel::instance().getName(mSessionID)); + updateSessionName(session_name, session_name); + } + //*TODO if session is not initialized yet, add some sort of a warning message like "starting session...blablabla" //see LLFloaterIMPanel for how it is done (IB) @@ -311,6 +319,22 @@ BOOL LLIMFloater::postBuild() } } +void LLIMFloater::updateSessionName(const std::string& ui_title, + const std::string& ui_label) +{ + mInputEditor->setLabel(LLTrans::getString("IM_to_label") + " " + ui_label); + setTitle(ui_title); +} + +void LLIMFloater::onAvatarNameCache(const LLUUID& agent_id, + const LLAvatarName& av_name) +{ + // Use display name only for labels, as the extended name will be in the + // floater title + std::string ui_title = av_name.getNameAndSLID(); + updateSessionName(ui_title, av_name.mDisplayName); +} + // virtual void LLIMFloater::draw() { diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h index d63246a5cd..75ff0372ee 100644 --- a/indra/newview/llimfloater.h +++ b/indra/newview/llimfloater.h @@ -38,6 +38,7 @@ #include "lltooldraganddrop.h" #include "lltransientdockablefloater.h" +class LLAvatarName; class LLLineEditor; class LLPanelChatControlPanel; class LLChatHistory; @@ -130,6 +131,12 @@ private: /* virtual */ void onFocusLost(); /* virtual */ void onFocusReceived(); + // Update the window title, input field help text, etc. + void updateSessionName(const std::string& ui_title, const std::string& ui_label); + + // For display name lookups for IM window titles + void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name); + BOOL dropCallingCard(LLInventoryItem* item, BOOL drop); BOOL dropCategory(LLInventoryCategory* category, BOOL drop); -- cgit v1.2.3 From cbc9fcabf945558ef22d35e2957ae9f1c879ef7b Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 19 May 2010 09:38:49 -0700 Subject: DEV-50013 More SLID to Username renames --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llfloaterpreference.cpp | 2 +- indra/newview/llvoavatar.cpp | 10 +++++----- .../newview/skins/default/xui/en/panel_preferences_general.xml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 6a68f72bb5..6e7d851072 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7337,7 +7337,7 @@ Value 1 - NameTagShowSLIDs + NameTagShowUsernames Comment Show usernames in avatar name tags diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index f248fde64a..a7e5eedf5f 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -326,7 +326,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) sSkin = gSavedSettings.getString("SkinCurrent"); - gSavedSettings.getControl("NameTagShowSLIDs")->getCommitSignal()->connect(boost::bind(&handleNameTagOptionChanged, _2)); + gSavedSettings.getControl("NameTagShowUsernames")->getCommitSignal()->connect(boost::bind(&handleNameTagOptionChanged, _2)); gSavedSettings.getControl("UseDisplayNames")->getCommitSignal()->connect(boost::bind(&handleDisplayNamesOptionChanged, _2)); } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index e7721d6068..40e1f31697 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2856,7 +2856,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) } static LLUICachedControl show_display_names("NameTagShowDisplayNames"); - static LLUICachedControl show_slids("NameTagShowSLIDs"); + static LLUICachedControl show_usernames("NameTagShowUsernames"); if (LLAvatarNameCache::useDisplayNames()) { @@ -2876,11 +2876,11 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) LLFontGL::getFontSansSerif()); } // Suppress SLID display if display name matches exactly (ugh) - if (show_slids && !av_name.mIsDisplayNameDefault) + if (show_usernames && !av_name.mIsDisplayNameDefault) { - // JAMESDEBUG HACK - LLColor4 slid_color = name_tag_color * 0.83f; - addNameTagLine(av_name.mUsername, slid_color, LLFontGL::NORMAL, + // *HACK: Desaturate the color + LLColor4 username_color = name_tag_color * 0.83f; + addNameTagLine(av_name.mUsername, username_color, LLFontGL::NORMAL, LLFontGL::getFontSansSerifSmall()); } } diff --git a/indra/newview/skins/default/xui/en/panel_preferences_general.xml b/indra/newview/skins/default/xui/en/panel_preferences_general.xml index b09ac4d0fa..5f50b962ee 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_general.xml @@ -287,7 +287,7 @@ top_pad="5" /> --> Date: Wed, 19 May 2010 10:25:52 -0700 Subject: Remove colors for match/mismatch/friends from name tags Product team request. Reviewed with Leyla --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llvoavatar.cpp | 5 +++-- indra/newview/skins/default/colors.xml | 2 +- .../skins/default/xui/en/panel_preferences_general.xml | 11 ++++++++++- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 6e7d851072..acd3c10ec6 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7337,6 +7337,17 @@ Value 1 + NameTagShowFriends + + Comment + Highlight the name tags of your friends + Persist + 1 + Type + Boolean + Value + 0 + NameTagShowUsernames Comment diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 40e1f31697..a9250991f6 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3072,14 +3072,15 @@ void LLVOAvatar::idleUpdateNameTagAlpha(BOOL new_name, F32 alpha) LLColor4 LLVOAvatar::getNameTagColor(bool is_friend) { + static LLUICachedControl show_friends("NameTagShowFriends"); const char* color_name; - if (is_friend) + if (show_friends && is_friend) { color_name = "NameTagFriend"; } else if (LLAvatarNameCache::useDisplayNames()) { - // ...color based on whether SLID "matches" a computed display + // ...color based on whether username "matches" a computed display // name LLAvatarName av_name; if (LLAvatarNameCache::get(getID(), &av_name) diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index bb43de6ada..bfa57892a7 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -550,7 +550,7 @@ reference="White" /> + reference="White" /> diff --git a/indra/newview/skins/default/xui/en/panel_preferences_general.xml b/indra/newview/skins/default/xui/en/panel_preferences_general.xml index 5f50b962ee..eabbdc2186 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_general.xml @@ -256,7 +256,16 @@ name="show_my_name_checkbox1" top_pad="4" width="300" /> - + Date: Wed, 19 May 2010 11:23:29 -0700 Subject: DEV-50013 Viewer reads legacy first/last name from People API Useful for voice subsystem and muting subsystem. --- indra/llcommon/llavatarname.cpp | 18 ++++++++++++++++++ indra/llcommon/llavatarname.h | 19 ++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp index de51a7f2aa..e30f353a6c 100644 --- a/indra/llcommon/llavatarname.cpp +++ b/indra/llcommon/llavatarname.cpp @@ -42,12 +42,16 @@ // LLSD map lookups static const std::string SL_ID("sl_id"); static const std::string DISPLAY_NAME("display_name"); +static const std::string LEGACY_FIRST_NAME("legacy_first_name"); +static const std::string LEGACY_LAST_NAME("legacy_last_name"); static const std::string IS_DISPLAY_NAME_DEFAULT("is_display_name_default"); static const std::string DISPLAY_NAME_EXPIRES("display_name_expires"); LLAvatarName::LLAvatarName() : mUsername(), mDisplayName(), + mLegacyFirstName(), + mLegacyLastName(), mIsDisplayNameDefault(false), mIsDummy(false), mExpires(F64_MAX) @@ -68,6 +72,8 @@ LLSD LLAvatarName::asLLSD() const // "SLID" to "Username", but it was too late to change the wire format. sd[SL_ID] = mUsername; sd[DISPLAY_NAME] = mDisplayName; + sd[LEGACY_FIRST_NAME] = mLegacyFirstName; + sd[LEGACY_LAST_NAME] = mLegacyLastName; sd[IS_DISPLAY_NAME_DEFAULT] = mIsDisplayNameDefault; sd[DISPLAY_NAME_EXPIRES] = LLDate(mExpires); return sd; @@ -77,6 +83,8 @@ void LLAvatarName::fromLLSD(const LLSD& sd) { mUsername = sd[SL_ID].asString(); // see asLLSD() above mDisplayName = sd[DISPLAY_NAME].asString(); + mLegacyFirstName = sd[LEGACY_FIRST_NAME].asString(); + mLegacyLastName = sd[LEGACY_LAST_NAME].asString(); mIsDisplayNameDefault = sd[IS_DISPLAY_NAME_DEFAULT].asBoolean(); LLDate expires = sd[DISPLAY_NAME_EXPIRES]; mExpires = expires.secondsSinceEpoch(); @@ -96,3 +104,13 @@ std::string LLAvatarName::getNameAndSLID() const } return name; } + +std::string LLAvatarName::getLegacyName() const +{ + std::string name; + name.reserve( mLegacyFirstName.size() + 1 + mLegacyLastName.size() ); + name = mLegacyFirstName; + name += " "; + name += mLegacyLastName; + return name; +} diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h index 39071ec4c7..fb5cb277a2 100644 --- a/indra/llcommon/llavatarname.h +++ b/indra/llcommon/llavatarname.h @@ -53,14 +53,31 @@ public: // When display names are disabled returns just "James Linden" std::string getNameAndSLID() const; + // Returns "James Linden" or "bobsmith123 Resident" for backwards + // compatibility with systems like voice and muting + // *TODO: Eliminate this in favor of username only + std::string getLegacyName() const; + // "bobsmith123" or "james.linden", US-ASCII only std::string mUsername; // "Jose' Sanchez" or "James Linden", UTF-8 encoded Unicode // Contains data whether or not user has explicitly set - // a display name; may duplicate their SLID. + // a display name; may duplicate their username. std::string mDisplayName; + // For "James Linden", "James" + // For "bobsmith123", "bobsmith123" + // Used to communicate with legacy systems like voice and muting which + // rely on old-style names. + // *TODO: Eliminate this in favor of username only + std::string mLegacyFirstName; + + // For "James Linden", "Linden" + // For "bobsmith123", "Resident" + // see above for rationale + std::string mLegacyLastName; + // If true, both display name and SLID were generated from // a legacy first and last name, like "James Linden (james.linden)" bool mIsDisplayNameDefault; -- cgit v1.2.3