summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelpeople.cpp
diff options
context:
space:
mode:
authorMike Antipov <mantipov@productengine.com>2010-07-30 10:02:09 +0300
committerMike Antipov <mantipov@productengine.com>2010-07-30 10:02:09 +0300
commitc13048fd8aa273fc3a7fe6b69f0a27ffa25eef43 (patch)
tree9993a15301f42a4dff0214cdc0a7035d23fabe48 /indra/newview/llpanelpeople.cpp
parenta486b553e152209158089161463e37a4963aee75 (diff)
EXT-8522 FIXED (Code improvements: Update a way in which Nearby people list is controlled depend on its visibility to user)
1. Removed special processing of Nearby People List Updater when: * tabs in People panel are changed; * People panel change its visibility. 2. Subscribed Nearby People List Updater's setActive() method directly to Nearby list Panel's onVisibleChange callback. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/825/ --HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llpanelpeople.cpp')
-rw-r--r--indra/newview/llpanelpeople.cpp31
1 files changed, 3 insertions, 28 deletions
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 3140fe8de1..3f5191ca12 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -515,8 +515,6 @@ void LLPanelPeople::onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LL
BOOL LLPanelPeople::postBuild()
{
- setVisibleCallback(boost::bind(&LLPanelPeople::onVisibilityChange, this, _2));
-
mFilterEditor = getChild<LLFilterEditor>("filter_input");
mFilterEditor->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
@@ -533,7 +531,9 @@ BOOL LLPanelPeople::postBuild()
mAllFriendList->setNoItemsCommentText(getString("no_friends"));
mAllFriendList->setShowIcons("FriendsListShowIcons");
- mNearbyList = getChild<LLPanel>(NEARBY_TAB_NAME)->getChild<LLAvatarList>("avatar_list");
+ LLPanel* nearby_tab = getChild<LLPanel>(NEARBY_TAB_NAME);
+ nearby_tab->setVisibleCallback(boost::bind(&Updater::setActive, mNearbyListUpdater, _2));
+ mNearbyList = nearby_tab->getChild<LLAvatarList>("avatar_list");
mNearbyList->setNoItemsCommentText(getString("no_one_near"));
mNearbyList->setNoItemsMsg(getString("no_one_near"));
mNearbyList->setNoFilteredItemsMsg(getString("no_one_filtered_near"));
@@ -977,28 +977,6 @@ void LLPanelPeople::setSortOrder(LLAvatarList* list, ESortOrder order, bool save
}
}
-void LLPanelPeople::onVisibilityChange(const LLSD& new_visibility)
-{
- if (new_visibility.asBoolean() == FALSE)
- {
- // Don't update anything while we're invisible.
- mNearbyListUpdater->setActive(FALSE);
- }
- else
- {
- reSelectedCurrentTab();
- }
-}
-
-// Make the tab-container re-select current tab
-// for onTabSelected() callback to get called.
-// (currently this is needed to reactivate nearby list updates
-// when we get visible)
-void LLPanelPeople::reSelectedCurrentTab()
-{
- mTabContainer->selectTab(mTabContainer->getCurrentPanelIndex());
-}
-
bool LLPanelPeople::isRealGroup()
{
return getCurrentItemID() != LLUUID::null;
@@ -1046,7 +1024,6 @@ void LLPanelPeople::onFilterEdit(const std::string& search_string)
void LLPanelPeople::onTabSelected(const LLSD& param)
{
std::string tab_name = getChild<LLPanel>(param.asString())->getName();
- mNearbyListUpdater->setActive(tab_name == NEARBY_TAB_NAME);
updateButtons();
showFriendsAccordionsIfNeeded();
@@ -1410,8 +1387,6 @@ void LLPanelPeople::onOpen(const LLSD& key)
if (!tab_name.empty())
mTabContainer->selectTabByName(tab_name);
- else
- reSelectedCurrentTab();
}
bool LLPanelPeople::notifyChildren(const LLSD& info)