summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelpeople.cpp
diff options
context:
space:
mode:
authornat-goodspeed <nat@lindenlab.com>2024-09-05 08:37:16 -0400
committerGitHub <noreply@github.com>2024-09-05 08:37:16 -0400
commit7ac4c3b56e5246fceaa73e7c9c665d3c04827d6c (patch)
treee96334bd9299102ebdaf229eec9cf4c2165f8c2f /indra/newview/llpanelpeople.cpp
parent487973d3f0ee9b8583b3d977ca6a405cba5fe518 (diff)
parent6a747e1ce027700a3609f4c377179bfa29c3ce31 (diff)
Merge pull request #2450 from secondlife/lua-merge
Merge updated 'main' branch into release/luau-scripting
Diffstat (limited to 'indra/newview/llpanelpeople.cpp')
-rw-r--r--indra/newview/llpanelpeople.cpp67
1 files changed, 24 insertions, 43 deletions
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 4c916f35e5..fb96718d1c 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -338,7 +338,7 @@ public:
LLAvatarTracker::instance().addObserver(this);
// For notification when SIP online status changes.
- LLVoiceClient::getInstance()->addObserver(this);
+ LLVoiceClient::addObserver(this);
mInvObserver = new LLInventoryFriendCardObserver(this);
}
@@ -346,10 +346,7 @@ public:
{
// will be deleted by ~LLInventoryModel
//delete mInvObserver;
- if (LLVoiceClient::instanceExists())
- {
- LLVoiceClient::getInstance()->removeObserver(this);
- }
+ LLVoiceClient::removeObserver(this);
LLAvatarTracker::instance().removeObserver(this);
}
@@ -369,7 +366,7 @@ public:
bool tick() override
{
- if (!mIsActive) return FALSE;
+ if (!mIsActive) return false;
if (mMask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE))
{
@@ -576,10 +573,13 @@ LLPanelPeople::~LLPanelPeople()
delete mFriendListUpdater;
delete mRecentListUpdater;
- if(LLVoiceClient::instanceExists())
- {
- LLVoiceClient::getInstance()->removeObserver(this);
- }
+ LLVoiceClient::removeObserver(this);
+
+ mNearbyFilterCommitConnection.disconnect();
+ mFriedsFilterCommitConnection.disconnect();
+ mGroupsFilterCommitConnection.disconnect();
+ mRecentFilterCommitConnection.disconnect();
+
}
void LLPanelPeople::onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LLSD& param, LLAvatarList* avatar_list)
@@ -608,14 +608,14 @@ void LLPanelPeople::removePicker()
}
}
-BOOL LLPanelPeople::postBuild()
+bool LLPanelPeople::postBuild()
{
S32 max_premium = LLAgentBenefitsMgr::get("Premium").getGroupMembershipLimit();
- getChild<LLFilterEditor>("nearby_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
- getChild<LLFilterEditor>("friends_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
- getChild<LLFilterEditor>("groups_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
- getChild<LLFilterEditor>("recent_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
+ mNearbyFilterCommitConnection = getChild<LLFilterEditor>("nearby_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
+ mFriedsFilterCommitConnection = getChild<LLFilterEditor>("friends_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
+ mGroupsFilterCommitConnection = getChild<LLFilterEditor>("groups_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
+ mRecentFilterCommitConnection = getChild<LLFilterEditor>("recent_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
if(LLAgentBenefitsMgr::current().getGroupMembershipLimit() < max_premium)
{
@@ -720,7 +720,7 @@ BOOL LLPanelPeople::postBuild()
// Must go after setting commit callback and initializing all pointers to children.
mTabContainer->selectTabByName(NEARBY_TAB_NAME);
- LLVoiceClient::getInstance()->addObserver(this);
+ LLVoiceClient::addObserver(this);
// call this method in case some list is empty and buttons can be in inconsistent state
updateButtons();
@@ -728,11 +728,11 @@ BOOL LLPanelPeople::postBuild()
mOnlineFriendList->setRefreshCompleteCallback(boost::bind(&LLPanelPeople::onFriendListRefreshComplete, this, _1, _2));
mAllFriendList->setRefreshCompleteCallback(boost::bind(&LLPanelPeople::onFriendListRefreshComplete, this, _1, _2));
- return TRUE;
+ return true;
}
// virtual
-void LLPanelPeople::onChange(EStatusType status, const std::string &channelURI, bool proximal)
+void LLPanelPeople::onChange(EStatusType status, const LLSD& channelInfo, bool proximal)
{
if(status == STATUS_JOINING || status == STATUS_LEFT_CHANNEL)
{
@@ -830,7 +830,7 @@ void LLPanelPeople::updateNearbyList()
mNearbyList->setDirty();
DISTANCE_COMPARATOR.updateAvatarsPositions(positions, mNearbyList->getIDs());
- LLActiveSpeakerMgr::instance().update(TRUE);
+ LLActiveSpeakerMgr::instance().update(true);
}
void LLPanelPeople::updateRecentList()
@@ -865,8 +865,8 @@ void LLPanelPeople::updateButtons()
LLPanel* groups_panel = mTabContainer->getCurrentPanel();
groups_panel->getChildView("minus_btn")->setEnabled(item_selected && selected_id.notNull()); // a real group selected
- U32 groups_count = gAgent.mGroups.size();
- S32 max_groups = LLAgentBenefitsMgr::current().getGroupMembershipLimit();
+ U32 groups_count = static_cast<U32>(gAgent.mGroups.size());
+ U32 max_groups = LLAgentBenefitsMgr::current().getGroupMembershipLimit();
U32 groups_remaining = max_groups > groups_count ? max_groups - groups_count : 0;
groups_panel->getChild<LLUICtrl>("groupcount")->setTextArg("[COUNT]", llformat("%d", groups_count));
groups_panel->getChild<LLUICtrl>("groupcount")->setTextArg("[REMAINING]", llformat("%d", groups_remaining));
@@ -886,7 +886,7 @@ void LLPanelPeople::updateButtons()
LLPanel* cur_panel = mTabContainer->getCurrentPanel();
if (cur_panel)
{
- if (cur_panel->hasChild("add_friend_btn", TRUE))
+ if (cur_panel->hasChild("add_friend_btn", true))
cur_panel->getChildView("add_friend_btn")->setEnabled(item_selected && !is_friend && !is_self);
if (friends_tab_active)
@@ -960,25 +960,6 @@ void LLPanelPeople::getCurrentItemIDs(uuid_vec_t& selected_uuids) const
}
-void LLPanelPeople::showGroupMenu(LLMenuGL* menu)
-{
- // Shows the menu at the top of the button bar.
-
- // Calculate its coordinates.
- // (assumes that groups panel is the current tab)
- LLPanel* bottom_panel = mTabContainer->getCurrentPanel()->getChild<LLPanel>("bottom_panel");
- LLPanel* parent_panel = mTabContainer->getCurrentPanel();
- menu->arrangeAndClear();
- S32 menu_height = menu->getRect().getHeight();
- S32 menu_x = -2; // *HACK: compensates HPAD in showPopup()
- S32 menu_y = bottom_panel->getRect().mTop + menu_height;
-
- // Actually show the menu.
- menu->buildDrawLabels();
- menu->updateParent(LLMenuGL::sMenuContainer);
- LLMenuGL::showPopup(parent_panel, menu, menu_x, menu_y);
-}
-
void LLPanelPeople::setSortOrder(LLAvatarList* list, ESortOrder order, bool save)
{
switch (order)
@@ -1183,11 +1164,11 @@ bool LLPanelPeople::isItemsFreeOfFriends(const uuid_vec_t& uuids)
void LLPanelPeople::onAddFriendWizButtonClicked()
{
LLPanel* cur_panel = mTabContainer->getCurrentPanel();
- LLView * button = cur_panel->findChild<LLButton>("friends_add_btn", TRUE);
+ LLView * button = cur_panel->findChild<LLButton>("friends_add_btn", true);
// Show add friend wizard.
LLFloater* root_floater = gFloaterView->getParentFloater(this);
- LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLPanelPeople::onAvatarPicked, _1, _2), FALSE, TRUE, FALSE, root_floater->getName(), button);
+ LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLPanelPeople::onAvatarPicked, _1, _2), false, true, false, root_floater->getName(), button);
if (!picker)
{
return;