diff options
author | Denis Serdjuk <dserduk@productengine.com> | 2010-03-03 11:39:44 +0200 |
---|---|---|
committer | Denis Serdjuk <dserduk@productengine.com> | 2010-03-03 11:39:44 +0200 |
commit | d587c77e90947385402c786c045ceaed11f90e1a (patch) | |
tree | 912688de29e996e624c53e0a8638eeca8e2ed06e /indra | |
parent | 5d2b69207ade17a6502a72f05d5e59d5939f14ef (diff) |
Low Bug EXT-5752 Trash button in people panel remains enabled after removing last friend
Cause:
Avatarlist has been hidden before it had been updated. So one listitem was left in the list and remained always selected.
Solution:
Force update ability has been added to avatarlist
--HG--
branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llavatarlist.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llavatarlist.h | 2 | ||||
-rw-r--r-- | indra/newview/llpanelpeople.cpp | 15 |
3 files changed, 20 insertions, 6 deletions
diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 50d8672083..45c540b3a3 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -183,6 +183,15 @@ void LLAvatarList::sortByName() sort(); } +void LLAvatarList::setDirty(bool val /*= true*/, bool force_refresh /*= false*/) +{ + mDirty = val; + if(mDirty && force_refresh) + { + refresh(); + } +} + ////////////////////////////////////////////////////////////////////////// // PROTECTED SECTION ////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llavatarlist.h b/indra/newview/llavatarlist.h index 0e4215e91a..00c72f1f9d 100644 --- a/indra/newview/llavatarlist.h +++ b/indra/newview/llavatarlist.h @@ -73,7 +73,7 @@ public: virtual void clear(); void setNameFilter(const std::string& filter); - void setDirty(bool val = true) { mDirty = val; } + void setDirty(bool val = true, bool force_refresh = false); uuid_vector_t& getIDs() { return mIDs; } bool contains(const LLUUID& id); diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index d2a518a06a..93a6a7803a 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -683,9 +683,15 @@ void LLPanelPeople::updateFriendList() online_friendsp.push_back(buddy_id); } - mOnlineFriendList->setDirty(); - mAllFriendList->setDirty(); - + /* + * Avatarlists will be hidden by showFriendsAccordionsIfNeeded(), if they do not have items. + * But avatarlist can be updated only if it is visible @see LLAvatarList::draw(); + * So we need to do force update of lists to avoid inconsistency of data and view of avatarlist. + */ + mOnlineFriendList->setDirty(true, !mOnlineFriendList->filterHasMatches());// do force update if list do NOT have items + mAllFriendList->setDirty(true, !mAllFriendList->filterHasMatches()); + //update trash and other buttons according to a selected item + updateButtons(); showFriendsAccordionsIfNeeded(); } @@ -1434,9 +1440,8 @@ void LLPanelPeople::onFriendListRefreshComplete(LLUICtrl*ctrl, const LLSD& param { showAccordion("tab_all", param.asInteger()); } + updateButtons(); - LLAccordionCtrl* accordion = getChild<LLAccordionCtrl>("friends_accordion"); - accordion->arrange(); } void LLPanelPeople::setAccordionCollapsedByUser(LLUICtrl* acc_tab, bool collapsed) |