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


C++ LLPreview类代码示例

本文整理汇总了C++中LLPreview的典型用法代码示例。如果您正苦于以下问题:C++ LLPreview类的具体用法?C++ LLPreview怎么用?C++ LLPreview使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了LLPreview类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: onDiscardBtn

// static
void LLPreview::onDiscardBtn(void* data)
{
	LLPreview* self = (LLPreview*)data;

	const LLInventoryItem* item = self->getItem();
	if (!item) return;

	self->mForceClose = TRUE;
	self->closeFloater();

	// Move the item to the trash
	const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
	if (item->getParentUUID() != trash_id)
	{
		LLInventoryModel::update_list_t update;
		LLInventoryModel::LLCategoryUpdate old_folder(item->getParentUUID(),-1);
		update.push_back(old_folder);
		LLInventoryModel::LLCategoryUpdate new_folder(trash_id, 1);
		update.push_back(new_folder);
		gInventory.accountForUpdate(update);

		LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
		new_item->setParent(trash_id);
		// no need to restamp it though it's a move into trash because
		// it's a brand new item already.
		new_item->updateParentOnServer(FALSE);
		gInventory.updateItem(new_item);
		gInventory.notifyObservers();
	}
}
开发者ID:CaseyraeStarfinder,项目名称:Firestorm-Viewer,代码行数:31,代码来源:llpreview.cpp

示例2: onBtnCopyToInv

// static
void LLPreview::onBtnCopyToInv(void* userdata)
{
	LLPreview* self = (LLPreview*) userdata;
	LLInventoryItem *item = self->mAuxItem;

	if(item && item->getUUID().notNull())
	{
		// Copy to inventory
		if (self->mNotecardInventoryID.notNull())
		{
			copy_inventory_from_notecard(self->mObjectID,
				self->mNotecardInventoryID, item);
		}
		else
		{
			LLPointer<LLInventoryCallback> cb = NULL;
			copy_inventory_item(
				gAgent.getID(),
				item->getPermissions().getOwner(),
				item->getUUID(),
				LLUUID::null,
				std::string(),
				cb);
		}
	}
	self->close();
}
开发者ID:Boy,项目名称:rainbow,代码行数:28,代码来源:llpreview.cpp

示例3: rename

// static
void LLPreview::rename(const LLUUID& item_uuid, const std::string& new_name)
{
	preview_map_t::iterator found_it = LLPreview::sInstances.find(item_uuid);
	if(found_it != LLPreview::sInstances.end())
	{
		LLPreview* instance = found_it->second;
		instance->setTitle( new_name );
	}
}
开发者ID:Boy,项目名称:rainbow,代码行数:10,代码来源:llpreview.cpp

示例4: done

void LLInventoryGestureAvailable::done()
{
	for(uuid_vec_t::iterator it = mComplete.begin(); it != mComplete.end(); ++it)
	{
		LLPreview *preview = LLPreview::find((*it));
		if(preview)
		{
			preview->refresh();
		}
	}
	gInventory.removeObserver(this);
	delete this;
}
开发者ID:Nekrofage,项目名称:SingularityViewer,代码行数:13,代码来源:llpreviewgesture.cpp

示例5: save

// static
bool LLPreview::save( const LLUUID& item_uuid, LLPointer<LLInventoryItem>* itemptr )
{
	bool res = false;
	LLPreview* instance = LLPreview::find(item_uuid);
	if(instance)
	{
		res = instance->saveItem(itemptr);
	}
	if (!res)
	{
		delete itemptr;
	}
	return res;
}
开发者ID:Boy,项目名称:rainbow,代码行数:15,代码来源:llpreview.cpp

示例6: hide

// static
void LLPreview::hide(const LLUUID& item_uuid, BOOL no_saving /* = FALSE */ )
{
	preview_map_t::iterator found_it = LLPreview::sInstances.find(item_uuid);
	if(found_it != LLPreview::sInstances.end())
	{
		LLPreview* instance = found_it->second;

		if ( no_saving )
		{
			instance->mForceClose = TRUE;
		}

		instance->close();
	}
}
开发者ID:Boy,项目名称:rainbow,代码行数:16,代码来源:llpreview.cpp

示例7: LLSD

// static
void LLPreview::hide(const LLUUID& item_uuid, BOOL no_saving /* = FALSE */ )
{
	LLFloater* floater = LLFloaterReg::findInstance("preview", LLSD(item_uuid));
	if (!floater) floater = LLFloaterReg::findInstance("preview_avatar", LLSD(item_uuid));
	
	LLPreview* preview = dynamic_cast<LLPreview*>(floater);
	if (preview)
	{
		if ( no_saving )
		{
			preview->mForceClose = TRUE;
		}
		preview->closeFloater();
	}
}
开发者ID:Katharine,项目名称:kittyviewer,代码行数:16,代码来源:llpreview.cpp

