From 581cad9cc45c375b8c60692e565b27ac1568f4c9 Mon Sep 17 00:00:00 2001 From: Darl Date: Fri, 3 Apr 2026 18:36:10 -0500 Subject: Make LLBlockList more reactive to LLMuteList changes This allows the UI to update if already initialized before fallback or load occurs Signed-off-by: Darl --- indra/newview/llblocklist.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/newview/llblocklist.cpp') diff --git a/indra/newview/llblocklist.cpp b/indra/newview/llblocklist.cpp index 89516a8a84..230aa19ad2 100644 --- a/indra/newview/llblocklist.cpp +++ b/indra/newview/llblocklist.cpp @@ -101,6 +101,14 @@ BlockListActionType LLBlockList::getCurrentMuteListActionType() return type; } +void LLBlockList::onChange() +{ + // Something changed, not sure what so force a refresh. + mShouldAddAll = true; + mActionType = NONE; + setDirty(); +} + void LLBlockList::onChangeDetailed(const LLMute &mute) { mActionType = getCurrentMuteListActionType(); -- cgit v1.3 From 901ad6193b767b07028b816a1b3284927491c3db Mon Sep 17 00:00:00 2001 From: Darl Date: Fri, 3 Apr 2026 18:38:08 -0500 Subject: Add noitems text to the block list UI, with translation friendly helper strings to denote loading or failed states Signed-off-by: Darl --- indra/newview/llblocklist.cpp | 27 +++++++++++++++++++++- indra/newview/llblocklist.h | 5 ++++ indra/newview/llpanelblockedlist.cpp | 4 ++++ .../default/xui/en/panel_block_list_sidetray.xml | 12 ++++++++++ 4 files changed, 47 insertions(+), 1 deletion(-) (limited to 'indra/newview/llblocklist.cpp') 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(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 (*it); if(curItem) - { + { + // Refresh item text styling each pass so filtering keeps highlight in sync. + curItem->highlightName(mNameFilter); hideListItem(curItem, findInsensitive(curItem->getName(), mNameFilter)); } } diff --git a/indra/newview/llblocklist.h b/indra/newview/llblocklist.h index 92bb910c57..9266584256 100644 --- a/indra/newview/llblocklist.h +++ b/indra/newview/llblocklist.h @@ -68,6 +68,8 @@ public: void refresh(); U32 getMuteListSize() { return mMuteListSize; } + void setLoadingItemsMsg(const std::string& msg) { mLoadingItemsMsg = msg; updateNoItemsCommentText(); } + void setFailedItemsMsg(const std::string& msg) { mFailedItemsMsg = msg; updateNoItemsCommentText(); } private: @@ -83,6 +85,7 @@ private: bool isMenuItemVisible(const LLSD& userdata); void toggleMute(U32 flags); void createList(); + void updateNoItemsCommentText(); BlockListActionType getCurrentMuteListActionType(); @@ -100,6 +103,8 @@ private: LLMute::EType mCurItemType; U32 mCurItemFlags; std::string mPrevNameFilter; + std::string mLoadingItemsMsg; + std::string mFailedItemsMsg; }; diff --git a/indra/newview/llpanelblockedlist.cpp b/indra/newview/llpanelblockedlist.cpp index 69f51b03b6..178f994beb 100644 --- a/indra/newview/llpanelblockedlist.cpp +++ b/indra/newview/llpanelblockedlist.cpp @@ -78,6 +78,10 @@ bool LLPanelBlockedList::postBuild() { mBlockedList = getChild("blocked"); mBlockedList->setCommitOnSelectionChange(true); + mBlockedList->setNoItemsMsg(getString("no_blocked")); + mBlockedList->setNoFilteredItemsMsg(getString("no_filtered_blocked")); + mBlockedList->setLoadingItemsMsg(getString("loading_blocked")); + mBlockedList->setFailedItemsMsg(getString("failed_blocked")); this->setVisibleCallback(boost::bind(&LLPanelBlockedList::removePicker, this)); switch (gSavedSettings.getU32("BlockPeopleSortOrder")) diff --git a/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml b/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml index 6bb891db63..d907a050b6 100644 --- a/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml +++ b/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml @@ -10,6 +10,18 @@ min_height="350" min_width="240" width="323"> + + + +