From a6c0e4e71de033c8e6798c867c8526261fc96e66 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 12 Jan 2010 16:32:32 -0800 Subject: Change login screen to single "SLID" input field. Use last name "Resident" if none provided. Reviewed with Huseby --- indra/newview/llpanellogin.cpp | 47 ++++++++++++++++------ indra/newview/skins/default/xui/en/panel_login.xml | 18 +++++---- 2 files changed, 46 insertions(+), 19 deletions(-) diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 87d101b00f..46420ce503 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -213,7 +213,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, } #if !USE_VIEWER_AUTH - childSetPrevalidate("first_name_edit", LLLineEditor::prevalidateASCIIPrintableNoSpace); + //childSetPrevalidate("login_id_edit", LLLineEditor::prevalidateASCIIPrintableNoSpace); childSetPrevalidate("last_name_edit", LLLineEditor::prevalidateASCIIPrintableNoSpace); childSetCommitCallback("password_edit", mungePassword, this); @@ -498,7 +498,7 @@ void LLPanelLogin::giveFocus() if( sInstance ) { // Grab focus and move cursor to first blank input field - std::string first = sInstance->childGetText("first_name_edit"); + std::string first = sInstance->childGetText("login_id_edit"); std::string pass = sInstance->childGetText("password_edit"); BOOL have_first = !first.empty(); @@ -514,7 +514,7 @@ void LLPanelLogin::giveFocus() else { // User doesn't have a name, so start there. - edit = sInstance->getChild("first_name_edit"); + edit = sInstance->getChild("login_id_edit"); } if (edit) @@ -536,8 +536,8 @@ void LLPanelLogin::showLoginWidgets() // *TODO: Append all the usual login parameters, like first_login=Y etc. std::string splash_screen_url = sInstance->getString("real_url"); web_browser->navigateTo( splash_screen_url, "text/html" ); - LLUICtrl* first_name_edit = sInstance->getChild("first_name_edit"); - first_name_edit->setFocus(TRUE); + LLUICtrl* login_id_edit = sInstance->getChild("login_id_edit"); + login_id_edit->setFocus(TRUE); } // static @@ -569,8 +569,15 @@ void LLPanelLogin::setFields(const std::string& firstname, return; } - sInstance->childSetText("first_name_edit", firstname); - sInstance->childSetText("last_name_edit", lastname); + std::string login_id = firstname; + if (!lastname.empty()) + { + // support traditional First Last name slurls + login_id += " "; + login_id += lastname; + } + sInstance->childSetText("login_id_edit", login_id); + sInstance->childSetText("last_name_edit", std::string()); // Max "actual" password length is 16 characters. // Hex digests are always 32 characters. @@ -623,10 +630,24 @@ void LLPanelLogin::getFields(std::string *firstname, return; } - *firstname = sInstance->childGetText("first_name_edit"); - LLStringUtil::trim(*firstname); + std::string login_id = sInstance->childGetText("login_id_edit"); + LLStringUtil::trim(login_id); - *lastname = sInstance->childGetText("last_name_edit"); + U32 pos = login_id.find(' '); + if (pos != std::string::npos) + { + // old-style Firstname Lastname + *firstname = login_id.substr(0, pos); + *lastname = login_id.substr(pos+1); + } + else + { + // new-style single SLID string + *firstname = login_id; + *lastname = "Resident"; + } + + LLStringUtil::trim(*firstname); LLStringUtil::trim(*lastname); *password = sInstance->mMungedPassword; @@ -896,8 +917,10 @@ void LLPanelLogin::onClickConnect(void *) // JC - Make sure the fields all get committed. sInstance->setFocus(FALSE); - std::string first = sInstance->childGetText("first_name_edit"); - std::string last = sInstance->childGetText("last_name_edit"); + // Do SLID "Resident" name mangling + std::string first, last, unused_password; + getFields(&first, &last, &unused_password); + LLComboBox* combo = sInstance->getChild("start_location_combo"); std::string combo_text = combo->getSimple(); diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index df942b1a26..30506dcde4 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="first_name_text" top="20" left="20" width="150"> -First name: + Second Life ID: + width="200" /> - Last name: + Last name: + -- cgit v1.2.3 From f97236a1d9146ec605fb745f8ede42c808c3201f Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 12 Jan 2010 16:32:32 -0800 Subject: Change login screen to single "SLID" input field. Use last name "Resident" if none provided. Reviewed with Huseby --- indra/newview/llpanellogin.cpp | 47 ++++++++++++++++------ indra/newview/skins/default/xui/en/panel_login.xml | 18 +++++---- 2 files changed, 46 insertions(+), 19 deletions(-) diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 87d101b00f..46420ce503 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -213,7 +213,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, } #if !USE_VIEWER_AUTH - childSetPrevalidate("first_name_edit", LLLineEditor::prevalidateASCIIPrintableNoSpace); + //childSetPrevalidate("login_id_edit", LLLineEditor::prevalidateASCIIPrintableNoSpace); childSetPrevalidate("last_name_edit", LLLineEditor::prevalidateASCIIPrintableNoSpace); childSetCommitCallback("password_edit", mungePassword, this); @@ -498,7 +498,7 @@ void LLPanelLogin::giveFocus() if( sInstance ) { // Grab focus and move cursor to first blank input field - std::string first = sInstance->childGetText("first_name_edit"); + std::string first = sInstance->childGetText("login_id_edit"); std::string pass = sInstance->childGetText("password_edit"); BOOL have_first = !first.empty(); @@ -514,7 +514,7 @@ void LLPanelLogin::giveFocus() else { // User doesn't have a name, so start there. - edit = sInstance->getChild("first_name_edit"); + edit = sInstance->getChild("login_id_edit"); } if (edit) @@ -536,8 +536,8 @@ void LLPanelLogin::showLoginWidgets() // *TODO: Append all the usual login parameters, like first_login=Y etc. std::string splash_screen_url = sInstance->getString("real_url"); web_browser->navigateTo( splash_screen_url, "text/html" ); - LLUICtrl* first_name_edit = sInstance->getChild("first_name_edit"); - first_name_edit->setFocus(TRUE); + LLUICtrl* login_id_edit = sInstance->getChild("login_id_edit"); + login_id_edit->setFocus(TRUE); } // static @@ -569,8 +569,15 @@ void LLPanelLogin::setFields(const std::string& firstname, return; } - sInstance->childSetText("first_name_edit", firstname); - sInstance->childSetText("last_name_edit", lastname); + std::string login_id = firstname; + if (!lastname.empty()) + { + // support traditional First Last name slurls + login_id += " "; + login_id += lastname; + } + sInstance->childSetText("login_id_edit", login_id); + sInstance->childSetText("last_name_edit", std::string()); // Max "actual" password length is 16 characters. // Hex digests are always 32 characters. @@ -623,10 +630,24 @@ void LLPanelLogin::getFields(std::string *firstname, return; } - *firstname = sInstance->childGetText("first_name_edit"); - LLStringUtil::trim(*firstname); + std::string login_id = sInstance->childGetText("login_id_edit"); + LLStringUtil::trim(login_id); - *lastname = sInstance->childGetText("last_name_edit"); + U32 pos = login_id.find(' '); + if (pos != std::string::npos) + { + // old-style Firstname Lastname + *firstname = login_id.substr(0, pos); + *lastname = login_id.substr(pos+1); + } + else + { + // new-style single SLID string + *firstname = login_id; + *lastname = "Resident"; + } + + LLStringUtil::trim(*firstname); LLStringUtil::trim(*lastname); *password = sInstance->mMungedPassword; @@ -896,8 +917,10 @@ void LLPanelLogin::onClickConnect(void *) // JC - Make sure the fields all get committed. sInstance->setFocus(FALSE); - std::string first = sInstance->childGetText("first_name_edit"); - std::string last = sInstance->childGetText("last_name_edit"); + // Do SLID "Resident" name mangling + std::string first, last, unused_password; + getFields(&first, &last, &unused_password); + LLComboBox* combo = sInstance->getChild("start_location_combo"); std::string combo_text = combo->getSimple(); diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index 6187b8f1e2..4609ecf56f 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -59,7 +59,7 @@ name="first_name_text" top="20" left="20" width="150"> -First name: + Second Life ID: + width="200" /> - Last name: + Last name: + -- cgit v1.2.3 From 1d6d3fc5a9698dfd64d5fa778823d38d514ec3b1 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 12 Jan 2010 16:33:08 -0800 Subject: Suppress rendering of last name "Resident" to display only SLIDs. Reviewed with Huseby --- indra/newview/llvoavatar.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 4235f97eab..7df24c9ade 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2792,8 +2792,12 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) line += firstname->getString(); } - line += " "; - line += lastname->getString(); + // Suppress last name "Resident" as this is used for new SLID names + if (strcmp(lastname->getString(), "Resident")) + { + line += " "; + line += lastname->getString(); + } BOOL need_comma = FALSE; if (is_away || is_muted || is_busy) -- cgit v1.2.3 From d5c377ec71fac22cf63a25daa29e1c83d9b3ef08 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 12 Jan 2010 16:33:08 -0800 Subject: Suppress rendering of last name "Resident" to display only SLIDs. Reviewed with Huseby --- indra/newview/llvoavatar.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 6e93bf1bf2..ad23aab9be 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2791,8 +2791,12 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) line += firstname->getString(); } - line += " "; - line += lastname->getString(); + // Suppress last name "Resident" as this is used for new SLID names + if (strcmp(lastname->getString(), "Resident")) + { + line += " "; + line += lastname->getString(); + } BOOL need_comma = FALSE; if (is_away || is_muted || is_busy) -- cgit v1.2.3 From dd9bfb6d859c5848b5ff6c8fdebbc34ab65f92e7 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 22 Jan 2010 16:52:53 -0800 Subject: LLCacheName and LLUrlEntryAgent now understand SLIDs - accounts with "Resident" as last name should not display that name. Also added test display names. --- indra/llmessage/llcachename.cpp | 17 ++++++++-- indra/llui/llurlentry.cpp | 65 +++++++++++++++++++++++++++++++++--- indra/llui/tests/llurlentry_stub.cpp | 7 ++++ 3 files changed, 83 insertions(+), 6 deletions(-) diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index 3078d80552..04b8ef9637 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -461,7 +461,7 @@ void LLCacheName::exportFile(std::ostream& ostr) // store it LLUUID id = iter->first; std::string id_str = id.asString(); - if(!entry->mFirstName.empty() && !entry->mLastName.empty()) + if(!entry->mFirstName.empty() /* && !entry->mLastName.empty() */ ) // IDEVO save SLIDs { data[AGENTS][id_str][FIRST] = entry->mFirstName; data[AGENTS][id_str][LAST] = entry->mLastName; @@ -506,6 +506,7 @@ BOOL LLCacheName::getName(const LLUUID& id, std::string& first, std::string& las } } + // static void LLCacheName::LocalizeCacheName(std::string key, std::string value) { @@ -519,7 +520,13 @@ BOOL LLCacheName::getFullName(const LLUUID& id, std::string& fullname) { std::string first_name, last_name; BOOL res = getName(id, first_name, last_name); - fullname = first_name + " " + last_name; + fullname = first_name; + if (!last_name.empty()) + { + // IDEVO legacy resident name, not SLID + fullname += " "; + fullname += last_name; + } return res; } @@ -916,6 +923,12 @@ void LLCacheName::Impl::processUUIDReply(LLMessageSystem* msg, bool isGroup) { msg->getStringFast(_PREHASH_UUIDNameBlock, _PREHASH_FirstName, entry->mFirstName, i); msg->getStringFast(_PREHASH_UUIDNameBlock, _PREHASH_LastName, entry->mLastName, i); + + // IDEVO HACK - blank out last name + if (entry->mLastName == "Resident") + { + entry->mLastName = ""; + } } else { // is group diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 4927e57a52..326f1cec29 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -310,13 +310,70 @@ LLUrlEntryAgent::LLUrlEntryAgent() mColor = LLUIColorTable::instance().getColor("AgentLinkColor"); } +// IDEVO demo code +static std::string clean_name(const std::string& first, const std::string& last) +{ + std::string displayname; + if (first == "miyazaki23") // IDEVO demo code + { + // miyazaki + displayname += (char)(0xE5); + displayname += (char)(0xAE); + displayname += (char)(0xAE); + displayname += (char)(0xE5); + displayname += (char)(0xB4); + displayname += (char)(0x8E); + // hayao + displayname += (char)(0xE9); + displayname += (char)(0xA7); + displayname += (char)(0xBF); + // san + displayname += (char)(0xE3); + displayname += (char)(0x81); + displayname += (char)(0x95); + displayname += (char)(0xE3); + displayname += (char)(0x82); + displayname += (char)(0x93); + } + else if (first == "Jim") + { + displayname = "Jos"; + displayname += (char)(0xC3); + displayname += (char)(0xA9); + displayname += " Sanchez"; + } + else if (first == "James") + { + displayname = "James Cook"; + } + + std::string fullname = first; + if (!last.empty()) + { + fullname += ' '; + fullname += last; + } + + std::string final; + if (!displayname.empty()) + { + final = displayname + " (" + fullname + ")"; + } + else + { + final = fullname; + } + return final; +} + void LLUrlEntryAgent::onAgentNameReceived(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group) { + std::string final = clean_name(first, last); // received the agent name from the server - tell our observers - callObservers(id.asString(), first + " " + last); + callObservers(id.asString(), final); } std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCallback &cb) @@ -335,14 +392,14 @@ std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCa } LLUUID agent_id(agent_id_string); - std::string full_name; + std::string first, last; if (agent_id.isNull()) { return LLTrans::getString("AvatarNameNobody"); } - else if (gCacheName->getFullName(agent_id, full_name)) + else if (gCacheName->getName(agent_id, first, last)) { - return full_name; + return clean_name(first, last); } else { diff --git a/indra/llui/tests/llurlentry_stub.cpp b/indra/llui/tests/llurlentry_stub.cpp index 26d1f2e067..3731800adf 100644 --- a/indra/llui/tests/llurlentry_stub.cpp +++ b/indra/llui/tests/llurlentry_stub.cpp @@ -36,6 +36,13 @@ BOOL LLCacheName::getFullName(const LLUUID& id, std::string& fullname) return TRUE; } +BOOL LLCacheName::getName(const LLUUID& id, std::string& first, std::string& last) +{ + first = "Lynx"; + last = "Linden"; + return TRUE; +} + BOOL LLCacheName::getGroupName(const LLUUID& id, std::string& group) { group = "My Group"; -- cgit v1.2.3 From 48111a2ab847bb3bacf658b3771d0324157fc751 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 22 Jan 2010 16:53:18 -0800 Subject: Converted friend request names to SLID-compatible --- indra/newview/llavataractions.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 40c9bb6afa..8c4dfaea50 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -62,6 +62,7 @@ #include "llimfloater.h" #include "lltrans.h" #include "llcallingcard.h" +#include "llslurl.h" // IDEVO // static void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::string& name) @@ -73,7 +74,7 @@ void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::strin } LLSD args; - args["NAME"] = name; + args["NAME"] = LLSLURL::buildCommand("agent", id, "inspect"); LLSD payload; payload["id"] = id; payload["name"] = name; @@ -102,7 +103,7 @@ void LLAvatarActions::requestFriendshipDialog(const LLUUID& id) } std::string full_name; - gCacheName->getFullName(id, full_name); + // IDEVO gCacheName->getFullName(id, full_name); requestFriendshipDialog(id, full_name); } -- cgit v1.2.3 From 830c938ad218f2e5dbe161fa50222a5702ca73cd Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 22 Jan 2010 16:53:29 -0800 Subject: Converted landmark info names to SLID-compatible --- indra/newview/llpanellandmarkinfo.cpp | 39 +++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index 9654e17659..ae445764cf 100644 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -44,6 +44,7 @@ #include "llagent.h" #include "llagentui.h" #include "lllandmarkactions.h" +#include "llslurl.h" #include "llviewerinventory.h" #include "llviewerparcelmgr.h" #include "llviewerregion.h" @@ -230,13 +231,15 @@ void LLPanelLandmarkInfo::displayItemInfo(const LLInventoryItem* pItem) ////////////////// if (pItem->getCreatorUUID().notNull()) { - std::string name; + // IDEVO LLUUID creator_id = pItem->getCreatorUUID(); - if (!gCacheName->getFullName(creator_id, name)) - { - gCacheName->get(creator_id, FALSE, - boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mCreator, _2, _3)); - } + std::string name = + LLSLURL::buildCommand("agent", creator_id, "inspect"); + //if (!gCacheName->getFullName(creator_id, name)) + //{ + // gCacheName->get(creator_id, FALSE, + // boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mCreator, _2, _3)); + //} mCreator->setText(name); } else @@ -253,20 +256,24 @@ void LLPanelLandmarkInfo::displayItemInfo(const LLInventoryItem* pItem) if (perm.isGroupOwned()) { LLUUID group_id = perm.getGroup(); - if (!gCacheName->getGroupName(group_id, name)) - { - gCacheName->get(group_id, TRUE, - boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mOwner, _2, _3)); - } + // IDEVO + //if (!gCacheName->getGroupName(group_id, name)) + //{ + // gCacheName->get(group_id, TRUE, + // boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mOwner, _2, _3)); + //} + name = LLSLURL::buildCommand("group", group_id, "inspect"); } else { LLUUID owner_id = perm.getOwner(); - if (!gCacheName->getFullName(owner_id, name)) - { - gCacheName->get(owner_id, FALSE, - boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mOwner, _2, _3)); - } + // IDEVO + //if (!gCacheName->getFullName(owner_id, name)) + //{ + // gCacheName->get(owner_id, FALSE, + // boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mOwner, _2, _3)); + //} + name = LLSLURL::buildCommand("agent", owner_id, "inspect"); } mOwner->setText(name); } -- cgit v1.2.3 From 1ddd2f2677471cc00465b2a619b138bb054db770 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 22 Jan 2010 16:53:45 -0800 Subject: Converted place info names to SLID-compatible, probably unused --- indra/newview/llpanelplaceprofile.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index d892e2885b..a80b6f2e0e 100644 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -49,6 +49,7 @@ #include "llappviewer.h" #include "llcallbacklist.h" #include "llfloaterbuycurrency.h" +#include "llslurl.h" // IDEVO #include "llstatusbar.h" #include "llviewercontrol.h" #include "llviewerparcelmgr.h" @@ -441,8 +442,12 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, else { // Figure out the owner's name - gCacheName->get(parcel->getOwnerID(), FALSE, - boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mParcelOwner, _2, _3)); + // IDEVO + //gCacheName->get(parcel->getOwnerID(), FALSE, + // boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mParcelOwner, _2, _3)); + std::string parcel_owner = + LLSLURL::buildCommand("agent", parcel->getOwnerID(), "inspect"); + mParcelOwner->setText(parcel_owner); gCacheName->get(region->getOwner(), FALSE, boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mRegionOwnerText, _2, _3)); } -- cgit v1.2.3 From 40907986d4044e2be75f862fac1153f9a14f13ad Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 22 Jan 2010 18:29:29 -0800 Subject: Pull llurlentryagent into newview so I can compile/link faster --- indra/llui/llurlentry.cpp | 114 +------------------------- indra/llui/llurlentry.h | 14 +--- indra/llui/llurlregistry.cpp | 11 ++- indra/llui/llurlregistry.h | 4 +- indra/llui/tests/llurlentry_test.cpp | 35 ++++---- indra/newview/CMakeLists.txt | 2 + indra/newview/llstartup.cpp | 5 ++ indra/newview/llurlentryagent.cpp | 154 +++++++++++++++++++++++++++++++++++ indra/newview/llurlentryagent.h | 53 ++++++++++++ 9 files changed, 245 insertions(+), 147 deletions(-) create mode 100644 indra/newview/llurlentryagent.cpp create mode 100644 indra/newview/llurlentryagent.h diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 326f1cec29..d04cb8c7ff 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -297,119 +297,7 @@ std::string LLUrlEntrySLURL::getLocation(const std::string &url) const return url.substr(pos, url.size() - pos); } -// -// LLUrlEntryAgent Describes a Second Life agent Url, e.g., -// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about -// -LLUrlEntryAgent::LLUrlEntryAgent() -{ - mPattern = boost::regex("secondlife:///app/agent/[\\da-f-]+/\\w+", - boost::regex::perl|boost::regex::icase); - mMenuName = "menu_url_agent.xml"; - mIcon = "Generic_Person"; - mColor = LLUIColorTable::instance().getColor("AgentLinkColor"); -} - -// IDEVO demo code -static std::string clean_name(const std::string& first, const std::string& last) -{ - std::string displayname; - if (first == "miyazaki23") // IDEVO demo code - { - // miyazaki - displayname += (char)(0xE5); - displayname += (char)(0xAE); - displayname += (char)(0xAE); - displayname += (char)(0xE5); - displayname += (char)(0xB4); - displayname += (char)(0x8E); - // hayao - displayname += (char)(0xE9); - displayname += (char)(0xA7); - displayname += (char)(0xBF); - // san - displayname += (char)(0xE3); - displayname += (char)(0x81); - displayname += (char)(0x95); - displayname += (char)(0xE3); - displayname += (char)(0x82); - displayname += (char)(0x93); - } - else if (first == "Jim") - { - displayname = "Jos"; - displayname += (char)(0xC3); - displayname += (char)(0xA9); - displayname += " Sanchez"; - } - else if (first == "James") - { - displayname = "James Cook"; - } - - std::string fullname = first; - if (!last.empty()) - { - fullname += ' '; - fullname += last; - } - - std::string final; - if (!displayname.empty()) - { - final = displayname + " (" + fullname + ")"; - } - else - { - final = fullname; - } - return final; -} - -void LLUrlEntryAgent::onAgentNameReceived(const LLUUID& id, - const std::string& first, - const std::string& last, - BOOL is_group) -{ - std::string final = clean_name(first, last); - // received the agent name from the server - tell our observers - callObservers(id.asString(), final); -} - -std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCallback &cb) -{ - if (!gCacheName) - { - // probably at the login screen, use short string for layout - return LLTrans::getString("LoadingData"); - } - - std::string agent_id_string = getIDStringFromUrl(url); - if (agent_id_string.empty()) - { - // something went wrong, just give raw url - return unescapeUrl(url); - } - - LLUUID agent_id(agent_id_string); - std::string first, last; - if (agent_id.isNull()) - { - return LLTrans::getString("AvatarNameNobody"); - } - else if (gCacheName->getName(agent_id, first, last)) - { - return clean_name(first, last); - } - else - { - gCacheName->get(agent_id, FALSE, - boost::bind(&LLUrlEntryAgent::onAgentNameReceived, - this, _1, _2, _3, _4)); - addObserver(agent_id_string, url, cb); - return LLTrans::getString("LoadingData"); - } -} +// LLUrlEntryAgent temporarily moved to newview IDEVO // // LLUrlEntryGroup Describes a Second Life group Url, e.g., diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h index 4adffde99c..33ec9d82a9 100644 --- a/indra/llui/llurlentry.h +++ b/indra/llui/llurlentry.h @@ -156,19 +156,7 @@ public: /*virtual*/ std::string getLocation(const std::string &url) const; }; -/// -/// LLUrlEntryAgent Describes a Second Life agent Url, e.g., -/// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about -/// -class LLUrlEntryAgent : public LLUrlEntryBase -{ -public: - LLUrlEntryAgent(); - /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); -private: - void onAgentNameReceived(const LLUUID& id, const std::string& first, - const std::string& last, BOOL is_group); -}; +/// IDEVO LLUrlEntryAgent temporarily moved to newview /// /// LLUrlEntryGroup Describes a Second Life group Url, e.g., diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp index ad5c0911f8..4fbdae9d38 100644 --- a/indra/llui/llurlregistry.cpp +++ b/indra/llui/llurlregistry.cpp @@ -43,11 +43,13 @@ void LLUrlRegistryNullCallback(const std::string &url, const std::string &label) LLUrlRegistry::LLUrlRegistry() { + mUrlEntry.reserve(16); + // Urls are matched in the order that they were registered registerUrl(new LLUrlEntrySLURL()); registerUrl(new LLUrlEntryHTTP()); registerUrl(new LLUrlEntryHTTPLabel()); - registerUrl(new LLUrlEntryAgent()); + // IDEVO registerUrl(new LLUrlEntryAgent()); registerUrl(new LLUrlEntryGroup()); registerUrl(new LLUrlEntryParcel()); registerUrl(new LLUrlEntryTeleport()); @@ -73,11 +75,14 @@ LLUrlRegistry::~LLUrlRegistry() } } -void LLUrlRegistry::registerUrl(LLUrlEntryBase *url) +void LLUrlRegistry::registerUrl(LLUrlEntryBase *url, bool force_front) { if (url) { - mUrlEntry.push_back(url); + if (force_front) // IDEVO + mUrlEntry.insert(mUrlEntry.begin(), url); + else + mUrlEntry.push_back(url); } } diff --git a/indra/llui/llurlregistry.h b/indra/llui/llurlregistry.h index 399ee0a988..6d47c2c2a2 100644 --- a/indra/llui/llurlregistry.h +++ b/indra/llui/llurlregistry.h @@ -70,7 +70,9 @@ public: ~LLUrlRegistry(); /// add a new Url handler to the registry (will be freed on destruction) - void registerUrl(LLUrlEntryBase *url); + /// optionally force it to the front of the list, making it take + /// priority over other regular expression matches for URLs + void registerUrl(LLUrlEntryBase *url, bool force_front = false); /// get the next Url in an input string, starting at a given character offset /// your callback is invoked if the matched Url's label changes in the future diff --git a/indra/llui/tests/llurlentry_test.cpp b/indra/llui/tests/llurlentry_test.cpp index 80be8fcbf7..9200708784 100644 --- a/indra/llui/tests/llurlentry_test.cpp +++ b/indra/llui/tests/llurlentry_test.cpp @@ -266,28 +266,29 @@ namespace tut // // test LLUrlEntryAgent - secondlife://app/agent Urls // - LLUrlEntryAgent url; - boost::regex r = url.getPattern(); + // IDEVO - moved temporarily into newview, not available for test + //LLUrlEntryAgent url; + //boost::regex r = url.getPattern(); - testRegex("Invalid Agent Url", r, - "secondlife:///app/agent/0e346d8b-4433-4d66-XXXX-fd37083abc4c/about", - ""); + //testRegex("Invalid Agent Url", r, + // "secondlife:///app/agent/0e346d8b-4433-4d66-XXXX-fd37083abc4c/about", + // ""); - testRegex("Agent Url ", r, - "secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about", - "secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about"); + //testRegex("Agent Url ", r, + // "secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about", + // "secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about"); - testRegex("Agent Url in text", r, - "XXX secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about XXX", - "secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about"); + //testRegex("Agent Url in text", r, + // "XXX secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about XXX", + // "secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about"); - testRegex("Agent Url multicase", r, - "XXX secondlife:///App/AGENT/0E346D8B-4433-4d66-a6b0-fd37083abc4c/About XXX", - "secondlife:///App/AGENT/0E346D8B-4433-4d66-a6b0-fd37083abc4c/About"); + //testRegex("Agent Url multicase", r, + // "XXX secondlife:///App/AGENT/0E346D8B-4433-4d66-a6b0-fd37083abc4c/About XXX", + // "secondlife:///App/AGENT/0E346D8B-4433-4d66-a6b0-fd37083abc4c/About"); - testRegex("Agent Url alternate command", r, - "XXX secondlife:///App/AGENT/0E346D8B-4433-4d66-a6b0-fd37083abc4c/foobar", - "secondlife:///App/AGENT/0E346D8B-4433-4d66-a6b0-fd37083abc4c/foobar"); + //testRegex("Agent Url alternate command", r, + // "XXX secondlife:///App/AGENT/0E346D8B-4433-4d66-a6b0-fd37083abc4c/foobar", + // "secondlife:///App/AGENT/0E346D8B-4433-4d66-a6b0-fd37083abc4c/foobar"); } diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 5373556c20..f4bbe7133f 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -445,6 +445,7 @@ set(viewer_SOURCE_FILES llurl.cpp llurldispatcher.cpp llurldispatcherlistener.cpp + llurlentryagent.cpp llurlhistory.cpp llurllineeditorctrl.cpp llurlsimstring.cpp @@ -952,6 +953,7 @@ set(viewer_HEADER_FILES llurl.h llurldispatcher.h llurldispatcherlistener.h + llurlentryagent.h llurlhistory.h llurllineeditorctrl.h llurlsimstring.h diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 6b816f8786..a372ab44f2 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -144,7 +144,9 @@ #include "llui.h" #include "llurldispatcher.h" #include "llurlsimstring.h" +#include "llurlentryagent.h" // IDEVO #include "llurlhistory.h" +#include "llurlregistry.h" // IDEVO #include "llurlwhitelist.h" #include "llvieweraudio.h" #include "llviewerassetstorage.h" @@ -1282,6 +1284,9 @@ bool idle_startup() gCacheName->LocalizeCacheName("none", LLTrans::getString("GroupNameNone")); // Load stored cache if possible LLAppViewer::instance()->loadNameCache(); + + // Handle secondlife:///app/agent name lookups IDEVO + LLUrlRegistry::getInstance()->registerUrl(new LLUrlEntryAgent(), true); } // *Note: this is where gWorldMap used to be initialized. diff --git a/indra/newview/llurlentryagent.cpp b/indra/newview/llurlentryagent.cpp new file mode 100644 index 0000000000..d104fdf20d --- /dev/null +++ b/indra/newview/llurlentryagent.cpp @@ -0,0 +1,154 @@ +/** + * @file llurlentry.cpp + * @author Martin Reddy + * @brief Describes the Url types that can be registered in LLUrlRegistry + * + * $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 "llviewerprecompiledheaders.h" + +#include "llurlentryagent.h" + +#include "llcachename.h" +#include "lltrans.h" +#include "lluicolortable.h" + +// +// LLUrlEntryAgent Describes a Second Life agent Url, e.g., +// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about +// +LLUrlEntryAgent::LLUrlEntryAgent() +{ + mPattern = boost::regex("secondlife:///app/agent/[\\da-f-]+/\\w+", + boost::regex::perl|boost::regex::icase); + mMenuName = "menu_url_agent.xml"; + mIcon = "Generic_Person"; + mColor = LLUIColorTable::instance().getColor("AgentLinkColor"); +} + +// IDEVO demo code +static std::string clean_name(const std::string& first, const std::string& last) +{ + std::string displayname; + if (first == "miyazaki23") // IDEVO demo code + { + // miyazaki + displayname += (char)(0xE5); + displayname += (char)(0xAE); + displayname += (char)(0xAE); + displayname += (char)(0xE5); + displayname += (char)(0xB4); + displayname += (char)(0x8E); + // hayao + displayname += (char)(0xE9); + displayname += (char)(0xA7); + displayname += (char)(0xBF); + // san + displayname += (char)(0xE3); + displayname += (char)(0x81); + displayname += (char)(0x95); + displayname += (char)(0xE3); + displayname += (char)(0x82); + displayname += (char)(0x93); + } + else if (first == "Jim") + { + displayname = "Jos"; + displayname += (char)(0xC3); + displayname += (char)(0xA9); + displayname += " Sanchez"; + } + else if (first == "James") + { + displayname = "James Cook"; + } + + std::string fullname = first; + if (!last.empty()) + { + fullname += ' '; + fullname += last; + } + + std::string final; + if (!displayname.empty()) + { + final = displayname + " (" + fullname + ")"; + } + else + { + final = fullname; + } + return final; +} + +void LLUrlEntryAgent::onAgentNameReceived(const LLUUID& id, + const std::string& first, + const std::string& last, + BOOL is_group) +{ + std::string final = clean_name(first, last); + // received the agent name from the server - tell our observers + callObservers(id.asString(), final); +} + +std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCallback &cb) +{ + if (!gCacheName) + { + // probably at the login screen, use short string for layout + return LLTrans::getString("LoadingData"); + } + + std::string agent_id_string = getIDStringFromUrl(url); + if (agent_id_string.empty()) + { + // something went wrong, just give raw url + return unescapeUrl(url); + } + + LLUUID agent_id(agent_id_string); + std::string first, last; + if (agent_id.isNull()) + { + return LLTrans::getString("AvatarNameNobody"); + } + else if (gCacheName->getName(agent_id, first, last)) + { + return clean_name(first, last); + } + else + { + gCacheName->get(agent_id, FALSE, + boost::bind(&LLUrlEntryAgent::onAgentNameReceived, + this, _1, _2, _3, _4)); + addObserver(agent_id_string, url, cb); + return LLTrans::getString("LoadingData"); + } +} diff --git a/indra/newview/llurlentryagent.h b/indra/newview/llurlentryagent.h new file mode 100644 index 0000000000..8e5e321a31 --- /dev/null +++ b/indra/newview/llurlentryagent.h @@ -0,0 +1,53 @@ +/** + * @file llurlentryagent.h + * + * $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_LLURLENTRYAGENT_H +#define LL_LLURLENTRYAGENT_H + +#include "llurlentry.h" + +/// +/// LLUrlEntryAgent Describes a Second Life agent Url, e.g., +/// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about +/// +/// IDEVO Pulled this temporarily into newview for faster compile/link +/// times while iterating on UI. +class LLUrlEntryAgent : public LLUrlEntryBase +{ +public: + LLUrlEntryAgent(); + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); +private: + void onAgentNameReceived(const LLUUID& id, const std::string& first, + const std::string& last, BOOL is_group); +}; + +#endif -- cgit v1.2.3 From 852c4acb59f6a15e3f384904ab9b237795107119 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 22 Jan 2010 18:43:58 -0800 Subject: Replace tab with spaces --- scripts/template_verifier.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/template_verifier.py b/scripts/template_verifier.py index d5fc119270..adcfcbcae6 100755 --- a/scripts/template_verifier.py +++ b/scripts/template_verifier.py @@ -103,7 +103,7 @@ MESSAGE_TEMPLATE = 'message_template.msg' PRODUCTION_ACCEPTABLE = (compatibility.Same, compatibility.Newer) DEVELOPMENT_ACCEPTABLE = ( compatibility.Same, compatibility.Newer, - compatibility.Older, compatibility.Mixed) + compatibility.Older, compatibility.Mixed) MAX_MASTER_AGE = 60 * 60 * 4 # refresh master cache every 4 hours -- cgit v1.2.3 From e88e1022f804bd23edff73f95e5ac3cec5effcfb Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 1 Feb 2010 11:00:14 -0800 Subject: Show SLIDs in avatar picker --- indra/newview/llfloateravatarpicker.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index a0b2de85f0..50aa70478b 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -370,6 +370,19 @@ void LLFloaterAvatarPicker::setAllowMultiple(BOOL allow_multiple) getChild("Friends")->setAllowMultipleSelection(allow_multiple); } +// IDEVO +static std::string clean_name_from_avatar_picker(const std::string& first, const std::string& last) +{ + if (last.empty() || last == "Resident") + { + return first; + } + else + { + return first + " " + last; + } +} + // static void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void**) { @@ -420,7 +433,7 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void* } else { - avatar_name = first_name + " " + last_name; + avatar_name = clean_name_from_avatar_picker(first_name, last_name); search_results->setEnabled(TRUE); found_one = TRUE; } -- cgit v1.2.3 From 660f1a9ecb8204d2f12fa30262955ea45f67a68d Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 1 Feb 2010 11:00:42 -0800 Subject: Fixed typo in SLURL name conversion for "Resident" --- indra/newview/llurlentryagent.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/llurlentryagent.cpp b/indra/newview/llurlentryagent.cpp index d104fdf20d..6af7c9001d 100644 --- a/indra/newview/llurlentryagent.cpp +++ b/indra/newview/llurlentryagent.cpp @@ -90,7 +90,8 @@ static std::string clean_name(const std::string& first, const std::string& last) } std::string fullname = first; - if (!last.empty()) + if (!last.empty() + && last != "Resident") { fullname += ' '; fullname += last; -- cgit v1.2.3 From 130214c766763855b733c9b5d4e177afe0c39865 Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 1 Feb 2010 11:01:00 -0800 Subject: Fix "Resident" names in IM and chat --- indra/newview/llviewermessage.cpp | 70 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 0358efc0af..b7d3e407c6 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1647,6 +1647,60 @@ bool inspect_remote_object_callback(const LLSD& notification, const LLSD& respon } static LLNotificationFunctorRegistration inspect_remote_object_callback_reg("ServerObjectMessage", inspect_remote_object_callback); +// Strip out "Resident" for display, but only if the message came from a user +// (rather than a script) +static std::string clean_name_from_im(const std::string& name, EInstantMessage type) +{ + U32 pos = 0; + switch(type) + { + case IM_NOTHING_SPECIAL: + case IM_MESSAGEBOX: + case IM_GROUP_INVITATION: + case IM_INVENTORY_OFFERED: + case IM_INVENTORY_ACCEPTED: + case IM_INVENTORY_DECLINED: + case IM_GROUP_VOTE: + case IM_GROUP_MESSAGE_DEPRECATED: + //IM_TASK_INVENTORY_OFFERED + //IM_TASK_INVENTORY_ACCEPTED + //IM_TASK_INVENTORY_DECLINED + case IM_NEW_USER_DEFAULT: + case IM_SESSION_INVITE: + case IM_SESSION_P2P_INVITE: + case IM_SESSION_GROUP_START: + case IM_SESSION_CONFERENCE_START: + case IM_SESSION_SEND: + case IM_SESSION_LEAVE: + //IM_FROM_TASK + case IM_BUSY_AUTO_RESPONSE: + case IM_CONSOLE_AND_CHAT_HISTORY: + case IM_LURE_USER: + case IM_LURE_ACCEPTED: + case IM_LURE_DECLINED: + case IM_GODLIKE_LURE_USER: + case IM_YET_TO_BE_USED: + case IM_GROUP_ELECTION_DEPRECATED: + //IM_GOTO_URL + //IM_FROM_TASK_AS_ALERT + case IM_GROUP_NOTICE: + case IM_GROUP_NOTICE_INVENTORY_ACCEPTED: + case IM_GROUP_NOTICE_INVENTORY_DECLINED: + case IM_GROUP_INVITATION_ACCEPT: + case IM_GROUP_INVITATION_DECLINE: + case IM_GROUP_NOTICE_REQUESTED: + case IM_FRIENDSHIP_OFFERED: + case IM_FRIENDSHIP_ACCEPTED: + case IM_FRIENDSHIP_DECLINED_DEPRECATED: + //IM_TYPING_START + //IM_TYPING_STOP + pos = name.find(" Resident"); + return name.substr(0, pos); + default: + return name; + } +} + void process_improved_im(LLMessageSystem *msg, void **user_data) { if (gNoRender) @@ -1694,6 +1748,8 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) { name = LLTrans::getString("Unnamed"); } + // IDEVO convert new-style "Resident" names for display + name = clean_name_from_im(name, dialog); BOOL is_busy = gAgent.getBusy(); BOOL is_muted = LLMuteList::getInstance()->isMuted(from_id, name, LLMute::flagTextChat); @@ -2494,6 +2550,15 @@ void process_decline_callingcard(LLMessageSystem* msg, void**) LLNotificationsUtil::add("CallingCardDeclined"); } +static std::string clean_name_from_chat(const std::string& full_name, EChatSourceType type) +{ + if (type == CHAT_SOURCE_AGENT) + { + U32 pos = full_name.find(" Resident"); + return full_name.substr(0, pos); + } + return full_name; +} void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) { @@ -2510,7 +2575,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) LLViewerObject* chatter; msg->getString("ChatData", "FromName", from_name); - chat.mFromName = from_name; + //chat.mFromName = from_name; msg->getUUID("ChatData", "SourceID", from_id); chat.mFromID = from_id; @@ -2529,6 +2594,9 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) chat.mTime = LLFrameTimer::getElapsedSeconds(); + // IDEVO Correct for new-style "Resident" names + chat.mFromName = clean_name_from_chat(from_name, chat.mSourceType); + BOOL is_busy = gAgent.getBusy(); BOOL is_muted = FALSE; -- cgit v1.2.3 From 146e9d5e4d9a9a4f33d9ccd47a901980972b7ab9 Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 1 Feb 2010 17:06:18 -0800 Subject: Support returning full_name (and SLID) for LLCacheName::get() calls Changed callback signature to full_name instead of first_name,last_name Eliminated all calls to legacy (non-signal/non-boost-bind) lookup mechanism Change Pay dialog names to SLURL links Tweaked layout of Pay Resident and Pay via Object floaters to make SLURLs fit Consolidate name first + " " + last concatenation in LLCacheName::buildFullName() Reviewed with Kelly --- indra/llmessage/llcachename.cpp | 58 +++++++++++++--------- indra/llmessage/llcachename.h | 15 +++--- indra/llmessage/mean_collision_data.h | 5 +- indra/llui/lltextbase.cpp | 2 +- indra/llui/llurlentry.cpp | 11 ++-- indra/llui/llurlentry.h | 3 +- indra/llui/tests/llurlentry_stub.cpp | 2 +- indra/newview/llavatariconctrl.cpp | 15 +++--- indra/newview/llavatariconctrl.h | 11 ++-- indra/newview/llavatarlistitem.cpp | 7 ++- indra/newview/llavatarlistitem.h | 2 +- indra/newview/llchathistory.cpp | 19 +++---- indra/newview/llfloaterbump.cpp | 5 +- indra/newview/llfloaterbuyland.cpp | 16 +++--- indra/newview/llfloaterpay.cpp | 36 ++++++-------- indra/newview/llfloaterscriptlimits.cpp | 14 +++--- indra/newview/llfloaterscriptlimits.h | 4 +- indra/newview/llimview.cpp | 7 +-- indra/newview/llimview.h | 2 +- indra/newview/llinspectavatar.cpp | 19 +++---- indra/newview/llinspectgroup.cpp | 17 +++---- indra/newview/llinspectremoteobject.cpp | 17 +++---- indra/newview/llinventorymodel.cpp | 3 +- indra/newview/llmutelist.cpp | 28 ++++------- indra/newview/llmutelist.h | 2 +- indra/newview/llnamebox.cpp | 19 ++----- indra/newview/llnamebox.h | 5 +- indra/newview/llnameeditor.cpp | 19 ++----- indra/newview/llnameeditor.h | 5 +- indra/newview/llnamelistctrl.cpp | 20 ++------ indra/newview/llnamelistctrl.h | 5 +- indra/newview/llpanelavatartag.cpp | 2 +- indra/newview/llpanelimcontrolpanel.cpp | 12 ++--- indra/newview/llpanelimcontrolpanel.h | 2 +- indra/newview/llpanelmediasettingspermissions.cpp | 2 +- indra/newview/llpanelpermissions.cpp | 2 +- indra/newview/llpanelplaceinfo.cpp | 6 +-- indra/newview/llpanelplaceinfo.h | 4 +- indra/newview/llpanelplaceprofile.cpp | 16 +++--- indra/newview/llpanelprofileview.cpp | 8 +-- indra/newview/llpanelprofileview.h | 7 ++- indra/newview/llsidepaneltaskinfo.cpp | 2 +- indra/newview/llspeakers.cpp | 7 +-- indra/newview/llspeakers.h | 2 +- indra/newview/llstartup.cpp | 8 +-- indra/newview/llurlentryagent.cpp | 41 ++++++--------- indra/newview/llurlentryagent.h | 3 +- indra/newview/llviewerinventory.cpp | 4 +- indra/newview/llviewerinventory.h | 2 +- indra/newview/llviewermessage.cpp | 32 ++++++------ indra/newview/llvoiceclient.cpp | 14 +----- indra/newview/llvoiceclient.h | 1 - .../newview/skins/default/xui/en/floater_bumps.xml | 10 ++-- indra/newview/skins/default/xui/en/floater_pay.xml | 17 ++----- .../skins/default/xui/en/floater_pay_object.xml | 26 +++------- .../newview/skins/default/xui/en/notifications.xml | 6 +-- 56 files changed, 255 insertions(+), 374 deletions(-) diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index 04b8ef9637..e1e5f5bc02 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -75,7 +75,7 @@ public: public: bool mIsGroup; U32 mCreateTime; // unix time_t - std::string mFirstName; + std::string mFirstName; // IDEVO TODO collapse to one field std::string mLastName; std::string mGroupName; }; @@ -520,13 +520,7 @@ BOOL LLCacheName::getFullName(const LLUUID& id, std::string& fullname) { std::string first_name, last_name; BOOL res = getName(id, first_name, last_name); - fullname = first_name; - if (!last_name.empty()) - { - // IDEVO legacy resident name, not SLID - fullname += " "; - fullname += last_name; - } + fullname = buildFullname(first_name, last_name); return res; } @@ -566,7 +560,7 @@ BOOL LLCacheName::getGroupName(const LLUUID& id, std::string& group) BOOL LLCacheName::getUUID(const std::string& first, const std::string& last, LLUUID& id) { - std::string fullname = first + " " + last; + std::string fullname = buildFullname(first, last); return getUUID(fullname, id); } @@ -584,6 +578,19 @@ BOOL LLCacheName::getUUID(const std::string& fullname, LLUUID& id) } } +//static +std::string LLCacheName::buildFullname(const std::string& first, const std::string& last) +{ + std::string fullname = first; + if (!last.empty() + && last != "Resident") + { + fullname += ' '; + fullname += last; + } + return fullname; +} + // This is a little bit kludgy. LLCacheNameCallback is a slot instead of a function pointer. // The reason it is a slot is so that the legacy get() function below can bind an old callback // and pass it as a slot. The reason it isn't a boost::function is so that trackable behavior @@ -591,7 +598,7 @@ BOOL LLCacheName::getUUID(const std::string& fullname, LLUUID& id) // we call it immediately. -Steve // NOTE: Even though passing first and last name is a bit of extra overhead, it eliminates the // potential need for any parsing should any code need to handle first and last name independently. -boost::signals2::connection LLCacheName::get(const LLUUID& id, BOOL is_group, const LLCacheNameCallback& callback) +boost::signals2::connection LLCacheName::get(const LLUUID& id, bool is_group, const LLCacheNameCallback& callback) { boost::signals2::connection res; @@ -599,7 +606,7 @@ boost::signals2::connection LLCacheName::get(const LLUUID& id, BOOL is_group, co { LLCacheNameSignal signal; signal.connect(callback); - signal(id, sCacheName["nobody"], "", is_group); + signal(id, sCacheName["nobody"], is_group); return res; } @@ -611,11 +618,13 @@ boost::signals2::connection LLCacheName::get(const LLUUID& id, BOOL is_group, co // id found in map therefore we can call the callback immediately. if (entry->mIsGroup) { - signal(id, entry->mGroupName, "", entry->mIsGroup); + signal(id, entry->mGroupName, entry->mIsGroup); } else { - signal(id, entry->mFirstName, entry->mLastName, entry->mIsGroup); + std::string fullname = + buildFullname(entry->mFirstName, entry->mLastName); + signal(id, fullname, entry->mIsGroup); } } else @@ -637,9 +646,9 @@ boost::signals2::connection LLCacheName::get(const LLUUID& id, BOOL is_group, co return res; } -boost::signals2::connection LLCacheName::get(const LLUUID& id, BOOL is_group, old_callback_t callback, void* user_data) +boost::signals2::connection LLCacheName::get(const LLUUID& id, bool is_group, old_callback_t callback, void* user_data) { - return get(id, is_group, boost::bind(callback, _1, _2, _3, _4, user_data)); + return get(id, is_group, boost::bind(callback, _1, _2, _3, user_data)); } void LLCacheName::processPending() @@ -711,7 +720,7 @@ void LLCacheName::dump() { llinfos << iter->first << " = " - << entry->mFirstName << " " << entry->mLastName + << buildFullname(entry->mFirstName, entry->mLastName) << " @ " << entry->mCreateTime << llendl; } @@ -757,11 +766,13 @@ void LLCacheName::Impl::processPendingReplies() if (!entry->mIsGroup) { - (reply->mSignal)(reply->mID, entry->mFirstName, entry->mLastName, FALSE); + std::string fullname = + LLCacheName::buildFullname(entry->mFirstName, entry->mLastName); + (reply->mSignal)(reply->mID, fullname, false); } else { - (reply->mSignal)(reply->mID, entry->mGroupName, "", TRUE); + (reply->mSignal)(reply->mID, entry->mGroupName, true); } } @@ -924,7 +935,8 @@ void LLCacheName::Impl::processUUIDReply(LLMessageSystem* msg, bool isGroup) msg->getStringFast(_PREHASH_UUIDNameBlock, _PREHASH_FirstName, entry->mFirstName, i); msg->getStringFast(_PREHASH_UUIDNameBlock, _PREHASH_LastName, entry->mLastName, i); - // IDEVO HACK - blank out last name + // IDEVO blank out last name for storage to reduce string compares on + // retrieval. Eventually need to convert to single mName field. if (entry->mLastName == "Resident") { entry->mLastName = ""; @@ -938,13 +950,14 @@ void LLCacheName::Impl::processUUIDReply(LLMessageSystem* msg, bool isGroup) if (!isGroup) { - mSignal(id, entry->mFirstName, entry->mLastName, FALSE); - std::string fullname = entry->mFirstName + " " + entry->mLastName; + std::string fullname = + LLCacheName::buildFullname(entry->mFirstName, entry->mLastName); + mSignal(id, fullname, false); mReverseCache[fullname] = id; } else { - mSignal(id, entry->mGroupName, "", TRUE); + mSignal(id, entry->mGroupName, true); mReverseCache[entry->mGroupName] = id; } } @@ -973,4 +986,3 @@ void LLCacheName::Impl::handleUUIDGroupNameReply(LLMessageSystem* msg, void** us { ((LLCacheName::Impl*)userData)->processUUIDReply(msg, true); } - diff --git a/indra/llmessage/llcachename.h b/indra/llmessage/llcachename.h index 111cc8b650..c7385204f5 100644 --- a/indra/llmessage/llcachename.h +++ b/indra/llmessage/llcachename.h @@ -42,13 +42,12 @@ class LLUUID; typedef boost::signals2::signal LLCacheNameSignal; + const std::string& name, + bool is_group)> LLCacheNameSignal; typedef LLCacheNameSignal::slot_type LLCacheNameCallback; // Old callback with user data for compatability -typedef void (*old_callback_t)(const LLUUID&, const std::string&, const std::string&, BOOL, void*); +typedef void (*old_callback_t)(const LLUUID&, const std::string&, bool, void*); // Here's the theory: // If you request a name that isn't in the cache, it returns "waiting" @@ -89,6 +88,10 @@ public: // Reverse lookup of UUID from name BOOL getUUID(const std::string& first, const std::string& last, LLUUID& id); BOOL getUUID(const std::string& fullname, LLUUID& id); + + // IDEVO Temporary code + // Clean up new-style "bobsmith123 Resident" names to "bobsmith123" for display + static std::string buildFullname(const std::string& first, const std::string& last); // If available, this method copies the group name into the string // provided. The caller must allocate at least @@ -100,10 +103,10 @@ public: // If the data is currently available, may call the callback immediatly // otherwise, will request the data, and will call the callback when // available. There is no garuntee the callback will ever be called. - boost::signals2::connection get(const LLUUID& id, BOOL is_group, const LLCacheNameCallback& callback); + boost::signals2::connection get(const LLUUID& id, bool is_group, const LLCacheNameCallback& callback); // LEGACY - boost::signals2::connection get(const LLUUID& id, BOOL is_group, old_callback_t callback, void* user_data); + boost::signals2::connection get(const LLUUID& id, bool is_group, old_callback_t callback, void* user_data); // This method needs to be called from time to time to send out // requests. void processPending(); diff --git a/indra/llmessage/mean_collision_data.h b/indra/llmessage/mean_collision_data.h index 03b96f9f90..a6c635e81e 100644 --- a/indra/llmessage/mean_collision_data.h +++ b/indra/llmessage/mean_collision_data.h @@ -61,7 +61,7 @@ public: LLMeanCollisionData(LLMeanCollisionData *mcd) : mVictim(mcd->mVictim), mPerp(mcd->mPerp), mTime(mcd->mTime), mType(mcd->mType), mMag(mcd->mMag), - mFirstName(mcd->mFirstName), mLastName(mcd->mLastName) + mFullName(mcd->mFullName) { } @@ -95,8 +95,7 @@ public: time_t mTime; EMeanCollisionType mType; F32 mMag; - std::string mFirstName; - std::string mLastName; + std::string mFullName; }; diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 17aecaf32f..790240ab48 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -2493,7 +2493,7 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin LLUIImagePtr image = mStyle->getImage(); if( image.notNull()) { - num_pixels -= image->getWidth(); + num_pixels = llmax(0, num_pixels - image->getWidth()); } // search for newline and if found, truncate there diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index d04cb8c7ff..40f8c27431 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -315,12 +315,11 @@ LLUrlEntryGroup::LLUrlEntryGroup() } void LLUrlEntryGroup::onGroupNameReceived(const LLUUID& id, - const std::string& first, - const std::string& last, - BOOL is_group) + const std::string& name, + bool is_group) { // received the group name from the server - tell our observers - callObservers(id.asString(), first); + callObservers(id.asString(), name); } std::string LLUrlEntryGroup::getLabel(const std::string &url, const LLUrlLabelCallback &cb) @@ -350,9 +349,9 @@ std::string LLUrlEntryGroup::getLabel(const std::string &url, const LLUrlLabelCa } else { - gCacheName->get(group_id, TRUE, + gCacheName->get(group_id, true, boost::bind(&LLUrlEntryGroup::onGroupNameReceived, - this, _1, _2, _3, _4)); + this, _1, _2, _3)); addObserver(group_id_string, url, cb); return LLTrans::getString("LoadingData"); } diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h index 33ec9d82a9..6d875a40c7 100644 --- a/indra/llui/llurlentry.h +++ b/indra/llui/llurlentry.h @@ -168,8 +168,7 @@ public: LLUrlEntryGroup(); /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); private: - void onGroupNameReceived(const LLUUID& id, const std::string& first, - const std::string& last, BOOL is_group); + void onGroupNameReceived(const LLUUID& id, const std::string& name, bool is_group); }; /// diff --git a/indra/llui/tests/llurlentry_stub.cpp b/indra/llui/tests/llurlentry_stub.cpp index 3731800adf..30bab1eb91 100644 --- a/indra/llui/tests/llurlentry_stub.cpp +++ b/indra/llui/tests/llurlentry_stub.cpp @@ -49,7 +49,7 @@ BOOL LLCacheName::getGroupName(const LLUUID& id, std::string& group) return TRUE; } -boost::signals2::connection LLCacheName::get(const LLUUID& id, BOOL is_group, const LLCacheNameCallback& callback) +boost::signals2::connection LLCacheName::get(const LLUUID& id, bool is_group, const LLCacheNameCallback& callback) { return boost::signals2::connection(); } diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp index 87b8d807c4..11cc456695 100644 --- a/indra/newview/llavatariconctrl.cpp +++ b/indra/newview/llavatariconctrl.cpp @@ -244,7 +244,8 @@ void LLAvatarIconCtrl::setValue(const LLSD& value) LLIconCtrl::setValue(value); } - gCacheName->get(mAvatarId, FALSE, boost::bind(&LLAvatarIconCtrl::nameUpdatedCallback, this, _1, _2, _3, _4)); + gCacheName->get(mAvatarId, false, + boost::bind(&LLAvatarIconCtrl::nameUpdatedCallback, this, _1, _2, _3)); } bool LLAvatarIconCtrl::updateFromCache() @@ -289,22 +290,20 @@ void LLAvatarIconCtrl::processProperties(void* data, EAvatarProcessorType type) void LLAvatarIconCtrl::nameUpdatedCallback( const LLUUID& id, - const std::string& first, - const std::string& last, - BOOL is_group) + const std::string& name, + bool is_group) { if (id == mAvatarId) { - mFirstName = first; - mLastName = last; + mFullName = name; if (mDrawTooltip) { - setToolTip(mFirstName + " " + mLastName); + setToolTip(name); } else { - setToolTip(std::string("")); + setToolTip(std::string()); } } } diff --git a/indra/newview/llavatariconctrl.h b/indra/newview/llavatariconctrl.h index 38616b7852..a5452ee1d3 100644 --- a/indra/newview/llavatariconctrl.h +++ b/indra/newview/llavatariconctrl.h @@ -92,20 +92,17 @@ public: void nameUpdatedCallback( const LLUUID& id, - const std::string& first, - const std::string& last, - BOOL is_group); + const std::string& name, + bool is_group); const LLUUID& getAvatarId() const { return mAvatarId; } - const std::string& getFirstName() const { return mFirstName; } - const std::string& getLastName() const { return mLastName; } + const std::string& getFullName() const { return mFullName; } void setDrawTooltip(bool value) { mDrawTooltip = value;} protected: LLUUID mAvatarId; - std::string mFirstName; - std::string mLastName; + std::string mFullName; bool mDrawTooltip; std::string mDefaultIconName; diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 66ab32f3e8..6024dd8a21 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -193,7 +193,7 @@ void LLAvatarListItem::setAvatarId(const LLUUID& id, bool ignore_status_changes) LLAvatarTracker::instance().addParticularFriendObserver(mAvatarId, this); // Set avatar name. - gCacheName->get(id, FALSE, boost::bind(&LLAvatarListItem::onNameCache, this, _2, _3)); + gCacheName->get(id, false, boost::bind(&LLAvatarListItem::onNameCache, this, _2)); } void LLAvatarListItem::showLastInteractionTime(bool show) @@ -298,10 +298,9 @@ void LLAvatarListItem::setNameInternal(const std::string& name, const std::strin mAvatarName->setToolTip(name); } -void LLAvatarListItem::onNameCache(const std::string& first_name, const std::string& last_name) +void LLAvatarListItem::onNameCache(const std::string& fullname) { - std::string name = first_name + " " + last_name; - setName(name); + setName(fullname); } // Convert given number of seconds to a string like "23 minutes", "15 hours" or "3 years", diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index 479a4833cb..f3c1f0ec01 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -139,7 +139,7 @@ private: } EAvatarListItemChildIndex; void setNameInternal(const std::string& name, const std::string& highlight); - void onNameCache(const std::string& first_name, const std::string& last_name); + void onNameCache(const std::string& fullname); std::string formatSeconds(U32 secs); diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index a46cd84b60..12c8d58976 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -103,11 +103,7 @@ public: } else if (level == "add") { - std::string name; - name.assign(getFirstName()); - name.append(" "); - name.append(getLastName()); - + std::string name = getFullName(); LLAvatarActions::requestFriendshipDialog(getAvatarId(), name); } else if (level == "remove") @@ -177,14 +173,13 @@ public: } const LLUUID& getAvatarId () const { return mAvatarID;} - const std::string& getFirstName() const { return mFirstName; } - const std::string& getLastName () const { return mLastName; } + const std::string& getFullName() const { return mFullName; } void setup(const LLChat& chat,const LLStyle::Params& style_params) { mAvatarID = chat.mFromID; mSourceType = chat.mSourceType; - gCacheName->get(mAvatarID, FALSE, boost::bind(&LLChatHistoryHeader::nameUpdatedCallback, this, _1, _2, _3, _4)); + gCacheName->get(mAvatarID, false, boost::bind(&LLChatHistoryHeader::nameUpdatedCallback, this, _1, _2, _3)); if(chat.mFromID.isNull()) { mSourceType = CHAT_SOURCE_SYSTEM; @@ -256,12 +251,11 @@ public: LLPanel::draw(); } - void nameUpdatedCallback(const LLUUID& id,const std::string& first,const std::string& last,BOOL is_group) + void nameUpdatedCallback(const LLUUID& id,const std::string& full_name, bool is_group) { if (id != mAvatarID) return; - mFirstName = first; - mLastName = last; + mFullName = full_name; } protected: static const S32 PADDING = 20; @@ -341,8 +335,7 @@ protected: LLUUID mAvatarID; EChatSourceType mSourceType; - std::string mFirstName; - std::string mLastName; + std::string mFullName; std::string mFrom; S32 mMinUserNameWidth; diff --git a/indra/newview/llfloaterbump.cpp b/indra/newview/llfloaterbump.cpp index e925796526..9ccae43a92 100644 --- a/indra/newview/llfloaterbump.cpp +++ b/indra/newview/llfloaterbump.cpp @@ -89,7 +89,7 @@ void LLFloaterBump::onOpen(const LLSD& key) void LLFloaterBump::add(LLScrollListCtrl* list, LLMeanCollisionData* mcd) { - if (mcd->mFirstName.empty() || list->getItemCount() >= 20) + if (mcd->mFullName.empty() || list->getItemCount() >= 20) { return; } @@ -127,8 +127,7 @@ void LLFloaterBump::add(LLScrollListCtrl* list, LLMeanCollisionData* mcd) // All above action strings are in XML file LLUIString text = getString(action); text.setArg("[TIME]", timeStr); - text.setArg("[FIRST]", mcd->mFirstName); - text.setArg("[LAST]", mcd->mLastName); + text.setArg("[NAME]", mcd->mFullName); LLSD row; row["id"] = mcd->mPerp; diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp index 9b88923e7e..47678d1e82 100644 --- a/indra/newview/llfloaterbuyland.cpp +++ b/indra/newview/llfloaterbuyland.cpp @@ -182,9 +182,8 @@ public: void updateNames(); // Name cache callback void updateGroupName(const LLUUID& id, - const std::string& first_name, - const std::string& last_name, - BOOL is_group); + const std::string& name, + bool is_group); void refreshUI(); @@ -801,9 +800,9 @@ void LLFloaterBuyLandUI::updateNames() } else if (parcelp->getIsGroupOwned()) { - gCacheName->get(parcelp->getGroupID(), TRUE, + gCacheName->get(parcelp->getGroupID(), true, boost::bind(&LLFloaterBuyLandUI::updateGroupName, this, - _1, _2, _3, _4)); + _1, _2, _3)); } else { @@ -813,16 +812,15 @@ void LLFloaterBuyLandUI::updateNames() } void LLFloaterBuyLandUI::updateGroupName(const LLUUID& id, - const std::string& first_name, - const std::string& last_name, - BOOL is_group) + const std::string& name, + bool is_group) { LLParcel* parcelp = mParcel->getParcel(); if (parcelp && parcelp->getGroupID() == id) { // request is current - mParcelSellerName = first_name; + mParcelSellerName = name; } } diff --git a/indra/newview/llfloaterpay.cpp b/indra/newview/llfloaterpay.cpp index c2389e73a0..b37be3c1bf 100644 --- a/indra/newview/llfloaterpay.cpp +++ b/indra/newview/llfloaterpay.cpp @@ -47,6 +47,7 @@ #include "lllineeditor.h" #include "llmutelist.h" #include "llfloaterreporter.h" +#include "llslurl.h" #include "llviewerobject.h" #include "llviewerobjectlist.h" #include "llviewerregion.h" @@ -102,10 +103,6 @@ private: static void onGive(void* data); void give(S32 amount); static void processPayPriceReply(LLMessageSystem* msg, void **userdata); - void onCacheOwnerName(const LLUUID& owner_id, - const std::string& firstname, - const std::string& lastname, - BOOL is_group); void finishPayUI(const LLUUID& target_id, BOOL is_group); protected: @@ -426,33 +423,28 @@ void LLFloaterPay::payDirectly(money_callback callback, void LLFloaterPay::finishPayUI(const LLUUID& target_id, BOOL is_group) { - gCacheName->get(target_id, is_group, boost::bind(&LLFloaterPay::onCacheOwnerName, this, _1, _2, _3, _4)); - - // Make sure the amount field has focus - - childSetFocus("amount", TRUE); - - LLLineEditor* amount = getChild("amount"); - amount->selectAll(); - mTargetIsGroup = is_group; -} - -void LLFloaterPay::onCacheOwnerName(const LLUUID& owner_id, - const std::string& firstname, - const std::string& lastname, - BOOL is_group) -{ + // IDEVO + //gCacheName->get(target_id, is_group, boost::bind(&LLFloaterPay::onCacheOwnerName, this, _1, _2, _3, _4)); + std::string slurl; if (is_group) { setTitle(getString("payee_group")); + slurl = LLSLURL::buildCommand("group", target_id, "inspect"); } else { setTitle(getString("payee_resident")); + slurl = LLSLURL::buildCommand("agent", target_id, "inspect"); } + childSetText("payee_name", slurl); + + // Make sure the amount field has focus + + childSetFocus("amount", TRUE); - childSetTextArg("payee_name", "[FIRST]", firstname); - childSetTextArg("payee_name", "[LAST]", lastname); + LLLineEditor* amount = getChild("amount"); + amount->selectAll(); + mTargetIsGroup = is_group; } // static diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp index 0964ad7f91..4a194217b5 100644 --- a/indra/newview/llfloaterscriptlimits.cpp +++ b/indra/newview/llfloaterscriptlimits.cpp @@ -335,11 +335,8 @@ void LLPanelScriptLimitsRegionMemory::setErrorStatus(U32 status, const std::stri // callback from the name cache with an owner name to add to the list void LLPanelScriptLimitsRegionMemory::onNameCache( const LLUUID& id, - const std::string& first_name, - const std::string& last_name) + const std::string& name) { - std::string name = first_name + " " + last_name; - LLScrollListCtrl *list = getChild("scripts_list"); std::vector::iterator id_itor; for (id_itor = mObjectListItems.begin(); id_itor != mObjectListItems.end(); ++id_itor) @@ -421,9 +418,12 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content) if(std::find(names_requested.begin(), names_requested.end(), owner_id) == names_requested.end()) { names_requested.push_back(owner_id); - gCacheName->get(owner_id, TRUE, - boost::bind(&LLPanelScriptLimitsRegionMemory::onNameCache, - this, _1, _2, _3)); + // Is this a bug? It's trying to look up a GROUP name, not + // an AVATAR name? JC + const bool is_group = true; + gCacheName->get(owner_id, is_group, + boost::bind(&LLPanelScriptLimitsRegionMemory::onNameCache, + this, _1, _2)); } } diff --git a/indra/newview/llfloaterscriptlimits.h b/indra/newview/llfloaterscriptlimits.h index 7e2b536eb6..77ff496893 100644 --- a/indra/newview/llfloaterscriptlimits.h +++ b/indra/newview/llfloaterscriptlimits.h @@ -166,10 +166,8 @@ public: void returnObjects(); private: - void onNameCache( const LLUUID& id, - const std::string& first_name, - const std::string& last_name); + const std::string& name); LLUUID mParcelId; BOOL mGotParcelMemoryUsed; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index c2a7969c0d..9cc4aefe35 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -2556,7 +2556,8 @@ void LLIMMgr::inviteToSession( { if (caller_name.empty()) { - gCacheName->get(caller_id, FALSE, boost::bind(&LLIMMgr::onInviteNameLookup, payload, _1, _2, _3, _4)); + gCacheName->get(caller_id, false, + boost::bind(&LLIMMgr::onInviteNameLookup, payload, _1, _2, _3)); } else { @@ -2566,9 +2567,9 @@ void LLIMMgr::inviteToSession( } } -void LLIMMgr::onInviteNameLookup(LLSD payload, const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group) +void LLIMMgr::onInviteNameLookup(LLSD payload, const LLUUID& id, const std::string& name, bool is_group) { - payload["caller_name"] = first + " " + last; + payload["caller_name"] = name; payload["session_name"] = payload["caller_name"].asString(); std::string notify_box_type = payload["notify_box_type"].asString(); diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index a3b4f78af0..4de3d8b9b9 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -456,7 +456,7 @@ private: void processIMTypingCore(const LLIMInfo* im_info, BOOL typing); - static void onInviteNameLookup(LLSD payload, const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group); + static void onInviteNameLookup(LLSD payload, const LLUUID& id, const std::string& name, bool is_group); void notifyObserverSessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id); void notifyObserverSessionRemoved(const LLUUID& session_id); diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 4b0539337b..c5cf40d7b7 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -138,11 +138,9 @@ private: bool isNotFriend(); // Callback for gCacheName to look up avatar name - void nameUpdatedCallback( - const LLUUID& id, - const std::string& first, - const std::string& last, - BOOL is_group); + void nameUpdatedCallback(const LLUUID& id, + const std::string& name, + bool is_group); private: LLUUID mAvatarID; @@ -359,9 +357,9 @@ void LLInspectAvatar::requestUpdate() childSetValue("avatar_icon", LLSD(mAvatarID) ); - gCacheName->get(mAvatarID, FALSE, + gCacheName->get(mAvatarID, false, boost::bind(&LLInspectAvatar::nameUpdatedCallback, - this, _1, _2, _3, _4)); + this, _1, _2, _3)); } void LLInspectAvatar::processAvatarData(LLAvatarData* data) @@ -597,13 +595,12 @@ void LLInspectAvatar::onVolumeChange(const LLSD& data) void LLInspectAvatar::nameUpdatedCallback( const LLUUID& id, - const std::string& first, - const std::string& last, - BOOL is_group) + const std::string& name, + bool is_group) { if (id == mAvatarID) { - mAvatarName = first + " " + last; + mAvatarName = name; childSetValue("user_name", LLSD(mAvatarName) ); } } diff --git a/indra/newview/llinspectgroup.cpp b/indra/newview/llinspectgroup.cpp index 7fd7b69021..364da3f64c 100644 --- a/indra/newview/llinspectgroup.cpp +++ b/indra/newview/llinspectgroup.cpp @@ -84,9 +84,8 @@ public: // Callback for gCacheName to look up group name // Faster than waiting for group properties to return void nameUpdatedCallback(const LLUUID& id, - const std::string& first, - const std::string& last, - BOOL is_group); + const std::string& name, + bool is_group); // Button/menu callbacks void onClickViewProfile(); @@ -225,21 +224,19 @@ void LLInspectGroup::requestUpdate() mPropertiesRequest = new LLFetchGroupData(mGroupID, this); // Name lookup will be faster out of cache, use that - gCacheName->get(mGroupID, TRUE, + gCacheName->get(mGroupID, true, boost::bind(&LLInspectGroup::nameUpdatedCallback, - this, _1, _2, _3, _4)); + this, _1, _2, _3)); } void LLInspectGroup::nameUpdatedCallback( const LLUUID& id, - const std::string& first, - const std::string& last, - BOOL is_group) + const std::string& name, + bool is_group) { if (id == mGroupID) { - // group names are returned as a first name - childSetValue("group_name", LLSD(first) ); + childSetValue("group_name", LLSD(name) ); } // Otherwise possibly a request for an older inspector, ignore it diff --git a/indra/newview/llinspectremoteobject.cpp b/indra/newview/llinspectremoteobject.cpp index e4d2eec242..31f69d21d9 100644 --- a/indra/newview/llinspectremoteobject.cpp +++ b/indra/newview/llinspectremoteobject.cpp @@ -67,7 +67,7 @@ public: private: void update(); - static void nameCallback(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* data); + void onNameCache(const LLUUID& id, const std::string& name, bool is_group); private: LLUUID mObjectID; @@ -122,7 +122,8 @@ void LLInspectRemoteObject::onOpen(const LLSD& data) mOwner = ""; if (gCacheName) { - gCacheName->get(mOwnerID, mGroupOwned, nameCallback, this); + gCacheName->get(mOwnerID, mGroupOwned, + boost::bind(&LLInspectRemoteObject::onNameCache, this, _1, _2, _3)); } // update the inspector with the current object state @@ -153,16 +154,10 @@ void LLInspectRemoteObject::onClickClose() closeFloater(); } -//static -void LLInspectRemoteObject::nameCallback(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* data) +void LLInspectRemoteObject::onNameCache(const LLUUID& id, const std::string& name, bool is_group) { - LLInspectRemoteObject *self = (LLInspectRemoteObject*)data; - self->mOwner = first; - if (!last.empty()) - { - self->mOwner += " " + last; - } - self->update(); + mOwner = name; + update(); } void LLInspectRemoteObject::update() diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 961f7adc0a..eadcfe9f09 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -752,7 +752,8 @@ U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item) new_item->setCreator(id); std::string avatar_name; // Fetch the currect name - gCacheName->get(id, FALSE, boost::bind(&LLViewerInventoryItem::onCallingCardNameLookup, new_item.get(), _1, _2, _3)); + gCacheName->get(id, false, + boost::bind(&LLViewerInventoryItem::onCallingCardNameLookup, new_item.get(), _1, _2, _3)); } } else if (new_item->getType() == LLAssetType::AT_GESTURE) diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index 7ee4c64f8f..0b4c07c9ed 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -496,7 +496,7 @@ void LLMuteList::updateRemove(const LLMute& mute) gAgent.sendReliableMessage(); } -void notify_automute_callback(const LLUUID& agent_id, const std::string& first_name, const std::string& last_name, BOOL is_group, LLMuteList::EAutoReason reason) +void notify_automute_callback(const LLUUID& agent_id, const std::string& full_name, bool is_group, LLMuteList::EAutoReason reason) { std::string notif_name; switch (reason) @@ -514,8 +514,7 @@ void notify_automute_callback(const LLUUID& agent_id, const std::string& first_n } LLSD args; - args["FIRST"] = first_name; - args["LAST"] = last_name; + args["NAME"] = full_name; LLNotificationPtr notif_ptr = LLNotifications::instance().add(notif_name, args, LLSD()); if (notif_ptr) @@ -536,7 +535,7 @@ void notify_automute_callback(const LLUUID& agent_id, const std::string& first_n } -BOOL LLMuteList::autoRemove(const LLUUID& agent_id, const EAutoReason reason, const std::string& first_name, const std::string& last_name) +BOOL LLMuteList::autoRemove(const LLUUID& agent_id, const EAutoReason reason) { BOOL removed = FALSE; @@ -546,24 +545,17 @@ BOOL LLMuteList::autoRemove(const LLUUID& agent_id, const EAutoReason reason, co removed = TRUE; remove(automute); - if (first_name.empty() && last_name.empty()) + std::string full_name; + if (gCacheName->getFullName(agent_id, full_name)) { - std::string cache_first, cache_last; - if (gCacheName->getName(agent_id, cache_first, cache_last)) - { - // name in cache, call callback directly - notify_automute_callback(agent_id, cache_first, cache_last, FALSE, reason); - } - else - { - // not in cache, lookup name from cache - gCacheName->get(agent_id, FALSE, boost::bind(¬ify_automute_callback, _1, _2, _3, _4, reason)); - } + // name in cache, call callback directly + notify_automute_callback(agent_id, full_name, false, reason); } else { - // call callback directly - notify_automute_callback(agent_id, first_name, last_name, FALSE, reason); + // not in cache, lookup name from cache + gCacheName->get(agent_id, false, + boost::bind(¬ify_automute_callback, _1, _2, _3, reason)); } } diff --git a/indra/newview/llmutelist.h b/indra/newview/llmutelist.h index 409b637bf2..11a20e015e 100644 --- a/indra/newview/llmutelist.h +++ b/indra/newview/llmutelist.h @@ -107,7 +107,7 @@ public: // Remove both normal and legacy mutes, for any or all properties. BOOL remove(const LLMute& mute, U32 flags = 0); - BOOL autoRemove(const LLUUID& agent_id, const EAutoReason reason, const std::string& first_name = LLStringUtil::null, const std::string& last_name = LLStringUtil::null); + BOOL autoRemove(const LLUUID& agent_id, const EAutoReason reason); // Name is required to test against legacy text-only mutes. BOOL isMuted(const LLUUID& id, const std::string& name = LLStringUtil::null, U32 flags = 0) const; diff --git a/indra/newview/llnamebox.cpp b/indra/newview/llnamebox.cpp index cd810b9793..da3e95e947 100644 --- a/indra/newview/llnamebox.cpp +++ b/indra/newview/llnamebox.cpp @@ -87,26 +87,15 @@ void LLNameBox::setNameID(const LLUUID& name_id, BOOL is_group) setText(mInitialValue); } -void LLNameBox::refresh(const LLUUID& id, const std::string& firstname, - const std::string& lastname, BOOL is_group) +void LLNameBox::refresh(const LLUUID& id, const std::string& full_name, bool is_group) { if (id == mNameID) { - std::string name; - if (!is_group) - { - name = firstname + " " + lastname; - } - else - { - name = firstname; - } - setName(name, is_group); + setName(full_name, is_group); } } -void LLNameBox::refreshAll(const LLUUID& id, const std::string& firstname, - const std::string& lastname, BOOL is_group) +void LLNameBox::refreshAll(const LLUUID& id, const std::string& full_name, bool is_group) { std::set::iterator it; for (it = LLNameBox::sInstances.begin(); @@ -114,7 +103,7 @@ void LLNameBox::refreshAll(const LLUUID& id, const std::string& firstname, ++it) { LLNameBox* box = *it; - box->refresh(id, firstname, lastname, is_group); + box->refresh(id, full_name, is_group); } } diff --git a/indra/newview/llnamebox.h b/indra/newview/llnamebox.h index 48b54faec8..2fe8990653 100644 --- a/indra/newview/llnamebox.h +++ b/indra/newview/llnamebox.h @@ -59,10 +59,9 @@ public: void setNameID(const LLUUID& name_id, BOOL is_group); - void refresh(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group); + void refresh(const LLUUID& id, const std::string& full_name, bool is_group); - static void refreshAll(const LLUUID& id, const std::string& firstname, - const std::string& lastname, BOOL is_group); + static void refreshAll(const LLUUID& id, const std::string& full_name, bool is_group); protected: LLNameBox (const Params&); diff --git a/indra/newview/llnameeditor.cpp b/indra/newview/llnameeditor.cpp index 65601da7da..0c704a1f56 100644 --- a/indra/newview/llnameeditor.cpp +++ b/indra/newview/llnameeditor.cpp @@ -81,26 +81,15 @@ void LLNameEditor::setNameID(const LLUUID& name_id, BOOL is_group) setText(name); } -void LLNameEditor::refresh(const LLUUID& id, const std::string& firstname, - const std::string& lastname, BOOL is_group) +void LLNameEditor::refresh(const LLUUID& id, const std::string& full_name, bool is_group) { if (id == mNameID) { - std::string name; - if (!is_group) - { - name = firstname + " " + lastname; - } - else - { - name = firstname; - } - setText(name); + setText(full_name); } } -void LLNameEditor::refreshAll(const LLUUID& id, const std::string& firstname, - const std::string& lastname, BOOL is_group) +void LLNameEditor::refreshAll(const LLUUID& id, const std::string& full_name, bool is_group) { std::set::iterator it; for (it = LLNameEditor::sInstances.begin(); @@ -108,7 +97,7 @@ void LLNameEditor::refreshAll(const LLUUID& id, const std::string& firstname, ++it) { LLNameEditor* box = *it; - box->refresh(id, firstname, lastname, is_group); + box->refresh(id, full_name, is_group); } } diff --git a/indra/newview/llnameeditor.h b/indra/newview/llnameeditor.h index 99e03a1166..a75c492aca 100644 --- a/indra/newview/llnameeditor.h +++ b/indra/newview/llnameeditor.h @@ -65,10 +65,9 @@ public: void setNameID(const LLUUID& name_id, BOOL is_group); - void refresh(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group); + void refresh(const LLUUID& id, const std::string& full_name, bool is_group); - static void refreshAll(const LLUUID& id, const std::string& firstname, - const std::string& lastname, BOOL is_group); + static void refreshAll(const LLUUID& id, const std::string& full_name, bool is_group); // Take/return agent UUIDs diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index 6375362ae2..c9fbf35033 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -314,22 +314,11 @@ void LLNameListCtrl::removeNameItem(const LLUUID& agent_id) } // public -void LLNameListCtrl::refresh(const LLUUID& id, const std::string& first, - const std::string& last, BOOL is_group) +void LLNameListCtrl::refresh(const LLUUID& id, const std::string& full_name, bool is_group) { //llinfos << "LLNameListCtrl::refresh " << id << " '" << first << " " // << last << "'" << llendl; - std::string fullname; - if (!is_group) - { - fullname = first + " " + last; - } - else - { - fullname = first; - } - // TODO: scan items for that ID, fix if necessary item_list::iterator iter; for (iter = getItemList().begin(); iter != getItemList().end(); iter++) @@ -341,7 +330,7 @@ void LLNameListCtrl::refresh(const LLUUID& id, const std::string& first, cell = item->getColumn(mNameColumnIndex); if (cell) { - cell->setValue(fullname); + cell->setValue(full_name); } } } @@ -351,14 +340,13 @@ void LLNameListCtrl::refresh(const LLUUID& id, const std::string& first, // static -void LLNameListCtrl::refreshAll(const LLUUID& id, const std::string& first, - const std::string& last, BOOL is_group) +void LLNameListCtrl::refreshAll(const LLUUID& id, const std::string& full_name, bool is_group) { LLInstanceTracker::instance_iter it; for (it = beginInstances(); it != endInstances(); ++it) { LLNameListCtrl& ctrl = *it; - ctrl.refresh(id, first, last, is_group); + ctrl.refresh(id, full_name, is_group); } } diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index 192a3a5afa..0e8eb39fd6 100644 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -105,10 +105,9 @@ public: void removeNameItem(const LLUUID& agent_id); - void refresh(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group); + void refresh(const LLUUID& id, const std::string& full_name, bool is_group); - static void refreshAll(const LLUUID& id, const std::string& firstname, - const std::string& lastname, BOOL is_group); + static void refreshAll(const LLUUID& id, const std::string& full_name, bool is_group); // LLView interface /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, diff --git a/indra/newview/llpanelavatartag.cpp b/indra/newview/llpanelavatartag.cpp index 7563cc7f61..173fb851ce 100644 --- a/indra/newview/llpanelavatartag.cpp +++ b/indra/newview/llpanelavatartag.cpp @@ -86,7 +86,7 @@ void LLPanelAvatarTag::setAvatarId(const LLUUID& avatar_id) { mIcon->setValue(avatar_id); } - setName(std::string(mIcon->getFirstName()+ " "+ mIcon->getLastName())); + setName(std::string(mIcon->getFullName())); } boost::signals2::connection LLPanelAvatarTag::setLeftButtonClickCallback( diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index a334eb9d68..a39fe64767 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -164,7 +164,7 @@ void LLPanelIMControlPanel::onViewProfileButtonClicked() void LLPanelIMControlPanel::onAddFriendButtonClicked() { LLAvatarIconCtrl* avatar_icon = getChild("avatar_icon"); - std::string full_name = avatar_icon->getFirstName() + " " + avatar_icon->getLastName(); + std::string full_name = avatar_icon->getFullName(); LLAvatarActions::requestFriendshipDialog(mAvatarID, full_name); } @@ -213,7 +213,8 @@ void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id) else { // If the participant is an avatar, fetch the currect name - gCacheName->get(mAvatarID, FALSE, boost::bind(&LLPanelIMControlPanel::nameUpdatedCallback, this, _1, _2, _3, _4)); + gCacheName->get(mAvatarID, false, + boost::bind(&LLPanelIMControlPanel::onNameCache, this, _1, _2, _3)); } } @@ -229,14 +230,11 @@ void LLPanelIMControlPanel::changed(U32 mask) } } -void LLPanelIMControlPanel::nameUpdatedCallback(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group) +void LLPanelIMControlPanel::onNameCache(const LLUUID& id, const std::string& full_name, bool is_group) { if ( id == mAvatarID ) { - std::string avatar_name; - avatar_name.assign(first); - avatar_name.append(" "); - avatar_name.append(last); + std::string avatar_name = full_name; getChild("avatar_name")->setValue(avatar_name); getChild("avatar_name")->setToolTip(avatar_name); } diff --git a/indra/newview/llpanelimcontrolpanel.h b/indra/newview/llpanelimcontrolpanel.h index 25fdf944c9..0d750acc82 100644 --- a/indra/newview/llpanelimcontrolpanel.h +++ b/indra/newview/llpanelimcontrolpanel.h @@ -82,7 +82,7 @@ public: virtual void changed(U32 mask); protected: - void nameUpdatedCallback(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group); + void onNameCache(const LLUUID& id, const std::string& full_name, bool is_group); private: void onViewProfileButtonClicked(); diff --git a/indra/newview/llpanelmediasettingspermissions.cpp b/indra/newview/llpanelmediasettingspermissions.cpp index a23aed2e98..dcc052f15e 100644 --- a/indra/newview/llpanelmediasettingspermissions.cpp +++ b/indra/newview/llpanelmediasettingspermissions.cpp @@ -115,7 +115,7 @@ void LLPanelMediaSettingsPermissions::draw() if(mPermsGroupName) { mPermsGroupName->setNameID(LLUUID::null, TRUE); - mPermsGroupName->refresh(LLUUID::null, LLStringUtil::null, LLStringUtil::null, true); + mPermsGroupName->refresh(LLUUID::null, std::string(), true); mPermsGroupName->setEnabled(false); }; }; diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 8b8b1bed37..b820adeaf3 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -385,7 +385,7 @@ void LLPanelPermissions::refresh() if (mLabelGroupName) { mLabelGroupName->setNameID(LLUUID::null, TRUE); - mLabelGroupName->refresh(LLUUID::null,LLStringUtil::null, LLStringUtil::null, TRUE); + mLabelGroupName->refresh(LLUUID::null, std::string(), true); mLabelGroupName->setEnabled(FALSE); } } diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp index 0c10f11bfc..ccb364a001 100644 --- a/indra/newview/llpanelplaceinfo.cpp +++ b/indra/newview/llpanelplaceinfo.cpp @@ -274,9 +274,7 @@ void LLPanelPlaceInfo::createPick(const LLVector3d& pos_global, LLPanelPickEdit* } // static -void LLPanelPlaceInfo::nameUpdatedCallback(LLTextBox* text, - const std::string& first, - const std::string& last) +void LLPanelPlaceInfo::onNameCache(LLTextBox* text, const std::string& full_name) { - text->setText(first + " " + last); + text->setText(full_name); } diff --git a/indra/newview/llpanelplaceinfo.h b/indra/newview/llpanelplaceinfo.h index 3091f7ed24..248b967842 100644 --- a/indra/newview/llpanelplaceinfo.h +++ b/indra/newview/llpanelplaceinfo.h @@ -100,9 +100,7 @@ public: void createPick(const LLVector3d& pos_global, LLPanelPickEdit* pick_panel); protected: - static void nameUpdatedCallback(LLTextBox* text, - const std::string& first, - const std::string& last); + static void onNameCache(LLTextBox* text, const std::string& full_name); /** * mParcelID is valid only for remote places, in other cases it's null. See resetLocation() diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index a80b6f2e0e..a24f873145 100644 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -426,11 +426,11 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, if(!parcel->getGroupID().isNull()) { // FIXME: Using parcel group as region group. - gCacheName->get(parcel->getGroupID(), TRUE, - boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mRegionGroupText, _2, _3)); + gCacheName->get(parcel->getGroupID(), true, + boost::bind(&LLPanelPlaceInfo::onNameCache, mRegionGroupText, _2)); - gCacheName->get(parcel->getGroupID(), TRUE, - boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mParcelOwner, _2, _3)); + gCacheName->get(parcel->getGroupID(), true, + boost::bind(&LLPanelPlaceInfo::onNameCache, mParcelOwner, _2)); } else { @@ -448,8 +448,8 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, std::string parcel_owner = LLSLURL::buildCommand("agent", parcel->getOwnerID(), "inspect"); mParcelOwner->setText(parcel_owner); - gCacheName->get(region->getOwner(), FALSE, - boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mRegionOwnerText, _2, _3)); + gCacheName->get(region->getOwner(), false, + boost::bind(&LLPanelPlaceInfo::onNameCache, mRegionOwnerText, _2)); } if(LLParcel::OS_LEASE_PENDING == parcel->getOwnershipStatus()) @@ -475,8 +475,8 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, const LLUUID& auth_buyer_id = parcel->getAuthorizedBuyerID(); if(auth_buyer_id.notNull()) { - gCacheName->get(auth_buyer_id, TRUE, - boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mSaleToText, _2, _3)); + gCacheName->get(auth_buyer_id, true, + boost::bind(&LLPanelPlaceInfo::onNameCache, mSaleToText, _2)); // Show sales info to a specific person or a group he belongs to. if (auth_buyer_id != gAgent.getID() && !gAgent.isInGroup(auth_buyer_id)) diff --git a/indra/newview/llpanelprofileview.cpp b/indra/newview/llpanelprofileview.cpp index 7832f63e6a..1e7a259b41 100644 --- a/indra/newview/llpanelprofileview.cpp +++ b/indra/newview/llpanelprofileview.cpp @@ -109,8 +109,8 @@ void LLPanelProfileView::onOpen(const LLSD& key) } // Update the avatar name. - gCacheName->get(getAvatarId(), FALSE, - boost::bind(&LLPanelProfileView::onAvatarNameCached, this, _1, _2, _3, _4)); + gCacheName->get(getAvatarId(), false, + boost::bind(&LLPanelProfileView::onNameCache, this, _1, _2, _3)); /* // disable this part of code according to EXT-2022. See processOnlineStatus // status should only show if viewer has permission to view online/offline. EXT-453 @@ -187,10 +187,10 @@ void LLPanelProfileView::processOnlineStatus(bool online) mStatusText->setVisible(online); } -void LLPanelProfileView::onAvatarNameCached(const LLUUID& id, const std::string& first_name, const std::string& last_name, BOOL is_group) +void LLPanelProfileView::onNameCache(const LLUUID& id, const std::string& full_name, bool is_group) { llassert(getAvatarId() == id); - getChild("user_name", FALSE)->setValue(first_name + " " + last_name); + getChild("user_name", FALSE)->setValue(full_name); } void LLPanelProfileView::togglePanel(LLPanel* panel, const LLSD& key) diff --git a/indra/newview/llpanelprofileview.h b/indra/newview/llpanelprofileview.h index 5dc617d4a0..02bb004a1e 100644 --- a/indra/newview/llpanelprofileview.h +++ b/indra/newview/llpanelprofileview.h @@ -88,11 +88,10 @@ protected: private: // LLCacheName will call this function when avatar name is loaded from server. // This is required to display names that have not been cached yet. - void onAvatarNameCached( + void onNameCache( const LLUUID& id, - const std::string& first_name, - const std::string& last_name, - BOOL is_group); + const std::string& full_name, + bool is_group); LLTextBox* mStatusText; AvatarStatusObserver* mAvatarStatusObserver; diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index 0b8f66c5f3..1da6fc516d 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -348,7 +348,7 @@ void LLSidepanelTaskInfo::refresh() if (mLabelGroupName) { mLabelGroupName->setNameID(LLUUID::null, TRUE); - mLabelGroupName->refresh(LLUUID::null,LLStringUtil::null, LLStringUtil::null, TRUE); + mLabelGroupName->refresh(LLUUID::null, std::string(), true); mLabelGroupName->setEnabled(FALSE); } } diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 9608cd1263..fea78852c1 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -77,12 +77,13 @@ LLSpeaker::LLSpeaker(const LLUUID& id, const std::string& name, const ESpeakerTy void LLSpeaker::lookupName() { - gCacheName->get(mID, FALSE, boost::bind(&LLSpeaker::onAvatarNameLookup, this, _1, _2, _3, _4)); + gCacheName->get(mID, false, + boost::bind(&LLSpeaker::onNameCache, this, _1, _2, _3)); } -void LLSpeaker::onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group) +void LLSpeaker::onNameCache(const LLUUID& id, const std::string& full_name, bool is_group) { - mDisplayName = first + " " + last; + mDisplayName = full_name; } bool LLSpeaker::isInVoiceChannel() diff --git a/indra/newview/llspeakers.h b/indra/newview/llspeakers.h index 63237204c8..cf236f4fe8 100644 --- a/indra/newview/llspeakers.h +++ b/indra/newview/llspeakers.h @@ -65,7 +65,7 @@ public: ~LLSpeaker() {}; void lookupName(); - void onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group); + void onNameCache(const LLUUID& id, const std::string& full_name, bool is_group); bool isInVoiceChannel(); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index a372ab44f2..0ba5fa9866 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -268,11 +268,11 @@ void apply_udp_blacklist(const std::string& csv); bool process_login_success_response(); void transition_back_to_login_panel(const std::string& emsg); -void callback_cache_name(const LLUUID& id, const std::string& firstname, const std::string& lastname, BOOL is_group) +void callback_cache_name(const LLUUID& id, const std::string& full_name, bool is_group) { - LLNameListCtrl::refreshAll(id, firstname, lastname, is_group); - LLNameBox::refreshAll(id, firstname, lastname, is_group); - LLNameEditor::refreshAll(id, firstname, lastname, is_group); + LLNameListCtrl::refreshAll(id, full_name, is_group); + LLNameBox::refreshAll(id, full_name, is_group); + LLNameEditor::refreshAll(id, full_name, is_group); // TODO: Actually be intelligent about the refresh. // For now, just brute force refresh the dialogs. diff --git a/indra/newview/llurlentryagent.cpp b/indra/newview/llurlentryagent.cpp index 6af7c9001d..bce64d7140 100644 --- a/indra/newview/llurlentryagent.cpp +++ b/indra/newview/llurlentryagent.cpp @@ -53,10 +53,10 @@ LLUrlEntryAgent::LLUrlEntryAgent() } // IDEVO demo code -static std::string clean_name(const std::string& first, const std::string& last) +static std::string clean_name(const std::string& full_name) { std::string displayname; - if (first == "miyazaki23") // IDEVO demo code + if (full_name == "miyazaki23") // IDEVO demo code { // miyazaki displayname += (char)(0xE5); @@ -77,44 +77,35 @@ static std::string clean_name(const std::string& first, const std::string& last) displayname += (char)(0x82); displayname += (char)(0x93); } - else if (first == "Jim") + else if (full_name == "Jim Linden") { displayname = "Jos"; displayname += (char)(0xC3); displayname += (char)(0xA9); displayname += " Sanchez"; } - else if (first == "James") + else if (full_name == "James Linden") { displayname = "James Cook"; } - std::string fullname = first; - if (!last.empty() - && last != "Resident") - { - fullname += ' '; - fullname += last; - } - std::string final; if (!displayname.empty()) { - final = displayname + " (" + fullname + ")"; + final = displayname + " (" + full_name + ")"; } else { - final = fullname; + final = full_name; } return final; } -void LLUrlEntryAgent::onAgentNameReceived(const LLUUID& id, - const std::string& first, - const std::string& last, - BOOL is_group) +void LLUrlEntryAgent::onNameCache(const LLUUID& id, + const std::string& full_name, + bool is_group) { - std::string final = clean_name(first, last); + std::string final = clean_name(full_name); // received the agent name from the server - tell our observers callObservers(id.asString(), final); } @@ -135,20 +126,20 @@ std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCa } LLUUID agent_id(agent_id_string); - std::string first, last; + std::string full_name; if (agent_id.isNull()) { return LLTrans::getString("AvatarNameNobody"); } - else if (gCacheName->getName(agent_id, first, last)) + else if (gCacheName->getFullName(agent_id, full_name)) { - return clean_name(first, last); + return clean_name(full_name); } else { - gCacheName->get(agent_id, FALSE, - boost::bind(&LLUrlEntryAgent::onAgentNameReceived, - this, _1, _2, _3, _4)); + gCacheName->get(agent_id, false, + boost::bind(&LLUrlEntryAgent::onNameCache, + this, _1, _2, _3)); addObserver(agent_id_string, url, cb); return LLTrans::getString("LoadingData"); } diff --git a/indra/newview/llurlentryagent.h b/indra/newview/llurlentryagent.h index 8e5e321a31..76a54dfeb1 100644 --- a/indra/newview/llurlentryagent.h +++ b/indra/newview/llurlentryagent.h @@ -46,8 +46,7 @@ public: LLUrlEntryAgent(); /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); private: - void onAgentNameReceived(const LLUUID& id, const std::string& first, - const std::string& last, BOOL is_group); + void onNameCache(const LLUUID& id, const std::string& full_name, bool is_group); }; #endif diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index b330c1ba83..189a174d11 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1432,9 +1432,9 @@ bool LLViewerInventoryItem::checkPermissionsSet(PermissionMask mask) const //---------- -void LLViewerInventoryItem::onCallingCardNameLookup(const LLUUID& id, const std::string& first_name, const std::string& last_name) +void LLViewerInventoryItem::onCallingCardNameLookup(const LLUUID& id, const std::string& name, bool is_group) { - rename(first_name + " " + last_name); + rename(name); gInventory.addChangedMask(LLInventoryObserver::LABEL, getUUID()); gInventory.notifyObservers(); } diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 917b8747ea..eb6e0fdc9c 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -164,7 +164,7 @@ public: bool checkPermissionsSet(PermissionMask mask) const; // callback - void onCallingCardNameLookup(const LLUUID& id, const std::string& first_name, const std::string& last_name); + void onCallingCardNameLookup(const LLUUID& id, const std::string& name, bool is_group); // If this is a broken link, try to fix it and any other identical link. BOOL regenerateLink(); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index b7d3e407c6..79e21b3ee7 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -983,27 +983,24 @@ void open_inventory_offer(const std::vector& items, const std::string& f } void inventory_offer_mute_callback(const LLUUID& blocked_id, - const std::string& first_name, - const std::string& last_name, - BOOL is_group, LLOfferInfo* offer = NULL) + const std::string& full_name, + bool is_group, + LLOfferInfo* offer = NULL) { - std::string from_name; + std::string from_name = full_name; LLMute::EType type; if (is_group) { type = LLMute::GROUP; - from_name = first_name; } else if(offer && offer->mFromObject) { //we have to block object by name because blocked_id is an id of owner type = LLMute::BY_NAME; - from_name = offer->mFromName; } else { type = LLMute::AGENT; - from_name = first_name + " " + last_name; } // id should be null for BY_NAME mute, see LLMuteList::add for details @@ -1129,7 +1126,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& // * we can't build two messages at once. if (2 == button) // Block { - gCacheName->get(mFromID, mFromGroup, boost::bind(&inventory_offer_mute_callback,_1,_2,_3,_4,this)); + gCacheName->get(mFromID, mFromGroup, boost::bind(&inventory_offer_mute_callback,_1,_2,_3,this)); } std::string from_string; // Used in the pop-up. @@ -1270,7 +1267,7 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const // * we can't build two messages at once. if (2 == button) { - gCacheName->get(mFromID, mFromGroup, boost::bind(&inventory_offer_mute_callback,_1,_2,_3,_4,this)); + gCacheName->get(mFromID, mFromGroup, boost::bind(&inventory_offer_mute_callback,_1,_2,_3,this)); } LLMessageSystem* msg = gMessageSystem; @@ -4761,7 +4758,7 @@ void handle_show_mean_events(void *) //LLFloaterBump::showInstance(); } -void mean_name_callback(const LLUUID &id, const std::string& first, const std::string& last, BOOL always_false) +void mean_name_callback(const LLUUID &id, const std::string& full_name, bool is_group) { if (gNoRender) { @@ -4783,8 +4780,7 @@ void mean_name_callback(const LLUUID &id, const std::string& first, const std::s LLMeanCollisionData *mcd = *iter; if (mcd->mPerp == id) { - mcd->mFirstName = first; - mcd->mLastName = last; + mcd->mFullName = full_name; } } } @@ -4838,8 +4834,7 @@ void process_mean_collision_alert_message(LLMessageSystem *msgsystem, void **use { LLMeanCollisionData *mcd = new LLMeanCollisionData(gAgentID, perp, time, type, mag); gMeanCollisionList.push_front(mcd); - const BOOL is_group = FALSE; - gCacheName->get(perp, is_group, &mean_name_callback); + gCacheName->get(perp, false, boost::bind(&mean_name_callback, _1, _2, _3)); } } } @@ -5738,7 +5733,7 @@ static LLNotificationFunctorRegistration callback_load_url_reg("LoadWebPage", ca // We've got the name of the person who owns the object hurling the url. // Display confirmation dialog. -void callback_load_url_name(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group) +void callback_load_url_name(const LLUUID& id, const std::string& full_name, bool is_group) { std::vector::iterator it; for (it = gLoadUrlList.begin(); it != gLoadUrlList.end(); ) @@ -5751,11 +5746,11 @@ void callback_load_url_name(const LLUUID& id, const std::string& first, const st std::string owner_name; if (is_group) { - owner_name = first + LLTrans::getString("Group"); + owner_name = full_name + LLTrans::getString("Group"); } else { - owner_name = first + " " + last; + owner_name = full_name; } // For legacy name-only mutes. @@ -5815,7 +5810,8 @@ void process_load_url(LLMessageSystem* msg, void**) // Add to list of pending name lookups gLoadUrlList.push_back(payload); - gCacheName->get(owner_id, owner_is_group, &callback_load_url_name); + gCacheName->get(owner_id, owner_is_group, + boost::bind(&callback_load_url_name, _1, _2, _3)); } diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index c84afa5af1..1d9297cf2d 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -6941,18 +6941,8 @@ void LLVoiceClient::notifyFriendObservers() void LLVoiceClient::lookupName(const LLUUID &id) { - BOOL is_group = FALSE; - gCacheName->get(id, is_group, &LLVoiceClient::onAvatarNameLookup); -} - -//static -void LLVoiceClient::onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group) -{ - if(gVoiceClient) - { - std::string name = llformat("%s %s", first.c_str(), last.c_str()); - gVoiceClient->avatarNameResolved(id, name); - } + gCacheName->get(id, false, + boost::bind(&LLVoiceClient::avatarNameResolved, this, _1, _2)); } void LLVoiceClient::avatarNameResolved(const LLUUID &id, const std::string &name) diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index 6231c6ba29..c6f6b2368b 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -474,7 +474,6 @@ static void updatePosition(void); void removeObserver(LLFriendObserver* observer); void lookupName(const LLUUID &id); - static void onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group); void avatarNameResolved(const LLUUID &id, const std::string &name); typedef std::vector deviceList; diff --git a/indra/newview/skins/default/xui/en/floater_bumps.xml b/indra/newview/skins/default/xui/en/floater_bumps.xml index 303c28d7c8..1f2fe62b3c 100644 --- a/indra/newview/skins/default/xui/en/floater_bumps.xml +++ b/indra/newview/skins/default/xui/en/floater_bumps.xml @@ -14,23 +14,23 @@ - [TIME] [FIRST] [LAST] bumped you + [TIME] [NAME] bumped you - [TIME] [FIRST] [LAST] pushed you with a script + [TIME] [NAME] pushed you with a script - [TIME] [FIRST] [LAST] hit you with an object + [TIME] [NAME] hit you with an object - [TIME] [FIRST] [LAST] hit you with a scripted object + [TIME] [NAME] hit you with a scripted object - [TIME] [FIRST] [LAST] hit you with a physical object + [TIME] [NAME] hit you with a physical object diff --git a/indra/newview/skins/default/xui/en/floater_pay.xml b/indra/newview/skins/default/xui/en/floater_pay.xml index 509cffe490..8f60dd6f28 100644 --- a/indra/newview/skins/default/xui/en/floater_pay.xml +++ b/indra/newview/skins/default/xui/en/floater_pay.xml @@ -28,16 +28,6 @@ width="75"> Pay: - - [FIRST] [LAST] + top_pad="0" + width="230"> + Test Name + -- cgit v1.2.3 From 31a0d236d59de5eaaa9e33ed99e6971c1ee01ad7 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 11 May 2010 17:26:29 -0700 Subject: Clean up merge-fight about getIcon() const-ness --- indra/llui/llurlentry.cpp | 4 ++-- indra/llui/llurlentry.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index f3e1a07fbc..f9e5bd76d0 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -62,7 +62,7 @@ std::string LLUrlEntryBase::getUrl(const std::string &string) const } //virtual -std::string LLUrlEntryBase::getIcon(const std::string &url) const +std::string LLUrlEntryBase::getIcon(const std::string &url) { return mIcon; } @@ -464,7 +464,7 @@ std::string localize_slapp_label(const std::string& url, const std::string& full } -std::string LLUrlEntryAgent::getIcon(const std::string &url) const +std::string LLUrlEntryAgent::getIcon(const std::string &url) { // *NOTE: Could look up a badge here by calling getIDStringFromUrl() // and looking up the badge for the agent. diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h index d89f647a55..0abf7a603f 100644 --- a/indra/llui/llurlentry.h +++ b/indra/llui/llurlentry.h @@ -80,7 +80,7 @@ public: virtual std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) { return url; } /// Return an icon that can be displayed next to Urls of this type - virtual std::string getIcon(const std::string &url) const; + virtual std::string getIcon(const std::string &url); /// Return the color to render the displayed text LLUIColor getColor() const { return mColor; } @@ -171,7 +171,7 @@ class LLUrlEntryAgent : public LLUrlEntryBase public: LLUrlEntryAgent(); /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); - /*virtual*/ std::string getIcon(const std::string &url) const; + /*virtual*/ std::string getIcon(const std::string &url); /*virtual*/ std::string getTooltip(const std::string &string) const; protected: /*virtual*/ void callObservers(const std::string &id, const std::string &label, const std::string& icon); @@ -308,7 +308,7 @@ public: LLUrlEntryIcon(); /*virtual*/ std::string getUrl(const std::string &string) const; /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); - /*virtual*/ std::string getIcon(const std::string &url) const; + /*virtual*/ std::string getIcon(const std::string &url); }; -- cgit v1.2.3 From e2deaf5a14a01020afe4240f33e438a0676ba0ec Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 11 May 2010 17:26:55 -0700 Subject: Clean up merge about name cache callback prototype --- indra/llui/llnotifications.cpp | 6 ++++-- indra/llui/llnotifications.h | 5 ++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 7b8f51ae3c..23f79aad36 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -1488,9 +1488,11 @@ std::ostream& operator<<(std::ostream& s, const LLNotification& notification) return s; } -void LLPostponedNotification::onCachedNameReceived(const LLUUID& id, const std::string& first, - const std::string& last, bool is_group) +void LLPostponedNotification::onCachedNameReceived(const LLUUID& id, + const std::string& full_name, + bool is_group) { + // *TODO: This is dumb, just use full_name as given gCacheName->getFullName(id, mName); modifyNotificationParams(); LLNotifications::instance().add(mParams); diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index c942a32512..f818b386b5 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -1005,12 +1005,11 @@ public: gCacheName->get(id, is_group, boost::bind( &LLPostponedNotification::onCachedNameReceived, thiz, _1, _2, - _3, _4)); + _3)); } private: - void onCachedNameReceived(const LLUUID& id, const std::string& first, - const std::string& last, bool is_group); + void onCachedNameReceived(const LLUUID& id, const std::string& full_name, bool is_group); void cleanup() { -- cgit v1.2.3 From 5aa8b5d37eb6824865d09af248aa9d9d518daeb9 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 11 May 2010 17:27:14 -0700 Subject: Clean up merge, dueling LLDateUtil refactoring --- indra/newview/lldateutil.cpp | 72 +++++++++++++++++++-------------- indra/newview/lldateutil.h | 6 +-- indra/newview/llfloateravatarpicker.cpp | 2 +- indra/newview/tests/lldateutil_test.cpp | 18 ++++----- 4 files changed, 54 insertions(+), 44 deletions(-) diff --git a/indra/newview/lldateutil.cpp b/indra/newview/lldateutil.cpp index 32b8b9662a..ae955b6cad 100644 --- a/indra/newview/lldateutil.cpp +++ b/indra/newview/lldateutil.cpp @@ -59,18 +59,22 @@ static S32 days_from_month(S32 year, S32 month) } } -std::string LLDateUtil::ageFromDate(S32 born_year, - S32 born_month, - S32 born_day, - const LLDate& now) +bool LLDateUtil::dateFromPDTString(LLDate& date, const std::string& str) { - LLDate born_date; - born_date.fromYMDHMS(born_year, born_month, born_day); - F64 born_date_secs_since_epoch = born_date.secondsSinceEpoch(); - // Correct for the fact that account creation dates are in Pacific time, - // == UTC - 8 - born_date_secs_since_epoch += 8.0 * 60.0 * 60.0; - born_date.secondsSinceEpoch(born_date_secs_since_epoch); + S32 month, day, year; + S32 matched = sscanf(str.c_str(), "%d/%d/%d", &month, &day, &year); + if (matched != 3) return false; + date.fromYMDHMS(year, month, day); + F64 secs_since_epoch = date.secondsSinceEpoch(); + // Correct for the fact that specified date is in Pacific time, == UTC - 8 + secs_since_epoch += 8.0 * 60.0 * 60.0; + date.secondsSinceEpoch(secs_since_epoch); + return true; +} + +std::string LLDateUtil::ageFromDate(const LLDate& born_date, const LLDate& now) +{ + S32 born_month, born_day, born_year; // explode out to month/day/year again born_date.split(&born_year, &born_month, &born_day); @@ -154,13 +158,14 @@ std::string LLDateUtil::ageFromDate(S32 born_year, return LLTrans::getString("TodayOld"); } -std::string LLDateUtil::ageFromDate(const std::string& date_string, - const LLDate& now) +std::string LLDateUtil::ageFromDate(const std::string& date_string, const LLDate& now) { - S32 born_month, born_day, born_year; - S32 matched = sscanf(date_string.c_str(), "%d/%d/%d", &born_month, &born_day, &born_year); - if (matched != 3) return "???"; - return ageFromDate(born_year, born_month, born_day, now); + LLDate born_date; + + if (!dateFromPDTString(born_date, date_string)) + return "???"; + + return ageFromDate(born_date, now); } std::string LLDateUtil::ageFromDate(const std::string& date_string) @@ -168,17 +173,22 @@ std::string LLDateUtil::ageFromDate(const std::string& date_string) return ageFromDate(date_string, LLDate::now()); } -std::string LLDateUtil::ageFromDateISO(const std::string& date_string, - const LLDate& now) -{ - S32 born_month, born_day, born_year; - S32 matched = sscanf(date_string.c_str(), "%d-%d-%d", - &born_year, &born_month, &born_day); - if (matched != 3) return "???"; - return ageFromDate(born_year, born_month, born_day, now); -} - -std::string LLDateUtil::ageFromDateISO(const std::string& date_string) -{ - return ageFromDateISO(date_string, LLDate::now()); -} +//std::string LLDateUtil::ageFromDateISO(const std::string& date_string, +// const LLDate& now) +//{ +// S32 born_month, born_day, born_year; +// S32 matched = sscanf(date_string.c_str(), "%d-%d-%d", +// &born_year, &born_month, &born_day); +// if (matched != 3) return "???"; +// date.fromYMDHMS(year, month, day); +// F64 secs_since_epoch = date.secondsSinceEpoch(); +// // Correct for the fact that specified date is in Pacific time, == UTC - 8 +// secs_since_epoch += 8.0 * 60.0 * 60.0; +// date.secondsSinceEpoch(secs_since_epoch); +// return ageFromDate(born_year, born_month, born_day, now); +//} +// +//std::string LLDateUtil::ageFromDateISO(const std::string& date_string) +//{ +// return ageFromDateISO(date_string, LLDate::now()); +//} diff --git a/indra/newview/lldateutil.h b/indra/newview/lldateutil.h index a2bfa11ce7..8d41eea511 100644 --- a/indra/newview/lldateutil.h +++ b/indra/newview/lldateutil.h @@ -69,12 +69,12 @@ namespace LLDateUtil std::string ageFromDate(const std::string& date_string); // As above, for YYYY-MM-DD dates - std::string ageFromDateISO(const std::string& date_string, const LLDate& now); + //std::string ageFromDateISO(const std::string& date_string, const LLDate& now); // Calls the above with LLDate::now() - std::string ageFromDateISO(const std::string& date_string); + //std::string ageFromDateISO(const std::string& date_string); - std::string ageFromDate(S32 born_year, S32 born_month, S32 born_day, const LLDate& now); + //std::string ageFromDate(S32 born_year, S32 born_month, S32 born_day, const LLDate& now); } #endif diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index bca9282cec..e0346222c0 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -604,7 +604,7 @@ void LLFloaterAvatarPicker::processResponse(const LLUUID& query_id, const LLSD& S32 year, month, day; account_created.split(&year, &month, &day); std::string age = - LLDateUtil::ageFromDate(year, month, day, LLDate::now()); + LLDateUtil::ageFromDate(account_created, LLDate::now()); columns[2]["column"] = "age"; columns[2]["value"] = age; search_results->addElement(item); diff --git a/indra/newview/tests/lldateutil_test.cpp b/indra/newview/tests/lldateutil_test.cpp index e19983db8f..9ec24eb515 100644 --- a/indra/newview/tests/lldateutil_test.cpp +++ b/indra/newview/tests/lldateutil_test.cpp @@ -190,13 +190,13 @@ namespace tut "3 weeks old" ); } - template<> template<> - void dateutil_object_t::test<6>() - { - set_test_name("ISO dates"); - LLDate now(std::string("2010-01-04T12:00:00Z")); - ensure_equals("days", - LLDateUtil::ageFromDateISO("2009-12-13", now), - "3 weeks old" ); - } + //template<> template<> + //void dateutil_object_t::test<6>() + //{ + // set_test_name("ISO dates"); + // LLDate now(std::string("2010-01-04T12:00:00Z")); + // ensure_equals("days", + // LLDateUtil::ageFromDateISO("2009-12-13", now), + // "3 weeks old" ); + //} } -- cgit v1.2.3 From 49d6cf471df112eff54eba050f1aa57647c130c3 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 11 May 2010 17:27:27 -0700 Subject: Clean up merge, advanced preferences layout --- indra/newview/skins/default/xui/en/panel_preferences_advanced.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml index 063d51e08d..2452067383 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml @@ -301,6 +301,7 @@ Automatic position for: halign="center" height="23" image_overlay="Refresh_Off" + layout="topleft" tool_tip="Reset to Middle Mouse Button" mouse_opaque="true" name="set_voice_middlemouse_button" @@ -314,7 +315,7 @@ Automatic position for: label="Other Devices" left="30" name="joystick_setup_button" - top_pad="12" + top_pad="5" width="155"> + tool_tip="Check to use display names in chat, IM, name tags, etc." + top_pad="5"/> -- cgit v1.2.3 From fd2d23aa2c1f726dc522bbc268a92de5ee649f79 Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 12 May 2010 11:58:27 -0700 Subject: Delete textures/xui files incorrectly added back during last merge --- .../skins/default/textures/icons/Generic_Group_Large.png | Bin 2282 -> 0 bytes indra/newview/skins/default/textures/locked_image.j2c | Bin 6140 -> 0 bytes indra/newview/skins/default/textures/map_infohub.tga | Bin 1068 -> 0 bytes 3 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 indra/newview/skins/default/textures/icons/Generic_Group_Large.png delete mode 100644 indra/newview/skins/default/textures/locked_image.j2c delete mode 100644 indra/newview/skins/default/textures/map_infohub.tga diff --git a/indra/newview/skins/default/textures/icons/Generic_Group_Large.png b/indra/newview/skins/default/textures/icons/Generic_Group_Large.png deleted file mode 100644 index 4d4f1e1bee..0000000000 Binary files a/indra/newview/skins/default/textures/icons/Generic_Group_Large.png and /dev/null differ diff --git a/indra/newview/skins/default/textures/locked_image.j2c b/indra/newview/skins/default/textures/locked_image.j2c deleted file mode 100644 index 9e8998d675..0000000000 Binary files a/indra/newview/skins/default/textures/locked_image.j2c and /dev/null differ diff --git a/indra/newview/skins/default/textures/map_infohub.tga b/indra/newview/skins/default/textures/map_infohub.tga deleted file mode 100644 index 545b8e532c..0000000000 Binary files a/indra/newview/skins/default/textures/map_infohub.tga and /dev/null differ -- cgit v1.2.3 From 3bc7e63f92b29f4be44a589b661d7ff911b443cf Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 12 May 2010 13:54:49 -0700 Subject: Fix merge problem, crash on close prefs due to SmallAvatarNames Was deleted in trunk in code I refactored extensively. --- indra/newview/llvoavatar.cpp | 4 +--- .../skins/default/xui/en/panel_preferences_general.xml | 11 ----------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 8fa845e54a..9ee2c913c6 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2886,9 +2886,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) } else { - static LLUICachedControl small_avatar_names("SmallAvatarNames"); - const LLFontGL* font = - (small_avatar_names ? LLFontGL::getFontSansSerif() : LLFontGL::getFontSansSerifBig() ); + const LLFontGL* font = LLFontGL::getFontSansSerif(); std::string full_name = LLCacheName::buildFullName( firstname->getString(), lastname->getString() ); addNameTagLine(full_name, name_tag_color, LLFontGL::NORMAL, font); 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 15db679f2a..131d9312af 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_general.xml @@ -246,17 +246,6 @@ value="2" width="160" /> - Date: Wed, 12 May 2010 13:55:16 -0700 Subject: Add link to help docs to "Thanks for updating your name" dialog --- indra/newview/skins/default/xui/en/notifications.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index b01a071c2a..ffc58746e3 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -3095,6 +3095,8 @@ Change your display name? 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. Date: Wed, 12 May 2010 14:01:22 -0700 Subject: DEV-50013 IM inline text uses display names Reviewed with Leyla --- indra/newview/llchathistory.cpp | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 0fc5e92324..b3f9bb1dc1 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -242,12 +242,6 @@ public: mAvatarID = chat.mFromID; mSessionID = chat.mSessionID; mSourceType = chat.mSourceType; - //gCacheName->get(mAvatarID, false, boost::bind(&LLChatHistoryHeader::nameUpdatedCallback, this, _1, _2, _3)); - if (mAvatarID.notNull()) - { - LLAvatarNameCache::get(mAvatarID, - boost::bind(&LLChatHistoryHeader::onAvatarNameCache, this, _1, _2)); - } //*TODO overly defensive thing, source type should be maintained out there if((chat.mFromID.isNull() && chat.mFromName.empty()) || chat.mFromName == SYSTEM_FROM) @@ -260,14 +254,19 @@ public: userName->setReadOnlyColor(style_params.readonly_color()); userName->setColor(style_params.color()); - userName->setValue(chat.mFromName); - mFrom = chat.mFromName; - if (chat.mFromName.empty() || CHAT_SOURCE_SYSTEM == mSourceType) + if (chat.mFromName.empty() + || mSourceType == CHAT_SOURCE_SYSTEM + || mAvatarID.isNull()) { mFrom = LLTrans::getString("SECOND_LIFE"); userName->setValue(mFrom); } - + else + { + // ...from a normal user, lookup the name and fill in later + LLAvatarNameCache::get(mAvatarID, + boost::bind(&LLChatHistoryHeader::onAvatarNameCache, this, _1, _2)); + } mMinUserNameWidth = style_params.font()->getWidth(userName->getWText().c_str()) + PADDING; @@ -324,21 +323,15 @@ public: LLPanel::draw(); } - void nameUpdatedCallback(const LLUUID& id,const std::string& full_name, bool is_group) - { - if (id != mAvatarID) - return; - mFrom = full_name; - } - void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) { - if (agent_id != mAvatarID) return; + mFrom = av_name.mDisplayName; - // HACK: just update tooltip - setToolTip( av_name.mSLID ); LLTextBox* user_name = getChild("user_name"); + user_name->setValue( LLSD(av_name.mDisplayName ) ); + user_name->setToolTip( av_name.mSLID ); + setToolTip( av_name.mSLID ); } protected: -- cgit v1.2.3 From 6b00537c871fb08f760016698c7e83f178c1cf55 Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 12 May 2010 16:30:57 -0700 Subject: DEV-50013 WIP Added utility to get name and SLID in single string --- indra/llcommon/llavatarname.cpp | 15 +++++++++++++++ indra/llcommon/llavatarname.h | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp index 4eeb6e706d..7415acadd4 100644 --- a/indra/llcommon/llavatarname.cpp +++ b/indra/llcommon/llavatarname.cpp @@ -79,3 +79,18 @@ void LLAvatarName::fromLLSD(const LLSD& sd) LLDate expires = sd[DISPLAY_NAME_EXPIRES]; mExpires = expires.secondsSinceEpoch(); } + +std::string LLAvatarName::getNameAndSLID() const +{ + std::string name; + if (!mSLID.empty()) + { + name = mDisplayName + " (" + mSLID + ")"; + } + else + { + // ...display names are off, legacy name is in mDisplayName + name = mDisplayName; + } + return name; +} diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h index d7d91e1c7a..87750210c6 100644 --- a/indra/llcommon/llavatarname.h +++ b/indra/llcommon/llavatarname.h @@ -49,6 +49,10 @@ public: void fromLLSD(const LLSD& sd); + // For normal names, returns "James Linden (james.linden)" + // When display names are disabled returns just "James Linden" + std::string getNameAndSLID() const; + // "bobsmith123" or "james.linden", US-ASCII only std::string mSLID; -- cgit v1.2.3 From ab79144d7937b12677d0a19145e3fc958e4c659c Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 12 May 2010 16:31:16 -0700 Subject: Remove unnecessary include (was for debugging) --- indra/newview/llviewerdisplayname.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp index bec2687cca..ec80129f8a 100644 --- a/indra/newview/llviewerdisplayname.cpp +++ b/indra/newview/llviewerdisplayname.cpp @@ -148,7 +148,6 @@ public: } }; -#include "llsdserialize.h" class LLDisplayNameUpdate : public LLHTTPNode { -- cgit v1.2.3 From bee1a091469f8d1f2277e8d5b4cc9981e8060bde Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 12 May 2010 16:32:25 -0700 Subject: DEV-50013 IM window titles use correct name lookup method --- indra/newview/llavataractions.cpp | 65 +++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 37 deletions(-) diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 85a087d6f6..fe6ca60d7c 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -187,28 +187,11 @@ void LLAvatarActions::offerTeleport(const uuid_vec_t& ids) handle_lure(ids); } -// static -void LLAvatarActions::startIM(const LLUUID& id) +static void on_avatar_name_cache_start_im(const LLUUID& agent_id, + const LLAvatarName& av_name) { - if (id.isNull()) - return; - - std::string name; - if (!gCacheName->getFullName(id, name)) - { - gCacheName->get(id, FALSE, boost::bind(&LLAvatarActions::startIM, id)); - return; - } - - // IDEVO - LLAvatarName av_name; - if (LLAvatarNameCache::useDisplayNames() - && LLAvatarNameCache::get(id, &av_name)) - { - name = av_name.mDisplayName + " (" + av_name.mSLID + ")"; - } - - LLUUID session_id = gIMMgr->addSession(name, IM_NOTHING_SPECIAL, id); + std::string name = av_name.getNameAndSLID(); + LLUUID session_id = gIMMgr->addSession(name, IM_NOTHING_SPECIAL, agent_id); if (session_id != LLUUID::null) { LLIMFloater::show(session_id); @@ -216,6 +199,16 @@ void LLAvatarActions::startIM(const LLUUID& id) make_ui_sound("UISndStartIM"); } +// static +void LLAvatarActions::startIM(const LLUUID& id) +{ + if (id.isNull()) + return; + + LLAvatarNameCache::get(id, + boost::bind(&on_avatar_name_cache_start_im, _1, _2)); +} + // static void LLAvatarActions::endIM(const LLUUID& id) { @@ -229,6 +222,18 @@ void LLAvatarActions::endIM(const LLUUID& id) } } +static void on_avatar_name_cache_start_call(const LLUUID& agent_id, + const LLAvatarName& av_name) +{ + std::string name = av_name.getNameAndSLID(); + LLUUID session_id = gIMMgr->addSession(name, IM_NOTHING_SPECIAL, agent_id, true); + if (session_id != LLUUID::null) + { + gIMMgr->startCall(session_id); + } + make_ui_sound("UISndStartIM"); +} + // static void LLAvatarActions::startCall(const LLUUID& id) { @@ -236,22 +241,8 @@ void LLAvatarActions::startCall(const LLUUID& id) { return; } - - std::string name; - gCacheName->getFullName(id, name); - // IDEVO - LLAvatarName av_name; - if (LLAvatarNameCache::useDisplayNames() - && LLAvatarNameCache::get(id, &av_name)) - { - name = av_name.mDisplayName + " (" + av_name.mSLID + ")"; - } - LLUUID session_id = gIMMgr->addSession(name, IM_NOTHING_SPECIAL, id, true); - if (session_id != LLUUID::null) - { - gIMMgr->startCall(session_id); - } - make_ui_sound("UISndStartIM"); + LLAvatarNameCache::get(id, + boost::bind(&on_avatar_name_cache_start_call, _1, _2)); } // static -- cgit v1.2.3 From 6871747f11f300fcf90edba2224c91a3645617cc Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 12 May 2010 16:32:54 -0700 Subject: DEV-50013 Display names limited to 31 chars (not bytes) in viewer UI Reviewed with Leyla --- indra/newview/llpanelme.cpp | 15 +++++++++++++-- indra/newview/skins/default/xui/en/notifications.xml | 11 ++++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index 483741e643..f38c8859ef 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -352,8 +352,19 @@ void LLPanelMyProfileEdit::onDialogSetName(const LLSD& notification, const LLSD& LLUUID agent_id = notification["payload"]["agent_id"]; if (agent_id.isNull()) return; - std::string display_name = response["display_name"].asString(); - LLViewerDisplayName::set(display_name, + std::string display_name_utf8 = response["display_name"].asString(); + + const U32 DISPLAY_NAME_MAX_LENGTH = 31; // characters, not bytes + LLWString display_name_wstr = utf8string_to_wstring(display_name_utf8); + if (display_name_wstr.size() > DISPLAY_NAME_MAX_LENGTH) + { + LLSD args; + args["LENGTH"] = llformat("%d", DISPLAY_NAME_MAX_LENGTH); + LLNotificationsUtil::add("SetDisplayNameFailedLength", args); + return; + } + + LLViewerDisplayName::set(display_name_utf8, boost::bind(&LLPanelMyProfileEdit::onCacheSetName, this, _1, _2, _3)); } diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index ffc58746e3..c4ddae1a12 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -3098,7 +3098,16 @@ Just like in real life, it takes a while for everyone to learn about a new name. See http://wiki.secondlife.com/wiki/Display_Names for details. - + + +Sorry, that name is too long. Display names can have a maximum of [LENGTH] characters. + +Please try a shorter name. + + Date: Wed, 12 May 2010 16:33:21 -0700 Subject: DEV-50031 Moved buttons in IM ctrl panel to top, looks cleaner Reviewed with Leyla --- .../default/xui/en/panel_im_control_panel.xml | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/indra/newview/skins/default/xui/en/panel_im_control_panel.xml b/indra/newview/skins/default/xui/en/panel_im_control_panel.xml index 33a5e01e4c..a36f078f4f 100644 --- a/indra/newview/skins/default/xui/en/panel_im_control_panel.xml +++ b/indra/newview/skins/default/xui/en/panel_im_control_panel.xml @@ -23,26 +23,16 @@ orientation="vertical" top_pad="5" width="114"> - + top_pad="5"/> -- cgit v1.2.3 From 14f423a23c38bf554e9633752074fbcabd92599c Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 13 May 2010 12:18:10 -0700 Subject: DEV-50013 General "name list" support for display name +/- SLID Added lookups via new name cache system. Added optional short_name parameter to show only display names in the list (don't need this yet). Removed top-level global refresh of all name list controls when legacy name cache receives names -- it was inefficient and we don't need it anymore. Reviewed with Leyla. --- indra/newview/llnamelistctrl.cpp | 51 ++++++++++++---------- indra/newview/llnamelistctrl.h | 8 ++-- indra/newview/llstartup.cpp | 1 - .../skins/default/xui/en/panel_group_general.xml | 1 + .../skins/default/xui/en/panel_group_roles.xml | 1 + 5 files changed, 33 insertions(+), 29 deletions(-) diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index c5706e8345..2a7e84256e 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -36,6 +36,7 @@ #include +#include "llavatarnamecache.h" #include "llcachename.h" #include "llfloaterreg.h" #include "llinventory.h" @@ -58,7 +59,8 @@ void LLNameListCtrl::NameTypeNames::declareValues() LLNameListCtrl::Params::Params() : name_column(""), - allow_calling_card_drop("allow_calling_card_drop", false) + allow_calling_card_drop("allow_calling_card_drop", false), + short_names("short_names", false) { name = "name_list"; } @@ -67,7 +69,8 @@ LLNameListCtrl::LLNameListCtrl(const LLNameListCtrl::Params& p) : LLScrollListCtrl(p), mNameColumnIndex(p.name_column.column_index), mNameColumn(p.name_column.column_name), - mAllowCallingCardDrop(p.allow_calling_card_drop) + mAllowCallingCardDrop(p.allow_calling_card_drop), + mShortNames(p.short_names) {} // public @@ -297,10 +300,20 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow( break; case INDIVIDUAL: { - std::string name; - if (gCacheName->getFullName(id, name)) + LLAvatarName av_name; + if (LLAvatarNameCache::get(id, &av_name)) { - fullname = name; + if (mShortNames) + fullname = av_name.mDisplayName; + else + fullname = av_name.getNameAndSLID(); + } + else + { + // ...schedule a callback + LLAvatarNameCache::get(id, + boost::bind(&LLNameListCtrl::onAvatarNameCache, + this, _1, _2)); } break; } @@ -355,23 +368,25 @@ void LLNameListCtrl::removeNameItem(const LLUUID& agent_id) } } -// public -void LLNameListCtrl::refresh(const LLUUID& id, const std::string& full_name, bool is_group) +void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id, + const LLAvatarName& av_name) { - //llinfos << "LLNameListCtrl::refresh " << id << " '" << first << " " - // << last << "'" << llendl; + std::string name; + if (mShortNames) + name = av_name.mDisplayName; + else + name = av_name.getNameAndSLID(); - // TODO: scan items for that ID, fix if necessary item_list::iterator iter; for (iter = getItemList().begin(); iter != getItemList().end(); iter++) { LLScrollListItem* item = *iter; - if (item->getUUID() == id) + if (item->getUUID() == agent_id) { LLScrollListCell* cell = item->getColumn(mNameColumnIndex); if (cell) { - cell->setValue(full_name); + cell->setValue(name); } } } @@ -380,18 +395,6 @@ void LLNameListCtrl::refresh(const LLUUID& id, const std::string& full_name, boo } -// static -void LLNameListCtrl::refreshAll(const LLUUID& id, const std::string& full_name, bool is_group) -{ - LLInstanceTrackerScopedGuard guard; - LLInstanceTracker::instance_iter it; - for (it = guard.beginInstances(); it != guard.endInstances(); ++it) - { - LLNameListCtrl& ctrl = *it; - ctrl.refresh(id, full_name, is_group); - } -} - void LLNameListCtrl::updateColumns() { LLScrollListCtrl::updateColumns(); diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index 6d61214712..54237f4305 100644 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -37,6 +37,7 @@ #include "llscrolllistctrl.h" +class LLAvatarName; class LLNameListCtrl : public LLScrollListCtrl, protected LLInstanceTracker @@ -80,6 +81,7 @@ public: { Optional name_column; Optional allow_calling_card_drop; + Optional short_names; Params(); }; @@ -105,10 +107,6 @@ public: void removeNameItem(const LLUUID& agent_id); - void refresh(const LLUUID& id, const std::string& full_name, bool is_group); - - static void refreshAll(const LLUUID& id, const std::string& full_name, bool is_group); - // LLView interface /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, @@ -123,11 +121,13 @@ public: /*virtual*/ void mouseOverHighlightNthItem( S32 index ); private: void showInspector(const LLUUID& avatar_id, bool is_group); + void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name); private: S32 mNameColumnIndex; std::string mNameColumn; BOOL mAllowCallingCardDrop; + bool mShortNames; // display name only, no SLID }; /** diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 8f53463269..689275421d 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -269,7 +269,6 @@ void transition_back_to_login_panel(const std::string& emsg); void callback_cache_name(const LLUUID& id, const std::string& full_name, bool is_group) { - LLNameListCtrl::refreshAll(id, full_name, is_group); LLNameBox::refreshAll(id, full_name, is_group); LLNameEditor::refreshAll(id, full_name, is_group); diff --git a/indra/newview/skins/default/xui/en/panel_group_general.xml b/indra/newview/skins/default/xui/en/panel_group_general.xml index 9341d433e8..d7a4094d50 100644 --- a/indra/newview/skins/default/xui/en/panel_group_general.xml +++ b/indra/newview/skins/default/xui/en/panel_group_general.xml @@ -112,6 +112,7 @@ Hover your mouse over the options for more help. layout="topleft" left="0" name="visible_members" + short_names="false" top_pad="2"> Date: Thu, 13 May 2010 16:30:15 -0700 Subject: Fix build errors introduced in last merge --- indra/newview/llavataractions.cpp | 2 +- indra/newview/llfloaterland.cpp | 7 +++---- indra/newview/llfloaterpay.cpp | 4 ++-- indra/newview/llpanellandmarkinfo.cpp | 6 +++--- indra/newview/llpanellogin.cpp | 18 +++++++++++++++--- indra/newview/llpanelplaceprofile.cpp | 2 +- indra/newview/llviewermessage.cpp | 4 ++-- indra/newview/llvoicevivox.cpp | 6 ++---- indra/newview/llvoicevivox.h | 2 +- 9 files changed, 30 insertions(+), 21 deletions(-) diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index e1e9e03889..708ef1895e 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -79,7 +79,7 @@ void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::strin } LLSD args; - args["NAME"] = LLSLURL::buildCommand("agent", id, "inspect"); + args["NAME"] = LLSLURL("agent", id, "inspect").getSLURLString(); LLSD payload; payload["id"] = id; payload["name"] = name; diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index b80280d74d..b008189b0d 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -825,9 +825,9 @@ void LLPanelLandGeneral::refreshNames() const LLUUID& auth_buyer_id = parcel->getAuthorizedBuyerID(); if(auth_buyer_id.notNull()) { - std::string name; - name = LLSLURL("agent", auth_buyer_id, "inspect").getSLURLString(); - mSaleInfoForSale2->setTextArg("[BUYER]", name); + std::string name; + name = LLSLURL("agent", auth_buyer_id, "inspect").getSLURLString(); + mSaleInfoForSale2->setTextArg("[BUYER]", name); } else { @@ -835,7 +835,6 @@ void LLPanelLandGeneral::refreshNames() } } } -} // virtual diff --git a/indra/newview/llfloaterpay.cpp b/indra/newview/llfloaterpay.cpp index 7dbcc9555c..7b596e9ba3 100644 --- a/indra/newview/llfloaterpay.cpp +++ b/indra/newview/llfloaterpay.cpp @@ -430,12 +430,12 @@ void LLFloaterPay::finishPayUI(const LLUUID& target_id, BOOL is_group) if (is_group) { setTitle(getString("payee_group")); - slurl = LLSLURL::buildCommand("group", target_id, "inspect"); + slurl = LLSLURL("group", target_id, "inspect").getSLURLString(); } else { setTitle(getString("payee_resident")); - slurl = LLSLURL::buildCommand("agent", target_id, "inspect"); + slurl = LLSLURL("agent", target_id, "inspect").getSLURLString(); } childSetText("payee_name", slurl); diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index c03bc82904..4c2ff471e8 100644 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -235,7 +235,7 @@ void LLPanelLandmarkInfo::displayItemInfo(const LLInventoryItem* pItem) // IDEVO LLUUID creator_id = pItem->getCreatorUUID(); std::string name = - LLSLURL::buildCommand("agent", creator_id, "inspect"); + LLSLURL("agent", creator_id, "inspect").getSLURLString(); //if (!gCacheName->getFullName(creator_id, name)) //{ // gCacheName->get(creator_id, FALSE, @@ -263,7 +263,7 @@ void LLPanelLandmarkInfo::displayItemInfo(const LLInventoryItem* pItem) // gCacheName->get(group_id, TRUE, // boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mOwner, _2, _3)); //} - name = LLSLURL::buildCommand("group", group_id, "inspect"); + name = LLSLURL("group", group_id, "inspect").getSLURLString(); } else { @@ -274,7 +274,7 @@ void LLPanelLandmarkInfo::displayItemInfo(const LLInventoryItem* pItem) // gCacheName->get(owner_id, FALSE, // boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mOwner, _2, _3)); //} - name = LLSLURL::buildCommand("agent", owner_id, "inspect"); + name = LLSLURL("agent", owner_id, "inspect").getSLURLString(); } mOwner->setText(name); } diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 23d05183b4..d313a95546 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -600,7 +600,8 @@ void LLPanelLogin::getFields(LLPointer& credential, LL_INFOS2("Credentials", "Authentication") << "retrieving username:" << username << LL_ENDL; // determine if the username is a first/last form or not. size_t separator_index = username.find_first_of(' '); - if (separator_index == username.npos) + if (separator_index == username.npos + && !LLGridManager::getInstance()->isSystemGrid()) { LL_INFOS2("Credentials", "Authentication") << "account: " << username << LL_ENDL; // single username, so this is a 'clear' identifier @@ -618,8 +619,19 @@ void LLPanelLogin::getFields(LLPointer& credential, else { std::string first = username.substr(0, separator_index); - std::string last = username.substr(separator_index, username.npos); - LLStringUtil::trim(last); + std::string last; + if (separator_index != username.npos) + { + last = username.substr(separator_index, username.npos); + LLStringUtil::trim(last); + } + else + { + // ...on Linden grids, single username users as considered to have + // last name "Resident" + // *TODO: Make login.cgi support "account_name" like above + last = "Resident"; + } if (last.find_first_of(' ') == last.npos) { diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index 41ca237b1e..52a46a45b6 100644 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -448,7 +448,7 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, //gCacheName->get(parcel->getOwnerID(), FALSE, // boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mParcelOwner, _2, _3)); std::string parcel_owner = - LLSLURL::buildCommand("agent", parcel->getOwnerID(), "inspect"); + LLSLURL("agent", parcel->getOwnerID(), "inspect").getSLURLString(); mParcelOwner->setText(parcel_owner); gCacheName->get(region->getOwner(), false, boost::bind(&LLPanelPlaceInfo::onNameCache, mRegionOwnerText, _2)); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index e5fdda62d5..11ab6e7de4 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5008,11 +5008,11 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg) const char* source_type = (is_source_group ? "group" : "agent"); std::string source_slurl = - LLSLURL::buildCommand( source_type, source_id, "about"); + LLSLURL( source_type, source_id, "about").getSLURLString(); const char* dest_type = (is_dest_group ? "group" : "agent"); std::string dest_slurl = - LLSLURL::buildCommand( dest_type, dest_id, "about"); + LLSLURL( dest_type, dest_id, "about").getSLURLString(); // // diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index bcb1a70efb..a457bd1fe6 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -6181,11 +6181,9 @@ void LLVivoxVoiceClient::lookupName(const LLUUID &id) } //static -void LLVivoxVoiceClient::onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group) +void LLVivoxVoiceClient::onAvatarNameLookup(const LLUUID& id, const std::string& name, BOOL is_group) { - std::string name = llformat("%s %s", first.c_str(), last.c_str()); - LLVivoxVoiceClient::getInstance()->avatarNameResolved(id, name); - + LLVivoxVoiceClient::getInstance()->avatarNameResolved(id, name); } void LLVivoxVoiceClient::avatarNameResolved(const LLUUID &id, const std::string &name) diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index 59fec8b954..e6dd0e9823 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -619,7 +619,7 @@ protected: void leaveAudioSession(); void lookupName(const LLUUID &id); - static void onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group); + static void onAvatarNameLookup(const LLUUID& id, const std::string& name, BOOL is_group); void avatarNameResolved(const LLUUID &id, const std::string &name); private: -- cgit v1.2.3 From 669953f6950000821c33e77d4c29ef0c905667f9 Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 13 May 2010 17:07:21 -0700 Subject: DEV-50013 Call floater uses your display name --- indra/newview/llcallfloater.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index dd99c6564c..44fb4e9e72 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -33,13 +33,14 @@ #include "llviewerprecompiledheaders.h" +#include "llcallfloater.h" + #include "llnotificationsutil.h" #include "lltrans.h" -#include "llcallfloater.h" - #include "llagent.h" #include "llagentdata.h" // for gAgentID +#include "llavatarnamecache.h" #include "llavatariconctrl.h" #include "llavatarlist.h" #include "llbottomtray.h" @@ -422,9 +423,10 @@ void LLCallFloater::initAgentData() { mAgentPanel->childSetValue("user_icon", gAgentID); - std::string name; - gCacheName->getFullName(gAgentID, name); - mAgentPanel->childSetValue("user_text", name); + // Just use display name, because it's you + LLAvatarName av_name; + LLAvatarNameCache::get( gAgentID, &av_name ); + mAgentPanel->childSetValue("user_text", av_name.mDisplayName); mSpeakingIndicator = mAgentPanel->getChild("speaking_indicator"); mSpeakingIndicator->setSpeakerId(gAgentID); @@ -445,7 +447,10 @@ void LLCallFloater::setModeratorMutedVoice(bool moderator_muted) void LLCallFloater::updateAgentModeratorState() { std::string name; - gCacheName->getFullName(gAgentID, name); + // Just use display name, because it's you + LLAvatarName av_name; + LLAvatarNameCache::get(gAgentID, &av_name); + name = av_name.mDisplayName; if(gAgent.isInGroup(mSpeakerManager->getSessionID())) { -- cgit v1.2.3 From 2af4875309450fa3d3e266426ada12330489a8c9 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Thu, 13 May 2010 17:26:06 -0700 Subject: DEV-50013 Friends in sidebar now correctly displaying names reviewed by James --- indra/llmessage/llavatarnamecache.cpp | 21 +++++++++++++++++++++ indra/newview/llavatarlist.cpp | 14 ++++++++++---- indra/newview/llavatarlistitem.cpp | 8 +++++--- indra/newview/llavatarlistitem.h | 3 ++- 4 files changed, 38 insertions(+), 8 deletions(-) diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index fdbc28656e..2fc92ff36f 100644 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -214,6 +214,27 @@ public: // cache it and fire signals LLAvatarNameCache::processName(agent_id, av_name, true); } + + // Same logic as error response case + LLSD unresolved_agents = content["bad_ids"]; + if (unresolved_agents.size() > 0) + { + const std::string DUMMY_NAME("\?\?\?"); + LLAvatarName av_name; + av_name.mSLID = DUMMY_NAME; + av_name.mDisplayName = DUMMY_NAME; + av_name.mIsDisplayNameDefault = false; + av_name.mIsDummy = true; + av_name.mExpires = expires; + + it = unresolved_agents.beginArray(); + for ( ; it != unresolved_agents.endArray(); ++it) + { + const LLUUID& agent_id = *it; + // cache it and fire signals + LLAvatarNameCache::processName(agent_id, av_name, true); + } + } } /*virtual*/ void error(U32 status, const std::string& reason) diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index dfb213716c..8801903df7 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -41,6 +41,7 @@ // newview #include "llavatariconctrl.h" +#include "llavatarnamecache.h" #include "llcallingcard.h" // for LLAvatarTracker #include "llcachename.h" #include "llrecentpeople.h" @@ -239,12 +240,15 @@ void LLAvatarList::refresh() // Handle added items. unsigned nadded = 0; + const std::string waiting_str = LLTrans::getString("AvatarNameWaiting"); + for (uuid_vec_t::const_iterator it=added.begin(); it != added.end(); it++) { - std::string name; const LLUUID& buddy_id = *it; - have_names &= (bool)gCacheName->getFullName(buddy_id, name); - if (!have_filter || findInsensitive(name, mNameFilter)) + LLAvatarName av_name; + have_names &= LLAvatarNameCache::get(buddy_id, &av_name); + + if (!have_filter || findInsensitive(av_name.mDisplayName, mNameFilter)) { if (nadded >= ADD_LIMIT) { @@ -253,7 +257,9 @@ void LLAvatarList::refresh() } else { - addNewItem(buddy_id, name, LLAvatarTracker::instance().isBuddyOnline(buddy_id)); + addNewItem(buddy_id, + av_name.mDisplayName.empty() ? waiting_str : av_name.mDisplayName, + LLAvatarTracker::instance().isBuddyOnline(buddy_id)); modified = true; nadded++; } diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index fc5453c2dd..fcfc05af02 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -38,6 +38,7 @@ #include "llfloaterreg.h" #include "llagent.h" +#include "llavatarnamecache.h" #include "lloutputmonitorctrl.h" #include "llavatariconctrl.h" #include "lltextutil.h" @@ -229,7 +230,8 @@ void LLAvatarListItem::setAvatarId(const LLUUID& id, const LLUUID& session_id, b mAvatarIcon->setValue(id); // Set avatar name. - gCacheName->get(id, FALSE, boost::bind(&LLAvatarListItem::onNameCache, this, _2)); + LLAvatarNameCache::get(id, + boost::bind(&LLAvatarListItem::onAvatarNameCache, this, _2)); } } @@ -335,9 +337,9 @@ void LLAvatarListItem::setNameInternal(const std::string& name, const std::strin mAvatarName->setToolTip(name); } -void LLAvatarListItem::onNameCache(const std::string& fullname) +void LLAvatarListItem::onAvatarNameCache(const LLAvatarName& av_name) { - setName(fullname); + setName(av_name.mDisplayName); //requesting the list to resort notifyParent(LLSD().with("sort", LLSD())); diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index 1e3b67b094..bad8aa9d5c 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -42,6 +42,7 @@ #include "llcallingcard.h" // for LLFriendObserver class LLAvatarIconCtrl; +class LLAvatarName; class LLAvatarListItem : public LLPanel, public LLFriendObserver { @@ -151,7 +152,7 @@ private: } EAvatarListItemChildIndex; void setNameInternal(const std::string& name, const std::string& highlight); - void onNameCache(const std::string& fullname); + void onAvatarNameCache(const LLAvatarName& av_name); std::string formatSeconds(U32 secs); -- cgit v1.2.3 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 22f4de740dfcb2fdf92e46b91a426ca14fc42081 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Mon, 17 May 2010 15:28:37 -0700 Subject: inspector and friends list tooltip updates reviewed by James --- indra/newview/llavatarlistitem.cpp | 3 ++- indra/newview/llinspectavatar.cpp | 38 +++++++++++++++----------------------- 2 files changed, 17 insertions(+), 24 deletions(-) diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index fcfc05af02..c458930a62 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -170,6 +170,7 @@ void LLAvatarListItem::setOnline(bool online) void LLAvatarListItem::setName(const std::string& name) { setNameInternal(name, mHighlihtSubstring); + mAvatarName->setToolTip(name); } void LLAvatarListItem::setHighlight(const std::string& highlight) @@ -334,12 +335,12 @@ const std::string LLAvatarListItem::getAvatarName() const void LLAvatarListItem::setNameInternal(const std::string& name, const std::string& highlight) { LLTextUtil::textboxSetHighlightedVal(mAvatarName, mAvatarNameStyle, name, highlight); - mAvatarName->setToolTip(name); } void LLAvatarListItem::onAvatarNameCache(const LLAvatarName& av_name) { setName(av_name.mDisplayName); + mAvatarName->setToolTip(av_name.mSLID); //requesting the list to resort notifyParent(LLSD().with("sort", LLSD())); diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 0024651863..3cbde2bb9c 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -154,7 +154,7 @@ private: private: LLUUID mAvatarID; // Need avatar name information to spawn friend add request - std::string mAvatarName; + std::string mLegacyName; // an in-flight request for avatar properties from LLAvatarPropertiesProcessor // is represented by this object LLFetchAvatarData* mPropertiesRequest; @@ -209,7 +209,7 @@ public: LLInspectAvatar::LLInspectAvatar(const LLSD& sd) : LLInspect( LLSD() ), // single_instance, doesn't really need key mAvatarID(), // set in onOpen() *Note: we used to show partner's name but we dont anymore --angela 3rd Dec* - mAvatarName(), + mLegacyName(), mPropertiesRequest(NULL) { mCommitCallbackRegistrar.add("InspectAvatar.ViewProfile", boost::bind(&LLInspectAvatar::onClickViewProfile, this)); @@ -376,8 +376,7 @@ void LLInspectAvatar::requestUpdate() childSetValue("avatar_icon", LLSD(mAvatarID) ); // JAMESDEBUG HACK: Request via both legacy name system and new - // name system to set mAvatarName for not-yet-converted friendship - // request system. + // name system to set mLegacyName for use with mute system gCacheName->get(mAvatarID, false, boost::bind(&LLInspectAvatar::onNameCache, this, _1, _2, _3)); @@ -574,7 +573,7 @@ void LLInspectAvatar::updateVolumeSlider() LLUICtrl* mute_btn = getChild("mute_btn"); - bool is_linden = LLStringUtil::endsWith(mAvatarName, " Linden"); + bool is_linden = LLStringUtil::endsWith(mLegacyName, " Linden"); mute_btn->setEnabled( !is_linden); mute_btn->setValue( is_muted ); @@ -605,7 +604,7 @@ void LLInspectAvatar::onClickMuteVolume() LLMuteList* mute_list = LLMuteList::getInstance(); bool is_muted = mute_list->isMuted(mAvatarID, LLMute::flagVoiceChat); - LLMute mute(mAvatarID, mAvatarName, LLMute::AGENT); + LLMute mute(mAvatarID, mLegacyName, LLMute::AGENT); if (!is_muted) { mute_list->add(mute, LLMute::flagVoiceChat); @@ -631,14 +630,8 @@ void LLInspectAvatar::onNameCache( { if (id == mAvatarID) { - mAvatarName = full_name; - - // IDEVO JAMESDEBUG - need to always display a display name - if (!LLAvatarNameCache::useDisplayNames()) - { - getChild("user_name")->setValue(full_name); - getChild("user_slid")->setValue(""); - } + // we need the legacy name for the mute list :-( + mLegacyName = full_name; } } @@ -648,7 +641,6 @@ void LLInspectAvatar::onAvatarNameCache( { if (agent_id == mAvatarID) { - // JAMESDEBUG what to do about mAvatarName ? getChild("user_name")->setValue(av_name.mDisplayName); getChild("user_slid")->setValue(av_name.mSLID); } @@ -656,7 +648,7 @@ void LLInspectAvatar::onAvatarNameCache( void LLInspectAvatar::onClickAddFriend() { - LLAvatarActions::requestFriendshipDialog(mAvatarID, mAvatarName); + LLAvatarActions::requestFriendshipDialog(mAvatarID, mLegacyName); closeFloater(); } @@ -724,7 +716,7 @@ void LLInspectAvatar::onClickShare() void LLInspectAvatar::onToggleMute() { - LLMute mute(mAvatarID, mAvatarName, LLMute::AGENT); + LLMute mute(mAvatarID, mLegacyName, LLMute::AGENT); if (LLMuteList::getInstance()->isMuted(mute.mID, mute.mName)) { @@ -741,7 +733,7 @@ void LLInspectAvatar::onToggleMute() void LLInspectAvatar::onClickReport() { - LLFloaterReporter::showFromAvatar(mAvatarID, mAvatarName); + LLFloaterReporter::showFromAvatar(mAvatarID, mLegacyName); closeFloater(); } @@ -765,17 +757,17 @@ void LLInspectAvatar::onClickZoomIn() void LLInspectAvatar::onClickFindOnMap() { - gFloaterWorldMap->trackAvatar(mAvatarID, mAvatarName); + gFloaterWorldMap->trackAvatar(mAvatarID, mLegacyName); LLFloaterReg::showInstance("world_map"); } bool LLInspectAvatar::enableMute() { - bool is_linden = LLStringUtil::endsWith(mAvatarName, " Linden"); + bool is_linden = LLStringUtil::endsWith(mLegacyName, " Linden"); bool is_self = mAvatarID == gAgent.getID(); - if (!is_linden && !is_self && !LLMuteList::getInstance()->isMuted(mAvatarID, mAvatarName)) + if (!is_linden && !is_self && !LLMuteList::getInstance()->isMuted(mAvatarID, mLegacyName)) { return true; } @@ -787,10 +779,10 @@ bool LLInspectAvatar::enableMute() bool LLInspectAvatar::enableUnmute() { - bool is_linden = LLStringUtil::endsWith(mAvatarName, " Linden"); + bool is_linden = LLStringUtil::endsWith(mLegacyName, " Linden"); bool is_self = mAvatarID == gAgent.getID(); - if (!is_linden && !is_self && LLMuteList::getInstance()->isMuted(mAvatarID, mAvatarName)) + if (!is_linden && !is_self && LLMuteList::getInstance()->isMuted(mAvatarID, mLegacyName)) { return true; } -- 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 efa00298b3e806a92ced61803b2bbe8ca40d1681 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Mon, 17 May 2010 17:11:27 -0700 Subject: updated preferences placement for display names option reviewed by James --- .../default/xui/en/panel_preferences_advanced.xml | 15 ++---------- .../default/xui/en/panel_preferences_setup.xml | 27 ++++++++++++++++++++-- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml index e3ee14771c..88b60ea3c8 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml @@ -205,7 +205,7 @@ Automatic position for: layout="topleft" left="30" name="UI Size:" - top_pad="5" + top_pad="15" width="300"> UI size @@ -316,21 +316,10 @@ Automatic position for: label="Other Devices" left="30" name="joystick_setup_button" - top_pad="5" + top_pad="10" width="155"> - diff --git a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml index 2c6ceeef2e..7148aba00a 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml @@ -115,7 +115,7 @@ layout="topleft" left="77" name="connection_port_enabled" - top_pad="20" + top_pad="15" width="256"> Cache size @@ -375,4 +375,27 @@ name="web_proxy_port" top_delta="0" width="145" /> + + Communications: + + -- 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 From da1a39c935d8ef660c35d01bf9d7c53af3adf7ae Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Wed, 19 May 2010 11:38:29 -0700 Subject: Land display name updates reviewed by James --- indra/newview/llfloaterland.cpp | 23 +++++++++-------------- indra/newview/llfloatersellland.cpp | 16 +++++++++++++--- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index b008189b0d..78dea87bfd 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -37,7 +37,7 @@ #include "llfloaterland.h" -#include "llcachename.h" +#include "llavatarnamecache.h" #include "llfocusmgr.h" #include "llnotificationsutil.h" #include "llparcel.h" @@ -586,6 +586,8 @@ void LLPanelLandGeneral::refresh() parcel, GP_LAND_SET_SALE_INFO); BOOL can_be_sold = owner_sellable || estate_manager_sellable; + can_be_sold = true; + const LLUUID &owner_id = parcel->getOwnerID(); BOOL is_public = parcel->isPublic(); @@ -1387,9 +1389,7 @@ bool LLPanelLandObjects::callbackReturnOwnerObjects(const LLSD& notification, co } else { - std::string full_name; - gCacheName->getFullName(owner_id, full_name); - args["NAME"] = full_name; + args["NAME"] = LLSLURL("agent", owner_id, "inspect").getSLURLString(); LLNotificationsUtil::add("OtherObjectsReturned", args); } send_return_objects_message(parcel->getLocalID(), RT_OWNER); @@ -1607,9 +1607,9 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo } // Placeholder for name. - std::string name; - gCacheName->getFullName(owner_id, name); - item_params.columns.add().value(name).font(FONT).column("name"); + LLAvatarName av_name; + LLAvatarNameCache::get(owner_id, &av_name); + item_params.columns.add().value(av_name.getNameAndSLID()).font(FONT).column("name"); object_count_str = llformat("%d", object_count); item_params.columns.add().value(object_count_str).font(FONT).column("count"); @@ -1718,9 +1718,7 @@ void LLPanelLandObjects::onClickReturnOwnerObjects(void* userdata) } else { - std::string name; - gCacheName->getFullName(owner_id, name); - args["NAME"] = name; + args["NAME"] = LLSLURL("agent", owner_id, "inspect").getSLURLString(); LLNotificationsUtil::add("ReturnObjectsOwnedByUser", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOwnerObjects, panelp, _1, _2)); } } @@ -1779,10 +1777,7 @@ void LLPanelLandObjects::onClickReturnOtherObjects(void* userdata) } else { - std::string name; - gCacheName->getFullName(owner_id, name); - args["NAME"] = name; - + args["NAME"] = LLSLURL("agent", owner_id, "inspect").getSLURLString(); LLNotificationsUtil::add("ReturnObjectsNotOwnedByUser", args, LLSD(), boost::bind(&LLPanelLandObjects::callbackReturnOtherObjects, panelp, _1, _2)); } } diff --git a/indra/newview/llfloatersellland.cpp b/indra/newview/llfloatersellland.cpp index 9dddbd998a..ad35581641 100644 --- a/indra/newview/llfloatersellland.cpp +++ b/indra/newview/llfloatersellland.cpp @@ -33,6 +33,7 @@ #include "llfloatersellland.h" +#include "llavatarnamecache.h" #include "llfloateravatarpicker.h" #include "llfloaterreg.h" #include "llfloaterland.h" @@ -47,6 +48,8 @@ #include "lluictrlfactory.h" #include "llviewerwindow.h" +class LLAvatarName; + // defined in llfloaterland.cpp void send_parcel_select_objects(S32 parcel_local_id, U32 return_type, uuid_list_t* return_ids = NULL); @@ -97,6 +100,8 @@ private: void callbackAvatarPick(const std::vector& names, const uuid_vec_t& ids); + void onBuyerNameCache(const LLAvatarName& av_name); + public: virtual BOOL postBuild(); @@ -230,12 +235,17 @@ void LLFloaterSellLandUI::updateParcelInfo() if(mSellToBuyer) { - std::string name; - gCacheName->getFullName(mAuthorizedBuyer, name); - childSetText("sell_to_agent", name); + LLAvatarNameCache::get(mAuthorizedBuyer, + boost::bind(&LLFloaterSellLandUI::onBuyerNameCache, this, _2)); } } +void LLFloaterSellLandUI::onBuyerNameCache(const LLAvatarName& av_name) +{ + childSetText("sell_to_agent", av_name.getNameAndSLID()); + childSetToolTip("sell_to_agent", av_name.mSLID); +} + void LLFloaterSellLandUI::setBadge(const char* id, Badge badge) { static std::string badgeOK("badge_ok.j2c"); -- cgit v1.2.3 From ccc4fbdb1db0ca79b18e9e7f9ba1c2a8d812e5c8 Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 19 May 2010 12:31:57 -0700 Subject: DEV-50263 "Username" hovertip still mentions "Second Life ID" Now refers to Username. Also checked with Char to make sure it's OK to refer to Steller Sunshine (she's fine with it) and fixed the spelling of "Steller" --- indra/newview/skins/default/xui/en/panel_login.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index 88c264c649..5a671ac78a 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -65,13 +65,13 @@ Username: Date: Wed, 19 May 2010 12:34:13 -0700 Subject: DEV-50204 "Ericag Vader" shows when starting IM and local chat Start with blank header to hide sample text from XUI XML. Also fixed problem with computation of minimum chat header name width when the name wasn't in cache. --- indra/newview/llchathistory.cpp | 44 ++++++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 6d98afbc58..a196b4c750 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -106,6 +106,18 @@ LLObjectIMHandler gObjectIMHandler; class LLChatHistoryHeader: public LLPanel { public: + LLChatHistoryHeader() + : LLPanel(), + mPopupMenuHandleAvatar(), + mPopupMenuHandleObject(), + mAvatarID(), + mSourceType(CHAT_SOURCE_UNKNOWN), + mFrom(), + mSessionID(), + mMinUserNameWidth(0), + mUserNameFont(NULL) + {} + static LLChatHistoryHeader* createInstance(const std::string& file_name) { LLChatHistoryHeader* pInstance = new LLChatHistoryHeader; @@ -249,27 +261,29 @@ public: mSourceType = CHAT_SOURCE_SYSTEM; } - LLTextBox* userName = getChild("user_name"); - - userName->setReadOnlyColor(style_params.readonly_color()); - userName->setColor(style_params.color()); + mUserNameFont = style_params.font(); + LLTextBox* user_name = getChild("user_name"); + user_name->setReadOnlyColor(style_params.readonly_color()); + user_name->setColor(style_params.color()); if (chat.mFromName.empty() || mSourceType == CHAT_SOURCE_SYSTEM || mAvatarID.isNull()) { mFrom = LLTrans::getString("SECOND_LIFE"); - userName->setValue(mFrom); + user_name->setValue(mFrom); + updateMinUserNameWidth(); } else { - // ...from a normal user, lookup the name and fill in later + // ...from a normal user, lookup the name and fill in later, + // but start with blank so sample data from XUI XML doesn't + // flash on the screen + user_name->setValue( LLSD() ); LLAvatarNameCache::get(mAvatarID, boost::bind(&LLChatHistoryHeader::onAvatarNameCache, this, _1, _2)); } - mMinUserNameWidth = style_params.font()->getWidth(userName->getWText().c_str()) + PADDING; - setTimeField(chat); LLAvatarIconCtrl* icon = getChild("avatar_icon"); @@ -323,15 +337,26 @@ public: LLPanel::draw(); } + void updateMinUserNameWidth() + { + if (mUserNameFont) + { + LLTextBox* user_name = getChild("user_name"); + const LLWString& text = user_name->getWText(); + mMinUserNameWidth = mUserNameFont->getWidth(text.c_str()) + PADDING; + } + } + void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) { mFrom = av_name.mDisplayName; LLTextBox* user_name = getChild("user_name"); user_name->setValue( LLSD(av_name.mDisplayName ) ); - user_name->setToolTip( av_name.mUsername ); setToolTip( av_name.mUsername ); + // name might have changed, update width + updateMinUserNameWidth(); } protected: @@ -450,6 +475,7 @@ protected: LLUUID mSessionID; S32 mMinUserNameWidth; + const LLFontGL* mUserNameFont; }; LLUICtrl* LLChatHistoryHeader::sInfoCtrl = NULL; -- cgit v1.2.3 From b62d1472be7e64c176ea663562d8747f46ace316 Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 19 May 2010 12:35:22 -0700 Subject: DEV-50265 Login screen should say "Forgot your username or password?" --- indra/newview/skins/default/xui/en/panel_login.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index 5a671ac78a..14759ad731 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -186,7 +186,7 @@ name="forgot_password_text" top_pad="12" right="-10" width="180"> - Forgot your name or password? + Forgot your username or password? Date: Wed, 19 May 2010 14:35:29 -0700 Subject: Temporarily accept both username and sl_id from People API Need this for testing during transition, soon we can remove the code to read "sl_id" --- indra/llcommon/llavatarname.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp index e30f353a6c..5a20aff4e6 100644 --- a/indra/llcommon/llavatarname.cpp +++ b/indra/llcommon/llavatarname.cpp @@ -41,6 +41,7 @@ // Store these in pre-built std::strings to avoid memory allocations in // LLSD map lookups static const std::string SL_ID("sl_id"); +static const std::string USERNAME("username"); 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"); @@ -68,9 +69,7 @@ bool LLAvatarName::operator<(const LLAvatarName& rhs) const LLSD LLAvatarName::asLLSD() const { LLSD sd; - // 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[USERNAME] = mUsername; sd[DISPLAY_NAME] = mDisplayName; sd[LEGACY_FIRST_NAME] = mLegacyFirstName; sd[LEGACY_LAST_NAME] = mLegacyLastName; @@ -81,7 +80,17 @@ LLSD LLAvatarName::asLLSD() const void LLAvatarName::fromLLSD(const LLSD& sd) { - mUsername = sd[SL_ID].asString(); // see asLLSD() above + // *HACK: accept both wire formats for now, as we are transitioning + // People API to use "username" + if (sd.has(USERNAME)) + { + mUsername = sd[USERNAME].asString(); + } + else + { + // *TODO: Remove + mUsername = sd[SL_ID].asString(); + } mDisplayName = sd[DISPLAY_NAME].asString(); mLegacyFirstName = sd[LEGACY_FIRST_NAME].asString(); mLegacyLastName = sd[LEGACY_LAST_NAME].asString(); -- cgit v1.2.3 From 56839abe91ce11a5137b18aace9a1148e31e2642 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Wed, 19 May 2010 14:39:36 -0700 Subject: Updated avatar inspectors to use new legacy name field in avatarnamecache --- indra/newview/llinspectavatar.cpp | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 74bf6e378d..c4144c9844 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -144,10 +144,6 @@ private: // Is used to determine if "Add friend" option should be enabled in gear menu bool isNotFriend(); - // Callback for gCacheName to look up avatar name - void onNameCache(const LLUUID& id, - const std::string& name, - bool is_group); void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name); @@ -375,18 +371,9 @@ void LLInspectAvatar::requestUpdate() childSetValue("avatar_icon", LLSD(mAvatarID) ); - // JAMESDEBUG HACK: Request via both legacy name system and new - // name system to set mLegacyName for use with mute system - gCacheName->get(mAvatarID, false, - boost::bind(&LLInspectAvatar::onNameCache, - this, _1, _2, _3)); - - if (LLAvatarNameCache::useDisplayNames()) - { - LLAvatarNameCache::get(mAvatarID, + LLAvatarNameCache::get(mAvatarID, boost::bind(&LLInspectAvatar::onAvatarNameCache, this, _1, _2)); - } } void LLInspectAvatar::processAvatarData(LLAvatarData* data) @@ -623,18 +610,6 @@ void LLInspectAvatar::onVolumeChange(const LLSD& data) LLVoiceClient::getInstance()->setUserVolume(mAvatarID, volume); } -void LLInspectAvatar::onNameCache( - const LLUUID& id, - const std::string& full_name, - bool is_group) -{ - if (id == mAvatarID) - { - // we need the legacy name for the mute list :-( - mLegacyName = full_name; - } -} - void LLInspectAvatar::onAvatarNameCache( const LLUUID& agent_id, const LLAvatarName& av_name) @@ -643,6 +618,7 @@ void LLInspectAvatar::onAvatarNameCache( { getChild("user_name")->setValue(av_name.mDisplayName); getChild("user_slid")->setValue(av_name.mUsername); + mLegacyName = av_name.getLegacyName(); } } -- cgit v1.2.3 From 415cc68810a17bbe29759d6914746b0b9eb5d8a5 Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 19 May 2010 15:06:47 -0700 Subject: Fix name tag update when prefs applied Reviewed with Leyla --- indra/newview/llfloaterpreference.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index a7e5eedf5f..806572e04d 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -327,6 +327,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) sSkin = gSavedSettings.getString("SkinCurrent"); gSavedSettings.getControl("NameTagShowUsernames")->getCommitSignal()->connect(boost::bind(&handleNameTagOptionChanged, _2)); + gSavedSettings.getControl("NameTagShowFriends")->getCommitSignal()->connect(boost::bind(&handleNameTagOptionChanged, _2)); gSavedSettings.getControl("UseDisplayNames")->getCommitSignal()->connect(boost::bind(&handleDisplayNamesOptionChanged, _2)); } -- cgit v1.2.3 From 32f9bd0bcedfa2ba858448c7211a681d81b85b97 Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 19 May 2010 15:07:25 -0700 Subject: DEV-50013 Add 2px line padding to name tags Should match final requests from Rhett. Reviewed with Leyla --- indra/newview/llhudnametag.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp index e444fc88eb..2cb333a717 100644 --- a/indra/newview/llhudnametag.cpp +++ b/indra/newview/llhudnametag.cpp @@ -60,7 +60,7 @@ const F32 SPRING_STRENGTH = 0.7f; const F32 RESTORATION_SPRING_TIME_CONSTANT = 0.1f; const F32 HORIZONTAL_PADDING = 16.f; const F32 VERTICAL_PADDING = 12.f; -const F32 LINE_PADDING = 1; // aka "leading" +const F32 LINE_PADDING = 3.f; // aka "leading" const F32 BUFFER_SIZE = 2.f; const F32 MIN_EDGE_OVERLAP = 3.f; const F32 HUD_TEXT_MAX_WIDTH = 190.f; @@ -460,7 +460,7 @@ void LLHUDNameTag::renderText(BOOL for_select) LLUI::popMatrix(); } - F32 y_offset = (F32)mOffsetY - 2; // JAMESDEBUG + F32 y_offset = (F32)mOffsetY; // Render label { @@ -807,6 +807,12 @@ void LLHUDNameTag::updateSize() ++iter; } + // Don't want line spacing under the last line + if (height > 0.f) + { + height -= LINE_PADDING; + } + iter = mLabelSegments.begin(); while (iter != mLabelSegments.end()) { -- cgit v1.2.3 From 2c87657659eb6cdd0a0f135b78d290ed180cc21d Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 19 May 2010 16:38:50 -0700 Subject: DEV-50265 Fix clipping of "Forgot your username or password?" --- indra/newview/skins/default/xui/en/panel_login.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index 14759ad731..0f97301856 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -160,8 +160,8 @@ width="135" + width="200"> Sign up + width="200"> Forgot your username or password? + width="200"> Need help logging in? Click to view this web page Click to view this location's information - Click to view this Resident's profile - Click to mute this Resident + Click to view this Resident's profile + Learn more about this Resident + Click to mute this Resident Click to unmute this Resident Click to IM this Resident Click to Pay this Resident -- cgit v1.2.3 From e47249777b79d9c7576f5df010de92f9bbb4f999 Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 20 May 2010 14:16:02 -0700 Subject: DEV-50013 Display names for online/offline notifications Reviewed with Leyla --- indra/newview/llcallingcard.cpp | 77 ++++++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 36 deletions(-) diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index 36de46a367..645ff1f3e9 100644 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -43,6 +43,7 @@ //#include #include "indra_constants.h" +#include "llavatarnamecache.h" #include "llcachename.h" #include "llstl.h" #include "lltimer.h" @@ -96,8 +97,10 @@ const F32 OFFLINE_SECONDS = FIND_FREQUENCY + 8.0f; // static LLAvatarTracker LLAvatarTracker::sInstance; - - +static void on_avatar_name_cache_notify(const LLUUID& agent_id, + const LLAvatarName& av_name, + bool online, + LLSD payload); ///---------------------------------------------------------------------------- /// Class LLAvatarTracker @@ -681,8 +684,6 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online) { tracking_id = mTrackingData->mAvatarID; } - BOOL notify = FALSE; - LLSD args; LLSD payload; for(S32 i = 0; i < count; ++i) { @@ -692,16 +693,6 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online) if(info) { setBuddyOnline(agent_id,online); - if(chat_notify) - { - std::string full_name; - if(gCacheName->getFullName(agent_id, full_name)) - { - notify = TRUE; - args["NAME"] = full_name; - } - - } } else { @@ -717,29 +708,12 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online) // *TODO: get actual inventory id gInventory.addChangedMask(LLInventoryObserver::CALLING_CARD, LLUUID::null); } - if(notify) + if(chat_notify) { - // Popup a notify box with online status of this agent - LLNotificationPtr notification; - - if (online) - { - notification = - LLNotificationsUtil::add("FriendOnline", - args, - payload.with("respond_on_mousedown", TRUE), - boost::bind(&LLAvatarActions::startIM, agent_id)); - } - else - { - notification = - LLNotificationsUtil::add("FriendOffline", args, payload); - } - - // If there's an open IM session with this agent, send a notification there too. - LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, agent_id); - std::string notify_msg = notification->getMessage(); - LLIMModel::instance().proccessOnlineOfflineNotification(session_id, notify_msg); + // Look up the name of this agent for the notification + LLAvatarNameCache::get(agent_id, + boost::bind(&on_avatar_name_cache_notify, + _1, _2, online, payload)); } mModifyMask |= LLFriendObserver::ONLINE; @@ -748,6 +722,37 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online) } } +static void on_avatar_name_cache_notify(const LLUUID& agent_id, + const LLAvatarName& av_name, + bool online, + LLSD payload) +{ + // Popup a notify box with online status of this agent + // Use display name only because this user is your friend + LLSD args; + args["NAME"] = av_name.mDisplayName; + + LLNotificationPtr notification; + if (online) + { + notification = + LLNotificationsUtil::add("FriendOnline", + args, + payload.with("respond_on_mousedown", TRUE), + boost::bind(&LLAvatarActions::startIM, agent_id)); + } + else + { + notification = + LLNotificationsUtil::add("FriendOffline", args, payload); + } + + // If there's an open IM session with this agent, send a notification there too. + LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, agent_id); + std::string notify_msg = notification->getMessage(); + LLIMModel::instance().proccessOnlineOfflineNotification(session_id, notify_msg); +} + void LLAvatarTracker::formFriendship(const LLUUID& id) { if(id.notNull()) -- cgit v1.2.3 From c994a93ed11642fc0fe12c1b743215bf63d852ab Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 20 May 2010 15:30:59 -0700 Subject: DEV-50013 Convert call dialogs to use Display Names Reviewed with Leyla --- indra/newview/llimview.cpp | 17 +++++++---------- indra/newview/llvoicevivox.cpp | 19 +++++++++---------- indra/newview/llvoicevivox.h | 4 ++-- 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index fa8390f5ab..f615402f9c 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1749,7 +1749,7 @@ void LLOutgoingCallDialog::show(const LLSD& key) // 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) + if (mPayload["session_type"].asInteger() == LLIMModel::LLIMSession::P2P_SESSION) { LLAvatarName av_name; if (LLAvatarNameCache::get(callee_id, &av_name)) @@ -1957,8 +1957,9 @@ void LLIncomingCallDialog::setCallerName(const std::string& ui_title, const std::string& ui_label, const std::string& call_type) { - setTitle(ui_title + " " + call_type); + setTitle(ui_title); + // call_type may be a string like " is calling." LLUICtrl* caller_name_widget = getChild("caller name"); caller_name_widget->setValue(ui_label + " " + call_type); } @@ -2068,15 +2069,11 @@ void LLIncomingCallDialog::processCallResponse(S32 response) } else { - if (gCacheName->getFullName(caller_id, correct_session_name)) + // *NOTE: really should be using callbacks here + LLAvatarName av_name; + if (LLAvatarNameCache::get(caller_id, &av_name)) { - // IDEVO really should be using callbacks here - LLAvatarName av_name; - if (LLAvatarNameCache::useDisplayNames() - && LLAvatarNameCache::get(caller_id, &av_name)) - { - correct_session_name = av_name.mDisplayName + " (" + av_name.mUsername + ")"; - } + correct_session_name = av_name.mDisplayName + " (" + av_name.mUsername + ")"; correct_session_name.append(ADHOC_NAME_SUFFIX); } } diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 4a0b0f12a4..409e507c16 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -6180,19 +6180,18 @@ void LLVivoxVoiceClient::notifyFriendObservers() 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); + LLAvatarNameCache::get(id, + boost::bind(&LLVivoxVoiceClient::onAvatarNameCache, + this, _1, _2)); } -//static -void LLVivoxVoiceClient::onAvatarNameLookup(const LLUUID& id, const std::string& name, BOOL is_group) +void LLVivoxVoiceClient::onAvatarNameCache(const LLUUID& agent_id, + const LLAvatarName& av_name) { - LLVivoxVoiceClient::getInstance()->avatarNameResolved(id, name); + // For Vivox, we use the legacy name because I'm uncertain whether or + // not their service can tolerate switching to Username or Display Name + std::string legacy_name = av_name.getLegacyName(); + avatarNameResolved(agent_id, legacy_name); } void LLVivoxVoiceClient::avatarNameResolved(const LLUUID &id, const std::string &name) diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index e6dd0e9823..341f22bd73 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -51,7 +51,7 @@ class LLVivoxProtocolParser; #endif #include "llvoiceclient.h" - +class LLAvatarName; class LLVivoxVoiceAccountProvisionResponder; class LLVivoxVoiceClientMuteListObserver; class LLVivoxVoiceClientFriendsObserver; @@ -619,7 +619,7 @@ protected: void leaveAudioSession(); void lookupName(const LLUUID &id); - static void onAvatarNameLookup(const LLUUID& id, const std::string& name, BOOL is_group); + void onAvatarNameCache(const LLUUID& id, const LLAvatarName& av_name); void avatarNameResolved(const LLUUID &id, const std::string &name); private: -- cgit v1.2.3 From be3fb2b578bfc20dda7175cca595a1be53fe23d2 Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 20 May 2010 15:31:58 -0700 Subject: DEV-50266 Allow login with firstname.lastname Discussed with Gino --- indra/newview/llpanellogin.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index d313a95546..632c66a68c 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -618,11 +618,14 @@ void LLPanelLogin::getFields(LLPointer& credential, } else { + // Be lenient in terms of what separators we allow for two-word names + // and allow legacy users to login with firstname.lastname + separator_index = username.find_first_of(" ._"); std::string first = username.substr(0, separator_index); std::string last; if (separator_index != username.npos) { - last = username.substr(separator_index, username.npos); + last = username.substr(separator_index+1, username.npos); LLStringUtil::trim(last); } else -- cgit v1.2.3 From b637a183c41b091ea1c2e0a2f85987b7b5988afd Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 20 May 2010 16:15:22 -0700 Subject: DEV-50304 Busy mode response off bottom of preferences --- indra/newview/llpanellogin.cpp | 2 +- indra/newview/skins/default/xui/en/panel_preferences_general.xml | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 632c66a68c..feb36cf7dd 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -532,7 +532,7 @@ void LLPanelLogin::setFields(LLPointer credential, std::string login_id = firstname; if (!lastname.empty() && lastname != "Resident") { - // support traditional First Last name slurls + // support traditional First Last name SLURLs login_id += " "; login_id += lastname; } 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 eabbdc2186..c43784a6f8 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_general.xml @@ -303,7 +303,7 @@ left_delta="0" name="show_slids" tool_tip="Show username, like bobsmith123" - top_pad="5" /> + top_pad="2" /> Away timeout: @@ -394,7 +395,7 @@ hover="false" commit_on_focus_lost = "true" follows="left|top" - height="60" + height="42" layout="topleft" left="50" name="busy_response" -- cgit v1.2.3 From e7b1a16f071ff0ab253136a284e20d737352a5ca Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 20 May 2010 16:39:26 -0700 Subject: Strip out debug code related to toggling display names on/off --- indra/newview/llfloaterpreference.cpp | 1 + indra/newview/llviewermenu.cpp | 9 --------- indra/newview/llvoavatar.cpp | 8 -------- indra/newview/llvoavatar.h | 1 - 4 files changed, 1 insertion(+), 18 deletions(-) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 806572e04d..920d09bd7f 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -230,6 +230,7 @@ void handleNameTagOptionChanged(const LLSD& newvalue) void handleDisplayNamesOptionChanged(const LLSD& newvalue) { LLAvatarNameCache::setUseDisplayNames(newvalue.asBoolean()); + LLVOAvatar::invalidateNameTags(); } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index b661e1bcd1..f31f1e80e1 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -7588,15 +7588,6 @@ class LLWorldToggleCameraControls : public view_listener_t } }; -// IDEVO JAMESDEBUG temp code for testing -void toggle_display_names() -{ - bool use = LLAvatarNameCache::useDisplayNames(); - LLAvatarNameCache::setUseDisplayNames(!use); - - LLVOAvatar::invalidateNameTags(); -} - void show_navbar_context_menu(LLView* ctrl, S32 x, S32 y) { static LLMenuGL* show_navbar_context_menu = LLUICtrlFactory::getInstance()->createFromFile("menu_hide_navbar.xml", diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 7e061d69c9..cc38616cb8 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -665,7 +665,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mNameAlpha(0.f), mRenderGroupTitles(sRenderGroupTitles), mNameCloud(false), - mUseDisplayNames( LLAvatarNameCache::useDisplayNames() ), mFirstTEMessageReceived( FALSE ), mFirstAppearanceMessageReceived( FALSE ), mCulled( FALSE ), @@ -2748,13 +2747,6 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) new_name = TRUE; } - // IDEVO HACK to force refresh - if (LLAvatarNameCache::useDisplayNames() != mUseDisplayNames) - { - mUseDisplayNames = LLAvatarNameCache::useDisplayNames(); - new_name = TRUE; - } - // First Calculate Alpha // If alpha > 0, create mNameText if necessary, otherwise delete it F32 alpha = 0.f; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 703066b7a6..c99902a540 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -843,7 +843,6 @@ private: bool mNameCloud; F32 mNameAlpha; BOOL mRenderGroupTitles; - bool mUseDisplayNames; // IDEVO HACK to force refresh //-------------------------------------------------------------------- // Display the name (then optionally fade it out) -- cgit v1.2.3 From 22cef83f9a1008b341c905b0e9840fa37c4930fa Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 21 May 2010 15:26:18 -0700 Subject: DEV-49489 Money transaction msgs use display names Server 1.40 will be deployed before Viewer 2.1, and it sends more extensive money transaction messages, so I removed all the old crufty localization code. If Viewer 2.1 connects to an older server (like a dev grid) money transaction messages will be English only. This simplifies the code tremendously. Reviewed with Leyla --- indra/newview/llviewermessage.cpp | 323 ++++++++++--------------- indra/newview/skins/default/xui/en/strings.xml | 3 +- 2 files changed, 136 insertions(+), 190 deletions(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index cff1db3230..4188a214a8 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -141,7 +141,6 @@ extern BOOL gDebugClicks; // function prototypes bool check_offer_throttle(const std::string& from_name, bool check_only); static void process_money_balance_reply_extended(LLMessageSystem* msg); -static void process_money_balance_reply_legacy(const std::string& desc); //inventory offer throttle globals LLFrameTimer gThrottleTimer; @@ -4852,71 +4851,6 @@ void process_time_dilation(LLMessageSystem *msg, void **user_data) } */ -// Both Product Engine and I wrote solutions to non-localized payment messages. -// Their code probably has more localized strings against it. -// James Cook, 2010-03-27 -// -//static void show_money_balance_notification(const std::string& desc) -//{ -// // Intercept some messages constructed in lltransactionflags.cpp -// // to fix avatar names and allow localization. -// LLSD args; -// LLSD payload; -// std::string name; -// boost::smatch match; -// const char* notification_name = NULL; -// -// // paid you L$ for . -// static const boost::regex paid_you_for("(.+) paid you L\\$(\\d+) for (.*)\\."); -// // paid you L$. -// static const boost::regex paid_you("(.+) paid you L\\$(\\d+)\\."); -// // You paid L$ [for ]. -// static const boost::regex you_paid("You paid (.*) L\\$(\\d+)(.*)\\."); -// -// if (boost::regex_match(desc, match, paid_you_for)) -// { -// name = match[1].str(); -// // IDEVO strip legacy "Resident" name -// name = LLCacheName::cleanFullName(name); -// args["NAME"] = name; -// args["AMOUNT"] = match[2].str(); -// args["REASON"] = match[3].str(); -// notification_name = "PaymentReceivedFor"; -// } -// else if (boost::regex_match(desc, match, paid_you)) -// { -// name = match[1].str(); -// // IDEVO strip legacy "Resident" name -// name = LLCacheName::cleanFullName(name); -// args["NAME"] = name; -// args["AMOUNT"] = match[2].str(); -// notification_name = "PaymentReceived"; -// } -// else if (boost::regex_match(desc, match, you_paid)) -// { -// name = match[1].str(); -// // IDEVO strip legacy "Resident" name -// name = LLCacheName::cleanFullName(name); -// args["NAME"] = name; -// args["AMOUNT"] = match[2].str(); -// args["REASON"] = match[3].str(); -// notification_name = "PaymentSent"; -// } -// -// // if name extracted and name cache contains avatar id send loggable notification -// LLUUID from_id; -// if (notification_name != NULL -// && gCacheName->getUUID(name, from_id)) -// { -// payload["from_id"] = from_id; -// LLNotificationsUtil::add(notification_name, args, payload); -// } -// else -// { -// args["MESSAGE"] = desc; -// LLNotificationsUtil::add("SystemMessage", args); -// } -//} void process_money_balance_reply( LLMessageSystem* msg, void** ) { @@ -4969,19 +4903,84 @@ void process_money_balance_reply( LLMessageSystem* msg, void** ) if (msg->has("TransactionInfo")) { - // JAMESDEBUG TODO - for test, do both!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - process_money_balance_reply_legacy(desc); - // ...message has extended info for localization process_money_balance_reply_extended(msg); } else { - // *NOTE: Can remove this after server 1.40 is widely deployed. - process_money_balance_reply_legacy(desc); + // Only old dev grids will not supply the TransactionInfo block, + // so we can just use the hard-coded English string. + LLSD args; + args["MESSAGE"] = desc; + LLNotificationsUtil::add("SystemMessage", args); + } +} + +static std::string reason_from_transaction_type(S32 transaction_type, + const std::string& item_desc) +{ + // *NOTE: The keys for the reason strings are unusual because + // an earlier version of the code used English language strings + // extracted from hard-coded server English descriptions. + // Keeping them so we don't have to re-localize them. + switch (transaction_type) + { + case TRANS_OBJECT_SALE: + { + LLStringUtil::format_map_t arg; + arg["ITEM"] = item_desc; + return LLTrans::getString("for item", arg); + } + case TRANS_LAND_SALE: + return LLTrans::getString("for a parcel of land"); + + case TRANS_LAND_PASS_SALE: + return LLTrans::getString("for a land access pass"); + + case TRANS_GROUP_LAND_DEED: + return LLTrans::getString("for deeding land"); + + case TRANS_GROUP_CREATE: + return LLTrans::getString("to create a group"); + + case TRANS_GROUP_JOIN: + return LLTrans::getString("to join a group"); + + case TRANS_UPLOAD_CHARGE: + return LLTrans::getString("to upload"); + + default: + llwarns << "Unknown transaction type " + << transaction_type << llendl; + return std::string(); } } +static void money_balance_group_notify(const LLUUID& group_id, + const std::string& name, + bool is_group, + std::string notification, + LLSD args, + LLSD payload) +{ + // Message uses name SLURLs, don't actually have to substitute in + // the name. We're just making sure it's available. + // Notification is either PaymentReceived or PaymentSent + LLNotificationsUtil::add(notification, args, payload); +} + +static void money_balance_avatar_notify(const LLUUID& agent_id, + const LLAvatarName& av_name, + std::string notification, + LLSD args, + LLSD payload) +{ + // Message uses name SLURLs, don't actually have to substitute in + // the name. We're just making sure it's available. + // Notification is either PaymentReceived or PaymentSent + LLNotificationsUtil::add(notification, args, payload); +} + static void process_money_balance_reply_extended(LLMessageSystem* msg) { // Added in server 1.40 and viewer 2.1, support for localization @@ -5008,138 +5007,84 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg) const char* source_type = (is_source_group ? "group" : "agent"); std::string source_slurl = - LLSLURL( source_type, source_id, "about").getSLURLString(); + LLSLURL( source_type, source_id, "inspect").getSLURLString(); const char* dest_type = (is_dest_group ? "group" : "agent"); std::string dest_slurl = - LLSLURL( dest_type, dest_id, "about").getSLURLString(); + LLSLURL( dest_type, dest_id, "inspect").getSLURLString(); - // - // - // JAMESDEBUG TODO HERE!!! - // - // - - switch (transaction_type) - { - case TRANS_OBJECT_SALE: - case TRANS_LAND_SALE: - case TRANS_LAND_PASS_SALE: - case TRANS_GROUP_LAND_DEED: - case TRANS_GROUP_CREATE: - case TRANS_GROUP_JOIN: - case TRANS_UPLOAD_CHARGE: - default: - llinfos << "HERE!" << llendl; - break; - } -} - -// *NOTE: This can be removed after server 1.40 is widely deployed, as it will -// send an extra TransactionInfo block to allow proper localization. -static void process_money_balance_reply_legacy(const std::string& desc) -{ - LLSD args; - - // this is a marker to retrieve avatar name from server message: - // " paid you L$" - const std::string marker = "paid you L$"; - - args["MESSAGE"] = desc; - - // extract avatar name from system message - S32 marker_pos = desc.find(marker, 0); - - std::string base_name = desc.substr(0, marker_pos); + std::string reason = + reason_from_transaction_type(transaction_type, item_description); - std::string name = base_name; - LLStringUtil::trim(name); - - // if name extracted and name cache contains avatar id send loggable notification - LLUUID from_id; - if(name.size() > 0 && gCacheName->getUUID(name, from_id)) + LLStringUtil::format_map_t args; + args["REASON"] = reason; // could be empty + args["AMOUNT"] = llformat("%d", amount); + + // Need to delay until name looked up, so need to know whether or not + // is group + bool is_name_group = false; + LLUUID name_id; + std::string message; + std::string notification; + LLSD final_args; + LLSD payload; + + bool you_paid_someone = (source_id == gAgentID); + if (you_paid_someone) { - //description always comes not localized. lets fix this - - //ammount paid - std::string ammount = desc.substr(marker_pos + marker.length(),desc.length() - marker.length() - marker_pos); - - //reform description - LLStringUtil::format_map_t str_args; - str_args["NAME"] = LLCacheName::cleanFullName(name); - str_args["AMOUNT"] = ammount; - std::string new_description = LLTrans::getString("paid_you_ldollars", str_args); - - args["MESSAGE"] = new_description; - args["NAME"] = LLCacheName::cleanFullName(name); - LLSD payload; - payload["from_id"] = from_id; - LLNotificationsUtil::add("PaymentReceived", args, payload); + args["NAME"] = dest_slurl; + is_name_group = is_dest_group; + name_id = dest_id; + if (!reason.empty()) + { + message = LLTrans::getString("you_paid_ldollars", args); + } + else + { + message = LLTrans::getString("you_paid_ldollars_no_reason", args); + } + final_args["MESSAGE"] = message; + notification = "PaymentSent"; } - //AD *HACK: Parsing incoming string to localize messages that come from server! EXT-5986 - // It's only a temporarily and ineffective measure. It doesn't affect performance much - // because we get here only for specific type of messages, but anyway it is not right to do it! - // *TODO: Server-side changes should be made and this code removed. - else - { - if(desc.find("You paid")==0) + else { + // ...someone paid you + args["NAME"] = source_slurl; + is_name_group = is_source_group; + name_id = source_id; + if (!reason.empty()) { - // Regular expression for message parsing- change it in case of server-side changes. - // Each set of parenthesis will later be used to find arguments of message we generate - // in the end of this if- (.*) gives us name of money receiver, (\\d+)-amount of money we pay - // and ([^$]*)- reason of payment - boost::regex expr("You paid (?:.{0}|(.*) )L\\$(\\d+)\\s?([^$]*)\\."); - boost::match_results matches; - if(boost::regex_match(desc, matches, expr)) - { - // Name of full localizable notification string - // there are four types of this string- with name of receiver and reason of payment, - // without name and without reason (both may also be absent simultaneously). - // example of string without name - You paid L$100 to create a group. - // example of string without reason - You paid Smdby Linden L$100. - // example of string with reason and name - You paid Smbdy Linden L$100 for a land access pass. - // example of string with no info - You paid L$50. - std::string line = "you_paid_ldollars_no_name"; - - // arguments of string which will be in notification - LLStringUtil::format_map_t str_args; - - // extracting amount of money paid (without L$ symbols). It is always present. - str_args["[AMOUNT]"] = std::string(matches[2]); - - // extracting name of person/group you are paying (it may be absent) - std::string name = std::string(matches[1]); - if(!name.empty()) - { - str_args["[NAME]"] = LLCacheName::cleanFullName(name); - line = "you_paid_ldollars"; - } - - // extracting reason of payment (it may be absent) - std::string reason = std::string(matches[3]); - if (reason.empty()) - { - line = name.empty() ? "you_paid_ldollars_no_info" : "you_paid_ldollars_no_reason"; - } - else - { - std::string localized_reason; - // if we haven't found localized string for reason of payment leave it as it was - str_args["[REASON]"] = LLTrans::findString(localized_reason, reason) ? localized_reason : reason; - } - - // forming final message string by retrieving localized version from xml - // and applying previously found arguments - line = LLTrans::getString(line, str_args); - args["MESSAGE"] = line; - } + message = LLTrans::getString("paid_you_ldollars", args); } + else { + message = LLTrans::getString("paid_you_ldollars_no_reason", args); + } + final_args["MESSAGE"] = message; - LLNotificationsUtil::add("SystemMessage", args); + // make notification loggable + payload["from_id"] = source_id; + notification = "PaymentReceived"; } + // Despite using SLURLs, wait until the name is available before + // showing the notification, otherwise the UI layout is strange and + // the user sees a "Loading..." message + if (is_name_group) + { + gCacheName->get(name_id, true, + boost::bind(&money_balance_group_notify, + _1, _2, _3, + notification, final_args, payload)); + } + else { + LLAvatarNameCache::get(name_id, + boost::bind(&money_balance_avatar_notify, + _1, _2, + notification, final_args, payload)); + } } + + bool handle_special_notification_callback(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 83e3fee546..423e3a89c5 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3092,7 +3092,8 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. - [NAME] paid you L$[AMOUNT] + [NAME] paid you L$[AMOUNT] [REASON]. + [NAME] paid you L$[AMOUNT]. You paid [NAME] L$[AMOUNT] [REASON]. You paid L$[AMOUNT]. You paid [NAME] L$[AMOUNT]. -- cgit v1.2.3 From 8992232e64155588c64b4ab29bad6766bc6c7ff6 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 21 May 2010 16:45:35 -0700 Subject: DEV-50013 Display names in mini-map tooltips Reviewed with Leyla --- indra/newview/llnetmap.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index a8dee8a24a..33d03bd890 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -37,6 +37,7 @@ // Library includes (should move below) #include "indra_constants.h" +#include "llavatarnamecache.h" #include "llmath.h" #include "llfloaterreg.h" #include "llfocusmgr.h" @@ -555,11 +556,14 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, MASK mask ) // mToolTipMsg = "[AGENT][REGION](Double-click to open Map)" + bool have_agent = false; LLStringUtil::format_map_t args; - std::string fullname; - if(mClosestAgentToCursor.notNull() && gCacheName->getFullName(mClosestAgentToCursor, fullname)) + LLAvatarName av_name; + if(mClosestAgentToCursor.notNull() + && LLAvatarNameCache::get(mClosestAgentToCursor, &av_name)) { - args["[AGENT]"] = fullname + "\n"; + args["[AGENT]"] = av_name.getNameAndSLID() + "\n"; + have_agent = true; } else { @@ -567,7 +571,7 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, MASK mask ) } LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( viewPosToGlobal( x, y ) ); - if( region ) + if( region && !have_agent) { args["[REGION]"] = region->getName() + "\n"; } -- cgit v1.2.3 From d674d11f895b8f3d578cded931cdc1c430379c95 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 21 May 2010 17:11:31 -0700 Subject: Rename LLAvatarName::getNameAndSLID() to getCompleteName() Discussed with Leyla/Richard --- indra/llcommon/llavatarname.cpp | 2 +- indra/llcommon/llavatarname.h | 2 +- indra/newview/llavataractions.cpp | 4 ++-- indra/newview/llfloaterland.cpp | 2 +- indra/newview/llfloatersellland.cpp | 2 +- indra/newview/llimfloater.cpp | 2 +- indra/newview/llimview.cpp | 2 +- indra/newview/llnamelistctrl.cpp | 4 ++-- indra/newview/llnetmap.cpp | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp index 5a20aff4e6..13b6ad705b 100644 --- a/indra/llcommon/llavatarname.cpp +++ b/indra/llcommon/llavatarname.cpp @@ -99,7 +99,7 @@ void LLAvatarName::fromLLSD(const LLSD& sd) mExpires = expires.secondsSinceEpoch(); } -std::string LLAvatarName::getNameAndSLID() const +std::string LLAvatarName::getCompleteName() const { std::string name; if (!mUsername.empty()) diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h index fb5cb277a2..8b74e006c3 100644 --- a/indra/llcommon/llavatarname.h +++ b/indra/llcommon/llavatarname.h @@ -51,7 +51,7 @@ public: // For normal names, returns "James Linden (james.linden)" // When display names are disabled returns just "James Linden" - std::string getNameAndSLID() const; + std::string getCompleteName() const; // Returns "James Linden" or "bobsmith123 Resident" for backwards // compatibility with systems like voice and muting diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 708ef1895e..1d1a127dae 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -190,7 +190,7 @@ void LLAvatarActions::offerTeleport(const uuid_vec_t& ids) static void on_avatar_name_cache_start_im(const LLUUID& agent_id, const LLAvatarName& av_name) { - std::string name = av_name.getNameAndSLID(); + std::string name = av_name.getCompleteName(); LLUUID session_id = gIMMgr->addSession(name, IM_NOTHING_SPECIAL, agent_id); if (session_id != LLUUID::null) { @@ -225,7 +225,7 @@ void LLAvatarActions::endIM(const LLUUID& id) static void on_avatar_name_cache_start_call(const LLUUID& agent_id, const LLAvatarName& av_name) { - std::string name = av_name.getNameAndSLID(); + std::string name = av_name.getCompleteName(); LLUUID session_id = gIMMgr->addSession(name, IM_NOTHING_SPECIAL, agent_id, true); if (session_id != LLUUID::null) { diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 78dea87bfd..d0a15450a0 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -1609,7 +1609,7 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo // Placeholder for name. LLAvatarName av_name; LLAvatarNameCache::get(owner_id, &av_name); - item_params.columns.add().value(av_name.getNameAndSLID()).font(FONT).column("name"); + item_params.columns.add().value(av_name.getCompleteName()).font(FONT).column("name"); object_count_str = llformat("%d", object_count); item_params.columns.add().value(object_count_str).font(FONT).column("count"); diff --git a/indra/newview/llfloatersellland.cpp b/indra/newview/llfloatersellland.cpp index ebb73baffb..e214b58a9a 100644 --- a/indra/newview/llfloatersellland.cpp +++ b/indra/newview/llfloatersellland.cpp @@ -242,7 +242,7 @@ void LLFloaterSellLandUI::updateParcelInfo() void LLFloaterSellLandUI::onBuyerNameCache(const LLAvatarName& av_name) { - childSetText("sell_to_agent", av_name.getNameAndSLID()); + childSetText("sell_to_agent", av_name.getCompleteName()); childSetToolTip("sell_to_agent", av_name.mUsername); } diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index b5b923dcad..1c1d9343aa 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -331,7 +331,7 @@ void LLIMFloater::onAvatarNameCache(const LLUUID& agent_id, { // Use display name only for labels, as the extended name will be in the // floater title - std::string ui_title = av_name.getNameAndSLID(); + std::string ui_title = av_name.getCompleteName(); updateSessionName(ui_title, av_name.mDisplayName); } diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index f615402f9c..e915d3ad70 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1968,7 +1968,7 @@ void LLIncomingCallDialog::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name, const std::string& call_type) { - std::string title = av_name.getNameAndSLID(); + std::string title = av_name.getCompleteName(); setCallerName(title, av_name.mDisplayName, call_type); } diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index 2a7e84256e..a2450fcdd2 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -306,7 +306,7 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow( if (mShortNames) fullname = av_name.mDisplayName; else - fullname = av_name.getNameAndSLID(); + fullname = av_name.getCompleteName(); } else { @@ -375,7 +375,7 @@ void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id, if (mShortNames) name = av_name.mDisplayName; else - name = av_name.getNameAndSLID(); + name = av_name.getCompleteName(); item_list::iterator iter; for (iter = getItemList().begin(); iter != getItemList().end(); iter++) diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 33d03bd890..67b238ad58 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -562,7 +562,7 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, MASK mask ) if(mClosestAgentToCursor.notNull() && LLAvatarNameCache::get(mClosestAgentToCursor, &av_name)) { - args["[AGENT]"] = av_name.getNameAndSLID() + "\n"; + args["[AGENT]"] = av_name.getCompleteName() + "\n"; have_agent = true; } else -- cgit v1.2.3 From 01fa1379931ea41813e33a4228dcb8a156f609e7 Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 24 May 2010 15:36:30 -0700 Subject: DEV-50013 Use new cache to get legacy name for Vivox --- indra/newview/llvoicevivox.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 409e507c16..a9e14e4e89 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -2658,12 +2658,16 @@ void LLVivoxVoiceClient::buildLocalAudioUpdates(std::ostringstream &stream) void LLVivoxVoiceClient::checkFriend(const LLUUID& id) { - std::string name; buddyListEntry *buddy = findBuddy(id); // Make sure we don't add a name before it's been looked up. - if(gCacheName->getFullName(id, name)) + LLAvatarName av_name; + if(LLAvatarNameCache::get(id, &av_name)) { + // *NOTE: For now, we feed legacy names to Vivox because I don't know + // if their service can support a mix of new and old clients with + // different sorts of names. + std::string name = av_name.getLegacyName(); const LLRelationship* relationInfo = LLAvatarTracker::instance().getBuddyInfo(id); bool canSeeMeOnline = false; -- cgit v1.2.3 From 3b0bb8159605685befd79784ddcf6feadee36b67 Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 24 May 2010 16:58:49 -0700 Subject: DEV-50013 Add "Reset" button to Set Name dialog Reviewed with Richard --- indra/newview/llpanelme.cpp | 14 ++++++++++++-- indra/newview/skins/default/xui/en/notifications.xml | 8 +++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index c1d02fae39..544ca47da4 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -347,12 +347,22 @@ void LLPanelMyProfileEdit::onCacheSetName(bool success, void LLPanelMyProfileEdit::onDialogSetName(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (option == 0) + if (option == 0 || option == 1) { LLUUID agent_id = notification["payload"]["agent_id"]; if (agent_id.isNull()) return; - std::string display_name_utf8 = response["display_name"].asString(); + std::string display_name_utf8; + if (option == 0) + { + // user gave us a name + display_name_utf8 = response["display_name"].asString(); + } + else + { + // reset back to People API default + display_name_utf8 = ""; + } const U32 DISPLAY_NAME_MAX_LENGTH = 31; // characters, not bytes LLWString display_name_wstr = utf8string_to_wstring(display_name_utf8); diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index cc32941633..51b88cf59a 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -3145,7 +3145,9 @@ You are no longer frozen. icon="alertmodal.tga" name="SetDisplayName" type="alertmodal"> -Change your display name? +Change your display name (used for name tags, chat, etc.)? + +You can also reset it back to your original username.
[DISPLAY_NAME] @@ -3157,6 +3159,10 @@ Change your display name? text="Change"/>