summaryrefslogtreecommitdiff
path: root/indra/newview/llblocklist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llblocklist.cpp')
-rw-r--r--indra/newview/llblocklist.cpp35
1 files changed, 34 insertions, 1 deletions
diff --git a/indra/newview/llblocklist.cpp b/indra/newview/llblocklist.cpp
index 89516a8a84..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,8 +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;
@@ -197,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
@@ -208,6 +237,8 @@ void LLBlockList::refresh()
clear();
createList();
mShouldAddAll = false;
+ // Full rebuild supersedes any queued incremental action. This ensures list consistency.
+ mActionType = NONE;
}
else
{
@@ -246,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));
}
}