summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorMike Antipov <mantipov@productengine.com>2010-02-03 13:33:14 +0200
committerMike Antipov <mantipov@productengine.com>2010-02-03 13:33:14 +0200
commit007bc25f66bd54421a089777b1a1ab28eeed1a7d (patch)
treea9f112f8d63ccbe120c1d15b1354d6321f5e8163 /indra
parent5e63efe1da6b72fc0ce9771b9ef1e5c9d9bcb537 (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')
-rw-r--r--indra/newview/llgrouplist.cpp19
-rw-r--r--indra/newview/llgrouplist.h11
-rw-r--r--indra/newview/llpanelpeople.cpp1
-rw-r--r--indra/newview/skins/default/xui/en/panel_people.xml5
4 files changed, 31 insertions, 5 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);
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<Params, LLFlatListView::Params>
{
+ /**
+ * Contains a message for empty list when user is not a member of any group
+ */
+ Optional<std::string> no_groups_msg;
+
+ /**
+ * Contains a message for empty list when all groups don't match passed filter
+ */
+ Optional<std::string> 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<LLGroupList>("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
@@ -24,9 +24,6 @@ background_visible="true"
name="no_friends"
value="No friends" />
<string
- name="no_groups"
- value="No groups" />
- <string
name="people_filter_label"
value="Filter People" />
<string
@@ -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" />
<panel