summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelpeople.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelpeople.cpp')
-rw-r--r--indra/newview/llpanelpeople.cpp79
1 files changed, 30 insertions, 49 deletions
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 6bd4e53fcf..0e8036eea6 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -313,9 +313,9 @@ public:
mEventTimer.stop();
}
- virtual BOOL tick() // from LLEventTimer
+ virtual bool tick() // from LLEventTimer
{
- return FALSE;
+ return false;
}
};
@@ -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);
}
@@ -367,9 +364,9 @@ public:
}
- /*virtual*/ BOOL tick()
+ /*virtual*/ bool tick()
{
- if (!mIsActive) return FALSE;
+ if (!mIsActive) return false;
if (mMask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE))
{
@@ -380,7 +377,7 @@ public:
mEventTimer.stop();
mMask = 0;
- return FALSE;
+ return false;
}
// virtual
@@ -508,10 +505,10 @@ public:
}
}
- /*virtual*/ BOOL tick()
+ /*virtual*/ bool tick()
{
update();
- return FALSE;
+ return false;
}
private:
};
@@ -577,10 +574,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)
@@ -609,14 +609,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)
{
@@ -721,7 +721,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();
@@ -729,11 +729,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)
{
@@ -831,7 +831,7 @@ void LLPanelPeople::updateNearbyList()
mNearbyList->setDirty();
DISTANCE_COMPARATOR.updateAvatarsPositions(positions, mNearbyList->getIDs());
- LLActiveSpeakerMgr::instance().update(TRUE);
+ LLActiveSpeakerMgr::instance().update(true);
}
void LLPanelPeople::updateRecentList()
@@ -866,8 +866,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));
@@ -887,7 +887,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)
@@ -961,25 +961,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)
@@ -1184,11 +1165,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;