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 ++++++++++++++++++- indra/newview/llgrouplist.h | 11 +++++++++++ indra/newview/llpanelpeople.cpp | 1 - indra/newview/skins/default/xui/en/panel_people.xml | 5 ++--- 4 files changed, 31 insertions(+), 5 deletions(-) (limited to 'indra') 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); diff --git a/indra/newview/llgrouplist.h b/indra/newview/llgrouplist.h index f7afe0c0b2..f3ac676edd 100644 --- a/indra/newview/llgrouplist.h +++ b/indra/newview/llgrouplist.h @@ -53,6 +53,15 @@ class LLGroupList: public LLFlatListView, public LLOldEvents::LLSimpleListener public: struct Params : public LLInitParam::Block { + /** + * Contains a message for empty list when user is not a member of any group + */ + Optional no_groups_msg; + + /** + * Contains a message for empty list when all groups don't match passed filter + */ + Optional no_filtered_groups_msg; Params(); }; @@ -80,6 +89,8 @@ private: bool mShowIcons; bool mDirty; std::string mNameFilter; + std::string mNoFilteredGroupsMsg; + std::string mNoGroupsMsg; }; class LLButton; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index b01cdcc832..fb6f36d4da 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -516,7 +516,6 @@ BOOL LLPanelPeople::postBuild() mRecentList->setShowIcons("RecentListShowIcons"); mGroupList = getChild("group_list"); - mGroupList->setNoItemsCommentText(getString("no_groups")); mNearbyList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu); mRecentList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu); diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index ac98bb9bd9..9b83e0c68e 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -23,9 +23,6 @@ background_visible="true" - @@ -226,6 +223,8 @@ background_visible="true" layout="topleft" left="0" name="group_list" + no_filtered_groups_msg="No groups" + no_groups_msg="[secondlife:///app/search/groups Trying searching for some groups to join.]" top="0" width="313" />