当前位置: 首页>>代码示例>>C++>>正文


C++ LLFolderViewItem::getParentFolder方法代码示例

本文整理汇总了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);
			}
		}
	}
}
开发者ID:Belxjander,项目名称:Kirito,代码行数:55,代码来源:llpanellandmarks.cpp

示例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();
	}
}
开发者ID:NickyPerian,项目名称:viewer-development,代码行数:41,代码来源:llpaneloutfitedit.cpp


注:本文中的LLFolderViewItem::getParentFolder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。