本文整理汇总了C++中LLFolderViewItem::getParentFolder方法的典型用法代码示例。如果您正苦于以下问题:C++ LLFolderViewItem::getParentFolder方法的具体用法?C++ LLFolderViewItem::getParentFolder怎么用?C++ LLFolderViewItem::getParentFolder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLFolderViewItem
的用法示例。
在下文中一共展示了LLFolderViewItem::getParentFolder方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onAddAction
void LLLandmarksPanel::onAddAction(const LLSD& userdata) const
{
LLFolderViewModelItemInventory* view_model = getCurSelectedViewModelItem();
LLFolderViewItem* item = getCurSelectedItem();
std::string command_name = userdata.asString();
if("add_landmark" == command_name)
{
LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos();
if(landmark)
{
LLNotificationsUtil::add("LandmarkAlreadyExists");
}
else
{
LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark"));
}
}
else if ("category" == command_name)
{
if (item && mCurrentSelectedList == mLandmarksInventoryPanel)
{
LLFolderViewModelItem* folder_bridge = NULL;
if (view_model->getInventoryType()
== LLInventoryType::IT_LANDMARK)
{
// for a landmark get parent folder bridge
folder_bridge = item->getParentFolder()->getViewModelItem();
}
else if (view_model->getInventoryType()
== LLInventoryType::IT_CATEGORY)
{
// for a folder get its own bridge
folder_bridge = view_model;
}
menu_create_inventory_item(mCurrentSelectedList,
dynamic_cast<LLFolderBridge*> (folder_bridge), LLSD(
"category"), gInventory.findCategoryUUIDForType(
LLFolderType::FT_LANDMARK));
}
else
{
//in case My Landmarks tab is completely empty (thus cannot be determined as being selected)
menu_create_inventory_item(mLandmarksInventoryPanel, NULL, LLSD("category"),
gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK));
if (mMyLandmarksAccordionTab)
{
mMyLandmarksAccordionTab->changeOpenClose(false);
}
}
}
}
示例2: saveListSelection
void LLPanelOutfitEdit::saveListSelection()
{
if(mWearablesListViewPanel->getVisible())
{
std::set<LLUUID> selected_ids = mInventoryItemsPanel->getRootFolder()->getSelectionList();
if(!selected_ids.size()) return;
for (std::set<LLUUID>::const_iterator item_id = selected_ids.begin(); item_id != selected_ids.end(); ++item_id)
{
mWearableItemsList->selectItemByUUID(*item_id, true);
}
mWearableItemsList->scrollToShowFirstSelectedItem();
}
else if(mInventoryItemsPanel->getVisible())
{
std::vector<LLUUID> selected_ids;
mWearableItemsList->getSelectedUUIDs(selected_ids);
if(!selected_ids.size()) return;
mInventoryItemsPanel->clearSelection();
LLFolderView* root = mInventoryItemsPanel->getRootFolder();
if(!root) return;
for(std::vector<LLUUID>::const_iterator item_id = selected_ids.begin(); item_id != selected_ids.end(); ++item_id)
{
LLFolderViewItem* item = root->getItemByID(*item_id);
if (!item) continue;
LLFolderViewFolder* parent = item->getParentFolder();
if(parent)
{
parent->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
}
mInventoryItemsPanel->getRootFolder()->changeSelection(item, TRUE);
}
mInventoryItemsPanel->getRootFolder()->scrollToShowSelection();
}
}