From c0b7c93c18783d6a426cf43265f34c86bdeceb4a Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 4 Feb 2010 20:38:40 -0800 Subject: Converted all gCacheName->getName to getFullName for SLID compatibility Also eliminated notification "ObjectGiveItemUnknownUser" because the SLURL-based name lookup will always retrieve the user name. Fixed a bug with ObjectGiveItem where the SLURL would be incorrect for a group. --- indra/newview/llpanelme.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/newview/llpanelme.cpp') diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index ea66ef7d2c..75b93ad2c2 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -208,13 +208,13 @@ void LLPanelMyProfileEdit::processProfileProperties(const LLAvatarData* avatar_d childSetValue("show_in_search_checkbox", (BOOL)(avatar_data->flags & AVATAR_ALLOW_PUBLISH)); - std::string first, last; - BOOL found = gCacheName->getName(avatar_data->avatar_id, first, last); - if (found) - { - childSetTextArg("name_text", "[FIRST]", first); - childSetTextArg("name_text", "[LAST]", last); - } + // IDEVO - These fields do not seem to exist any more. + //std::string full_name; + //BOOL found = gCacheName->getFullName(avatar_data->avatar_id, full_name); + //if (found) + //{ + // childSetTextArg("name_text", "[NAME]", full_name); + //} } BOOL LLPanelMyProfileEdit::postBuild() -- cgit v1.2.3 From 3791745054546dbebb3373371aaf7a0ddad608a3 Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 22 Feb 2010 16:41:56 -0800 Subject: Simple button to change your display name Talks to web service so other people can see the change, but for now they need to relog or toggle display names on/off to clear their cache. --- indra/newview/llpanelme.cpp | 60 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) (limited to 'indra/newview/llpanelme.cpp') diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index 77a2ac3a8c..211187a769 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -33,11 +33,14 @@ #include "llviewerprecompiledheaders.h" #include "llpanelprofile.h" + #include "llavatarconstants.h" +#include "llavatarnamecache.h" // IDEVO #include "llpanelme.h" #include "llagent.h" #include "llagentwearables.h" #include "lliconctrl.h" +#include "llnotificationsutil.h" // IDEVO #include "llsidetray.h" #include "lltabcontainer.h" #include "lltexturectrl.h" @@ -228,6 +231,21 @@ void LLPanelMyProfileEdit::processProfileProperties(const LLAvatarData* avatar_d //{ // childSetTextArg("name_text", "[NAME]", full_name); //} + std::string full_name; + LLAvatarName av_name; + if (LLAvatarNameCache::useDisplayNames() + && LLAvatarNameCache::get(avatar_data->avatar_id, &av_name)) + { + getChild("user_name")->setValue( av_name.mDisplayName ); + getChild("user_slid")->setValue( av_name.mSLID ); + } + else if (gCacheName->getFullName(avatar_data->avatar_id, full_name)) + { + getChild("user_name")->setValue(full_name); + getChild("user_slid")->setValue(""); + } + + getChild("set_name")->setVisible( LLAvatarNameCache::useDisplayNames() ); } BOOL LLPanelMyProfileEdit::postBuild() @@ -237,6 +255,9 @@ BOOL LLPanelMyProfileEdit::postBuild() childSetTextArg("partner_edit_link", "[URL]", getString("partner_edit_link_url")); childSetTextArg("my_account_link", "[URL]", getString("my_account_link_url")); + getChild("set_name")->setCommitCallback( + boost::bind(&LLPanelMyProfileEdit::onClickSetName, this)); + return LLPanelAvatarProfile::postBuild(); } /** @@ -277,6 +298,45 @@ void LLPanelMyProfileEdit::onTexturePickerMouseLeave(LLUICtrl* ctrl) mTextureEditIconMap[ctrl->getName()]->setVisible(FALSE); } +static void set_name_callback(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) + { + LLUUID agent_id = notification["payload"]["agent_id"]; + if (agent_id.isNull()) return; + + std::string display_name = response["display_name"].asString(); + LLAvatarNameCache::setDisplayName(agent_id, display_name); + } +} + +void LLPanelMyProfileEdit::onClickSetName() +{ + // IDEVO + LLUUID agent_id = getAvatarId(); + std::string display_name; + LLAvatarName av_name; + if (LLAvatarNameCache::useDisplayNames() + && LLAvatarNameCache::get(agent_id, &av_name)) + { + display_name = av_name.mDisplayName; + } + else + { + gCacheName->getFullName(agent_id, display_name); + } + + if (!display_name.empty()) + { + LLSD args; + args["DISPLAY_NAME"] = display_name; + LLSD payload; + payload["agent_id"] = agent_id; + LLNotificationsUtil::add("SetDisplayName", args, payload, set_name_callback); + } +} + void LLPanelMyProfileEdit::enableEditing(bool enable) { childSetEnabled("2nd_life_pic", enable); -- cgit v1.2.3 From f3e0e9a5264a80d146a1d4d77fd9c4f5d3070278 Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 24 Feb 2010 14:31:46 -0800 Subject: Hack to refresh name tags when I change my display name. Also fixes a crash when turning on display names. --- indra/newview/llpanelme.cpp | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'indra/newview/llpanelme.cpp') diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index 211187a769..19eddb8c51 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -32,19 +32,23 @@ #include "llviewerprecompiledheaders.h" -#include "llpanelprofile.h" +#include "llpanelme.h" +// Viewer includes +#include "llpanelprofile.h" #include "llavatarconstants.h" -#include "llavatarnamecache.h" // IDEVO -#include "llpanelme.h" #include "llagent.h" #include "llagentwearables.h" +#include "llsidetray.h" +#include "llviewercontrol.h" + +// Linden libraries +#include "llavatarnamecache.h" // IDEVO +#include "llchat.h" // IDEVO HACK #include "lliconctrl.h" #include "llnotificationsutil.h" // IDEVO -#include "llsidetray.h" #include "lltabcontainer.h" #include "lltexturectrl.h" -#include "llviewercontrol.h" #define PICKER_SECOND_LIFE "2nd_life_pic" #define PICKER_FIRST_LIFE "real_world_pic" @@ -298,7 +302,10 @@ void LLPanelMyProfileEdit::onTexturePickerMouseLeave(LLUICtrl* ctrl) mTextureEditIconMap[ctrl->getName()]->setVisible(FALSE); } -static void set_name_callback(const LLSD& notification, const LLSD& response) +// IDEVO HACK +extern void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel); + +void LLPanelMyProfileEdit::callbackSetName(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) @@ -308,6 +315,11 @@ static void set_name_callback(const LLSD& notification, const LLSD& response) std::string display_name = response["display_name"].asString(); LLAvatarNameCache::setDisplayName(agent_id, display_name); + + // HACK: Use chat to invalidate names + send_chat_from_viewer("refreshname", CHAT_TYPE_NORMAL, 0); + + getChild("user_name")->setValue( display_name ); } } @@ -333,7 +345,8 @@ void LLPanelMyProfileEdit::onClickSetName() args["DISPLAY_NAME"] = display_name; LLSD payload; payload["agent_id"] = agent_id; - LLNotificationsUtil::add("SetDisplayName", args, payload, set_name_callback); + LLNotificationsUtil::add("SetDisplayName", args, payload, + boost::bind(&LLPanelMyProfileEdit::callbackSetName, this, _1, _2)); } } -- cgit v1.2.3 From 60d4870f59abbe081e36a50ffedbdea068aec75b Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 26 Feb 2010 14:12:23 -0800 Subject: Cleaned up Edit Profile > Set Name layout and feel --- indra/newview/llpanelme.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelme.cpp') diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index 19eddb8c51..84ed7356f1 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -289,8 +289,10 @@ void LLPanelMyProfileEdit::resetData() { LLPanelMyProfile::resetData(); - childSetTextArg("name_text", "[FIRST]", LLStringUtil::null); - childSetTextArg("name_text", "[LAST]", LLStringUtil::null); + //childSetTextArg("name_text", "[FIRST]", LLStringUtil::null); + //childSetTextArg("name_text", "[LAST]", LLStringUtil::null); + getChild("user_name")->setValue( LLSD() ); + getChild("user_slid")->setValue( LLSD() ); } void LLPanelMyProfileEdit::onTexturePickerMouseEnter(LLUICtrl* ctrl) -- cgit v1.2.3 From 639b234762133e4d09d6d7b1bac9d25c5a681926 Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 18 Mar 2010 17:19:57 -0700 Subject: Partial support for Set Name returning error msg from service --- indra/newview/llpanelme.cpp | 57 ++++++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 22 deletions(-) (limited to 'indra/newview/llpanelme.cpp') diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index 84ed7356f1..d6c7d7ea8d 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -235,21 +235,14 @@ void LLPanelMyProfileEdit::processProfileProperties(const LLAvatarData* avatar_d //{ // childSetTextArg("name_text", "[NAME]", full_name); //} - std::string full_name; - LLAvatarName av_name; - if (LLAvatarNameCache::useDisplayNames() - && LLAvatarNameCache::get(avatar_data->avatar_id, &av_name)) - { - getChild("user_name")->setValue( av_name.mDisplayName ); - getChild("user_slid")->setValue( av_name.mSLID ); - } - else if (gCacheName->getFullName(avatar_data->avatar_id, full_name)) - { - getChild("user_name")->setValue(full_name); - getChild("user_slid")->setValue(""); - } + LLAvatarNameCache::get(avatar_data->avatar_id, + boost::bind(&LLPanelMyProfileEdit::onNameCache, this, _1, _2)); +} - getChild("set_name")->setVisible( LLAvatarNameCache::useDisplayNames() ); +void LLPanelMyProfileEdit::onNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) +{ + getChild("user_name")->setValue( av_name.mDisplayName ); + getChild("user_slid")->setValue( av_name.mSLID ); } BOOL LLPanelMyProfileEdit::postBuild() @@ -307,7 +300,30 @@ void LLPanelMyProfileEdit::onTexturePickerMouseLeave(LLUICtrl* ctrl) // IDEVO HACK extern void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel); -void LLPanelMyProfileEdit::callbackSetName(const LLSD& notification, const LLSD& response) +void LLPanelMyProfileEdit::onCacheSetName(bool success, + const std::string& reason, + const LLSD& content) +{ + if (success) + { + // HACK: Use chat to invalidate names + send_chat_from_viewer("refreshname", CHAT_TYPE_NORMAL, 0); + + // Re-fetch my name, as it may have been sanitized by the service + LLAvatarNameCache::get(getAvatarId(), + boost::bind(&LLPanelMyProfileEdit::onNameCache, this, _1, _2)); + } + else + { + // JAMESDEBUG TODO: localize strings for reasons we couldn't + // change the name + LLNotificationsUtil::add("SetDisplayNameFailedGeneric"); + // TODO: SetDisplayNameFailedThrottle with [FREQUENCY] + // TODO: SetDisplayNameFailedUnavailable + } +} + +void LLPanelMyProfileEdit::onDialogSetName(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) @@ -316,12 +332,9 @@ void LLPanelMyProfileEdit::callbackSetName(const LLSD& notification, const LLSD& if (agent_id.isNull()) return; std::string display_name = response["display_name"].asString(); - LLAvatarNameCache::setDisplayName(agent_id, display_name); - - // HACK: Use chat to invalidate names - send_chat_from_viewer("refreshname", CHAT_TYPE_NORMAL, 0); - - getChild("user_name")->setValue( display_name ); + LLAvatarNameCache::setDisplayName(agent_id, display_name, + boost::bind(&LLPanelMyProfileEdit::onCacheSetName, this, + _1, _2, _3)); } } @@ -348,7 +361,7 @@ void LLPanelMyProfileEdit::onClickSetName() LLSD payload; payload["agent_id"] = agent_id; LLNotificationsUtil::add("SetDisplayName", args, payload, - boost::bind(&LLPanelMyProfileEdit::callbackSetName, this, _1, _2)); + boost::bind(&LLPanelMyProfileEdit::onDialogSetName, this, _1, _2)); } } -- cgit v1.2.3 From d2f9e34598621f1dabad15025417efd6b81dddf0 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 23 Mar 2010 11:41:33 -0700 Subject: Part DEV-47695 route display name changes via sim for rebroadcast to nearby avatars for name tag updates and to update cached display name for LSL nonblocking functions --- indra/newview/llpanelme.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanelme.cpp') diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index d6c7d7ea8d..aa19952317 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -41,6 +41,7 @@ #include "llagentwearables.h" #include "llsidetray.h" #include "llviewercontrol.h" +#include "llviewerdisplayname.h" // Linden libraries #include "llavatarnamecache.h" // IDEVO @@ -332,7 +333,7 @@ void LLPanelMyProfileEdit::onDialogSetName(const LLSD& notification, const LLSD& if (agent_id.isNull()) return; std::string display_name = response["display_name"].asString(); - LLAvatarNameCache::setDisplayName(agent_id, display_name, + LLViewerDisplayName::set(display_name, boost::bind(&LLPanelMyProfileEdit::onCacheSetName, this, _1, _2, _3)); } -- cgit v1.2.3 From c70c2631f0dc1db46fa5e6088605e21f5e3743ba Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 15 Apr 2010 16:19:39 -0700 Subject: Remove old hack to chat "refreshname" to trigger name tag updates --- indra/newview/llpanelme.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/newview/llpanelme.cpp') diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index aa19952317..d81d84767b 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -307,9 +307,6 @@ void LLPanelMyProfileEdit::onCacheSetName(bool success, { if (success) { - // HACK: Use chat to invalidate names - send_chat_from_viewer("refreshname", CHAT_TYPE_NORMAL, 0); - // Re-fetch my name, as it may have been sanitized by the service LLAvatarNameCache::get(getAvatarId(), boost::bind(&LLPanelMyProfileEdit::onNameCache, this, _1, _2)); -- cgit v1.2.3 From 16aa2a2a0f29fa927455e616817eef2bedbbf7a7 Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 19 Apr 2010 13:54:50 -0700 Subject: DEV-49149 Localizable server error message for Display Names Try to look up a specific translation for the error in the viewer, but failing that, try to use a message sent by the server. Reviewed with Simon. --- indra/newview/llpanelme.cpp | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) (limited to 'indra/newview/llpanelme.cpp') diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index d81d84767b..c4fe613161 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -45,8 +45,8 @@ // Linden libraries #include "llavatarnamecache.h" // IDEVO -#include "llchat.h" // IDEVO HACK #include "lliconctrl.h" +#include "llnotifications.h" #include "llnotificationsutil.h" // IDEVO #include "lltabcontainer.h" #include "lltexturectrl.h" @@ -298,9 +298,6 @@ void LLPanelMyProfileEdit::onTexturePickerMouseLeave(LLUICtrl* ctrl) mTextureEditIconMap[ctrl->getName()]->setVisible(FALSE); } -// IDEVO HACK -extern void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel); - void LLPanelMyProfileEdit::onCacheSetName(bool success, const std::string& reason, const LLSD& content) @@ -310,15 +307,34 @@ void LLPanelMyProfileEdit::onCacheSetName(bool success, // Re-fetch my name, as it may have been sanitized by the service LLAvatarNameCache::get(getAvatarId(), boost::bind(&LLPanelMyProfileEdit::onNameCache, this, _1, _2)); + return; } - else + + // Request failed, notify the user + std::string error_tag = content["error_tag"].asString(); + llinfos << "set name failure error_tag " << error_tag << llendl; + + // We might have a localized string for this message + if (!error_tag.empty() + && LLNotifications::getInstance()->templateExists(error_tag)) { - // JAMESDEBUG TODO: localize strings for reasons we couldn't - // change the name - LLNotificationsUtil::add("SetDisplayNameFailedGeneric"); - // TODO: SetDisplayNameFailedThrottle with [FREQUENCY] - // TODO: SetDisplayNameFailedUnavailable + LLNotificationsUtil::add(error_tag); + return; } + + // The server error might have a localized message for us + std::string lang_code = LLUI::getLanguage(); + LLSD error_desc = content["error_description"]; + if (error_desc.has( lang_code )) + { + LLSD args; + args["MESSAGE"] = error_desc[lang_code].asString(); + LLNotificationsUtil::add("GenericAlert", args); + return; + } + + // No specific error, throw a generic one + LLNotificationsUtil::add("SetDisplayNameFailedGeneric"); } void LLPanelMyProfileEdit::onDialogSetName(const LLSD& notification, const LLSD& response) -- cgit v1.2.3 From ea7d6eab6f58b994825cf051741a874ec1681515 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 30 Apr 2010 13:28:15 -0700 Subject: Hide "Set Name..." button if region/grid doesn't use display names --- indra/newview/llpanelme.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview/llpanelme.cpp') diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index c4fe613161..d4a54852cd 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -196,6 +196,13 @@ void LLPanelMyProfileEdit::onOpen(const LLSD& key) // Disable editing until data is loaded, or edited fields will be overwritten when data // 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); + LLPanelMyProfile::onOpen(getAvatarId()); } -- cgit v1.2.3 From 5ad8364a68d64d2d921f4cf65dbab0eb7b03fc1d Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 7 May 2010 15:01:27 -0700 Subject: DEV-49780 Better confirmation/failure messages for setting name Reviewed with Callum --- indra/newview/llpanelme.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/newview/llpanelme.cpp') diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index d4a54852cd..3e5fc7a482 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -311,6 +311,14 @@ void LLPanelMyProfileEdit::onCacheSetName(bool success, { if (success) { + // Inform the user that the change took place, but will take a while + // to percolate. + LLSD args; + // *TODO: get estimated percolation time from service + S32 timeout_hours = 72; + args["HOURS"] = llformat("%d", timeout_hours); + LLNotificationsUtil::add("SetDisplayNameSuccess", args); + // Re-fetch my name, as it may have been sanitized by the service LLAvatarNameCache::get(getAvatarId(), boost::bind(&LLPanelMyProfileEdit::onNameCache, this, _1, _2)); -- cgit v1.2.3 From 6871747f11f300fcf90edba2224c91a3645617cc Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 12 May 2010 16:32:54 -0700 Subject: DEV-50013 Display names limited to 31 chars (not bytes) in viewer UI Reviewed with Leyla --- indra/newview/llpanelme.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelme.cpp') diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index 483741e643..f38c8859ef 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -352,8 +352,19 @@ void LLPanelMyProfileEdit::onDialogSetName(const LLSD& notification, const LLSD& LLUUID agent_id = notification["payload"]["agent_id"]; if (agent_id.isNull()) return; - std::string display_name = response["display_name"].asString(); - LLViewerDisplayName::set(display_name, + std::string display_name_utf8 = response["display_name"].asString(); + + const U32 DISPLAY_NAME_MAX_LENGTH = 31; // characters, not bytes + LLWString display_name_wstr = utf8string_to_wstring(display_name_utf8); + if (display_name_wstr.size() > DISPLAY_NAME_MAX_LENGTH) + { + LLSD args; + args["LENGTH"] = llformat("%d", DISPLAY_NAME_MAX_LENGTH); + LLNotificationsUtil::add("SetDisplayNameFailedLength", args); + return; + } + + LLViewerDisplayName::set(display_name_utf8, boost::bind(&LLPanelMyProfileEdit::onCacheSetName, this, _1, _2, _3)); } -- cgit v1.2.3 From f4148502e484d516b42c4a88603eee6889d45697 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 18 May 2010 16:00:45 -0700 Subject: Rename mSLID to mUsername to match the name of the field in the UI Product made a late-breaking request to change the name of this field. The wire protocol for People API has not yet changed. --- indra/newview/llpanelme.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llpanelme.cpp') diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index f38c8859ef..c1d02fae39 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -242,7 +242,7 @@ void LLPanelMyProfileEdit::processProfileProperties(const LLAvatarData* avatar_d void LLPanelMyProfileEdit::onNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) { getChild("user_name")->setValue( av_name.mDisplayName ); - getChild("user_slid")->setValue( av_name.mSLID ); + getChild("user_slid")->setValue( av_name.mUsername ); } BOOL LLPanelMyProfileEdit::postBuild() -- cgit v1.2.3 From 3b0bb8159605685befd79784ddcf6feadee36b67 Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 24 May 2010 16:58:49 -0700 Subject: DEV-50013 Add "Reset" button to Set Name dialog Reviewed with Richard --- indra/newview/llpanelme.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelme.cpp') diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index c1d02fae39..544ca47da4 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -347,12 +347,22 @@ void LLPanelMyProfileEdit::onCacheSetName(bool success, void LLPanelMyProfileEdit::onDialogSetName(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (option == 0) + if (option == 0 || option == 1) { LLUUID agent_id = notification["payload"]["agent_id"]; if (agent_id.isNull()) return; - std::string display_name_utf8 = response["display_name"].asString(); + std::string display_name_utf8; + if (option == 0) + { + // user gave us a name + display_name_utf8 = response["display_name"].asString(); + } + else + { + // reset back to People API default + display_name_utf8 = ""; + } const U32 DISPLAY_NAME_MAX_LENGTH = 31; // characters, not bytes LLWString display_name_wstr = utf8string_to_wstring(display_name_utf8); -- cgit v1.2.3 From c7a6a2e08f34b2cd21816a905c21e8017646001c Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 27 May 2010 14:56:29 -0700 Subject: DEV-50013 Friendlier info if you can't change name due to time lockout Reviewed with Leyla --- indra/newview/llpanelme.cpp | 48 +++++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 17 deletions(-) (limited to 'indra/newview/llpanelme.cpp') diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index 544ca47da4..eb2d57af52 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -305,11 +305,7 @@ void LLPanelMyProfileEdit::onCacheSetName(bool success, { // Inform the user that the change took place, but will take a while // to percolate. - LLSD args; - // *TODO: get estimated percolation time from service - S32 timeout_hours = 72; - args["HOURS"] = llformat("%d", timeout_hours); - LLNotificationsUtil::add("SetDisplayNameSuccess", args); + LLNotificationsUtil::add("SetDisplayNameSuccess"); // Re-fetch my name, as it may have been sanitized by the service LLAvatarNameCache::get(getAvatarId(), @@ -322,6 +318,7 @@ void LLPanelMyProfileEdit::onCacheSetName(bool success, llinfos << "set name failure error_tag " << error_tag << llendl; // We might have a localized string for this message + // error_args will usually be empty from the server. if (!error_tag.empty() && LLNotifications::getInstance()->templateExists(error_tag)) { @@ -382,29 +379,46 @@ void LLPanelMyProfileEdit::onDialogSetName(const LLSD& notification, const LLSD& void LLPanelMyProfileEdit::onClickSetName() { - // IDEVO LLUUID agent_id = getAvatarId(); std::string display_name; LLAvatarName av_name; - if (LLAvatarNameCache::useDisplayNames() - && LLAvatarNameCache::get(agent_id, &av_name)) + if (!LLAvatarNameCache::get(agent_id, &av_name)) { - display_name = av_name.mDisplayName; + // something is wrong, tell user to try again later + LLNotificationsUtil::add("SetDisplayNameFailedGeneric"); + return; } - else + + display_name = av_name.mDisplayName; + if (display_name.empty()) { - gCacheName->getFullName(agent_id, display_name); + // something is wrong, tell user to try again later + LLNotificationsUtil::add("SetDisplayNameFailedGeneric"); + return; } - if (!display_name.empty()) + F64 now_secs = LLDate::now().secondsSinceEpoch(); + if (now_secs < av_name.mNextUpdate) { + // ...can't update until some time in the future + F64 next_update_local_secs = + av_name.mNextUpdate - LLStringOps::getLocalTimeOffset(); + LLDate next_update_local(next_update_local_secs); + // display as "July 18 12:17 PM" + std::string next_update_string = + next_update_local.toHTTPDateString("%B %d %I:%M %p"); LLSD args; - args["DISPLAY_NAME"] = display_name; - LLSD payload; - payload["agent_id"] = agent_id; - LLNotificationsUtil::add("SetDisplayName", args, payload, - boost::bind(&LLPanelMyProfileEdit::onDialogSetName, this, _1, _2)); + args["TIME"] = next_update_string; + LLNotificationsUtil::add("SetDisplayNameFailedLockout", args); + return; } + + LLSD args; + args["DISPLAY_NAME"] = display_name; + LLSD payload; + payload["agent_id"] = agent_id; + LLNotificationsUtil::add("SetDisplayName", args, payload, + boost::bind(&LLPanelMyProfileEdit::onDialogSetName, this, _1, _2)); } void LLPanelMyProfileEdit::enableEditing(bool enable) -- cgit v1.2.3 From 3bbb622731b2a6a29fc6576dcf4885527d813699 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 28 May 2010 08:21:33 -0700 Subject: WIP Fix miscellaneous display names in UI --- indra/newview/llpanelme.cpp | 7 ------- 1 file changed, 7 deletions(-) (limited to 'indra/newview/llpanelme.cpp') diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index eb2d57af52..d1ce59d436 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -228,13 +228,6 @@ void LLPanelMyProfileEdit::processProfileProperties(const LLAvatarData* avatar_d childSetValue("show_in_search_checkbox", (BOOL)(avatar_data->flags & AVATAR_ALLOW_PUBLISH)); - // IDEVO - These fields do not seem to exist any more. - //std::string full_name; - //BOOL found = gCacheName->getFullName(avatar_data->avatar_id, full_name); - //if (found) - //{ - // childSetTextArg("name_text", "[NAME]", full_name); - //} LLAvatarNameCache::get(avatar_data->avatar_id, boost::bind(&LLPanelMyProfileEdit::onNameCache, this, _1, _2)); } -- cgit v1.2.3 From 892ac2bb1eec257bbf29d57738e819b7ff368bb9 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 28 May 2010 15:43:15 -0700 Subject: Added debugging code for names changes for when People API breaks --- indra/newview/llpanelme.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llpanelme.cpp') diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index d1ce59d436..cd0cbe8128 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -390,6 +390,8 @@ void LLPanelMyProfileEdit::onClickSetName() return; } + llinfos << "name-change now " << LLDate::now() << " next_update " + << LLDate(av_name.mNextUpdate) << llendl; F64 now_secs = LLDate::now().secondsSinceEpoch(); if (now_secs < av_name.mNextUpdate) { -- cgit v1.2.3 From 4835c615d5a00f146bcd5c7a50153418ce2a3613 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 1 Jun 2010 16:09:58 -0700 Subject: DEV-50778 Update text for display name change in viewer Reviewed with Erica - got them as close as we can with the data we have available. --- indra/newview/llpanelme.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanelme.cpp') diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index cd0cbe8128..0fc2a78bcd 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -298,7 +298,9 @@ void LLPanelMyProfileEdit::onCacheSetName(bool success, { // Inform the user that the change took place, but will take a while // to percolate. - LLNotificationsUtil::add("SetDisplayNameSuccess"); + LLSD args; + args["DISPLAY_NAME"] = content["display_name"]; + LLNotificationsUtil::add("SetDisplayNameSuccess", args); // Re-fetch my name, as it may have been sanitized by the service LLAvatarNameCache::get(getAvatarId(), -- cgit v1.2.3 From 474457ea7ea1bd178682788426a4cf40c3fffdcd Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Thu, 15 Jul 2010 17:14:45 -0700 Subject: DEV-51021 Viewer returns misleading error message when a blocked user attempts to change his display name reviewed by Richard cc#220 --- indra/newview/llpanelme.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/newview/llpanelme.cpp') diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index 0fc2a78bcd..5e8e07b962 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -395,8 +395,18 @@ void LLPanelMyProfileEdit::onClickSetName() llinfos << "name-change now " << LLDate::now() << " next_update " << LLDate(av_name.mNextUpdate) << llendl; F64 now_secs = LLDate::now().secondsSinceEpoch(); + if (now_secs < av_name.mNextUpdate) { + // if the update time is more than a year in the future, it means updates have been blocked + // show a more general message + const int YEAR = 60*60*24*365; + if (now_secs + YEAR < av_name.mNextUpdate) + { + LLNotificationsUtil::add("SetDisplayNameBlocked"); + return; + } + // ...can't update until some time in the future F64 next_update_local_secs = av_name.mNextUpdate - LLStringOps::getLocalTimeOffset(); -- cgit v1.2.3 From 650171af1788435e200c62965c3ffe314d2082db Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Thu, 19 Aug 2010 14:20:49 -0700 Subject: DEV-51021 Viewer returns misleading error message when a blocked user attempts to change his display name --- indra/newview/llpanelme.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'indra/newview/llpanelme.cpp') diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index 5e8e07b962..75abad8fc7 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -194,6 +194,8 @@ void LLPanelMyProfileEdit::onOpen(const LLSD& key) 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()); } @@ -373,19 +375,15 @@ void LLPanelMyProfileEdit::onDialogSetName(const LLSD& notification, const LLSD& } void LLPanelMyProfileEdit::onClickSetName() +{ + LLAvatarNameCache::get(getAvatarId(), + boost::bind(&LLPanelMyProfileEdit::onAvatarNameCache, + this, _1, _2)); +} + +void LLPanelMyProfileEdit::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) { - LLUUID agent_id = getAvatarId(); - std::string display_name; - LLAvatarName av_name; - if (!LLAvatarNameCache::get(agent_id, &av_name)) - { - // something is wrong, tell user to try again later - LLNotificationsUtil::add("SetDisplayNameFailedGeneric"); - return; - } - - display_name = av_name.mDisplayName; - if (display_name.empty()) + if (av_name.mDisplayName.empty()) { // something is wrong, tell user to try again later LLNotificationsUtil::add("SetDisplayNameFailedGeneric"); @@ -421,7 +419,7 @@ void LLPanelMyProfileEdit::onClickSetName() } LLSD args; - args["DISPLAY_NAME"] = display_name; + args["DISPLAY_NAME"] = av_name.mDisplayName; LLSD payload; payload["agent_id"] = agent_id; LLNotificationsUtil::add("SetDisplayName", args, payload, -- cgit v1.2.3 From 7a43f0983d6906efcea56370e927912461ab898b Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Wed, 29 Sep 2010 14:26:01 -0700 Subject: edit profile display name now sizes down if too long --- indra/newview/llpanelme.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'indra/newview/llpanelme.cpp') diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index a4a63cdc1c..79d5195ccf 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -232,6 +232,20 @@ void LLPanelMyProfileEdit::onNameCache(const LLUUID& agent_id, const LLAvatarNam { getChild("user_name")->setValue( av_name.mDisplayName ); getChild("user_slid")->setValue( av_name.mUsername ); + getChild("user_name_small")->setValue( av_name.mDisplayName ); + + // show smaller display name if too long to display in regular size + if (getChild("user_name")->getTextPixelWidth() > getChild("user_name")->getRect().getWidth()) + { + getChild("user_name_small")->setVisible( true ); + getChild("user_name")->setVisible( false ); + } + else + { + getChild("user_name_small")->setVisible( false ); + getChild("user_name")->setVisible( true ); + + } } BOOL LLPanelMyProfileEdit::postBuild() -- cgit v1.2.3 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/llpanelme.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpanelme.cpp') 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) -- cgit v1.2.3 From 7ffc9b06c820d70724af2aef361ff9964e584e73 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Fri, 8 Oct 2010 16:56:02 -0700 Subject: Created a floater for setting display name --- indra/newview/llpanelme.cpp | 106 +++++++------------------------------------- 1 file changed, 17 insertions(+), 89 deletions(-) (limited to 'indra/newview/llpanelme.cpp') diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index 3cc6b32678..9a13d00685 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -35,6 +35,7 @@ #include "llagentcamera.h" #include "llagentwearables.h" #include "llfirstuse.h" +#include "llfloaterreg.h" #include "llhints.h" #include "llsidetray.h" #include "llviewercontrol.h" @@ -208,6 +209,14 @@ void LLPanelMyProfileEdit::onOpen(const LLSD& key) } } +void LLPanelMyProfileEdit::onClose(const LLSD& key) +{ + if (LLAvatarNameCache::useDisplayNames()) + { + LLFirstUse::setDisplayName(false); + } +} + void LLPanelMyProfileEdit::processProperties(void* data, EAvatarProcessorType type) { if(APT_PROPERTIES == type) @@ -262,6 +271,12 @@ void LLPanelMyProfileEdit::onNameCache(const LLUUID& agent_id, const LLAvatarNam } } +void LLPanelMyProfileEdit::onAvatarNameChanged() +{ + LLAvatarNameCache::get(getAvatarId(), + boost::bind(&LLPanelMyProfileEdit::onNameCache, this, _1, _2)); +} + BOOL LLPanelMyProfileEdit::postBuild() { initTexturePickerMouseEvents(); @@ -273,7 +288,7 @@ BOOL LLPanelMyProfileEdit::postBuild() boost::bind(&LLPanelMyProfileEdit::onClickSetName, this)); LLHints::registerHintTarget("set_display_name", getChild("set_name")->getHandle()); - + LLViewerDisplayName::addNameChangedCallback(boost::bind(&LLPanelMyProfileEdit::onAvatarNameChanged, this)); return LLPanelAvatarProfile::postBuild(); } /** @@ -316,88 +331,6 @@ void LLPanelMyProfileEdit::onTexturePickerMouseLeave(LLUICtrl* ctrl) mTextureEditIconMap[ctrl->getName()]->setVisible(FALSE); } -void LLPanelMyProfileEdit::onCacheSetName(bool success, - const std::string& reason, - const LLSD& content) -{ - if (success) - { - // Inform the user that the change took place, but will take a while - // to percolate. - LLSD args; - args["DISPLAY_NAME"] = content["display_name"]; - LLNotificationsUtil::add("SetDisplayNameSuccess", args); - - // Re-fetch my name, as it may have been sanitized by the service - LLAvatarNameCache::get(getAvatarId(), - boost::bind(&LLPanelMyProfileEdit::onNameCache, this, _1, _2)); - return; - } - - // Request failed, notify the user - std::string error_tag = content["error_tag"].asString(); - llinfos << "set name failure error_tag " << error_tag << llendl; - - // We might have a localized string for this message - // error_args will usually be empty from the server. - if (!error_tag.empty() - && LLNotifications::getInstance()->templateExists(error_tag)) - { - LLNotificationsUtil::add(error_tag); - return; - } - - // The server error might have a localized message for us - std::string lang_code = LLUI::getLanguage(); - LLSD error_desc = content["error_description"]; - if (error_desc.has( lang_code )) - { - LLSD args; - args["MESSAGE"] = error_desc[lang_code].asString(); - LLNotificationsUtil::add("GenericAlert", args); - return; - } - - // No specific error, throw a generic one - LLNotificationsUtil::add("SetDisplayNameFailedGeneric"); -} - -void LLPanelMyProfileEdit::onDialogSetName(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (option == 0 || option == 1) - { - LLUUID agent_id = notification["payload"]["agent_id"]; - if (agent_id.isNull()) return; - - std::string display_name_utf8; - if (option == 0) - { - // user gave us a name - display_name_utf8 = response["display_name"].asString(); - } - else - { - // reset back to People API default - display_name_utf8 = ""; - } - - const U32 DISPLAY_NAME_MAX_LENGTH = 31; // characters, not bytes - LLWString display_name_wstr = utf8string_to_wstring(display_name_utf8); - if (display_name_wstr.size() > DISPLAY_NAME_MAX_LENGTH) - { - LLSD args; - args["LENGTH"] = llformat("%d", DISPLAY_NAME_MAX_LENGTH); - LLNotificationsUtil::add("SetDisplayNameFailedLength", args); - return; - } - - LLViewerDisplayName::set(display_name_utf8, - boost::bind(&LLPanelMyProfileEdit::onCacheSetName, this, - _1, _2, _3)); - } -} - void LLPanelMyProfileEdit::onClickSetName() { LLAvatarNameCache::get(getAvatarId(), @@ -444,12 +377,7 @@ void LLPanelMyProfileEdit::onAvatarNameCache(const LLUUID& agent_id, const LLAva return; } - LLSD args; - args["DISPLAY_NAME"] = av_name.mDisplayName; - LLSD payload; - payload["agent_id"] = agent_id; - LLNotificationsUtil::add("SetDisplayName", args, payload, - boost::bind(&LLPanelMyProfileEdit::onDialogSetName, this, _1, _2)); + LLFloaterReg::showInstance("display_name"); } void LLPanelMyProfileEdit::enableEditing(bool enable) -- cgit v1.2.3 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 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) (limited to 'indra/newview/llpanelme.cpp') 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(), -- cgit v1.2.3 From 84f06e40e1e12723228e31d1a329c899cec99751 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Wed, 13 Oct 2010 14:36:01 -0700 Subject: DN-165 User cannot reset name to default if they are throttled because they receive the Sorry you cannot change your display name until [time] message. They cannot access the change display name dialog to hit reset when throttled. --- indra/newview/llpanelme.cpp | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'indra/newview/llpanelme.cpp') diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index f587923269..a9f7b6c62c 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -394,18 +394,6 @@ void LLPanelMyProfileEdit::onAvatarNameCache(const LLUUID& agent_id, const LLAva LLNotificationsUtil::add("SetDisplayNameBlocked"); return; } - - // ...can't update until some time in the future - F64 next_update_local_secs = - av_name.mNextUpdate - LLStringOps::getLocalTimeOffset(); - LLDate next_update_local(next_update_local_secs); - // display as "July 18 12:17 PM" - std::string next_update_string = - next_update_local.toHTTPDateString("%B %d %I:%M %p"); - LLSD args; - args["TIME"] = next_update_string; - LLNotificationsUtil::add("SetDisplayNameFailedLockout", args); - return; } LLFloaterReg::showInstance("display_name"); -- cgit v1.2.3 From 330ea83c3dd8f56f4cef56481f951b705d28f027 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Wed, 13 Oct 2010 15:39:16 -0700 Subject: making profiles look nicer when display names isn't on --- indra/newview/llpanelme.cpp | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) (limited to 'indra/newview/llpanelme.cpp') diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index a9f7b6c62c..5ea94e0611 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -212,6 +212,8 @@ void LLPanelMyProfileEdit::onOpen(const LLSD& key) getChild("display_name_label")->setVisible( true ); getChild("set_name")->setVisible( true ); getChild("set_name")->setEnabled( true ); + getChild("solo_user_name")->setVisible( false ); + getChild("solo_username_label")->setVisible( false ); } else { @@ -220,6 +222,8 @@ void LLPanelMyProfileEdit::onOpen(const LLSD& key) getChild("display_name_label")->setVisible( false ); getChild("set_name")->setVisible( false ); getChild("set_name")->setEnabled( false ); + getChild("solo_user_name")->setVisible( true ); + getChild("solo_username_label")->setVisible( true ); } } @@ -270,18 +274,8 @@ void LLPanelMyProfileEdit::onNameCache(const LLUUID& agent_id, const LLAvatarNam getChild("user_name")->setValue( av_name.mDisplayName ); getChild("user_slid")->setValue( av_name.mUsername ); getChild("user_name_small")->setValue( av_name.mDisplayName ); + getChild("solo_user_name")->setValue( av_name.mDisplayName ); - // show smaller display name if too long to display in regular size - if (getChild("user_name")->getTextPixelWidth() > getChild("user_name")->getRect().getWidth()) - { - getChild("user_name_small")->setVisible( true ); - getChild("user_name")->setVisible( false ); - } - else - { - getChild("user_name_small")->setVisible( false ); - getChild("user_name")->setVisible( true ); - } if (LLAvatarNameCache::useDisplayNames()) { @@ -290,6 +284,21 @@ void LLPanelMyProfileEdit::onNameCache(const LLUUID& agent_id, const LLAvatarNam getChild("display_name_label")->setVisible( true ); getChild("set_name")->setVisible( true ); getChild("set_name")->setEnabled( true ); + + getChild("solo_user_name")->setVisible( false ); + getChild("solo_username_label")->setVisible( false ); + + // show smaller display name if too long to display in regular size + if (getChild("user_name")->getTextPixelWidth() > getChild("user_name")->getRect().getWidth()) + { + getChild("user_name_small")->setVisible( true ); + getChild("user_name")->setVisible( false ); + } + else + { + getChild("user_name_small")->setVisible( false ); + getChild("user_name")->setVisible( true ); + } } else { @@ -298,6 +307,11 @@ void LLPanelMyProfileEdit::onNameCache(const LLUUID& agent_id, const LLAvatarNam getChild("display_name_label")->setVisible( false ); getChild("set_name")->setVisible( false ); getChild("set_name")->setEnabled( false ); + + getChild("solo_user_name")->setVisible( true ); + getChild("user_name_small")->setVisible( false ); + getChild("user_name")->setVisible( false ); + getChild("solo_username_label")->setVisible( true ); } } @@ -351,6 +365,8 @@ void LLPanelMyProfileEdit::resetData() //childSetTextArg("name_text", "[LAST]", LLStringUtil::null); getChild("user_name")->setValue( LLSD() ); getChild("user_slid")->setValue( LLSD() ); + getChild("solo_user_name")->setValue( LLSD() ); + getChild("user_name_small")->setValue( LLSD() ); } void LLPanelMyProfileEdit::onTexturePickerMouseEnter(LLUICtrl* ctrl) -- cgit v1.2.3