示例8: onBtnCopyToInv

// static
void LLPreview::onBtnCopyToInv(void* userdata)
{
	LLPreview* self = (LLPreview*) userdata;
	LLInventoryItem *item = self->mAuxItem;

	if(item && item->getUUID().notNull())
	{
		// Copy to inventory
		if (self->mNotecardInventoryID.notNull())
		{
			copy_inventory_from_notecard(LLUUID::null,
										 self->mNotecardObjectID,
										 self->mNotecardInventoryID,
										 item);
		}
		else if (self->mObjectUUID.notNull())
		{
			// item is in in-world inventory
			LLViewerObject* object = gObjectList.findObject(self->mObjectUUID);
			LLPermissions perm(item->getPermissions());
			if(object
				&&(perm.allowCopyBy(gAgent.getID(), gAgent.getGroupID())
				&& perm.allowTransferTo(gAgent.getID())))
			{
				// copy to default folder
				set_dad_inventory_item(item, LLUUID::null);
				object->moveInventory(LLUUID::null, item->getUUID());
			}
		}
		else
		{
			LLPointer<LLInventoryCallback> cb = NULL;
			copy_inventory_item(
				gAgent.getID(),
				item->getPermissions().getOwner(),
				item->getUUID(),
				LLUUID::null,
				std::string(),
				cb);
		}
	}
	self->closeFloater();
}
开发者ID:CaseyraeStarfinder,项目名称:Firestorm-Viewer,代码行数:44,代码来源:llpreview.cpp

示例9: show

// static
LLPreview* LLPreview::show( const LLUUID& item_uuid, BOOL take_focus )
{
	LLPreview* instance = LLPreview::find(item_uuid);
	if(instance)
	{
		if (LLFloater::getFloaterHost() && LLFloater::getFloaterHost() != instance->getHost())
		{
			// this preview window is being opened in a new context
			// needs to be rehosted
			LLFloater::getFloaterHost()->addFloater(instance, TRUE);
		}
		instance->open();  /*Flawfinder: ignore*/
		if (take_focus)
		{
			instance->setFocus(TRUE);
		}
	}

	return instance;
}
开发者ID:Boy,项目名称:rainbow,代码行数:21,代码来源:llpreview.cpp

示例10: LLSD

// static
void LLPreview::hide(const LLUUID& item_uuid, BOOL no_saving /* = FALSE */ )
{
	// <FS:Ansariel> FIRE-14195: Deleting item from inventory doesn't close preview
	//LLFloater* floater = LLFloaterReg::findInstance("preview", LLSD(item_uuid));
	LLFloater* floater = LLFloaterReg::findInstance("preview_anim", LLSD(item_uuid));
	if (!floater) floater = LLFloaterReg::findInstance("preview_gesture", LLSD(item_uuid));
	if (!floater) floater = LLFloaterReg::findInstance("preview_notecard", LLSD(item_uuid));
	if (!floater) floater = LLFloaterReg::findInstance("preview_script", LLSD(item_uuid));
	if (!floater) floater = LLFloaterReg::findInstance("preview_sound", LLSD(item_uuid));
	if (!floater) floater = LLFloaterReg::findInstance("preview_texture", LLSD(item_uuid));
	// </FS:Ansariel>
	if (!floater) floater = LLFloaterReg::findInstance("preview_avatar", LLSD(item_uuid));
	
	LLPreview* preview = dynamic_cast<LLPreview*>(floater);
	if (preview)
	{
		if ( no_saving )
		{
			preview->mForceClose = TRUE;
		}
		preview->closeFloater();
	}
}
开发者ID:CaseyraeStarfinder,项目名称:Firestorm-Viewer,代码行数:24,代码来源:llpreview.cpp

示例11: onKeepBtn

// static
void LLPreview::onKeepBtn(void* data)
{
	LLPreview* self = (LLPreview*)data;
	self->closeFloater();
}
开发者ID:CaseyraeStarfinder,项目名称:Firestorm-Viewer,代码行数:6,代码来源:llpreview.cpp

示例12: onRadio

// static
void LLPreview::onRadio(LLUICtrl*, void* userdata)
{
	LLPreview* self = (LLPreview*) userdata;
	self->onCommit();
}
开发者ID:CaseyraeStarfinder,项目名称:Firestorm-Viewer,代码行数:6,代码来源:llpreview.cpp


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