From a8165dfe59771962963e8a807b129c04a74f6d59 Mon Sep 17 00:00:00 2001 From: Ychebotarev ProductEngine Date: Tue, 23 Feb 2010 18:05:00 +0200 Subject: fix for normal EXT-5598 Group member status list is sorted by name instead of date --HG-- branch : product-engine --- indra/newview/llgroupmgr.cpp | 3 ++- indra/newview/llpanelgroupgeneral.cpp | 16 ++++++++++++++++ indra/newview/llpanelgroupgeneral.h | 3 +++ 3 files changed, 21 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 6e7321f739..ea5462a3e3 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -838,7 +838,8 @@ static void formatDateString(std::string &date_string) std::string day = result[2]; // ISO 8601 date format - date_string = llformat("%02s/%02s/%04s", month.c_str(), day.c_str(), year.c_str()); + //date_string = llformat("%02s/%02s/%04s", month.c_str(), day.c_str(), year.c_str()); + date_string = llformat("%04s/%02s/%04s", year.c_str(), month.c_str(), day.c_str()); } } diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 555e277ce5..517204b232 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -111,6 +111,8 @@ BOOL LLPanelGroupGeneral::postBuild() { mListVisibleMembers->setDoubleClickCallback(openProfile, this); mListVisibleMembers->setContextMenu(LLScrollListCtrl::MENU_AVATAR); + + mListVisibleMembers->setSortCallback(boost::bind(&LLPanelGroupGeneral::sortMembersList,this,_1,_2,_3)); } // Options @@ -944,4 +946,18 @@ void LLPanelGroupGeneral::setGroupID(const LLUUID& id) activate(); } +S32 LLPanelGroupGeneral::sortMembersList(S32 col_idx,const LLScrollListItem* i1,const LLScrollListItem* i2) +{ + const LLScrollListCell *cell1 = i1->getColumn(col_idx); + const LLScrollListCell *cell2 = i2->getColumn(col_idx); + + if(col_idx == 2) + { + if(LLStringUtil::compareDict(cell1->getValue().asString(),"Online") == 0 ) + return 1; + if(LLStringUtil::compareDict(cell2->getValue().asString(),"Online") == 0 ) + return -1; + } + return LLStringUtil::compareDict(cell1->getValue().asString(), cell2->getValue().asString()); +} diff --git a/indra/newview/llpanelgroupgeneral.h b/indra/newview/llpanelgroupgeneral.h index 7e90e43cf9..cc3101539a 100644 --- a/indra/newview/llpanelgroupgeneral.h +++ b/indra/newview/llpanelgroupgeneral.h @@ -83,6 +83,9 @@ private: static void onReceiveNotices(LLUICtrl* ctrl, void* data); static void openProfile(void* data); + S32 sortMembersList(S32,const LLScrollListItem*,const LLScrollListItem*); + //void sortMembersList(S32 column); + static bool joinDlgCB(const LLSD& notification, const LLSD& response); void updateMembers(); -- cgit v1.2.3