diff options
| author | Erik Kundiman <erik@megapahit.org> | 2025-12-04 13:11:22 +0800 |
|---|---|---|
| committer | Erik Kundiman <erik@megapahit.org> | 2025-12-04 13:11:22 +0800 |
| commit | d9d932f6375df28dbc59088fc09cd986043651d0 (patch) | |
| tree | 0dae07bf66d2e8b3ad25a1a9ec994b303a5f01f8 /indra/newview/llfloaterdisplayname.cpp | |
| parent | dcc927e1d29b2b927ae27f8f50a1dcadb4488c80 (diff) | |
| parent | 780b5c3bd9a2a97790efc1169817f1fc574f3387 (diff) | |
Merge branch '2025.08'
Diffstat (limited to 'indra/newview/llfloaterdisplayname.cpp')
| -rw-r--r-- | indra/newview/llfloaterdisplayname.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/indra/newview/llfloaterdisplayname.cpp b/indra/newview/llfloaterdisplayname.cpp index 236aadfbc1..4843a48e66 100644 --- a/indra/newview/llfloaterdisplayname.cpp +++ b/indra/newview/llfloaterdisplayname.cpp @@ -56,6 +56,7 @@ private: void onCacheSetName(bool success, const std::string& reason, const LLSD& content); + bool mIsLockedOut = false; }; LLFloaterDisplayName::LLFloaterDisplayName(const LLSD& key) : @@ -72,8 +73,8 @@ void LLFloaterDisplayName::onOpen(const LLSD& key) LLAvatarNameCache::get(gAgent.getID(), &av_name); F64 now_secs = LLDate::now().secondsSinceEpoch(); - - if (now_secs < av_name.mNextUpdate) + mIsLockedOut = now_secs < av_name.mNextUpdate; + if (mIsLockedOut) { // ...can't update until some time in the future F64 next_update_local_secs = @@ -167,18 +168,19 @@ void LLFloaterDisplayName::onReset() } getChild<LLUICtrl>("display_name_editor")->setValue(av_name.getUserName()); - if (getChild<LLUICtrl>("display_name_editor")->getEnabled()) + if (mIsLockedOut) { - // UI is enabled, fill the first field - getChild<LLUICtrl>("display_name_confirm")->clear(); - getChild<LLUICtrl>("display_name_confirm")->setFocus(true); + // UI is disabled. + // 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); } 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); + // UI is enabled, focus on the confirm field + getChild<LLUICtrl>("display_name_confirm")->clear(); + getChild<LLUICtrl>("display_name_confirm")->setFocus(true); } } |
