diff options
author | leyla_linden <none@none> | 2010-10-11 14:03:14 -0700 |
---|---|---|
committer | leyla_linden <none@none> | 2010-10-11 14:03:14 -0700 |
commit | f01ba3cf29b45ed312cc7f383a60819b1a8026c6 (patch) | |
tree | b34bf8ba9088bbd8477b36f74cebc3a64ae77a74 | |
parent | 1d08fa4cd72c17dfbe7906fa8f5e2bc44d0fb7cd (diff) |
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
-rw-r--r-- | indra/newview/llpanelme.cpp | 41 | ||||
-rw-r--r-- | indra/newview/llpanelprofileview.cpp | 16 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_edit_profile.xml | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_profile_view.xml | 2 |
4 files changed, 54 insertions, 7 deletions
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<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 LLAvatarNameCache::fetch(gAgent.getID()); LLPanelMyProfile::onOpen(getAvatarId()); @@ -207,6 +204,23 @@ void LLPanelMyProfileEdit::onOpen(const LLSD& key) 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) @@ -267,10 +281,27 @@ void LLPanelMyProfileEdit::onNameCache(const LLUUID& agent_id, const LLAvatarNam { getChild<LLUICtrl>("user_name_small")->setVisible( false ); 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() { 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<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 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" /> |