From 007bc25f66bd54421a089777b1a1ab28eeed1a7d Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Wed, 3 Feb 2010 13:33:14 +0200 Subject: 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 --- indra/newview/llgrouplist.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'indra/newview/llgrouplist.cpp') 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); -- cgit v1.2.3 From e1637b79a426df8cef575352bbee299458bf42b3 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Wed, 3 Feb 2010 13:34:00 +0200 Subject: No ticket: removed deprecated commented out code --HG-- branch : product-engine --- indra/newview/llgrouplist.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/newview/llgrouplist.cpp') diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index e924e902df..1ed1113f4d 100644 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -89,9 +89,6 @@ LLGroupList::LLGroupList(const Params& p) mShowIcons = gSavedSettings.getBOOL("GroupListShowIcons"); setCommitOnSelectionChange(true); - // TODO: implement context menu - // display a context menu appropriate for a list of group names -// setContextMenu(LLScrollListCtrl::MENU_GROUP); // Set default sort order. setComparator(&GROUP_COMPARATOR); -- cgit v1.2.3