LP: Fixed profile group list not showing all groups, having icons, or extra spacing in some cases

Kadah_Coba 2012-02-18 17:59:51 -08:00
parent 3fa7346151
commit cb2d52c0cc
3 changed files with 13 additions and 8 deletions

View File

@ -305,7 +305,8 @@ void FSPanelProfile::onOpen(const LLSD& key)
getChild<LLUICtrl>("overflow_btn")->setVisible( false );
LLGroupList* group_list = getChild<LLGroupList>("group_list");
group_list->enableForAgent();
group_list->setShowNone(false);
group_list->enableForAgent(false);
getChild<LLTextBase>("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;

View File

@ -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);

View File

@ -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;
};