diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-12-22 02:16:10 +0200 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-01-06 02:48:25 +0200 |
commit | 7196c8c2edeeb01ef4ffb839f7731a99df888bd1 (patch) | |
tree | 1aed26259107ccbd77640fc2f22301e57c017bdb /indra | |
parent | 200e185dff108605f0dde45c42b3d827b7a9f0b4 (diff) |
SL-17659 Reset button for user profile
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfloaterdisplayname.cpp | 16 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_display_name.xml | 20 |
2 files changed, 31 insertions, 5 deletions
diff --git a/indra/newview/llfloaterdisplayname.cpp b/indra/newview/llfloaterdisplayname.cpp index 3b0c67415a..19bc865d8b 100644 --- a/indra/newview/llfloaterdisplayname.cpp +++ b/indra/newview/llfloaterdisplayname.cpp @@ -47,6 +47,7 @@ public: virtual ~LLFloaterDisplayName() { } /*virtual*/ BOOL postBuild(); void onSave(); + void onReset(); void onCancel(); /*virtual*/ void onOpen(const LLSD& key); @@ -101,6 +102,7 @@ void LLFloaterDisplayName::onOpen(const LLSD& key) BOOL LLFloaterDisplayName::postBuild() { + getChild<LLUICtrl>("reset_btn")->setCommitCallback(boost::bind(&LLFloaterDisplayName::onReset, this)); getChild<LLUICtrl>("cancel_btn")->setCommitCallback(boost::bind(&LLFloaterDisplayName::onCancel, this)); getChild<LLUICtrl>("save_btn")->setCommitCallback(boost::bind(&LLFloaterDisplayName::onSave, this)); @@ -156,6 +158,20 @@ void LLFloaterDisplayName::onCancel() setVisible(false); } +void LLFloaterDisplayName::onReset() +{ + LLAvatarName av_name; + if (!LLAvatarNameCache::get(gAgent.getID(), &av_name)) + { + return; + } + getChild<LLUICtrl>("display_name_editor")->setValue(av_name.getCompleteName()); + + getChild<LLUICtrl>("display_name_confirm")->clear(); + getChild<LLUICtrl>("display_name_confirm")->setFocus(TRUE); +} + + void LLFloaterDisplayName::onSave() { std::string display_name_utf8 = getChild<LLUICtrl>("display_name_editor")->getValue().asString(); 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 3c8f415860..f3431da858 100644 --- a/indra/newview/skins/default/xui/en/floater_display_name.xml +++ b/indra/newview/skins/default/xui/en/floater_display_name.xml @@ -56,7 +56,7 @@ max_length_chars="31" height="20" top_pad="5" - left="50" /> + left_delta="0" /> <text top_pad="15" left="25" @@ -72,23 +72,33 @@ max_length_chars="31" height="20" top_pad="5" - left="50" /> + left_delta="0" /> + <button + label="Reset" + layout="topleft" + font="SansSerif" + width="120" + height="23" + top_pad="40" + left_delta="0" + name="reset_btn" + tool_tip="Use Username as a Display Name" /> <button height="23" label="Save" layout="topleft" font="SansSerif" - left="35" + left_pad="35" name="save_btn" tool_tip="Save your new Display Name" - top_pad="40" + top_delta="0" width="120" /> <button height="23" label="Cancel" font="SansSerif" layout="topleft" - left_pad="125" + left_pad="5" name="cancel_btn" width="120" /> </floater> |