diff options
author | Mike Antipov <mantipov@productengine.com> | 2010-07-30 10:02:09 +0300 |
---|---|---|
committer | Mike Antipov <mantipov@productengine.com> | 2010-07-30 10:02:09 +0300 |
commit | 7fcca83169287b5011b5b5a0193456e9a789619c (patch) | |
tree | 9993a15301f42a4dff0214cdc0a7035d23fabe48 | |
parent | 2c0632792101ebe5caedc3335fd9f28824cf1da9 (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
-rw-r--r-- | indra/newview/llpanelpeople.cpp | 31 | ||||
-rw-r--r-- | indra/newview/llpanelpeople.h | 4 |
2 files changed, 3 insertions, 32 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) diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 17c45a034b..ff8df5c7a8 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -91,10 +91,6 @@ private: void showGroupMenu(LLMenuGL* menu); void setSortOrder(LLAvatarList* list, ESortOrder order, bool save = true); - void onVisibilityChange( const LLSD& new_visibility); - - void reSelectedCurrentTab(); - // UI callbacks void onFilterEdit(const std::string& search_string); void onTabSelected(const LLSD& param); |