diff options
author | Mike Antipov <mantipov@productengine.com> | 2010-02-03 13:33:14 +0200 |
---|---|---|
committer | Mike Antipov <mantipov@productengine.com> | 2010-02-03 13:33:14 +0200 |
commit | 007bc25f66bd54421a089777b1a1ab28eeed1a7d (patch) | |
tree | a9f112f8d63ccbe120c1d15b1354d6321f5e8163 /indra/newview/llgrouplist.cpp | |
parent | 5e63efe1da6b72fc0ce9771b9ef1e5c9d9bcb537 (diff) |
Fixed critical bug EXT-4838 ([NUX] Add empty Groups list condition text)
- moved processing of empty list message into LLGroupList
- implemented separate messages for empty list: No matched groups / no groups at all
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llgrouplist.cpp')
-rw-r--r-- | indra/newview/llgrouplist.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index e01709aa3a..e924e902df 100644 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -72,6 +72,8 @@ public: static const LLGroupComparator GROUP_COMPARATOR; LLGroupList::Params::Params() +: no_groups_msg("no_groups_msg") +, no_filtered_groups_msg("no_filtered_groups_msg") { } @@ -79,6 +81,8 @@ LLGroupList::Params::Params() LLGroupList::LLGroupList(const Params& p) : LLFlatListView(p) , mDirty(true) // to force initial update + , mNoFilteredGroupsMsg(p.no_filtered_groups_msg) + , mNoGroupsMsg(p.no_groups_msg) { // Listen for agent group changes. gAgent.addListener(this, "new group"); @@ -158,6 +162,18 @@ void LLGroupList::refresh() LLUUID id; bool have_filter = !mNameFilter.empty(); + // set no items message depend on filter state & total count of groups + if (have_filter) + { + // groups were filtered + setNoItemsCommentText(mNoFilteredGroupsMsg); + } + else if (0 == count) + { + // user is not a member of any group + setNoItemsCommentText(mNoGroupsMsg); + } + clear(); for(S32 i = 0; i < count; ++i) @@ -173,7 +189,8 @@ void LLGroupList::refresh() sort(); // Add "none" to list at top if filter not set (what's the point of filtering "none"?). - if (!have_filter) + // but only if some real groups exists. EXT-4838 + if (!have_filter && count > 0) { std::string loc_none = LLTrans::getString("GroupsNone"); addNewItem(LLUUID::null, loc_none, LLUUID::null, ADD_TOP); |