Rework Name List Items to store the name type fully

It's more proper this way, but this will create some merge fighting
This commit is contained in:
Liru Færs
2019-08-25 15:51:29 -04:00
parent 29236442de
commit a399bd7b62
4 changed files with 48 additions and 48 deletions

View File

@@ -42,24 +42,47 @@ class LLAvatarName;
class LLNameListItem : public LLScrollListItem, public LLHandleProvider<LLNameListItem>
{
public:
bool isGroup() const { return mIsGroup; }
void setIsGroup(bool is_group) { mIsGroup = is_group; }
enum ENameType
{
INDIVIDUAL,
GROUP,
SPECIAL
};
// provide names for enums
struct NameTypeNames : public LLInitParam::TypeValuesHelper<ENameType, NameTypeNames>
{
static void declareValues();
};
struct Params : public LLInitParam::Block<Params, LLScrollListItem::Params>
{
Optional<std::string> name;
Optional<ENameType, NameTypeNames> target;
Params()
: name("name"),
target("target", INDIVIDUAL)
{}
};
ENameType getNameType() const { return mNameType; }
void setNameType(ENameType name_type) { mNameType = name_type; }
protected:
friend class LLNameListCtrl;
LLNameListItem( const LLScrollListItem::Params& p )
: LLScrollListItem(p), mIsGroup(false)
LLNameListItem( const Params& p )
: LLScrollListItem(p), mNameType(p.target)
{
}
LLNameListItem( const LLScrollListItem::Params& p, bool is_group )
: LLScrollListItem(p), mIsGroup(is_group)
LLNameListItem( const LLScrollListItem::Params& p, ENameType name_type)
: LLScrollListItem(p), mNameType(name_type)
{
}
private:
bool mIsGroup;
ENameType mNameType;
};
@@ -68,30 +91,7 @@ class LLNameListCtrl
{
public:
typedef boost::signals2::signal<void(bool)> namelist_complete_signal_t;
typedef enum e_name_type
{
INDIVIDUAL,
GROUP,
SPECIAL
} ENameType;
// provide names for enums
struct NameTypeNames : public LLInitParam::TypeValuesHelper<LLNameListCtrl::ENameType, NameTypeNames>
{
static void declareValues();
};
struct NameItem : public LLInitParam::Block<NameItem, LLScrollListItem::Params>
{
Optional<std::string> name;
Optional<ENameType, NameTypeNames> target;
NameItem()
: name("name"),
target("target", INDIVIDUAL)
{}
};
typedef LLNameListItem::Params NameItem;
struct NameColumn : public LLInitParam::ChoiceBlock<NameColumn>
{