From f01ba3cf29b45ed312cc7f383a60819b1a8026c6 Mon Sep 17 00:00:00 2001 From: leyla_linden Date: Mon, 11 Oct 2010 14:03:14 -0700 Subject: 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 --- indra/newview/llpanelme.cpp | 41 +++++++++++++++++++--- indra/newview/llpanelprofileview.cpp | 16 +++++++++ .../skins/default/xui/en/panel_edit_profile.xml | 2 +- .../skins/default/xui/en/panel_profile_view.xml | 2 +- 4 files changed, 54 insertions(+), 7 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index 9a13d00685..f587923269 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -176,6 +176,8 @@ LLPanelMyProfileEdit::LLPanelMyProfileEdit() buildFromFile( "panel_edit_profile.xml"); setAvatarId(gAgent.getID()); + + LLAvatarNameCache::addUseDisplayNamesCallback(boost::bind(&LLPanelMyProfileEdit::onAvatarNameChanged, this)); } void LLPanelMyProfileEdit::onOpen(const LLSD& key) @@ -186,11 +188,6 @@ void LLPanelMyProfileEdit::onOpen(const LLSD& key) // is loaded. enableEditing(false); - // Only allow changing name if this region/grid supports it - bool use_display_names = LLAvatarNameCache::useDisplayNames(); - LLUICtrl* set_name = getChild("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 LLAvatarNameCache::fetch(gAgent.getID()); LLPanelMyProfile::onOpen(getAvatarId()); @@ -207,6 +204,23 @@ void LLPanelMyProfileEdit::onOpen(const LLSD& key) LLFirstUse::setDisplayName(false); } } + + if (LLAvatarNameCache::useDisplayNames()) + { + getChild("user_label")->setVisible( true ); + getChild("user_slid")->setVisible( true ); + getChild("display_name_label")->setVisible( true ); + getChild("set_name")->setVisible( true ); + getChild("set_name")->setEnabled( true ); + } + else + { + getChild("user_label")->setVisible( false ); + getChild("user_slid")->setVisible( false ); + getChild("display_name_label")->setVisible( false ); + getChild("set_name")->setVisible( false ); + getChild("set_name")->setEnabled( false ); + } } void LLPanelMyProfileEdit::onClose(const LLSD& key) @@ -267,10 +281,27 @@ void LLPanelMyProfileEdit::onNameCache(const LLUUID& agent_id, const LLAvatarNam { getChild("user_name_small")->setVisible( false ); getChild("user_name")->setVisible( true ); + } + if (LLAvatarNameCache::useDisplayNames()) + { + getChild("user_label")->setVisible( true ); + getChild("user_slid")->setVisible( true ); + getChild("display_name_label")->setVisible( true ); + getChild("set_name")->setVisible( true ); + getChild("set_name")->setEnabled( true ); + } + else + { + getChild("user_label")->setVisible( false ); + getChild("user_slid")->setVisible( false ); + getChild("display_name_label")->setVisible( false ); + getChild("set_name")->setVisible( false ); + getChild("set_name")->setEnabled( false ); } } + void LLPanelMyProfileEdit::onAvatarNameChanged() { LLAvatarNameCache::get(getAvatarId(), diff --git a/indra/newview/llpanelprofileview.cpp b/indra/newview/llpanelprofileview.cpp index 2c4270090c..9011583a60 100644 --- a/indra/newview/llpanelprofileview.cpp +++ b/indra/newview/llpanelprofileview.cpp @@ -225,6 +225,22 @@ void LLPanelProfileView::onAvatarNameCache(const LLUUID& agent_id, } + if (LLAvatarNameCache::useDisplayNames()) + { + getChild("user_label")->setVisible( true ); + getChild("user_slid")->setVisible( true ); + getChild("display_name_label")->setVisible( true ); + getChild("copy_to_clipboard")->setVisible( true ); + getChild("copy_to_clipboard")->setEnabled( true ); + } + else + { + getChild("user_label")->setVisible( false ); + getChild("user_slid")->setVisible( false ); + getChild("display_name_label")->setVisible( false ); + getChild("copy_to_clipboard")->setVisible( false ); + getChild("copy_to_clipboard")->setEnabled( false ); + } } // EOF diff --git a/indra/newview/skins/default/xui/en/panel_edit_profile.xml b/indra/newview/skins/default/xui/en/panel_edit_profile.xml index cf075b8aae..a863f1cc56 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_profile.xml @@ -93,7 +93,7 @@ height="13" layout="topleft" left="10" - name="user_label" + name="display_name_label" text_color="LtGray" value="Display Name:" width="80" /> diff --git a/indra/newview/skins/default/xui/en/panel_profile_view.xml b/indra/newview/skins/default/xui/en/panel_profile_view.xml index 406ec775a5..dc5173867b 100644 --- a/indra/newview/skins/default/xui/en/panel_profile_view.xml +++ b/indra/newview/skins/default/xui/en/panel_profile_view.xml @@ -34,7 +34,7 @@ height="13" layout="topleft" left="45" - name="user_label" + name="display_name_label" text_color="LtGray" value="Display Name:" width="80" /> -- cgit v1.2.3