本文整理汇总了C++中LLWearableItemsList::updateList方法的典型用法代码示例。如果您正苦于以下问题:C++ LLWearableItemsList::updateList方法的具体用法?C++ LLWearableItemsList::updateList怎么用?C++ LLWearableItemsList::updateList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLWearableItemsList
的用法示例。
在下文中一共展示了LLWearableItemsList::updateList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: is_category
void LLOutfitsList::refreshList(const LLUUID& category_id)
{
LLInventoryModel::cat_array_t cat_array;
LLInventoryModel::item_array_t item_array;
// Collect all sub-categories of a given category.
LLIsType is_category(LLAssetType::AT_CATEGORY);
gInventory.collectDescendentsIf(
category_id,
cat_array,
item_array,
LLInventoryModel::EXCLUDE_TRASH,
is_category);
uuid_vec_t vadded;
uuid_vec_t vremoved;
// Create added and removed items vectors.
computeDifference(cat_array, vadded, vremoved);
// Handle added tabs.
for (uuid_vec_t::const_iterator iter = vadded.begin();
iter != vadded.end();
++iter)
{
const LLUUID cat_id = (*iter);
LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id);
if (!cat) continue;
std::string name = cat->getName();
outfit_accordion_tab_params tab_params(get_accordion_tab_params());
LLAccordionCtrlTab* tab = LLUICtrlFactory::create<LLAccordionCtrlTab>(tab_params);
if (!tab) continue;
LLWearableItemsList* wearable_list = LLUICtrlFactory::create<LLWearableItemsList>(tab_params.wearable_list);
wearable_list->setShape(tab->getLocalRect());
tab->addChild(wearable_list);
tab->setName(name);
tab->setTitle(name);
// *TODO: LLUICtrlFactory::defaultBuilder does not use "display_children" from xml. Should be investigated.
tab->setDisplayChildren(false);
mAccordion->addCollapsibleCtrl(tab);
// Start observing the new outfit category.
LLWearableItemsList* list = tab->getChild<LLWearableItemsList>("wearable_items_list");
if (!mCategoriesObserver->addCategory(cat_id, boost::bind(&LLWearableItemsList::updateList, list, cat_id)))
{
// Remove accordion tab if category could not be added to observer.
mAccordion->removeCollapsibleCtrl(tab);
// kill removed tab
tab->die();
continue;
}
// Map the new tab with outfit category UUID.
mOutfitsMap.insert(LLOutfitsList::outfits_map_value_t(cat_id, tab));
tab->setRightMouseDownCallback(boost::bind(&LLOutfitsList::onAccordionTabRightClick, this,
_1, _2, _3, cat_id));
// Setting tab focus callback to monitor currently selected outfit.
tab->setFocusReceivedCallback(boost::bind(&LLOutfitsList::changeOutfitSelection, this, list, cat_id));
// Setting callback to reset items selection inside outfit on accordion collapsing and expanding (EXT-7875)
tab->setDropDownStateChangedCallback(boost::bind(&LLOutfitsList::resetItemSelection, this, list, cat_id));
// force showing list items that don't match current filter(EXT-7158)
list->setForceShowingUnmatchedItems(true);
// Setting list commit callback to monitor currently selected wearable item.
list->setCommitCallback(boost::bind(&LLOutfitsList::onSelectionChange, this, _1));
// Setting list refresh callback to apply filter on list change.
list->setRefreshCompleteCallback(boost::bind(&LLOutfitsList::onFilteredWearableItemsListRefresh, this, _1));
list->setRightMouseDownCallback(boost::bind(&LLOutfitsList::onWearableItemsListRightClick, this, _1, _2, _3));
// Fetch the new outfit contents.
cat->fetch();
// Refresh the list of outfit items after fetch().
// Further list updates will be triggered by the category observer.
list->updateList(cat_id);
// If filter is currently applied we store the initial tab state and
// open it to show matched items if any.
if (!sFilterSubString.empty())
{
tab->notifyChildren(LLSD().with("action","store_state"));
tab->setDisplayChildren(true);
// Setting mForceRefresh flag will make the list refresh its contents
// even if it is not currently visible. This is required to apply the
// filter to the newly added list.
list->setForceRefresh(true);
list->setFilterSubString(sFilterSubString);
//.........这里部分代码省略.........
示例2: ndOutfitsCollector
void LLOutfitsList::refreshList(const LLUUID& category_id)
{
LLInventoryModel::cat_array_t cat_array;
LLInventoryModel::item_array_t item_array;
// Collect all sub-categories of a given category.
// <FS:ND> FIRE-6958/VWR-2862; Make sure to only collect folders of type FT_OUTFIT
class ndOutfitsCollector: public LLIsType
{
public:
ndOutfitsCollector()
: LLIsType( LLAssetType::AT_CATEGORY )
{ }
virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item)
{
if( !LLIsType::operator()( cat, item ) )
return false;
if( cat && LLFolderType::FT_OUTFIT == cat->getPreferredType() )
return true;
return false;
}
};
// LLIsType is_category(LLAssetType::AT_CATEGORY);
ndOutfitsCollector is_category;
// </FS:ND>
gInventory.collectDescendentsIf(
category_id,
cat_array,
item_array,
LLInventoryModel::EXCLUDE_TRASH,
is_category);
uuid_vec_t vadded;
uuid_vec_t vremoved;
// Create added and removed items vectors.
computeDifference(cat_array, vadded, vremoved);
// <FS:ND> FIRE-6958/VWR-2862; Handle large amounts of outfits, write a least a warning into the logs.
if( vadded.size() > 128 )
LL_WARNS() << "Large amount of outfits found: " << vadded.size() << " this may cause hangs and disconnects" << LL_ENDL;
U32 nCap = gSavedSettings.getU32( "FSDisplaySavedOutfitsCap" );
if( nCap && nCap < vadded.size() )
{
vadded.resize( nCap );
LL_WARNS() << "Capped outfits to " << nCap << " due to debug setting FSDisplaySavedOutfitsCap" << LL_ENDL;
}
// </FS:ND>
// <FS:Ansariel> FIRE-12939: Add outfit count to outfits list
getChild<LLTextBox>("OutfitcountText")->setTextArg("COUNT", llformat("%d", cat_array.size()));
// Handle added tabs.
for (uuid_vec_t::const_iterator iter = vadded.begin();
iter != vadded.end();
++iter)
{
const LLUUID cat_id = (*iter);
LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id);
if (!cat) continue;
std::string name = cat->getName();
outfit_accordion_tab_params tab_params(get_accordion_tab_params());
LLAccordionCtrlTab* tab = LLUICtrlFactory::create<LLAccordionCtrlTab>(tab_params);
if (!tab) continue;
LLWearableItemsList* wearable_list = LLUICtrlFactory::create<LLWearableItemsList>(tab_params.wearable_list);
wearable_list->setShape(tab->getLocalRect());
tab->addChild(wearable_list);
tab->setName(name);
tab->setTitle(name);
// *TODO: LLUICtrlFactory::defaultBuilder does not use "display_children" from xml. Should be investigated.
tab->setDisplayChildren(false);
// <FS:ND> Calling this when there's a lot of outfits causes horrible perfomance and disconnects, due to arrange eating so many cpu cycles.
// mAccordion->addCollapsibleCtrl(tab);
mAccordion->addCollapsibleCtrl(tab, false );
// </FS:ND>
// Start observing the new outfit category.
LLWearableItemsList* list = tab->getChild<LLWearableItemsList>("wearable_items_list");
if (!mCategoriesObserver->addCategory(cat_id, boost::bind(&LLWearableItemsList::updateList, list, cat_id)))
{
// Remove accordion tab if category could not be added to observer.
mAccordion->removeCollapsibleCtrl(tab);
// kill removed tab
tab->die();
continue;
//.........这里部分代码省略.........