summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/llflatlistview.h5
-rw-r--r--indra/newview/llavatarlist.cpp11
-rw-r--r--indra/newview/llavatarlist.h2
-rw-r--r--indra/newview/llavatarlistitem.cpp6
4 files changed, 22 insertions, 2 deletions
diff --git a/indra/llui/llflatlistview.h b/indra/llui/llflatlistview.h
index 92cb40332e..5a1ddc2c59 100644
--- a/indra/llui/llflatlistview.h
+++ b/indra/llui/llflatlistview.h
@@ -379,11 +379,14 @@ private:
void setNoItemsCommentVisible(bool visible) const;
-private:
+protected:
/** Comparator to use when sorting the list. */
const ItemComparator* mItemComparator;
+
+private:
+
LLPanel* mItemsPanel;
S32 mItemsNoScrollWidth;
diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp
index 45c540b3a3..91ebe910ce 100644
--- a/indra/newview/llavatarlist.cpp
+++ b/indra/newview/llavatarlist.cpp
@@ -334,6 +334,17 @@ boost::signals2::connection LLAvatarList::setItemDoubleClickCallback(const mouse
return mItemDoubleClickSignal.connect(cb);
}
+//virtual
+S32 LLAvatarList::notifyParent(const LLSD& info)
+{
+ if (info.has("sort") && &NAME_COMPARATOR == mItemComparator)
+ {
+ sort();
+ return 1;
+ }
+ return LLFlatListView::notifyParent(info);
+}
+
void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos)
{
LLAvatarListItem* item = new LLAvatarListItem();
diff --git a/indra/newview/llavatarlist.h b/indra/newview/llavatarlist.h
index 00c72f1f9d..b9be1d0bdc 100644
--- a/indra/newview/llavatarlist.h
+++ b/indra/newview/llavatarlist.h
@@ -96,6 +96,8 @@ public:
boost::signals2::connection setItemDoubleClickCallback(const mouse_signal_t::slot_type& cb);
+ virtual S32 notifyParent(const LLSD& info);
+
protected:
void refresh();
diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp
index 9645e75e60..44f88cce29 100644
--- a/indra/newview/llavatarlistitem.cpp
+++ b/indra/newview/llavatarlistitem.cpp
@@ -119,8 +119,9 @@ S32 LLAvatarListItem::notifyParent(const LLSD& info)
if (info.has("visibility_changed"))
{
updateChildren();
+ return 1;
}
- return 0;
+ return LLPanel::notifyParent(info);
}
void LLAvatarListItem::onMouseEnter(S32 x, S32 y, MASK mask)
@@ -334,6 +335,9 @@ void LLAvatarListItem::onNameCache(const std::string& first_name, const std::str
{
std::string name = first_name + " " + last_name;
setName(name);
+
+ //requesting the list to resort
+ notifyParent(LLSD().with("sort", LLSD()));
}
// Convert given number of seconds to a string like "23 minutes", "15 hours" or "3 years",