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.cpp46
1 files changed, 18 insertions, 28 deletions
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 2f0a8f7656..107b1cf6cd 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -727,12 +727,14 @@ bool LLPanelPeople::postBuild()
LL_WARNS() << "People->Groups list menu not found" << LL_ENDL;
}
- LLAccordionCtrlTab* accordion_tab = getChild<LLAccordionCtrlTab>("tab_all");
- accordion_tab->setDropDownStateChangedCallback(
+ mFriendsAccordion = friends_tab->getChild<LLAccordionCtrl>("friends_accordion");
+
+ mFriendsAllTab = mFriendsAccordion->getChild<LLAccordionCtrlTab>("tab_all");
+ mFriendsAllTab->setDropDownStateChangedCallback(
boost::bind(&LLPanelPeople::onFriendsAccordionExpandedCollapsed, this, _1, _2, mAllFriendList));
- accordion_tab = getChild<LLAccordionCtrlTab>("tab_online");
- accordion_tab->setDropDownStateChangedCallback(
+ mFriendsOnlineTab = mFriendsAccordion->getChild<LLAccordionCtrlTab>("tab_online");
+ mFriendsOnlineTab->setDropDownStateChangedCallback(
boost::bind(&LLPanelPeople::onFriendsAccordionExpandedCollapsed, this, _1, _2, mOnlineFriendList));
// Must go after setting commit callback and initializing all pointers to children.
@@ -1064,8 +1066,8 @@ void LLPanelPeople::onFilterEdit(const std::string& search_string)
mOnlineFriendList->setNameFilter(filter);
mAllFriendList->setNameFilter(filter);
- setAccordionCollapsedByUser("tab_online", false);
- setAccordionCollapsedByUser("tab_all", false);
+ setAccordionCollapsedByUser(mFriendsOnlineTab, false);
+ setAccordionCollapsedByUser(mFriendsAllTab, false);
showFriendsAccordionsIfNeeded();
// restore accordion tabs state _after_ all manipulations
@@ -1108,7 +1110,6 @@ void LLPanelPeople::onGroupLimitInfo()
void LLPanelPeople::onTabSelected(const LLSD& param)
{
- std::string tab_name = getChild<LLPanel>(param.asString())->getName();
updateButtons();
showFriendsAccordionsIfNeeded();
@@ -1142,9 +1143,9 @@ void LLPanelPeople::onAvatarListCommitted(LLAvatarList* list)
uuid_vec_t selected_uuids;
getCurrentItemIDs(selected_uuids);
mMiniMap->setSelected(selected_uuids);
- } else
+ }
// Make sure only one of the friends lists (online/all) has selection.
- if (getActiveTabName() == FRIENDS_TAB_NAME)
+ else if (getActiveTabName() == FRIENDS_TAB_NAME)
{
if (list == mOnlineFriendList)
mAllFriendList->resetSelection(true);
@@ -1169,12 +1170,9 @@ void LLPanelPeople::onAddFriendButtonClicked()
bool LLPanelPeople::isItemsFreeOfFriends(const uuid_vec_t& uuids)
{
const LLAvatarTracker& av_tracker = LLAvatarTracker::instance();
- for ( uuid_vec_t::const_iterator
- id = uuids.begin(),
- id_end = uuids.end();
- id != id_end; ++id )
+ for (const LLUUID& uuid : uuids)
{
- if (av_tracker.isBuddy (*id))
+ if (av_tracker.isBuddy(uuid))
{
return false;
}
@@ -1479,15 +1477,8 @@ bool LLPanelPeople::notifyChildren(const LLSD& info)
return LLPanel::notifyChildren(info);
}
-void LLPanelPeople::showAccordion(const std::string name, bool show)
+void LLPanelPeople::showAccordion(LLAccordionCtrlTab* tab, bool show)
{
- if(name.empty())
- {
- LL_WARNS() << "No name provided" << LL_ENDL;
- return;
- }
-
- LLAccordionCtrlTab* tab = getChild<LLAccordionCtrlTab>(name);
tab->setVisible(show);
if(show)
{
@@ -1505,12 +1496,11 @@ void LLPanelPeople::showFriendsAccordionsIfNeeded()
if(FRIENDS_TAB_NAME == getActiveTabName())
{
// Expand and show accordions if needed, else - hide them
- showAccordion("tab_online", mOnlineFriendList->filterHasMatches());
- showAccordion("tab_all", mAllFriendList->filterHasMatches());
+ showAccordion(mFriendsOnlineTab, mOnlineFriendList->filterHasMatches());
+ showAccordion(mFriendsAllTab, mAllFriendList->filterHasMatches());
// Rearrange accordions
- LLAccordionCtrl* accordion = getChild<LLAccordionCtrl>("friends_accordion");
- accordion->arrange();
+ mFriendsAccordion->arrange();
// *TODO: new no_matched_tabs_text attribute was implemented in accordion (EXT-7368).
// this code should be refactored to use it
@@ -1523,11 +1513,11 @@ void LLPanelPeople::onFriendListRefreshComplete(LLUICtrl*ctrl, const LLSD& param
{
if(ctrl == mOnlineFriendList)
{
- showAccordion("tab_online", param.asInteger());
+ showAccordion(mFriendsOnlineTab, param.asInteger());
}
else if(ctrl == mAllFriendList)
{
- showAccordion("tab_all", param.asInteger());
+ showAccordion(mFriendsAllTab, param.asInteger());
}
}