From 2ed5f04b99c4805b8adda9745811e82616d61c9b Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Thu, 7 Oct 2010 10:42:31 -0700 Subject: Adding viewer hint for setting display name the when edit profile is opened with no display name set --- indra/newview/app_settings/ignorable_dialogs.xml | 11 +++++++++++ indra/newview/llfirstuse.cpp | 6 ++++++ indra/newview/llfirstuse.h | 1 + indra/newview/llpanelme.cpp | 22 ++++++++++++++++++++-- .../newview/skins/default/xui/en/notifications.xml | 8 ++++++++ 5 files changed, 46 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/ignorable_dialogs.xml b/indra/newview/app_settings/ignorable_dialogs.xml index 0720ccee49..9ddf007ce7 100644 --- a/indra/newview/app_settings/ignorable_dialogs.xml +++ b/indra/newview/app_settings/ignorable_dialogs.xml @@ -45,6 +45,17 @@ Value 1 + FirstDisplayName + + Comment + Shows hint when edits profile for the first time + Persist + 1 + Type + Boolean + Value + 1 + FirstReceiveLindens Comment diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp index dd08706f4f..b08c113923 100644 --- a/indra/newview/llfirstuse.cpp +++ b/indra/newview/llfirstuse.cpp @@ -116,6 +116,12 @@ void LLFirstUse::notMoving(bool enable) firstUseNotification("FirstNotMoving", enable, "HintMove", LLSD(), LLSD().with("target", "move_btn").with("direction", "top")); } +// static +void LLFirstUse::setDisplayName(bool enable) +{ + firstUseNotification("FirstDisplayName", enable, "HintDisplayName", LLSD(), LLSD().with("target", "set_display_name").with("direction", "left")); +} + // static void LLFirstUse::receiveLindens(bool enable) { diff --git a/indra/newview/llfirstuse.h b/indra/newview/llfirstuse.h index 275f134400..3b7ff6383b 100644 --- a/indra/newview/llfirstuse.h +++ b/indra/newview/llfirstuse.h @@ -91,6 +91,7 @@ public: static void notMoving(bool enable = true); static void newInventory(bool enable = true); static void receiveLindens(bool enable = true); + static void setDisplayName(bool enable = true); static void useSandbox(); protected: diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index 79d5195ccf..3cc6b32678 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -34,6 +34,8 @@ #include "llagent.h" #include "llagentcamera.h" #include "llagentwearables.h" +#include "llfirstuse.h" +#include "llhints.h" #include "llsidetray.h" #include "llviewercontrol.h" #include "llviewerdisplayname.h" @@ -190,8 +192,20 @@ void LLPanelMyProfileEdit::onOpen(const LLSD& key) set_name->setEnabled(use_display_names); // force new avatar name fetch so we have latest update time LLAvatarNameCache::fetch(gAgent.getID()); - LLPanelMyProfile::onOpen(getAvatarId()); + + LLAvatarName av_name; + if (LLAvatarNameCache::useDisplayNames()) + { + if (LLAvatarNameCache::get(gAgent.getID(), &av_name) && av_name.mIsDisplayNameDefault) + { + LLFirstUse::setDisplayName(); + } + else + { + LLFirstUse::setDisplayName(false); + } + } } void LLPanelMyProfileEdit::processProperties(void* data, EAvatarProcessorType type) @@ -258,6 +272,8 @@ BOOL LLPanelMyProfileEdit::postBuild() getChild("set_name")->setCommitCallback( boost::bind(&LLPanelMyProfileEdit::onClickSetName, this)); + LLHints::registerHintTarget("set_display_name", getChild("set_name")->getHandle()); + return LLPanelAvatarProfile::postBuild(); } /** @@ -386,7 +402,9 @@ void LLPanelMyProfileEdit::onClickSetName() { LLAvatarNameCache::get(getAvatarId(), boost::bind(&LLPanelMyProfileEdit::onAvatarNameCache, - this, _1, _2)); + this, _1, _2)); + + LLFirstUse::setDisplayName(false); } void LLPanelMyProfileEdit::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index efd6ed0ac8..88b5613880 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -6537,6 +6537,14 @@ Mute everyone? To walk or run, open the Move Panel and use the directional arrows to navigate. You can also use the directional keys on your keyboard. + + Set your customizable display name here. This is in addition to your unique username, which can't be changed. + +