FIRE-33330: Can't reset display name within the first week; also show lock out date in SLT properly

meow-7.2.2
Ansariel 2023-12-12 18:19:22 +01:00
parent f506f8b450
commit dbe56047e2
3 changed files with 57 additions and 33 deletions

View File

@ -76,12 +76,16 @@ void LLFloaterDisplayName::onOpen(const LLSD& key)
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");
// <FS:Ansariel> Display lock out date in SLT
//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");
std::string next_update_string = getString("LockOutDateFormat");
LLStringUtil::format(next_update_string, LLSD().with("datetime", (S32)av_name.mNextUpdate));
// </FS:Ansariel>
getChild<LLUICtrl>("lockout_text")->setTextArg("[TIME]", next_update_string);
getChild<LLUICtrl>("lockout_text")->setVisible(true);
getChild<LLUICtrl>("save_btn")->setEnabled(false);
@ -160,26 +164,38 @@ void LLFloaterDisplayName::onCancel()
void LLFloaterDisplayName::onReset()
{
LLAvatarName av_name;
if (!LLAvatarNameCache::get(gAgent.getID(), &av_name))
{
return;
}
getChild<LLUICtrl>("display_name_editor")->setValue(av_name.getUserName());
// <FS:Ansariel> FIRE-33330: Can't reset display name within the first week
//LLAvatarName av_name;
//if (!LLAvatarNameCache::get(gAgent.getID(), &av_name))
//{
// return;
//}
//getChild<LLUICtrl>("display_name_editor")->setValue(av_name.getUserName());
if (getChild<LLUICtrl>("display_name_editor")->getEnabled())
//if (getChild<LLUICtrl>("display_name_editor")->getEnabled())
//{
// // UI is enabled, fill the first field
// getChild<LLUICtrl>("display_name_confirm")->clear();
// getChild<LLUICtrl>("display_name_confirm")->setFocus(TRUE);
//}
//else
//{
// // UI is disabled, looks like we should allow resetting
// // even if user already set a display name, enable save button
// getChild<LLUICtrl>("display_name_confirm")->setValue(av_name.getUserName());
// getChild<LLUICtrl>("save_btn")->setEnabled(true);
//}
if (LLAvatarNameCache::getInstance()->hasNameLookupURL())
{
// UI is enabled, fill the first field
getChild<LLUICtrl>("display_name_confirm")->clear();
getChild<LLUICtrl>("display_name_confirm")->setFocus(TRUE);
LLViewerDisplayName::set("", boost::bind(&LLFloaterDisplayName::onCacheSetName, this, _1, _2, _3));
}
else
{
// UI is disabled, looks like we should allow resetting
// even if user already set a display name, enable save button
getChild<LLUICtrl>("display_name_confirm")->setValue(av_name.getUserName());
getChild<LLUICtrl>("save_btn")->setEnabled(true);
LLNotificationsUtil::add("SetDisplayNameFailedGeneric");
}
setVisible(false);
// </FS:Ansariel>
}

View File

@ -1,10 +1,14 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="Display Name" title="Anzeigenamen ändern">
<floater.string name="LockOutDateFormat">
[day,datetime,slt]. [month,datetime,slt] [year,datetime,slt], [hour24,datetime,slt]:[min,datetime,slt]:[second,datetime,slt] [timezone,datetime,slt]
</floater.string>
<text name="info_text">
Der Anzeigename ist der Name, den Sie Ihrem Avatar geben. Sie können ihn einmal pro Woche ändern.
</text>
<text name="lockout_text">
Früheste Änderung möglich ab: [TIME].
Früheste Änderung möglich ab:
[TIME].
</text>
<text name="set_name_label">
Neuer Anzeigename:

View File

@ -10,6 +10,9 @@
save_rect="false"
title="Change Display Name"
width="445">
<floater.string name="LockOutDateFormat">
[month,datetime,slt] [day,datetime,slt] [year,datetime,slt] [hour12,datetime,slt]:[min,datetime,slt]:[second,datetime,slt] [ampm,datetime,slt] [timezone,datetime,slt]
</floater.string>
<text
type="string"
length="1"
@ -17,11 +20,11 @@
font="SansSerif"
height="40"
layout="topleft"
left="25"
left="15"
name="info_text"
top="20"
use_ellipses="true"
width="380"
right="-10"
wrap="true">
Your display name is what other people see above your head. It is different from your login name. You can change it once a week.
</text>
@ -30,20 +33,21 @@
length="1"
follows="left|top"
font="SansSerif"
height="20"
height="30"
layout="topleft"
left="25"
left="15"
text_color="EmphasisColor"
name="lockout_text"
top="65"
top="55"
use_ellipses="true"
visible="false"
width="410"
visible="true"
right="-10"
wrap="true">
You cannot change your Display Name until: [TIME].
You cannot change your Display Name until:
[TIME].
</text>
<text
top_pad="0"
top_pad="5"
width="150"
height="20"
font="SansSerif"
@ -59,7 +63,7 @@
left_delta="0" />
<text
top_pad="8"
left="25"
left="15"
width="380"
height="20"
font="SansSerif"
@ -79,7 +83,7 @@
font="SansSerif"
width="120"
height="23"
top_pad="10"
top_pad="8"
left_delta="0"
name="reset_btn"
tool_tip="Use Username as a Display Name" />
@ -88,7 +92,7 @@
label="Save"
layout="topleft"
font="SansSerif"
left_pad="35"
left_pad="50"
name="save_btn"
tool_tip="Save your new Display Name"
top_delta="0"