diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llavatarlist.cpp | 14 | ||||
-rw-r--r-- | indra/newview/llchathistory.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llfloateravatartextures.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llfloaterbuyland.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llfloaterinspect.cpp | 10 | ||||
-rw-r--r-- | indra/newview/llfloaterpay.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llfloaterscriptlimits.cpp | 20 | ||||
-rw-r--r-- | indra/newview/llfloatertopobjects.cpp | 67 | ||||
-rw-r--r-- | indra/newview/llfriendcard.cpp | 10 | ||||
-rw-r--r-- | indra/newview/llpanellandmarkinfo.cpp | 17 | ||||
-rw-r--r-- | indra/newview/llpanelme.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llpanelplaceinfo.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llpanelplaceinfo.h | 4 | ||||
-rw-r--r-- | indra/newview/llpanelplaceprofile.cpp | 20 | ||||
-rw-r--r-- | indra/newview/llviewermessage.cpp | 20 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_buy_object.xml | 11 |
16 files changed, 143 insertions, 88 deletions
diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 57624dec8b..c35e71cc71 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -260,6 +260,8 @@ void LLAvatarList::refresh() } else { + // *NOTE: If you change the UI to show a different string, + // be sure to change the filter code below. addNewItem(buddy_id, av_name.mDisplayName.empty() ? waiting_str : av_name.mDisplayName, LLAvatarTracker::instance().isBuddyOnline(buddy_id)); @@ -284,10 +286,10 @@ void LLAvatarList::refresh() for (std::vector<LLSD>::const_iterator it=cur_values.begin(); it != cur_values.end(); it++) { - std::string name; const LLUUID& buddy_id = it->asUUID(); - have_names &= (bool)gCacheName->getFullName(buddy_id, name); - if (!findInsensitive(name, mNameFilter)) + LLAvatarName av_name; + have_names &= LLAvatarNameCache::get(buddy_id, &av_name); + if (!findInsensitive(av_name.mDisplayName, mNameFilter)) { removeItemByUUID(buddy_id); modified = true; @@ -339,14 +341,14 @@ bool LLAvatarList::filterHasMatches() for (uuid_vec_t::const_iterator it=values.begin(); it != values.end(); it++) { - std::string name; const LLUUID& buddy_id = *it; - BOOL have_name = gCacheName->getFullName(buddy_id, name); + LLAvatarName av_name; + bool have_name = LLAvatarNameCache::get(buddy_id, &av_name); // If name has not been loaded yet we consider it as a match. // When the name will be loaded the filter will be applied again(in refresh()). - if (have_name && !findInsensitive(name, mNameFilter)) + if (have_name && !findInsensitive(av_name.mDisplayName, mNameFilter)) { continue; } diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index d3686ab99c..5323ecce72 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -274,7 +274,7 @@ public: user_name->setValue(mFrom); updateMinUserNameWidth(); } - else + else if (mSourceType == CHAT_SOURCE_AGENT) { // ...from a normal user, lookup the name and fill in later, // but start with blank so sample data from XUI XML doesn't @@ -283,6 +283,13 @@ public: LLAvatarNameCache::get(mAvatarID, boost::bind(&LLChatHistoryHeader::onAvatarNameCache, this, _1, _2)); } + else { + // ...from an object, just use name as given + mFrom = chat.mFromName; + user_name->setValue(mFrom); + updateMinUserNameWidth(); + } + setTimeField(chat); diff --git a/indra/newview/llfloateravatartextures.cpp b/indra/newview/llfloateravatartextures.cpp index fd392d949a..290a343075 100644 --- a/indra/newview/llfloateravatartextures.cpp +++ b/indra/newview/llfloateravatartextures.cpp @@ -33,6 +33,9 @@ #include "llviewerprecompiledheaders.h" #include "llfloateravatartextures.h" +// library headers +#include "llavatarnamecache.h" + #include "llagent.h" #include "llagentwearables.h" #include "lltexturectrl.h" @@ -138,10 +141,10 @@ void LLFloaterAvatarTextures::refresh() LLVOAvatar *avatarp = find_avatar(mID); if (avatarp) { - std::string fullname; - if (gCacheName->getFullName(avatarp->getID(), fullname)) + LLAvatarName av_name; + if (LLAvatarNameCache::get(avatarp->getID(), &av_name)) { - setTitle(mTitle + ": " + fullname); + setTitle(mTitle + ": " + av_name.getCompleteName()); } for (U32 i=0; i < TEX_NUM_INDICES; i++) { diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp index 5d7557a665..2faa9531c4 100644 --- a/indra/newview/llfloaterbuyland.cpp +++ b/indra/newview/llfloaterbuyland.cpp @@ -823,7 +823,7 @@ void LLFloaterBuyLandUI::updateNames() } else if (parcelp->getIsGroupOwned()) { - gCacheName->get(parcelp->getGroupID(), true, + gCacheName->getGroup(parcelp->getGroupID(), boost::bind(&LLFloaterBuyLandUI::updateGroupName, this, _1, _2, _3)); } diff --git a/indra/newview/llfloaterinspect.cpp b/indra/newview/llfloaterinspect.cpp index 13ca7638c5..f22ab70678 100644 --- a/indra/newview/llfloaterinspect.cpp +++ b/indra/newview/llfloaterinspect.cpp @@ -37,7 +37,7 @@ #include "llfloaterreg.h" #include "llfloatertools.h" #include "llavataractions.h" -#include "llcachename.h" +#include "llavatarnamecache.h" #include "llscrolllistctrl.h" #include "llscrolllistitem.h" #include "llselectmgr.h" @@ -212,8 +212,12 @@ void LLFloaterInspect::refresh() substitution["datetime"] = (S32) timestamp; LLStringUtil::format (timeStr, substitution); - gCacheName->getFullName(obj->mPermissions->getOwner(), owner_name); - gCacheName->getFullName(obj->mPermissions->getCreator(), creator_name); + LLAvatarName av_name; + LLAvatarNameCache::get(obj->mPermissions->getOwner(), &av_name); + owner_name = av_name.getCompleteName(); + LLAvatarNameCache::get(obj->mPermissions->getCreator(), &av_name); + creator_name = av_name.getCompleteName(); + row["id"] = obj->getObject()->getID(); row["columns"][0]["column"] = "object_name"; row["columns"][0]["type"] = "text"; diff --git a/indra/newview/llfloaterpay.cpp b/indra/newview/llfloaterpay.cpp index 7b596e9ba3..6b811b5886 100644 --- a/indra/newview/llfloaterpay.cpp +++ b/indra/newview/llfloaterpay.cpp @@ -424,8 +424,6 @@ void LLFloaterPay::payDirectly(money_callback callback, void LLFloaterPay::finishPayUI(const LLUUID& target_id, 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) { diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp index bd31181e5a..0149ead92e 100644 --- a/indra/newview/llfloaterscriptlimits.cpp +++ b/indra/newview/llfloaterscriptlimits.cpp @@ -34,6 +34,8 @@ #include "llviewerprecompiledheaders.h" #include "llfloaterscriptlimits.h" +// library includes +#include "llavatarnamecache.h" #include "llsdutil.h" #include "llsdutil_math.h" #include "message.h" @@ -599,7 +601,7 @@ 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& name) + const std::string& full_name) { LLScrollListCtrl *list = getChild<LLScrollListCtrl>("scripts_list"); if(!list) @@ -607,6 +609,16 @@ void LLPanelScriptLimitsRegionMemory::onNameCache( return; } + std::string name; + if (LLAvatarNameCache::useDisplayNames()) + { + name = LLCacheName::buildUsername(full_name); + } + else + { + name = full_name; + } + std::vector<LLSD>::iterator id_itor; for (id_itor = mObjectListItems.begin(); id_itor != mObjectListItems.end(); ++id_itor) { @@ -707,7 +719,11 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content) } else { - name_is_cached = gCacheName->getFullName(owner_id, owner_buf); + name_is_cached = gCacheName->getFullName(owner_id, owner_buf); // username + if (LLAvatarNameCache::useDisplayNames()) + { + owner_buf = LLCacheName::buildUsername(owner_buf); + } } if(!name_is_cached) { diff --git a/indra/newview/llfloatertopobjects.cpp b/indra/newview/llfloatertopobjects.cpp index 04eb5f5d86..c7c3c2f7da 100644 --- a/indra/newview/llfloatertopobjects.cpp +++ b/indra/newview/llfloatertopobjects.cpp @@ -34,7 +34,9 @@ #include "llfloatertopobjects.h" +// library includes #include "message.h" +#include "llavatarnamecache.h" #include "llfontgl.h" #include "llagent.h" @@ -196,38 +198,53 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data) LLSD element; element["id"] = task_id; - // These cause parse warnings. JC - //element["object_name"] = name_buf; - //element["owner_name"] = owner_buf; - element["columns"][0]["column"] = "score"; - element["columns"][0]["value"] = llformat("%0.3f", score); - element["columns"][0]["font"] = "SANSSERIF"; + + LLSD columns; + columns[0]["column"] = "score"; + columns[0]["value"] = llformat("%0.3f", score); + columns[0]["font"] = "SANSSERIF"; + + columns[1]["column"] = "name"; + columns[1]["value"] = name_buf; + columns[1]["font"] = "SANSSERIF"; + + // Owner names can have trailing spaces sent from server + LLStringUtil::trim(owner_buf); - element["columns"][1]["column"] = "name"; - element["columns"][1]["value"] = name_buf; - element["columns"][1]["font"] = "SANSSERIF"; - element["columns"][2]["column"] = "owner"; - element["columns"][2]["value"] = LLCacheName::cleanFullName(owner_buf); - element["columns"][2]["font"] = "SANSSERIF"; - element["columns"][3]["column"] = "location"; - element["columns"][3]["value"] = llformat("<%0.1f,%0.1f,%0.1f>", location_x, location_y, location_z); - element["columns"][3]["font"] = "SANSSERIF"; - element["columns"][4]["column"] = "time"; - element["columns"][4]["value"] = formatted_time((time_t)time_stamp); - element["columns"][4]["font"] = "SANSSERIF"; + if (LLAvatarNameCache::useDisplayNames()) + { + // ...convert hard-coded name from server to a username + // *TODO: Send owner_id from server and look up display name + owner_buf = LLCacheName::buildUsername(owner_buf); + } + else + { + // ...just strip out legacy "Resident" name + owner_buf = LLCacheName::cleanFullName(owner_buf); + } + columns[2]["column"] = "owner"; + columns[2]["value"] = owner_buf; + columns[2]["font"] = "SANSSERIF"; + + columns[3]["column"] = "location"; + columns[3]["value"] = llformat("<%0.1f,%0.1f,%0.1f>", location_x, location_y, location_z); + columns[3]["font"] = "SANSSERIF"; + columns[4]["column"] = "time"; + columns[4]["value"] = formatted_time((time_t)time_stamp); + columns[4]["font"] = "SANSSERIF"; if (mCurrentMode == STAT_REPORT_TOP_SCRIPTS && have_extended_data) { - element["columns"][5]["column"] = "mono_time"; - element["columns"][5]["value"] = llformat("%0.3f", mono_score); - element["columns"][5]["font"] = "SANSSERIF"; + columns[5]["column"] = "mono_time"; + columns[5]["value"] = llformat("%0.3f", mono_score); + columns[5]["font"] = "SANSSERIF"; - element["columns"][6]["column"] = "URLs"; - element["columns"][6]["value"] = llformat("%d", public_urls); - element["columns"][6]["font"] = "SANSSERIF"; + columns[6]["column"] = "URLs"; + columns[6]["value"] = llformat("%d", public_urls); + columns[6]["font"] = "SANSSERIF"; } - + element["columns"] = columns; list->addElement(element); mObjectListData.append(element); diff --git a/indra/newview/llfriendcard.cpp b/indra/newview/llfriendcard.cpp index 7f28e09933..0a1b0b5df0 100644 --- a/indra/newview/llfriendcard.cpp +++ b/indra/newview/llfriendcard.cpp @@ -32,13 +32,14 @@ #include "llviewerprecompiledheaders.h" +#include "llfriendcard.h" + +#include "llavatarnamecache.h" #include "llinventory.h" #include "llinventoryfunctions.h" #include "llinventoryobserver.h" #include "lltrans.h" -#include "llfriendcard.h" - #include "llcallingcard.h" // for LLAvatarTracker #include "llviewerinventory.h" #include "llinventorymodel.h" @@ -536,8 +537,9 @@ void LLFriendCardsManager::addFriendCardToInventory(const LLUUID& avatarID) { bool shouldBeAdded = true; - std::string name; - gCacheName->getFullName(avatarID, name); + LLAvatarName av_name; + LLAvatarNameCache::get(avatarID, &av_name); + const std::string& name = av_name.mUsername; lldebugs << "Processing buddy name: " << name << ", id: " << avatarID diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index 4c2ff471e8..f6c70c82da 100644 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -236,11 +236,6 @@ void LLPanelLandmarkInfo::displayItemInfo(const LLInventoryItem* pItem) LLUUID creator_id = pItem->getCreatorUUID(); std::string name = LLSLURL("agent", creator_id, "inspect").getSLURLString(); - //if (!gCacheName->getFullName(creator_id, name)) - //{ - // gCacheName->get(creator_id, FALSE, - // boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mCreator, _2, _3)); - //} mCreator->setText(name); } else @@ -257,23 +252,11 @@ void LLPanelLandmarkInfo::displayItemInfo(const LLInventoryItem* pItem) if (perm.isGroupOwned()) { LLUUID group_id = perm.getGroup(); - // IDEVO - //if (!gCacheName->getGroupName(group_id, name)) - //{ - // gCacheName->get(group_id, TRUE, - // boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mOwner, _2, _3)); - //} name = LLSLURL("group", group_id, "inspect").getSLURLString(); } else { LLUUID owner_id = perm.getOwner(); - // IDEVO - //if (!gCacheName->getFullName(owner_id, name)) - //{ - // gCacheName->get(owner_id, FALSE, - // boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mOwner, _2, _3)); - //} name = LLSLURL("agent", owner_id, "inspect").getSLURLString(); } mOwner->setText(name); diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index eb2d57af52..d1ce59d436 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -228,13 +228,6 @@ void LLPanelMyProfileEdit::processProfileProperties(const LLAvatarData* avatar_d childSetValue("show_in_search_checkbox", (BOOL)(avatar_data->flags & AVATAR_ALLOW_PUBLISH)); - // IDEVO - These fields do not seem to exist any more. - //std::string full_name; - //BOOL found = gCacheName->getFullName(avatar_data->avatar_id, full_name); - //if (found) - //{ - // childSetTextArg("name_text", "[NAME]", full_name); - //} LLAvatarNameCache::get(avatar_data->avatar_id, boost::bind(&LLPanelMyProfileEdit::onNameCache, this, _1, _2)); } diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp index 4c3d6e2758..3b0dcad679 100644 --- a/indra/newview/llpanelplaceinfo.cpp +++ b/indra/newview/llpanelplaceinfo.cpp @@ -34,6 +34,7 @@ #include "llpanelplaceinfo.h" +#include "llavatarname.h" #include "llsdutil.h" #include "llsdutil_math.h" @@ -285,3 +286,11 @@ void LLPanelPlaceInfo::onNameCache(LLTextBox* text, const std::string& full_name { text->setText(full_name); } + +// static +void LLPanelPlaceInfo::onAvatarNameCache(const LLUUID& agent_id, + const LLAvatarName& av_name, + LLTextBox* text) +{ + text->setText( av_name.getCompleteName() ); +} diff --git a/indra/newview/llpanelplaceinfo.h b/indra/newview/llpanelplaceinfo.h index 0d7a09b5de..0c08c5059b 100644 --- a/indra/newview/llpanelplaceinfo.h +++ b/indra/newview/llpanelplaceinfo.h @@ -40,6 +40,7 @@ #include "llremoteparcelrequest.h" +class LLAvatarName; class LLExpandableTextBox; class LLIconCtrl; class LLInventoryItem; @@ -103,6 +104,9 @@ public: protected: static void onNameCache(LLTextBox* text, const std::string& full_name); + static void onAvatarNameCache(const LLUUID& agent_id, + const LLAvatarName& av_name, + LLTextBox* text); /** * 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 23171d5ff2..2a8249f4b6 100644 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -34,6 +34,7 @@ #include "llpanelplaceprofile.h" +#include "llavatarnamecache.h" #include "llparcel.h" #include "message.h" @@ -428,10 +429,10 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, if(!parcel->getGroupID().isNull()) { // FIXME: Using parcel group as region group. - gCacheName->get(parcel->getGroupID(), true, + gCacheName->getGroup(parcel->getGroupID(), boost::bind(&LLPanelPlaceInfo::onNameCache, mRegionGroupText, _2)); - gCacheName->get(parcel->getGroupID(), true, + gCacheName->getGroup(parcel->getGroupID(), boost::bind(&LLPanelPlaceInfo::onNameCache, mParcelOwner, _2)); } else @@ -444,14 +445,12 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, else { // Figure out the owner's name - // IDEVO - //gCacheName->get(parcel->getOwnerID(), FALSE, - // boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mParcelOwner, _2, _3)); std::string parcel_owner = LLSLURL("agent", parcel->getOwnerID(), "inspect").getSLURLString(); mParcelOwner->setText(parcel_owner); - gCacheName->get(region->getOwner(), false, - boost::bind(&LLPanelPlaceInfo::onNameCache, mRegionOwnerText, _2)); + LLAvatarNameCache::get(region->getOwner(), + boost::bind(&LLPanelPlaceInfo::onAvatarNameCache, + _1, _2, mRegionOwnerText)); } if(LLParcel::OS_LEASE_PENDING == parcel->getOwnershipStatus()) @@ -473,9 +472,10 @@ 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::onNameCache, mSaleToText, _2)); - + LLAvatarNameCache::get(auth_buyer_id, + boost::bind(&LLPanelPlaceInfo::onAvatarNameCache, + _1, _2, mSaleToText)); + // 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/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index cdcbe20a94..cca1415f9c 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2024,7 +2024,8 @@ static std::string clean_name_from_im(const std::string& name, EInstantMessage t } } -static std::string clean_name_from_task_im(const std::string& msg) +static std::string clean_name_from_task_im(const std::string& msg, + BOOL from_group) { boost::smatch match; static const boost::regex returned_exp( @@ -2034,7 +2035,20 @@ static std::string clean_name_from_task_im(const std::string& msg) // match objects are 1-based for groups std::string final = match[1].str(); std::string name = match[2].str(); - final += LLCacheName::cleanFullName(name); + // Don't try to clean up group names + if (!from_group) + { + if (LLAvatarNameCache::useDisplayNames()) + { + // ...just convert to username + final += LLCacheName::buildUsername(name); + } + else + { + // ...strip out legacy "Resident" name + final += LLCacheName::cleanFullName(name); + } + } final += match[3].str(); return final; } @@ -2603,7 +2617,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } // IDEVO Some messages have embedded resident names - message = clean_name_from_task_im(message); + message = clean_name_from_task_im(message, from_group); LLSD query_string; query_string["owner"] = from_id; diff --git a/indra/newview/skins/default/xui/en/floater_buy_object.xml b/indra/newview/skins/default/xui/en/floater_buy_object.xml index 3d8f5d678b..db595458c0 100644 --- a/indra/newview/skins/default/xui/en/floater_buy_object.xml +++ b/indra/newview/skins/default/xui/en/floater_buy_object.xml @@ -2,7 +2,7 @@ <floater legacy_header_height="18" can_resize="true" - height="290" + height="310" layout="topleft" min_height="150" min_width="225" @@ -84,15 +84,18 @@ length="1" follows="left|right|bottom" font="SansSerif" - height="16" + height="35" layout="topleft" left_delta="0" + line_spacing.pixels="7" name="buy_text" text_color="white" top_pad="5" use_ellipses="true" - width="260"> - Buy for L$[AMOUNT] from [NAME]? + width="260" + word_wrap="true"> +Buy for L$[AMOUNT] from: +[NAME]? </text> <button follows="right|bottom" |