diff options
| author | Darl <me@darl.cat> | 2026-04-03 18:38:08 -0500 |
|---|---|---|
| committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2026-04-07 20:48:52 +0300 |
| commit | 901ad6193b767b07028b816a1b3284927491c3db (patch) | |
| tree | dbf8f35c5a1ea1fbd9aa703017fda3ba1a469a10 /indra/newview/llblocklist.cpp | |
| parent | 581cad9cc45c375b8c60692e565b27ac1568f4c9 (diff) | |
Add noitems text to the block list UI, with translation friendly helper strings to denote loading or failed states
Signed-off-by: Darl <me@darl.cat>
Diffstat (limited to 'indra/newview/llblocklist.cpp')
| -rw-r--r-- | indra/newview/llblocklist.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/indra/newview/llblocklist.cpp b/indra/newview/llblocklist.cpp index 230aa19ad2..05c882e3f1 100644 --- a/indra/newview/llblocklist.cpp +++ b/indra/newview/llblocklist.cpp @@ -48,6 +48,7 @@ LLBlockList::LLBlockList(const Params& p) LLMuteList::getInstance()->addObserver(this); mMuteListSize = static_cast<U32>(LLMuteList::getInstance()->getMutes().size()); + updateNoItemsCommentText(); // Set up context menu. LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; @@ -101,16 +102,35 @@ BlockListActionType LLBlockList::getCurrentMuteListActionType() return type; } +void LLBlockList::updateNoItemsCommentText() +{ + const LLMuteList* mute_list = LLMuteList::getInstance(); + if (!mute_list->isLoaded() && !mute_list->isFailed()) + { + setNoItemsCommentText(mLoadingItemsMsg); + } + else if (mute_list->isFailed()) + { + setNoItemsCommentText(mFailedItemsMsg); + } + else + { + updateNoItemsMessage(mNameFilter); + } +} + void LLBlockList::onChange() { // Something changed, not sure what so force a refresh. mShouldAddAll = true; mActionType = NONE; + updateNoItemsCommentText(); setDirty(); } void LLBlockList::onChangeDetailed(const LLMute &mute) { + updateNoItemsCommentText(); mActionType = getCurrentMuteListActionType(); mCurItemId = mute.mID; @@ -205,6 +225,7 @@ void LLBlockList::addNewItem(const LLMute* mute) void LLBlockList::refresh() { + updateNoItemsCommentText(); bool have_filter = !mNameFilter.empty(); // save selection to restore it after list rebuilt @@ -216,6 +237,8 @@ void LLBlockList::refresh() clear(); createList(); mShouldAddAll = false; + // Full rebuild supersedes any queued incremental action. This ensures list consistency. + mActionType = NONE; } else { @@ -254,7 +277,9 @@ void LLBlockList::refresh() { LLBlockedListItem * curItem = dynamic_cast<LLBlockedListItem *> (*it); if(curItem) - { + { + // Refresh item text styling each pass so filtering keeps highlight in sync. + curItem->highlightName(mNameFilter); hideListItem(curItem, findInsensitive(curItem->getName(), mNameFilter)); } } |
