summaryrefslogtreecommitdiff
path: root/indra/newview/llnamebox.cpp
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2010-01-19 20:21:08 +0200
committerVadim Savchuk <vsavchuk@productengine.com>2010-01-19 20:21:08 +0200
commitc9896ba504467117bf13a5f2d3526effc123212c (patch)
treed954d684b4002273e7e2631eb411d5d02341134f /indra/newview/llnamebox.cpp
parent138604c2e02f6c78be587ff1e253c31a10ee0301 (diff)
Fixed name_box to display correct initial value (e.g. "Loading...") until the name is cached instead of a broken link "(nobody)".
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llnamebox.cpp')
-rw-r--r--indra/newview/llnamebox.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/indra/newview/llnamebox.cpp b/indra/newview/llnamebox.cpp
index d434017804..cd810b9793 100644
--- a/indra/newview/llnamebox.cpp
+++ b/indra/newview/llnamebox.cpp
@@ -53,6 +53,7 @@ LLNameBox::LLNameBox(const Params& p)
{
mNameID = LLUUID::null;
mLink = p.link;
+ mInitialValue = p.initial_value().asString();
LLNameBox::sInstances.insert(this);
setText(LLStringUtil::null);
}
@@ -67,17 +68,23 @@ void LLNameBox::setNameID(const LLUUID& name_id, BOOL is_group)
mNameID = name_id;
std::string name;
+ BOOL got_name = FALSE;
if (!is_group)
{
- gCacheName->getFullName(name_id, name);
+ got_name = gCacheName->getFullName(name_id, name);
}
else
{
- gCacheName->getGroupName(name_id, name);
+ got_name = gCacheName->getGroupName(name_id, name);
}
- setName(name, is_group);
+ // Got the name already? Set it.
+ // Otherwise it will be set later in refresh().
+ if (got_name)
+ setName(name, is_group);
+ else
+ setText(mInitialValue);
}
void LLNameBox::refresh(const LLUUID& id, const std::string& firstname,