Merge in EAM from viewer-release
Remove the derpy stuff lindens like to do Wide strings aren't normal strings Make it all a bit better~ Redid the Duration floater because it was kinda icky, gave it more flexibility~<3 Display parcel ban and access durations as dates instead of text, sortable! Reworked the rather icky lookin' Access panel control ordering Enabled lowering parcel ban time without needing to find and remove first
This commit is contained in:
@@ -61,7 +61,7 @@ LLNameListCtrl::LLNameListCtrl(const std::string& name, const LLRect& rect, BOOL
|
||||
|
||||
// public
|
||||
LLScrollListItem* LLNameListCtrl::addNameItem(const LLUUID& agent_id, EAddPosition pos,
|
||||
BOOL enabled, const std::string& suffix)
|
||||
BOOL enabled, const std::string& suffix, const std::string& prefix)
|
||||
{
|
||||
//LL_INFOS() << "LLNameListCtrl::addNameItem " << agent_id << LL_ENDL;
|
||||
|
||||
@@ -70,7 +70,7 @@ LLScrollListItem* LLNameListCtrl::addNameItem(const LLUUID& agent_id, EAddPositi
|
||||
item.enabled = enabled;
|
||||
item.target = INDIVIDUAL;
|
||||
|
||||
return addNameItemRow(item, pos, suffix);
|
||||
return addNameItemRow(item, pos, suffix, prefix);
|
||||
}
|
||||
|
||||
// virtual, public
|
||||
@@ -160,7 +160,8 @@ LLScrollListItem* LLNameListCtrl::addElement(const LLSD& element, EAddPosition p
|
||||
LLScrollListItem* LLNameListCtrl::addNameItemRow(
|
||||
const LLNameListCtrl::NameItem& name_item,
|
||||
EAddPosition pos,
|
||||
const std::string& suffix)
|
||||
const std::string& suffix,
|
||||
const std::string& prefix)
|
||||
{
|
||||
LLUUID id = name_item.value().asUUID();
|
||||
LLNameListItem* item = new LLNameListItem(name_item,name_item.target() == GROUP);
|
||||
@@ -174,8 +175,19 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow(
|
||||
switch(name_item.target)
|
||||
{
|
||||
case GROUP:
|
||||
gCacheName->getGroupName(id, fullname);
|
||||
// fullname will be "nobody" if group not found
|
||||
if (!gCacheName->getGroupName(id, fullname))
|
||||
{
|
||||
avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.find(id);
|
||||
if (it != mAvatarNameCacheConnections.end())
|
||||
{
|
||||
if (it->second.connected())
|
||||
{
|
||||
it->second.disconnect();
|
||||
}
|
||||
mAvatarNameCacheConnections.erase(it);
|
||||
}
|
||||
mAvatarNameCacheConnections[id] = gCacheName->getGroup(id, boost::bind(&LLNameListCtrl::onGroupNameCache, this, _1, _2, item->getHandle()));
|
||||
}
|
||||
break;
|
||||
case SPECIAL:
|
||||
// just use supplied name
|
||||
@@ -203,12 +215,12 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow(
|
||||
}
|
||||
mAvatarNameCacheConnections.erase(it);
|
||||
}
|
||||
mAvatarNameCacheConnections[id] = LLAvatarNameCache::get(id,boost::bind(&LLNameListCtrl::onAvatarNameCache,this, _1, _2, suffix, item->getHandle()));
|
||||
mAvatarNameCacheConnections[id] = LLAvatarNameCache::get(id,boost::bind(&LLNameListCtrl::onAvatarNameCache,this, _1, _2, suffix, prefix, item->getHandle()));
|
||||
|
||||
if (mPendingLookupsRemaining <= 0)
|
||||
{
|
||||
// BAKER TODO:
|
||||
// We might get into a state where mPendingLookupsRemainig might
|
||||
// We might get into a state where mPendingLookupsRemaining might
|
||||
// go negative. So just reset it right now and figure out if it's
|
||||
// possible later :)
|
||||
mPendingLookupsRemaining = 0;
|
||||
@@ -231,7 +243,7 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow(
|
||||
LLScrollListCell* cell = item->getColumn(mNameColumnIndex);
|
||||
if (cell)
|
||||
{
|
||||
cell->setValue(fullname);
|
||||
cell->setValue(prefix + fullname);
|
||||
}
|
||||
|
||||
dirtyColumns();
|
||||
@@ -271,9 +283,24 @@ void LLNameListCtrl::removeNameItem(const LLUUID& agent_id)
|
||||
}
|
||||
}
|
||||
|
||||
// public
|
||||
LLScrollListItem* LLNameListCtrl::getNameItemByAgentId(const LLUUID& agent_id)
|
||||
{
|
||||
for (item_list::iterator it = getItemList().begin(); it != getItemList().end(); it++)
|
||||
{
|
||||
LLScrollListItem* item = *it;
|
||||
if (item && item->getUUID() == agent_id)
|
||||
{
|
||||
return item;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id,
|
||||
const LLAvatarName& av_name,
|
||||
std::string suffix,
|
||||
std::string prefix,
|
||||
LLHandle<LLNameListItem> item)
|
||||
{
|
||||
avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.find(agent_id);
|
||||
@@ -295,6 +322,11 @@ void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id,
|
||||
name.append(suffix);
|
||||
}
|
||||
|
||||
if (!prefix.empty())
|
||||
{
|
||||
name.insert(0, prefix);
|
||||
}
|
||||
|
||||
LLNameListItem* list_item = item.get();
|
||||
if (list_item && list_item->getUUID() == agent_id)
|
||||
{
|
||||
@@ -326,6 +358,33 @@ void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id,
|
||||
dirtyColumns();
|
||||
}
|
||||
|
||||
void LLNameListCtrl::onGroupNameCache(const LLUUID& group_id, const std::string name, LLHandle<LLNameListItem> item)
|
||||
{
|
||||
avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.find(group_id);
|
||||
if (it != mAvatarNameCacheConnections.end())
|
||||
{
|
||||
if (it->second.connected())
|
||||
{
|
||||
it->second.disconnect();
|
||||
}
|
||||
mAvatarNameCacheConnections.erase(it);
|
||||
}
|
||||
|
||||
LLNameListItem* list_item = item.get();
|
||||
if (list_item && list_item->getUUID() == group_id)
|
||||
{
|
||||
LLScrollListCell* cell = list_item->getColumn(mNameColumnIndex);
|
||||
if (cell)
|
||||
{
|
||||
cell->setValue(name);
|
||||
setNeedsSort();
|
||||
}
|
||||
}
|
||||
|
||||
dirtyColumns();
|
||||
}
|
||||
|
||||
|
||||
void LLNameListCtrl::sortByName(BOOL ascending)
|
||||
{
|
||||
sortByColumnIndex(mNameColumnIndex,ascending);
|
||||
|
||||
Reference in New Issue
Block a user