// override
	void fire(const LLUUID& inv_item)
	{
		if(!mTextEditor)
		{
			// The parent text editor may have vanished by now. 
            // In that case just quit.
			return;
		}

		LLInventoryItem* item = gInventory.getItem(inv_item);
		if(!item)
		{
			LL_WARNS() << "Item add reported, but not found in inventory!: " << inv_item << LL_ENDL;
		}
		else
		{
// [RLVa:KB] - Checked: 2009-11-11 (RLVa-1.1.0a) | Modified: RLVa-1.1.0a
			if (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWNOTE))
			{
				RlvUtil::notifyBlockedViewXXX(LLAssetType::AT_NOTECARD);
				return;
			}
// [/RLVa:KB]

			// See if we can bring an existing preview to the front
			if(!LLPreview::show(item->getUUID(), true))
			{
				if (gSavedSettings.getBOOL("ShowNewInventory")) // Singu Note: ShowNewInventory is true, not false, when they want a preview
				{
					// There isn't one, so make a new preview
					S32 left, top;
					gFloaterView->getNewFloaterPosition(&left, &top);
					LLRect rect = gSavedSettings.getRect("NotecardEditorRect");
					rect.translate(left - rect.mLeft, top - rect.mTop);
					LLPreviewNotecard* preview;
					preview = new LLPreviewNotecard("preview notecard", 
													rect, 
													std::string("Embedded Note: ") + item->getName(),
													item->getUUID(), 
													LLUUID::null, 
													item->getAssetUUID(),
													true, 
													(LLViewerInventoryItem*)item);
					preview->setSourceID(LLUUID::null);
					preview->setFocus(TRUE);

					// Force to be entirely onscreen.
					gFloaterView->adjustToFitScreen(preview, FALSE);
				}
			}
		}
	}
Exemplo n.º 2
0
	// override
	void fire(const LLUUID& inv_item)
	{
		if(!mTextEditor)
		{
			// The parent text editor may have vanished by now. 
            // In that case just quit.
			return;
		}

		LLInventoryItem* item = gInventory.getItem(inv_item);
		if(!item)
		{
			llwarns << "Item add reported, but not found in inventory!: " << inv_item << llendl;
		}
		else
		{
			// See if we can bring an existing preview to the front
			if(!LLPreview::show(item->getUUID(), true))
			{
				if(!gSavedSettings.getBOOL("ShowNewInventory"))
				{
					// There isn't one, so make a new preview
					S32 left, top;
					gFloaterView->getNewFloaterPosition(&left, &top);
					LLRect rect = gSavedSettings.getRect("NotecardEditorRect");
					rect.translate(left - rect.mLeft, top - rect.mTop);
					LLPreviewNotecard* preview;
					preview = new LLPreviewNotecard("preview notecard", 
													rect, 
													std::string("Embedded Note: ") + item->getName(),
													item->getUUID(), 
													LLUUID::null, 
													item->getAssetUUID(),
													true, 
													(LLViewerInventoryItem*)item);
					preview->setSourceID(LLUUID::null);
					preview->setFocus(TRUE);

					// Force to be entirely onscreen.
					gFloaterView->adjustToFitScreen(preview, FALSE);
				}
			}
		}
	}