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/llfloaterdisplayname.cpp | 57 +++++++++++++++++++--- indra/newview/llpanelme.cpp | 12 ----- .../skins/default/xui/en/floater_display_name.xml | 34 ++++++++++--- .../newview/skins/default/xui/en/notifications.xml | 10 +--- 4 files changed, 79 insertions(+), 34 deletions(-) diff --git a/indra/newview/llfloaterdisplayname.cpp b/indra/newview/llfloaterdisplayname.cpp index 11ac3d8fdf..ac8f107928 100644 --- a/indra/newview/llfloaterdisplayname.cpp +++ b/indra/newview/llfloaterdisplayname.cpp @@ -67,6 +67,37 @@ void LLFloaterDisplayName::onOpen(const LLSD& key) { getChild("display_name_editor")->clear(); getChild("display_name_confirm")->clear(); + + LLAvatarName av_name; + LLAvatarNameCache::get(gAgent.getID(), &av_name); + + 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"); + getChild("lockout_text")->setTextArg("[TIME]", next_update_string); + getChild("lockout_text")->setVisible(true); + getChild("save_btn")->setEnabled(false); + getChild("display_name_editor")->setEnabled(false); + getChild("display_name_confirm")->setEnabled(false); + getChild("cancel_btn")->setFocus(TRUE); + + } + else + { + getChild("lockout_text")->setVisible(false); + getChild("save_btn")->setEnabled(true); + getChild("display_name_editor")->setEnabled(true); + getChild("display_name_confirm")->setEnabled(true); + + } } BOOL LLFloaterDisplayName::postBuild() @@ -133,9 +164,16 @@ void LLFloaterDisplayName::onCancel() void LLFloaterDisplayName::onReset() { - LLViewerDisplayName::set("", - boost::bind(&LLFloaterDisplayName::onCacheSetName, this, _1, _2, _3)); - + if (LLAvatarNameCache::useDisplayNames()) + { + LLViewerDisplayName::set("", + boost::bind(&LLFloaterDisplayName::onCacheSetName, this, _1, _2, _3)); + } + else + { + LLNotificationsUtil::add("SetDisplayNameFailedGeneric"); + } + setVisible(false); } @@ -160,9 +198,16 @@ void LLFloaterDisplayName::onSave() LLNotificationsUtil::add("SetDisplayNameFailedLength", args); return; } - - LLViewerDisplayName::set(display_name_utf8, - boost::bind(&LLFloaterDisplayName::onCacheSetName, this, _1, _2, _3)); + + if (LLAvatarNameCache::useDisplayNames()) + { + LLViewerDisplayName::set(display_name_utf8, + boost::bind(&LLFloaterDisplayName::onCacheSetName, this, _1, _2, _3)); + } + else + { + LLNotificationsUtil::add("SetDisplayNameFailedGeneric"); + } setVisible(false); } 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"); diff --git a/indra/newview/skins/default/xui/en/floater_display_name.xml b/indra/newview/skins/default/xui/en/floater_display_name.xml index ecf2e524aa..7a3fb9334a 100644 --- a/indra/newview/skins/default/xui/en/floater_display_name.xml +++ b/indra/newview/skins/default/xui/en/floater_display_name.xml @@ -3,12 +3,13 @@ legacy_header_height="18" can_minimize="false" can_close="false" - height="280" + height="300" layout="topleft" name="Display Name" help_topic="display_name" save_rect="false" - width="440"> + title="CHANGE DISPLAY NAME" + width="445"> The name you give your avatar is called your Display Name. You can change it once a week. + + You cannot change your Display Name until: [TIME]. + - New display name: + New Display Name: -