diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llagentui.cpp | 25 | ||||
-rw-r--r-- | indra/newview/llagentui.h | 1 | ||||
-rw-r--r-- | indra/newview/llavataractions.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llfloateravatarpicker.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llfloaterreporter.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llmutelist.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llpanelgroupinvite.cpp | 7 | ||||
-rw-r--r-- | indra/newview/lltoolpie.cpp | 31 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 19 | ||||
-rw-r--r-- | indra/newview/llviewermessage.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llvoavatar.cpp | 48 |
12 files changed, 74 insertions, 87 deletions
diff --git a/indra/newview/llagentui.cpp b/indra/newview/llagentui.cpp index 7404fe5bc4..1bc9aa0f2b 100644 --- a/indra/newview/llagentui.cpp +++ b/indra/newview/llagentui.cpp @@ -46,31 +46,6 @@ #include "llslurl.h" //static -void LLAgentUI::buildName(std::string& name) -{ - name.clear(); - - LLVOAvatarSelf* avatar_object = gAgent.getAvatarObject(); - if (avatar_object) - { - LLNameValue *first_nv = avatar_object->getNVPair("FirstName"); - LLNameValue *last_nv = avatar_object->getNVPair("LastName"); - if (first_nv && last_nv) - { - name = first_nv->printData() + " " + last_nv->printData(); - } - else - { - llwarns << "Agent is missing FirstName and/or LastName nv pair." << llendl; - } - } - else - { - name = gSavedSettings.getString("FirstName") + " " + gSavedSettings.getString("LastName"); - } -} - -//static void LLAgentUI::buildFullname(std::string& name) { if (gAgent.getAvatarObject()) name = gAgent.getAvatarObject()->getFullname(); diff --git a/indra/newview/llagentui.h b/indra/newview/llagentui.h index 3478793e38..c682d3c951 100644 --- a/indra/newview/llagentui.h +++ b/indra/newview/llagentui.h @@ -45,7 +45,6 @@ public: LOCATION_FORMAT_FULL, // Parcel, Region (x, y, z) - Maturity }; - static void buildName(std::string& name); static void buildFullname(std::string &name); static std::string buildSLURL(const bool escaped = true); diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 7935c32d82..7f20eb02ea 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -103,7 +103,7 @@ void LLAvatarActions::requestFriendshipDialog(const LLUUID& id) } std::string full_name; - // IDEVO gCacheName->getFullName(id, full_name); + gCacheName->getFullName(id, full_name); requestFriendshipDialog(id, full_name); } diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index 7a5c7c835f..cb549e65c8 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -421,7 +421,7 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void* } else { - avatar_name = LLCacheName::buildFullname(first_name, last_name); + avatar_name = LLCacheName::buildFullName(first_name, last_name); search_results->setEnabled(TRUE); found_one = TRUE; } diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 0f3c176cea..a97c21ff6c 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -39,6 +39,7 @@ // linden library includes #include "llassetstorage.h" +#include "llcachename.h" #include "llfontgl.h" #include "llimagej2c.h" #include "llinventory.h" @@ -270,9 +271,8 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id) LLNameValue* lastname = objectp->getNVPair("LastName"); if (firstname && lastname) { - object_owner.append(firstname->getString()); - object_owner.append(1, ' '); - object_owner.append(lastname->getString()); + object_owner = LLCacheName::buildFullName( + firstname->getString(), lastname->getString()); } else { diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index 62085a47b4..38a518c5fd 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -118,9 +118,8 @@ LLMute::LLMute(const LLUUID& id, const std::string& name, EType type, U32 flags) LLNameValue* lastname = mute_object->getNVPair("LastName"); if (firstname && lastname) { - mName.assign( firstname->getString() ); - mName.append(" "); - mName.append( lastname->getString() ); + mName = LLCacheName::buildFullName( + firstname->getString(), lastname->getString()); } mType = mute_object->isAvatar() ? AGENT : OBJECT; } diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp index 06a682c905..0e677ee2bf 100644 --- a/indra/newview/llpanelgroupinvite.cpp +++ b/indra/newview/llpanelgroupinvite.cpp @@ -408,14 +408,13 @@ void LLPanelGroupInvite::addUsers(std::vector<LLUUID>& agent_ids) if(dest && dest->isAvatar()) { std::string fullname; - LLSD args; LLNameValue* nvfirst = dest->getNVPair("FirstName"); LLNameValue* nvlast = dest->getNVPair("LastName"); if(nvfirst && nvlast) { - args["FIRST"] = std::string(nvfirst->getString()); - args["LAST"] = std::string(nvlast->getString()); - fullname = std::string(nvfirst->getString()) + " " + std::string(nvlast->getString()); + fullname = LLCacheName::buildFullName( + nvfirst->getString(), nvlast->getString()); + } if (!fullname.empty()) { diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index bf1e307d71..fa1c99ece7 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -854,23 +854,38 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l || !existing_inspector->getVisible() || existing_inspector->getKey()["avatar_id"].asUUID() != hover_object->getID()) { - std::string avatar_name; - LLNameValue* firstname = hover_object->getNVPair("FirstName"); - LLNameValue* lastname = hover_object->getNVPair("LastName"); - if (firstname && lastname) + // IDEVO JAMESDEBUG try to get display name + SLID + std::string final_name; + std::string full_name; + if (!gCacheName->getFullName(hover_object->getID(), full_name)) { - avatar_name = llformat("%s %s", firstname->getString(), lastname->getString()); + LLNameValue* firstname = hover_object->getNVPair("FirstName"); + LLNameValue* lastname = hover_object->getNVPair("LastName"); + if (firstname && lastname) + { + full_name = LLCacheName::buildFullName( + firstname->getString(), lastname->getString()); + } + else + { + full_name = LLTrans::getString("TooltipPerson"); + } + } + std::string display_name; + if (gCacheName->getDisplayName(hover_object->getID(), display_name)) + { + final_name = display_name + " (" + full_name + ")"; } else { - avatar_name = LLTrans::getString("TooltipPerson"); + final_name = full_name; } - + // *HACK: We may select this object, so pretend it was clicked mPick = mHoverPick; LLInspector::Params p; p.fillFrom(LLUICtrlFactory::instance().getDefaultParams<LLInspector>()); - p.message(avatar_name); + p.message(final_name); p.image.name("Inspector_I"); p.click_callback(boost::bind(showAvatarInspector, hover_object->getID())); p.visible_time_near(6.f); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 6eb607fc6c..6f6932367f 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -2758,9 +2758,8 @@ class LLObjectMute : public view_listener_t LLNameValue *lastname = avatar->getNVPair("LastName"); if (firstname && lastname) { - name = firstname->getString(); - name += " "; - name += lastname->getString(); + name = LLCacheName::buildFullName( + firstname->getString(), lastname->getString()); } type = LLMute::AGENT; @@ -3517,21 +3516,17 @@ void request_friendship(const LLUUID& dest_id) LLViewerObject* dest = gObjectList.findObject(dest_id); if(dest && dest->isAvatar()) { - std::string fullname; - LLSD args; + std::string full_name; LLNameValue* nvfirst = dest->getNVPair("FirstName"); LLNameValue* nvlast = dest->getNVPair("LastName"); if(nvfirst && nvlast) { - args["FIRST"] = nvfirst->getString(); - args["LAST"] = nvlast->getString(); - fullname = nvfirst->getString(); - fullname += " "; - fullname += nvlast->getString(); + full_name = LLCacheName::buildFullName( + nvfirst->getString(), nvlast->getString()); } - if (!fullname.empty()) + if (!full_name.empty()) { - LLAvatarActions::requestFriendshipDialog(dest_id, fullname); + LLAvatarActions::requestFriendshipDialog(dest_id, full_name); } else { diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 266cad67f4..3cc6b9b591 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2517,9 +2517,8 @@ void process_offer_callingcard(LLMessageSystem* msg, void**) LLNameValue* nvlast = source->getNVPair("LastName"); if (nvfirst && nvlast) { - args["FIRST"] = nvfirst->getString(); - args["LAST"] = nvlast->getString(); - source_name = std::string(nvfirst->getString()) + " " + nvlast->getString(); + source_name = LLCacheName::buildFullName( + nvfirst->getString(), nvlast->getString()); } } @@ -5065,7 +5064,7 @@ void process_script_question(LLMessageSystem *msg, void **user_data) // so we'll reuse the same namespace for both throttle types. std::string throttle_name = owner_name; std::string self_name; - LLAgentUI::buildName( self_name ); + LLAgentUI::buildFullname( self_name ); if( owner_name == self_name ) { throttle_name = taskid.getString(); @@ -5708,7 +5707,7 @@ void process_script_dialog(LLMessageSystem* msg, void**) LLNotificationPtr notification; if (!first_name.empty()) { - args["NAME"] = LLCacheName::buildFullname(first_name, last_name); + args["NAME"] = LLCacheName::buildFullName(first_name, last_name); notification = LLNotifications::instance().add( LLNotification::Params("ScriptDialog").substitutions(args).payload(payload).form_elements(form.asLLSD())); } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index fdc6675db1..3f815314f0 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1180,12 +1180,8 @@ BOOL LLViewerWindow::handlePaint(LLWindow *window, S32 x, S32 y, S32 width, S //SetBKColor(hdc, RGB(255, 255, 255)); FillRect(hdc, &wnd_rect, CreateSolidBrush(RGB(255, 255, 255))); - std::string name_str; - LLAgentUI::buildName(name_str); - std::string temp_str; - temp_str = llformat( "%s FPS %3.1f Phy FPS %2.1f Time Dil %1.3f", /* Flawfinder: ignore */ - name_str.c_str(), + temp_str = llformat( "FPS %3.1f Phy FPS %2.1f Time Dil %1.3f", /* Flawfinder: ignore */ LLViewerStats::getInstance()->mFPSStat.getMeanPerSec(), LLViewerStats::getInstance()->mSimPhysicsFPS.getPrev(0), LLViewerStats::getInstance()->mSimTimeDilation.getPrev(0)); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 7df24c9ade..4f7b93b19d 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -44,6 +44,7 @@ #include <ctype.h> #include "llaudioengine.h" +#include "llcachename.h" #include "noise.h" #include "sound_ids.h" @@ -2773,31 +2774,42 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) || is_appearance != mNameAppearance) { std::string line; - if (!sRenderGroupTitles) - { - // If all group titles are turned off, stack first name - // on a line above last name - line += firstname->getString(); - line += "\n"; - } - else if (title && title->getString() && title->getString()[0] != '\0') + // IDEVO JAMESDEBUG + //if (!sRenderGroupTitles) + //{ + // // If all group titles are turned off, stack first name + // // on a line above last name + // line += firstname->getString(); + // line += "\n"; + //} + //else if (title && title->getString() && title->getString()[0] != '\0') + //{ + // line += title->getString(); + // LLStringFn::replace_ascii_controlchars(line,LL_UNKNOWN_CHAR); + // line += "\n"; + // line += firstname->getString(); + //} + //else + //{ + // line += firstname->getString(); + //} + if (title && title->getString() && title->getString()[0] != '\0') { line += title->getString(); LLStringFn::replace_ascii_controlchars(line,LL_UNKNOWN_CHAR); line += "\n"; - line += firstname->getString(); } - else + + std::string display_name; + if (gCacheName->getDisplayName(getID(), display_name)) { - line += firstname->getString(); + line += display_name; } - - // Suppress last name "Resident" as this is used for new SLID names - if (strcmp(lastname->getString(), "Resident")) + else { - line += " "; - line += lastname->getString(); + line += LLCacheName::buildFullName( firstname->getString(), lastname->getString() ); } + BOOL need_comma = FALSE; if (is_away || is_muted || is_busy) @@ -7520,9 +7532,7 @@ std::string LLVOAvatar::getFullname() const LLNameValue* last = getNVPair("LastName"); if (first && last) { - name += first->getString(); - name += " "; - name += last->getString(); + name = LLCacheName::buildFullName( first->getString(), last->getString() ); } return name; |