diff options
author | Leyla Farazha <leyla@lindenlab.com> | 2010-10-12 10:46:47 -0700 |
---|---|---|
committer | Leyla Farazha <leyla@lindenlab.com> | 2010-10-12 10:46:47 -0700 |
commit | 0f7ca61386e4cf0f9efda7c380c40cc608f26ea3 (patch) | |
tree | 5fb51a7ab9416ba40cd7a09b054f53cae707941e | |
parent | f1c41c7945456e0647fac3ae631034cf1ffb0e65 (diff) | |
parent | f01ba3cf29b45ed312cc7f383a60819b1a8026c6 (diff) |
Merge
-rw-r--r-- | indra/newview/llchathistory.cpp | 18 | ||||
-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 |
5 files changed, 63 insertions, 16 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index f28e02c66e..378c4358b3 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -367,15 +367,15 @@ public: user_name->setValue( LLSD(av_name.mDisplayName ) ); user_name->setToolTip( av_name.mUsername ); - if (gSavedSettings.getBOOL("NameTagShowUsernames")) - { - LLStyle::Params style_params_name; - LLColor4 userNameColor = LLUIColorTable::instance().getColor("EmphasisColor"); - style_params_name.color(userNameColor); - style_params_name.font.name("SansSerifSmall"); - style_params_name.font.style("NORMAL"); - style_params_name.readonly_color(userNameColor); - user_name->appendText(" - " + av_name.mUsername, FALSE, style_params_name); + if (gSavedSettings.getBOOL("NameTagShowUsernames") && LLAvatarNameCache::useDisplayNames()) + { + LLStyle::Params style_params_name; + LLColor4 userNameColor = LLUIColorTable::instance().getColor("EmphasisColor"); + style_params_name.color(userNameColor); + style_params_name.font.name("SansSerifSmall"); + style_params_name.font.style("NORMAL"); + style_params_name.readonly_color(userNameColor); + user_name->appendText(" - " + av_name.mUsername, FALSE, style_params_name); } setToolTip( av_name.mUsername ); // name might have changed, update width 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 d216bd9b2e..70c7bae662 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" /> |