diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llavatarlist.cpp | 12 | ||||
-rw-r--r-- | indra/newview/llavatarlist.h | 4 | ||||
-rw-r--r-- | indra/newview/llgrouplist.cpp | 21 | ||||
-rw-r--r-- | indra/newview/llgrouplist.h | 22 | ||||
-rw-r--r-- | indra/newview/llpanelpeople.cpp | 10 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_people.xml | 10 |
6 files changed, 28 insertions, 51 deletions
diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index c7a5691d70..8ba47b5198 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -113,7 +113,7 @@ LLAvatarList::Params::Params() } LLAvatarList::LLAvatarList(const Params& p) -: LLFlatListView(p) +: LLFlatListViewEx(p) , mIgnoreOnlineStatus(p.ignore_online_status) , mShowLastInteractionTime(p.show_last_interaction_time) , mContextMenu(NULL) @@ -154,7 +154,7 @@ void LLAvatarList::draw() // *NOTE dzaporozhan // Call refresh() after draw() to avoid flickering of avatar list items. - LLFlatListView::draw(); + LLFlatListViewEx::draw(); if (mDirty) refresh(); @@ -171,7 +171,7 @@ void LLAvatarList::clear() { getIDs().clear(); setDirty(true); - LLFlatListView::clear(); + LLFlatListViewEx::clear(); } void LLAvatarList::setNameFilter(const std::string& filter) @@ -179,6 +179,10 @@ void LLAvatarList::setNameFilter(const std::string& filter) if (mNameFilter != filter) { mNameFilter = filter; + + // update message for empty state here instead of refresh() to avoid blinking when switch + // between tabs. + updateNoItemsMessage(!mNameFilter.empty()); setDirty(); } } @@ -360,7 +364,7 @@ S32 LLAvatarList::notifyParent(const LLSD& info) sort(); return 1; } - return LLFlatListView::notifyParent(info); + return LLFlatListViewEx::notifyParent(info); } void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos) diff --git a/indra/newview/llavatarlist.h b/indra/newview/llavatarlist.h index 528f796b8b..ff090f3a34 100644 --- a/indra/newview/llavatarlist.h +++ b/indra/newview/llavatarlist.h @@ -49,11 +49,11 @@ class LLTimer; * @see setDirty() * @see setNameFilter() */ -class LLAvatarList : public LLFlatListView +class LLAvatarList : public LLFlatListViewEx { LOG_CLASS(LLAvatarList); public: - struct Params : public LLInitParam::Block<Params, LLFlatListView::Params> + struct Params : public LLInitParam::Block<Params, LLFlatListViewEx::Params> { Optional<bool> ignore_online_status, // show all items as online show_last_interaction_time, // show most recent interaction time. *HACK: move this to a derived class diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index 8a056f836f..f21b6e1085 100644 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -71,18 +71,10 @@ public: static const LLGroupComparator GROUP_COMPARATOR; -LLGroupList::Params::Params() -: no_groups_msg("no_groups_msg") -, no_filtered_groups_msg("no_filtered_groups_msg") -{ - -} LLGroupList::LLGroupList(const Params& p) -: LLFlatListView(p) +: LLFlatListViewEx(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"); @@ -160,16 +152,7 @@ void LLGroupList::refresh() 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); - } + updateNoItemsMessage(have_filter); clear(); diff --git a/indra/newview/llgrouplist.h b/indra/newview/llgrouplist.h index 0e9da25c58..16f3fc05a3 100644 --- a/indra/newview/llgrouplist.h +++ b/indra/newview/llgrouplist.h @@ -47,23 +47,10 @@ * * @see setNameFilter() */ -class LLGroupList: public LLFlatListView, public LLOldEvents::LLSimpleListener +class LLGroupList: public LLFlatListViewEx, public LLOldEvents::LLSimpleListener { LOG_CLASS(LLGroupList); 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(); - }; LLGroupList(const Params& p); virtual ~LLGroupList(); @@ -75,11 +62,6 @@ public: void toggleIcons(); bool getIconsVisible() const { return mShowIcons; } - // *WORKAROUND: two methods to overload appropriate Params due to localization issue: - // no_groups_msg & no_filtered_groups_msg attributes are not defined as translatable in VLT. See EXT-5931 - void setNoGroupsMsg(const std::string& msg) { mNoGroupsMsg = msg; } - void setNoFilteredGroupsMsg(const std::string& msg) { mNoFilteredGroupsMsg = msg; } - private: void setDirty(bool val = true) { mDirty = val; } void refresh(); @@ -94,8 +76,6 @@ 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 5802d53cd1..daa2a04f65 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -512,15 +512,19 @@ BOOL LLPanelPeople::postBuild() mNearbyList = getChild<LLPanel>(NEARBY_TAB_NAME)->getChild<LLAvatarList>("avatar_list"); mNearbyList->setNoItemsCommentText(getString("no_one_near")); + mNearbyList->setNoItemsMsg(getString("no_one_near")); + mNearbyList->setNoFilteredItemsMsg(getString("no_one_filtered_near")); mNearbyList->setShowIcons("NearbyListShowIcons"); mRecentList = getChild<LLPanel>(RECENT_TAB_NAME)->getChild<LLAvatarList>("avatar_list"); - mRecentList->setNoItemsCommentText(getString("no_people")); + mRecentList->setNoItemsCommentText(getString("no_recent_people")); + mRecentList->setNoItemsMsg(getString("no_recent_people")); + mRecentList->setNoFilteredItemsMsg(getString("no_filtered_recent_people")); mRecentList->setShowIcons("RecentListShowIcons"); mGroupList = getChild<LLGroupList>("group_list"); - mGroupList->setNoGroupsMsg(getString("no_groups_msg")); - mGroupList->setNoFilteredGroupsMsg(getString("no_filtered_groups_msg")); + mGroupList->setNoItemsMsg(getString("no_groups_msg")); + mGroupList->setNoFilteredItemsMsg(getString("no_filtered_groups_msg")); 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 8a4a28e188..61784fede4 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -12,12 +12,18 @@ top="0" width="333"> <string - name="no_people" + name="no_recent_people" value="No recent people. Looking for people to hang out with? Try [secondlife:///app/search/people Search] or the [secondlife:///app/worldmap World Map]." /> <string + name="no_filtered_recent_people" + value="Didn't find what you're looking for? Try [secondlife:///app/search/people Search]." /> + <string name="no_one_near" value="No one nearby. Looking for people to hang out with? Try [secondlife:///app/search/people Search] or the [secondlife:///app/worldmap World Map]." /> <string + name="no_one_filtered_near" + value="Didn't find what you're looking for? Try [secondlife:///app/search/people Search]." /> + <string name="no_friends_online" value="No friends online" /> <string @@ -30,7 +36,7 @@ name="groups_filter_label" value="Filter Groups" /> <!-- - *WORKAROUND: for group_list.no_groups_msg & group_list.no_filtered_groups_msg attributes. + *WORKAROUND: for group_list.no_items_msg & group_list.no_filtered_items_msg attributes. They are not defined as translatable in VLT. See EXT-5931 --> <string |