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.

master
Leyla Farazha 2010-10-13 14:36:01 -07:00
parent 0957d94baa
commit 84f06e40e1
4 changed files with 79 additions and 34 deletions

View File

@ -67,6 +67,37 @@ void LLFloaterDisplayName::onOpen(const LLSD& key)
{
getChild<LLUICtrl>("display_name_editor")->clear();
getChild<LLUICtrl>("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<LLUICtrl>("lockout_text")->setTextArg("[TIME]", next_update_string);
getChild<LLUICtrl>("lockout_text")->setVisible(true);
getChild<LLUICtrl>("save_btn")->setEnabled(false);
getChild<LLUICtrl>("display_name_editor")->setEnabled(false);
getChild<LLUICtrl>("display_name_confirm")->setEnabled(false);
getChild<LLUICtrl>("cancel_btn")->setFocus(TRUE);
}
else
{
getChild<LLUICtrl>("lockout_text")->setVisible(false);
getChild<LLUICtrl>("save_btn")->setEnabled(true);
getChild<LLUICtrl>("display_name_editor")->setEnabled(true);
getChild<LLUICtrl>("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);
}

View File

@ -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");

View File

@ -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">
<text
type="string"
length="1"
@ -20,17 +21,34 @@
name="info_text"
top="40"
use_ellipses="true"
width="400"
width="380"
wrap="true">
The name you give your avatar is called your Display Name. You can change it once a week.
</text>
<text
type="string"
length="1"
follows="left|top"
font="SansSerif"
height="25"
layout="topleft"
left="25"
text_color="EmphasisColor"
name="lockout_text"
top="80"
use_ellipses="true"
visible="false"
width="410"
wrap="true">
You cannot change your Display Name until: [TIME].
</text>
<text
top_pad="15"
top_pad="10"
width="150"
height="20"
font="SansSerif"
name="set_name_label">
New display name:
New Display Name:
</text>
<line_editor
width="330"
@ -39,9 +57,9 @@
height="20"
top_pad="5"
left="50" />
<text
<text
top_pad="15"
left="25"
left="25"
width="300"
height="20"
font="SansSerif"
@ -62,6 +80,7 @@
font="SansSerif"
left="35"
name="save_btn"
tool_tip="Save your new Display Name"
top_pad="40"
width="120" />
<button
@ -71,6 +90,7 @@
font="SansSerif"
left_pad="5"
name="reset_btn"
tool_tip="Make Display Name the same as Username"
width="120" />
<button
height="23"

View File

@ -3193,14 +3193,6 @@ Hi [DISPLAY_NAME]!
Just like in real life, it takes a while for everyone to learn about a new name. Please allow several days for [http://wiki.secondlife.com/wiki/Setting_your_display_name your name to update] in objects, scripts, search, etc.
</notification>
<notification
icon="alertmodal.tga"
name="SetDisplayNameFailedLockout"
type="alert">
Sorry, you cannot [http://wiki.secondlife.com/wiki/Setting_your_display_name change your display name] until:
[TIME]
</notification>
<notification
icon="alertmodal.tga"
name="SetDisplayNameBlocked"
@ -3231,7 +3223,7 @@ Please try a shorter name.
The display names you entered do not match. Please re-enter.
</notification>
<!-- *NOTE: This should never happen, users should see SetDisplayNameFailedLockout above -->
<!-- *NOTE: This should never happen -->
<notification
icon="alertmodal.tga"
name="AgentDisplayNameUpdateThresholdExceeded"