summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterdisplayname.cpp
diff options
context:
space:
mode:
authorCallum Prentice <callum@lindenlab.com>2023-04-03 14:58:58 -0700
committerCallum Prentice <callum@lindenlab.com>2023-04-03 14:58:58 -0700
commit28b240fd7fc39ff4668e37b5aa3bdfe392415b34 (patch)
tree923892b5ea9e9ac4d757fba089f0e9b2b24fbf26 /indra/newview/llfloaterdisplayname.cpp
parent7b9866791ac7922f7527811bbc99c090f35e4cfd (diff)
parentc7053a6928fd5eafdc935453742e92951ae4e0c1 (diff)
DRTVWR-489: Fix things up after a messy merge with main because of a gigantic CMake patch. Sadly, my macOS box updated to Xcode14.3 overnight and that caused many warnings/errors with variables being initialized and then used but not in a way that affected anything.. Building on Xcode 14.3 also requires that MACOSX_DEPLOYMENT_TARGET be set to > 10.13. Waiting on a decision about that but checking this in in the meantime. Builds on macOS with appropriate build variables set for MACOSX_DEPLOYMENT_TARGET = 10.14 but not really expecting this to build in TC because (REDACTED). Windows version probably hopelessly broken - switching to that now.
Diffstat (limited to 'indra/newview/llfloaterdisplayname.cpp')
-rw-r--r--indra/newview/llfloaterdisplayname.cpp16
1 files changed, 16 insertions, 0 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();