aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanelavatar.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llpanelavatar.cpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/linden/indra/newview/llpanelavatar.cpp b/linden/indra/newview/llpanelavatar.cpp
index e47ae2a..6b3be29 100644
--- a/linden/indra/newview/llpanelavatar.cpp
+++ b/linden/indra/newview/llpanelavatar.cpp
@@ -416,6 +416,7 @@ BOOL LLPanelAvatarWeb::postBuild(void)
416 childSetControlName("auto_load","AutoLoadWebProfiles"); 416 childSetControlName("auto_load","AutoLoadWebProfiles");
417 417
418 mWebBrowser = getChild<LLMediaCtrl>("profile_html"); 418 mWebBrowser = getChild<LLMediaCtrl>("profile_html");
419
419 mWebBrowser->addObserver(this); 420 mWebBrowser->addObserver(this);
420 421
421 // links open in internally 422 // links open in internally
@@ -490,7 +491,17 @@ void LLPanelAvatarWeb::refresh()
490 mNavigateTo = ""; 491 mNavigateTo = "";
491 } 492 }
492} 493}
494void LLPanelAvatarWeb::onVisibilityChange(BOOL new_visibility)
495{
496 LLPluginClassMedia::EPriority new_priority;
493 497
498 if (new_visibility)
499 new_priority = LLPluginClassMedia::PRIORITY_NORMAL;
500 else
501 new_priority = LLPluginClassMedia::PRIORITY_HIDDEN;
502
503 mWebBrowser->getMediaPlugin()->setPriority(new_priority);
504}
494 505
495void LLPanelAvatarWeb::enableControls(BOOL self) 506void LLPanelAvatarWeb::enableControls(BOOL self)
496{ 507{
@@ -1346,7 +1357,33 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const std::string &name
1346 { 1357 {
1347 name_edit->setText(name); 1358 name_edit->setText(name);
1348 } 1359 }
1360 childSetVisible("name", TRUE);
1361 }
1362 LLNameEditor* complete_name_edit = getChild<LLNameEditor>("complete_name");
1363 if (complete_name_edit)
1364 {
1365 if (LLAvatarNameCache::useDisplayNames())
1366 {
1367 LLAvatarName avatar_name;
1368 if (LLAvatarNameCache::get(avatar_id, &avatar_name))
1369 {
1370 // Always show "Display Name [Legacy Name]" for security reasons
1371 complete_name_edit->setText(avatar_name.getNames());
1372 }
1373 else
1374 {
1375 complete_name_edit->setText(name_edit->getText());
1376 LLAvatarNameCache::get(avatar_id, boost::bind(&LLPanelAvatar::completeNameCallback, _1, _2, this));
1377 }
1378 childSetVisible("name", FALSE);
1379 childSetVisible("complete_name", TRUE);
1380 }
1381 else
1382 {
1383 childSetVisible("complete_name", FALSE);
1384 }
1349 } 1385 }
1386
1350// if (avatar_changed) 1387// if (avatar_changed)
1351 { 1388 {
1352 // While we're waiting for data off the network, clear out the 1389 // While we're waiting for data off the network, clear out the
@@ -1469,6 +1506,22 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const std::string &name
1469 } 1506 }
1470} 1507}
1471 1508
1509void LLPanelAvatar::completeNameCallback(const LLUUID& agent_id,
1510 const LLAvatarName& avatar_name,
1511 void *userdata)
1512{
1513 LLPanelAvatar* self = (LLPanelAvatar*)userdata;
1514 if (!LLAvatarNameCache::useDisplayNames() || agent_id != self->mAvatarID)
1515 {
1516 return;
1517 }
1518 LLLineEditor* complete_name_edit = self->getChild<LLLineEditor>("complete_name");
1519 if (complete_name_edit)
1520 {
1521 // Always show "Display Name [Legacy Name]" for security reasons
1522 complete_name_edit->setText(avatar_name.getNames());
1523 }
1524}
1472 1525
1473void LLPanelAvatar::resetGroupList() 1526void LLPanelAvatar::resetGroupList()
1474{ 1527{