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/newview/llfloaterscriptlimits.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/newview/llfloaterscriptlimits.cpp') 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)); } } -- cgit v1.2.3 From 207c40de9435d2a51c41bc0b72250cd5ff7e87ac Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 3 Mar 2010 16:04:37 -0800 Subject: Fix script info for group-owned objects and stop requesting group name lookups for IDs that are actually avatars --- indra/newview/llfloaterscriptlimits.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'indra/newview/llfloaterscriptlimits.cpp') diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp index 2fce50007e..5474a68512 100644 --- a/indra/newview/llfloaterscriptlimits.cpp +++ b/indra/newview/llfloaterscriptlimits.cpp @@ -636,6 +636,9 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content) std::string name_buf = content["parcels"][i]["objects"][j]["name"].asString(); LLUUID task_id = content["parcels"][i]["objects"][j]["id"].asUUID(); LLUUID owner_id = content["parcels"][i]["objects"][j]["owner_id"].asUUID(); + // This field may not be sent by all server versions, but it's OK if + // it uses the LLSD default of false + bool is_group_owned = content["parcels"][i]["objects"][j]["is_group_owned"].asBoolean(); F32 location_x = 0.0f; F32 location_y = 0.0f; @@ -661,17 +664,22 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content) // ...and if not use the slightly more painful method of disovery: else { - BOOL name_is_cached = gCacheName->getFullName(owner_id, owner_buf); + BOOL name_is_cached; + if (is_group_owned) + { + name_is_cached = gCacheName->getGroupName(owner_id, owner_buf); + } + else + { + name_is_cached = gCacheName->getFullName(owner_id, owner_buf); + } if(!name_is_cached) { if(std::find(names_requested.begin(), names_requested.end(), owner_id) == names_requested.end()) { names_requested.push_back(owner_id); - // 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, + gCacheName->get(owner_id, is_group_owned, + boost::bind(&LLPanelScriptLimitsRegionMemory::onNameCache, this, _1, _2)); } } -- cgit v1.2.3 From b944a4792762bf61b7837a29c8580c9823c9670b Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 28 May 2010 09:59:47 -0700 Subject: DEV-50013 Script memory floater uses usernames --- indra/newview/llfloaterscriptlimits.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterscriptlimits.cpp') 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("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::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) { -- cgit v1.2.3 From 3e7f5e571ec223a67cb30ed8ce5cd09c130c3e72 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 28 May 2010 15:14:29 -0700 Subject: Code comments/variable names to make clear when legacy names used Reviewed with Leyla --- indra/newview/llfloaterscriptlimits.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterscriptlimits.cpp') diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp index 0149ead92e..f8a5e57389 100644 --- a/indra/newview/llfloaterscriptlimits.cpp +++ b/indra/newview/llfloaterscriptlimits.cpp @@ -730,8 +730,8 @@ 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, is_group_owned, - boost::bind(&LLPanelScriptLimitsRegionMemory::onNameCache, + gCacheName->get(owner_id, is_group_owned, // username + boost::bind(&LLPanelScriptLimitsRegionMemory::onNameCache, this, _1, _2)); } } -- cgit v1.2.3