From cb2d52c0ccd55df978777516a3146ec17725dc0b Mon Sep 17 00:00:00 2001 From: Kadah_Coba Date: Sat, 18 Feb 2012 17:59:51 -0800 Subject: [PATCH] LP: Fixed profile group list not showing all groups, having icons, or extra spacing in some cases --- indra/newview/fspanelprofile.cpp | 4 ++-- indra/newview/llgrouplist.cpp | 12 +++++++----- indra/newview/llgrouplist.h | 5 ++++- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/indra/newview/fspanelprofile.cpp b/indra/newview/fspanelprofile.cpp index d8505de62f..b681c343d3 100644 --- a/indra/newview/fspanelprofile.cpp +++ b/indra/newview/fspanelprofile.cpp @@ -305,7 +305,8 @@ void FSPanelProfile::onOpen(const LLSD& key) getChild("overflow_btn")->setVisible( false ); LLGroupList* group_list = getChild("group_list"); - group_list->enableForAgent(); + group_list->setShowNone(false); + group_list->enableForAgent(false); getChild("sl_description_edit")->setParseHTML(false); } @@ -408,7 +409,6 @@ void FSPanelProfile::processGroupProperties(const LLAvatarGroups* avatar_groups) LLAvatarGroups::group_list_t::const_iterator it = avatar_groups->group_list.begin(); const LLAvatarGroups::group_list_t::const_iterator it_end = avatar_groups->group_list.end(); - mGroups.clear(); for(; it_end != it; ++it) { LLAvatarGroups::LLGroupData group_data = *it; diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index ce86f3eced..be2fe13be2 100644 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -78,6 +78,8 @@ LLGroupList::LLGroupList(const Params& p) : LLFlatListViewEx(p), mForAgent(p.for_agent) , mDirty(true) // to force initial update + , mShowIcons(false) + , mShowNone(true) { setCommitOnSelectionChange(true); @@ -86,7 +88,7 @@ LLGroupList::LLGroupList(const Params& p) if (mForAgent) { - enableForAgent(); + enableForAgent(true); } } @@ -96,11 +98,11 @@ LLGroupList::~LLGroupList() if (mContextMenuHandle.get()) mContextMenuHandle.get()->die(); } -void LLGroupList::enableForAgent() +void LLGroupList::enableForAgent(bool show_icons) { mForAgent = true; - mShowIcons = mForAgent && gSavedSettings.getBOOL("GroupListShowIcons"); + mShowIcons = mForAgent && gSavedSettings.getBOOL("GroupListShowIcons") && show_icons; // Listen for agent group changes. gAgent.addListener(this, "new group"); @@ -192,7 +194,7 @@ void LLGroupList::refresh() // Add "none" to list at top if filter not set (what's the point of filtering "none"?). // but only if some real groups exists. EXT-4838 - if (!have_filter && count > 0) + if (!have_filter && count > 0 && mShowNone) { std::string loc_none = LLTrans::getString("GroupsNone"); addNewItem(LLUUID::null, loc_none, LLUUID::null, ADD_TOP); @@ -244,7 +246,7 @@ void LLGroupList::setGroups(const std::map< std::string,LLUUID> group_list) void LLGroupList::addNewItem(const LLUUID& id, const std::string& name, const LLUUID& icon_id, EAddPosition pos) { - LLGroupListItem* item = new LLGroupListItem(mForAgent); + LLGroupListItem* item = new LLGroupListItem(mForAgent && mShowIcons); item->setGroupID(id); item->setName(name, mNameFilter); diff --git a/indra/newview/llgrouplist.h b/indra/newview/llgrouplist.h index 692ae98a0f..8bc737142f 100644 --- a/indra/newview/llgrouplist.h +++ b/indra/newview/llgrouplist.h @@ -54,7 +54,7 @@ public: LLGroupList(const Params& p); virtual ~LLGroupList(); - void enableForAgent(); + void enableForAgent(bool show_icons); virtual void draw(); // from LLView /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); // from LLView @@ -62,6 +62,8 @@ public: void setNameFilter(const std::string& filter); void toggleIcons(); bool getIconsVisible() const { return mShowIcons; } + void setIconsVisible(bool show_icons) { mShowIcons = show_icons; } + void setShowNone(bool show_none) { mShowNone = show_none; } void setGroups(const std::map< std::string,LLUUID> group_list); private: @@ -80,6 +82,7 @@ private: std::string mNameFilter; bool mForAgent; + bool mShowNone; typedef std::map< std::string,LLUUID> group_map_t; group_map_t mGroups; };