diff options
author | Rye Mutt <rye@alchemyviewer.org> | 2024-07-24 19:34:35 -0400 |
---|---|---|
committer | Rye Mutt <rye@alchemyviewer.org> | 2024-07-25 08:45:53 -0400 |
commit | a067f935358098d57f472a5fb8d475e99dd5c510 (patch) | |
tree | 59a0b82eeefcc0b6cdb879459141694bf3614159 /indra | |
parent | e3deb8340a5f2e5b1c997e66042f3515f33f5cea (diff) |
Fix findChild calls during blocked list draw
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llpanelblockedlist.cpp | 18 | ||||
-rw-r--r-- | indra/newview/llpanelblockedlist.h | 7 |
2 files changed, 18 insertions, 7 deletions
diff --git a/indra/newview/llpanelblockedlist.cpp b/indra/newview/llpanelblockedlist.cpp index 0de22fce25..7d55ba3265 100644 --- a/indra/newview/llpanelblockedlist.cpp +++ b/indra/newview/llpanelblockedlist.cpp @@ -94,16 +94,21 @@ bool LLPanelBlockedList::postBuild() break; } + mBlockedGearBtn = getChild<LLMenuButton>("blocked_gear_btn"); + // Use the context menu of the Block list for the Block tab gear menu. LLToggleableMenu* blocked_gear_menu = mBlockedList->getContextMenu(); if (blocked_gear_menu) { - getChild<LLMenuButton>("blocked_gear_btn")->setMenu(blocked_gear_menu, LLMenuButton::MP_BOTTOM_LEFT); + mBlockedGearBtn->setMenu(blocked_gear_menu, LLMenuButton::MP_BOTTOM_LEFT); } + mUnblockBtn = getChild<LLButton>("unblock_btn"); + mUnblockBtn->setCommitCallback(boost::bind(&LLPanelBlockedList::unblockItem, this)); - getChild<LLButton>("unblock_btn")->setCommitCallback(boost::bind(&LLPanelBlockedList::unblockItem, this)); getChild<LLFilterEditor>("blocked_filter_input")->setCommitCallback(boost::bind(&LLPanelBlockedList::onFilterEdit, this, _2)); + mBlockLimitText = getChild<LLUICtrl>("block_limit"); + return LLPanel::postBuild(); } @@ -140,11 +145,12 @@ void LLPanelBlockedList::showPanelAndSelect(const LLUUID& idToSelect) void LLPanelBlockedList::updateButtons() { bool hasSelected = NULL != mBlockedList->getSelectedItem(); - getChildView("unblock_btn")->setEnabled(hasSelected); - getChildView("blocked_gear_btn")->setEnabled(hasSelected); + mUnblockBtn->setEnabled(hasSelected); + mBlockedGearBtn->setEnabled(hasSelected); - getChild<LLUICtrl>("block_limit")->setTextArg("[COUNT]", llformat("%d", mBlockedList->getMuteListSize())); - getChild<LLUICtrl>("block_limit")->setTextArg("[LIMIT]", llformat("%d", gSavedSettings.getS32("MuteListLimit"))); + static LLCachedControl<S32> mute_list_limit(gSavedSettings, "MuteListLimit"); + mBlockLimitText->setTextArg("[COUNT]", llformat("%d", mBlockedList->getMuteListSize())); + mBlockLimitText->setTextArg("[LIMIT]", llformat("%d", mute_list_limit())); } void LLPanelBlockedList::unblockItem() diff --git a/indra/newview/llpanelblockedlist.h b/indra/newview/llpanelblockedlist.h index 446f3d4bad..1f470199ce 100644 --- a/indra/newview/llpanelblockedlist.h +++ b/indra/newview/llpanelblockedlist.h @@ -33,6 +33,8 @@ class LLAvatarName; class LLBlockList; +class LLMenuButton; +class LLButton; class LLPanelBlockedList : public LLPanel { @@ -78,7 +80,10 @@ private: static void callbackBlockByName(const std::string& text); private: - LLBlockList* mBlockedList; + LLBlockList* mBlockedList = nullptr; + LLUICtrl* mBlockLimitText = nullptr; + LLMenuButton* mBlockedGearBtn = nullptr; + LLButton* mUnblockBtn = nullptr; LLHandle<LLFloater> mPicker; }; |