Skip to content
Snippets Groups Projects
Commit f01ba3cf authored by leyla_linden's avatar leyla_linden
Browse files

DN-161 Display Name and Username labels shown in profiles when View Display...

DN-161 Display Name and Username labels shown in profiles when View Display Names setting is off and when Display Names disabled on Simulator
DN-163 Set display name error if user changes View Display Name setting to off in preferences with Edit profile panel open
parent 1d08fa4c
No related branches found
No related tags found
No related merge requests found
...@@ -176,6 +176,8 @@ LLPanelMyProfileEdit::LLPanelMyProfileEdit() ...@@ -176,6 +176,8 @@ LLPanelMyProfileEdit::LLPanelMyProfileEdit()
buildFromFile( "panel_edit_profile.xml"); buildFromFile( "panel_edit_profile.xml");
setAvatarId(gAgent.getID()); setAvatarId(gAgent.getID());
LLAvatarNameCache::addUseDisplayNamesCallback(boost::bind(&LLPanelMyProfileEdit::onAvatarNameChanged, this));
} }
void LLPanelMyProfileEdit::onOpen(const LLSD& key) void LLPanelMyProfileEdit::onOpen(const LLSD& key)
...@@ -186,11 +188,6 @@ void LLPanelMyProfileEdit::onOpen(const LLSD& key) ...@@ -186,11 +188,6 @@ void LLPanelMyProfileEdit::onOpen(const LLSD& key)
// is loaded. // is loaded.
enableEditing(false); enableEditing(false);
// Only allow changing name if this region/grid supports it
bool use_display_names = LLAvatarNameCache::useDisplayNames();
LLUICtrl* set_name = getChild<LLUICtrl>("set_name");
set_name->setVisible(use_display_names);
set_name->setEnabled(use_display_names);
// force new avatar name fetch so we have latest update time // force new avatar name fetch so we have latest update time
LLAvatarNameCache::fetch(gAgent.getID()); LLAvatarNameCache::fetch(gAgent.getID());
LLPanelMyProfile::onOpen(getAvatarId()); LLPanelMyProfile::onOpen(getAvatarId());
...@@ -207,6 +204,23 @@ void LLPanelMyProfileEdit::onOpen(const LLSD& key) ...@@ -207,6 +204,23 @@ void LLPanelMyProfileEdit::onOpen(const LLSD& key)
LLFirstUse::setDisplayName(false); LLFirstUse::setDisplayName(false);
} }
} }
if (LLAvatarNameCache::useDisplayNames())
{
getChild<LLUICtrl>("user_label")->setVisible( true );
getChild<LLUICtrl>("user_slid")->setVisible( true );
getChild<LLUICtrl>("display_name_label")->setVisible( true );
getChild<LLUICtrl>("set_name")->setVisible( true );
getChild<LLUICtrl>("set_name")->setEnabled( true );
}
else
{
getChild<LLUICtrl>("user_label")->setVisible( false );
getChild<LLUICtrl>("user_slid")->setVisible( false );
getChild<LLUICtrl>("display_name_label")->setVisible( false );
getChild<LLUICtrl>("set_name")->setVisible( false );
getChild<LLUICtrl>("set_name")->setEnabled( false );
}
} }
void LLPanelMyProfileEdit::onClose(const LLSD& key) void LLPanelMyProfileEdit::onClose(const LLSD& key)
...@@ -267,10 +281,27 @@ void LLPanelMyProfileEdit::onNameCache(const LLUUID& agent_id, const LLAvatarNam ...@@ -267,10 +281,27 @@ void LLPanelMyProfileEdit::onNameCache(const LLUUID& agent_id, const LLAvatarNam
{ {
getChild<LLUICtrl>("user_name_small")->setVisible( false ); getChild<LLUICtrl>("user_name_small")->setVisible( false );
getChild<LLUICtrl>("user_name")->setVisible( true ); getChild<LLUICtrl>("user_name")->setVisible( true );
}
if (LLAvatarNameCache::useDisplayNames())
{
getChild<LLUICtrl>("user_label")->setVisible( true );
getChild<LLUICtrl>("user_slid")->setVisible( true );
getChild<LLUICtrl>("display_name_label")->setVisible( true );
getChild<LLUICtrl>("set_name")->setVisible( true );
getChild<LLUICtrl>("set_name")->setEnabled( true );
}
else
{
getChild<LLUICtrl>("user_label")->setVisible( false );
getChild<LLUICtrl>("user_slid")->setVisible( false );
getChild<LLUICtrl>("display_name_label")->setVisible( false );
getChild<LLUICtrl>("set_name")->setVisible( false );
getChild<LLUICtrl>("set_name")->setEnabled( false );
} }
} }
void LLPanelMyProfileEdit::onAvatarNameChanged() void LLPanelMyProfileEdit::onAvatarNameChanged()
{ {
LLAvatarNameCache::get(getAvatarId(), LLAvatarNameCache::get(getAvatarId(),
......
...@@ -225,6 +225,22 @@ void LLPanelProfileView::onAvatarNameCache(const LLUUID& agent_id, ...@@ -225,6 +225,22 @@ void LLPanelProfileView::onAvatarNameCache(const LLUUID& agent_id,
} }
if (LLAvatarNameCache::useDisplayNames())
{
getChild<LLUICtrl>("user_label")->setVisible( true );
getChild<LLUICtrl>("user_slid")->setVisible( true );
getChild<LLUICtrl>("display_name_label")->setVisible( true );
getChild<LLUICtrl>("copy_to_clipboard")->setVisible( true );
getChild<LLUICtrl>("copy_to_clipboard")->setEnabled( true );
}
else
{
getChild<LLUICtrl>("user_label")->setVisible( false );
getChild<LLUICtrl>("user_slid")->setVisible( false );
getChild<LLUICtrl>("display_name_label")->setVisible( false );
getChild<LLUICtrl>("copy_to_clipboard")->setVisible( false );
getChild<LLUICtrl>("copy_to_clipboard")->setEnabled( false );
}
} }
// EOF // EOF
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
height="13" height="13"
layout="topleft" layout="topleft"
left="10" left="10"
name="user_label" name="display_name_label"
text_color="LtGray" text_color="LtGray"
value="Display Name:" value="Display Name:"
width="80" /> width="80" />
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
height="13" height="13"
layout="topleft" layout="topleft"
left="45" left="45"
name="user_label" name="display_name_label"
text_color="LtGray" text_color="LtGray"
value="Display Name:" value="Display Name:"
width="80" /> width="80" />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment