Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Black Dragon Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
NiranV
Black Dragon Viewer
Commits
75cc897c
Commit
75cc897c
authored
15 years ago
by
James Cook
Browse files
Options
Downloads
Patches
Plain Diff
Underlined display names now update reliably.
parent
0957fa04
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
indra/llui/llurlentry.cpp
+37
-24
37 additions, 24 deletions
indra/llui/llurlentry.cpp
indra/llui/llurlentry.h
+3
-0
3 additions, 0 deletions
indra/llui/llurlentry.h
indra/llui/tests/llurlentry_stub.cpp
+5
-0
5 additions, 0 deletions
indra/llui/tests/llurlentry_stub.cpp
with
45 additions
and
24 deletions
indra/llui/llurlentry.cpp
+
37
−
24
View file @
75cc897c
...
...
@@ -323,22 +323,19 @@ LLUrlEntryAgent::LLUrlEntryAgent()
void
LLUrlEntryAgent
::
onNameCache
(
const
LLUUID
&
id
,
const
std
::
string
&
full_name
,
bool
is_group
)
{
callObservers
(
id
.
asString
(),
full_name
,
mIcon
);
}
void
LLUrlEntryAgent
::
onAvatarNameCache
(
const
LLUUID
&
id
,
const
LLAvatarName
&
av_name
)
{
// IDEVO demo code
LLAvatarName
av_name
;
if
(
LLAvatarNameCache
::
useDisplayNames
()
&&
LLAvatarNameCache
::
get
(
id
,
&
av_name
))
{
std
::
string
label
=
av_name
.
mDisplayName
+
" ("
+
av_name
.
mSLID
+
")"
;
// use custom icon if available
std
::
string
icon
=
(
!
av_name
.
mBadge
.
empty
()
?
av_name
.
mBadge
:
mIcon
);
// received the agent name from the server - tell our observers
callObservers
(
id
.
asString
(),
label
,
icon
);
}
else
{
callObservers
(
id
.
asString
(),
full_name
,
mIcon
);
}
std
::
string
label
=
av_name
.
mDisplayName
+
" ("
+
av_name
.
mSLID
+
")"
;
// use custom icon if available
std
::
string
icon
=
(
!
av_name
.
mBadge
.
empty
()
?
av_name
.
mBadge
:
mIcon
);
// received the agent name from the server - tell our observers
callObservers
(
id
.
asString
(),
label
,
icon
);
}
std
::
string
LLUrlEntryAgent
::
getLabel
(
const
std
::
string
&
url
,
const
LLUrlLabelCallback
&
cb
)
...
...
@@ -357,27 +354,43 @@ std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCa
}
LLUUID
agent_id
(
agent_id_string
);
std
::
string
full_name
;
if
(
agent_id
.
isNull
())
{
return
LLTrans
::
getString
(
"AvatarNameNobody"
);
}
else
if
(
gCacheName
->
getFullName
(
agent_id
,
full_name
))
if
(
LLAvatarNameCache
::
useDisplayNames
())
{
LLAvatarName
av_name
;
if
(
LLAvatarNameCache
::
useDisplayN
ame
s
(
)
&&
LLAvatarNameCache
::
get
(
agent_id
,
&
av_name
))
if
(
LLAvatarNameCache
::
get
(
agent_id
,
&
av_n
ame
)
)
{
return
av_name
.
mDisplayName
+
" ("
+
av_name
.
mSLID
+
")"
;
}
else
return
full_name
;
{
LLAvatarNameCache
::
get
(
agent_id
,
boost
::
bind
(
&
LLUrlEntryAgent
::
onAvatarNameCache
,
this
,
_1
,
_2
));
addObserver
(
agent_id_string
,
url
,
cb
);
return
LLTrans
::
getString
(
"LoadingData"
);
}
}
else
{
gCacheName
->
get
(
agent_id
,
false
,
boost
::
bind
(
&
LLUrlEntryAgent
::
onNameCache
,
this
,
_1
,
_2
,
_3
));
addObserver
(
agent_id_string
,
url
,
cb
);
return
LLTrans
::
getString
(
"LoadingData"
);
// ...no display names
std
::
string
full_name
;
if
(
gCacheName
->
getFullName
(
agent_id
,
full_name
))
{
return
full_name
;
}
else
{
gCacheName
->
get
(
agent_id
,
false
,
boost
::
bind
(
&
LLUrlEntryAgent
::
onNameCache
,
this
,
_1
,
_2
,
_3
));
addObserver
(
agent_id_string
,
url
,
cb
);
return
LLTrans
::
getString
(
"LoadingData"
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
indra/llui/llurlentry.h
+
3
−
0
View file @
75cc897c
...
...
@@ -41,6 +41,8 @@
#include
<string>
#include
<map>
class
LLAvatarName
;
typedef
boost
::
signals2
::
signal
<
void
(
const
std
::
string
&
url
,
const
std
::
string
&
label
,
const
std
::
string
&
icon
)
>
LLUrlLabelSignal
;
...
...
@@ -173,6 +175,7 @@ class LLUrlEntryAgent : public LLUrlEntryBase
private:
void
onNameCache
(
const
LLUUID
&
id
,
const
std
::
string
&
full_name
,
bool
is_group
);
void
onAvatarNameCache
(
const
LLUUID
&
id
,
const
LLAvatarName
&
av_name
);
};
///
...
...
This diff is collapsed.
Click to expand it.
indra/llui/tests/llurlentry_stub.cpp
+
5
−
0
View file @
75cc897c
...
...
@@ -34,6 +34,11 @@ bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name)
return
false
;
}
void
LLAvatarNameCache
::
get
(
const
LLUUID
&
agent_id
,
callback_slot_t
slot
)
{
return
;
}
bool
LLAvatarNameCache
::
useDisplayNames
()
{
return
false
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment