Ejemplo n.º 1
0
BOOL LLFloaterScriptQueue::start()
{
	//llinfos << "LLFloaterCompileQueue::start()" << llendl;
	std::string buffer;

	LLSelectMgr *mgr = LLSelectMgr::getInstance();
	LLObjectSelectionHandle selectHandle = mgr->getSelection();
	U32 n_objects = 0;
	if (gSavedSettings.getBOOL("EditLinkedParts"))
	{
		n_objects = selectHandle->getObjectCount();
	}
	else
	{
		n_objects = selectHandle->getRootObjectCount();
	}

	LLStringUtil::format_map_t args;
	args["[START]"] = mStartString;
	args["[COUNT]"] = llformat ("%d", mObjectIDs.count());
	buffer = getString ("Starting", args);
	
	getChild<LLScrollListCtrl>("queue output")->setCommentText(buffer);

	return nextObject();
}
Ejemplo n.º 2
0
// Checked: 2011-05-28 (RLVa-1.4.0a) | Modified: RLVa-1.4.0a
bool rlvCanDeleteOrReturn()
{
	if ( (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) || (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) )
	{
		struct RlvCanDeleteOrReturn : public LLSelectedObjectFunctor
		{
			/*virtual*/ bool apply(LLViewerObject* pObj) { return pObj->isReturnable(); }
		} f;
		LLObjectSelectionHandle hSel = LLSelectMgr::getInstance()->getSelection();
		return (hSel.notNull()) && (0 != hSel->getRootObjectCount()) && (hSel->applyToRootObjects(&f, false));
	}
	return true;
}
// static
void LLFloaterBuyContents::show(const LLSaleInfo& sale_info)
{
	LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();

	if (selection->getRootObjectCount() != 1)
	{
		LLNotificationsUtil::add("BuyContentsOneOnly");
		return;
	}
	
	LLFloaterBuyContents* floater = LLFloaterReg::showTypedInstance<LLFloaterBuyContents>("buy_object_contents");
	if (!floater)
		return;
	
	LLScrollListCtrl* list = floater->getChild<LLScrollListCtrl>("item_list");
	if (list)
		list->deleteAllItems();

	floater->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection();

	LLUUID owner_id;
	std::string owner_name;
	BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name);
	if (!owners_identical)
	{
		LLNotificationsUtil::add("BuyContentsOneOwner");
		return;
	}

	floater->mSaleInfo = sale_info;

	// Update the display
	LLSelectNode* node = selection->getFirstRootNode();
	if (!node) return;
	if(node->mPermissions->isGroupOwned())
	{
		gCacheName->getGroupName(owner_id, owner_name);
	}

	floater->getChild<LLUICtrl>("contains_text")->setTextArg("[NAME]", node->mName);
	floater->getChild<LLUICtrl>("buy_text")->setTextArg("[AMOUNT]", llformat("%d", sale_info.getSalePrice()));
	floater->getChild<LLUICtrl>("buy_text")->setTextArg("[NAME]", owner_name);
	std::string type_currency = LLGridManager::getInstance()->getCurrency();
	floater->getChild<LLUICtrl>("buy_text")->setTextArg("[CUR]", type_currency);
	// Must do this after the floater is created, because
	// sometimes the inventory is already there and 
	// the callback is called immediately.
	LLViewerObject* obj = selection->getFirstRootObject();
	floater->registerVOInventoryListener(obj,NULL);
	floater->requestVOInventory();
}
Ejemplo n.º 4
0
BOOL LLFloaterScriptQueue::start()
{
	//llinfos << "LLFloaterCompileQueue::start()" << llendl;
	std::string buffer;

	LLSelectMgr *mgr = LLSelectMgr::getInstance();
	LLObjectSelectionHandle selectHandle = mgr->getSelection();
	U32 n_objects = 0;
	if (gSavedSettings.getBOOL("EditLinkedParts"))
	{
		n_objects = selectHandle->getObjectCount();
	}
	else
	{
		n_objects = selectHandle->getRootObjectCount();
	}

	buffer = llformat("Starting %s of %d items.", mStartString.c_str(), n_objects); // *TODO: Translate
	
	LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output");
	list->addCommentText(buffer);

	return nextObject();
}
// Checked: 2010-04-11 (RLVa-1.2.0b) | Modified: RLVa-0.2.0g
bool rlvCanDeleteOrReturn()
{
	bool fIsAllowed = true;

	if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ))
	{
		// We'll allow if none of the prims are owned by the avie or group owned
		LLObjectSelectionHandle handleSel = LLSelectMgr::getInstance()->getSelection();
		RlvSelectIsOwnedByOrGroupOwned f(gAgent.getID());
		if ( (handleSel.notNull()) && ((0 == handleSel->getRootObjectCount()) || (NULL != handleSel->getFirstRootNode(&f, FALSE))) )
			fIsAllowed = false;
	}
	
	if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (gAgent.getAvatarObject()) )
	{
		// We'll allow if the avie isn't sitting on any of the selected objects
		LLObjectSelectionHandle handleSel = LLSelectMgr::getInstance()->getSelection();
		RlvSelectIsSittingOn f(gAgent.getAvatarObject()->getRoot());
		if ( (handleSel.notNull()) && (handleSel->getFirstRootNode(&f, TRUE)) )
			fIsAllowed = false;
	}

	return fIsAllowed;
}
// static
void LLFloaterBuy::show(const LLSaleInfo& sale_info)
{
	LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();

	if (selection->getRootObjectCount() != 1)
	{
		LLNotificationsUtil::add("BuyOneObjectOnly");
		return;
	}
	
	LLFloaterBuy* floater = LLFloaterReg::showTypedInstance<LLFloaterBuy>("buy_object");
	if (!floater)
		return;
	
	// Clean up the lists...
	floater->reset();
	floater->mSaleInfo = sale_info;
	floater->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection();
	
	LLSelectNode* node = selection->getFirstRootNode();
	if (!node)
		return;
	
	// Set title based on sale type
	LLUIString title;
	switch (sale_info.getSaleType())
	{
	  case LLSaleInfo::FS_ORIGINAL:
		title = floater->getString("title_buy_text");
		break;
	  case LLSaleInfo::FS_COPY:
	  default:
		title = floater->getString("title_buy_copy_text");
		break;
	}
	title.setArg("[NAME]", node->mName);
	floater->setTitle(title);

	LLUUID owner_id;
	std::string owner_name;
	BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name);
	if (!owners_identical)
	{
		LLNotificationsUtil::add("BuyObjectOneOwner");
		return;
	}

	LLCtrlListInterface *object_list = floater->childGetListInterface("object_list");
	if (!object_list)
	{
		return;
	}

	// Update the display
	// Display next owner permissions
	LLSD row;

	// Compute icon for this item
	std::string icon_name = LLInventoryIcon::getIconName(LLAssetType::AT_OBJECT, 
									 LLInventoryType::IT_OBJECT);

	row["columns"][0]["column"] = "icon";
	row["columns"][0]["type"] = "icon";
	row["columns"][0]["value"] = icon_name;
	
	// Append the permissions that you will acquire (not the current
	// permissions).
	U32 next_owner_mask = node->mPermissions->getMaskNextOwner();
	std::string text = node->mName;
	if (!(next_owner_mask & PERM_COPY))
	{
		text.append(floater->getString("no_copy_text"));
	}
	if (!(next_owner_mask & PERM_MODIFY))
	{
		text.append(floater->getString("no_modify_text"));
	}
	if (!(next_owner_mask & PERM_TRANSFER))
	{
		text.append(floater->getString("no_transfer_text"));
	}

	row["columns"][1]["column"] = "text";
	row["columns"][1]["value"] = text;
	row["columns"][1]["font"] = "SANSSERIF";

	// Add after columns added so appropriate heights are correct.
	object_list->addElement(row);

	floater->getChild<LLUICtrl>("buy_text")->setTextArg("[AMOUNT]", llformat("%d", sale_info.getSalePrice()));
	floater->getChild<LLUICtrl>("buy_name_text")->setTextArg("[NAME]", owner_name);

	// Must do this after the floater is created, because
	// sometimes the inventory is already there and 
	// the callback is called immediately.
	LLViewerObject* obj = selection->getFirstRootObject();
	floater->registerVOInventoryListener(obj,NULL);
	floater->requestVOInventory();
}
Ejemplo n.º 7
0
// static
void LLFloaterBuyContents::show(const LLSaleInfo& sale_info)
{
	LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();

	if (selection->getRootObjectCount() != 1)
	{
		LLNotifications::instance().add("BuyContentsOneOnly");
		return;
	}

	// Create a new instance only if needed
	if (sInstance)
	{
		LLScrollListCtrl* list = sInstance->getChild<LLScrollListCtrl>("item_list");
		if (list) list->deleteAllItems();
	}
	else
	{
		sInstance = new LLFloaterBuyContents();
	}

	sInstance->open(); /*Flawfinder: ignore*/
	sInstance->setFocus(TRUE);
	sInstance->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection();

	// Always center the dialog.  User can change the size,
	// but purchases are important and should be center screen.
	// This also avoids problems where the user resizes the application window
	// mid-session and the saved rect is off-center.
	sInstance->center();

	LLUUID owner_id;
	std::string owner_name;
	BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name);
	if (!owners_identical)
	{
		LLNotifications::instance().add("BuyContentsOneOwner");
		return;
	}

	sInstance->mSaleInfo = sale_info;

	// Update the display
	LLSelectNode* node = selection->getFirstRootNode();
	if (!node) return;
	if(node->mPermissions->isGroupOwned())
	{
		gCacheName->getGroupName(owner_id, owner_name);
	}

	sInstance->childSetTextArg("contains_text", "[NAME]", node->mName);
	sInstance->childSetTextArg("buy_text", "[AMOUNT]", llformat("%d", sale_info.getSalePrice()));
	sInstance->childSetTextArg("buy_text", "[NAME]", owner_name);

	// Must do this after the floater is created, because
	// sometimes the inventory is already there and 
	// the callback is called immediately.
	LLViewerObject* obj = selection->getFirstRootObject();
	sInstance->registerVOInventoryListener(obj,NULL);
	sInstance->requestVOInventory();
}
Ejemplo n.º 8
0
// static
void LLFloaterBuy::show(const LLSaleInfo& sale_info)
{
	LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();

	if (selection->getRootObjectCount() != 1)
	{
		LLNotifications::instance().add("BuyOneObjectOnly");
		return;
	}

	// Create a new instance only if one doesn't exist
	if (sInstance)
	{
		// Clean up the lists...
		sInstance->reset();
	}
	else
	{
		sInstance = new LLFloaterBuy();
	}
	
	sInstance->open(); /*Flawfinder: ignore*/
	sInstance->setFocus(TRUE);
	sInstance->mSaleInfo = sale_info;
	sInstance->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection();

	// Always center the dialog.  User can change the size,
	// but purchases are important and should be center screen.
	// This also avoids problems where the user resizes the application window
	// mid-session and the saved rect is off-center.
	sInstance->center();

	LLSelectNode* node = selection->getFirstRootNode();
	if (!node)
		return;

	// Set title based on sale type
	LLUIString title;
	switch (sale_info.getSaleType())
	{
	  case LLSaleInfo::FS_ORIGINAL:
		title = sInstance->getString("title_buy_text");
		break;
	  case LLSaleInfo::FS_COPY:
	  default:
		title = sInstance->getString("title_buy_copy_text");
		break;
	}
	title.setArg("[NAME]", node->mName);
	sInstance->setTitle(title);

	LLUUID owner_id;
	std::string owner_name;
	BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name);
	if (!owners_identical)
	{
		LLNotifications::instance().add("BuyObjectOneOwner");
		return;
	}

	LLCtrlListInterface *object_list = sInstance->childGetListInterface("object_list");
	if (!object_list)
	{
		return;
	}

	// Update the display
	// Display next owner permissions
	LLSD row;

	// Compute icon for this item
	std::string icon_name = get_item_icon_name(LLAssetType::AT_OBJECT, 
									 LLInventoryType::IT_OBJECT,
									 0x0, FALSE);

	row["columns"][0]["column"] = "icon";
	row["columns"][0]["type"] = "icon";
	row["columns"][0]["color"] = gColors.getColor("DefaultListIcon").getValue();
	row["columns"][0]["value"] = icon_name;
	
	// Append the permissions that you will acquire (not the current
	// permissions).
	U32 next_owner_mask = node->mPermissions->getMaskNextOwner();
	std::string text = node->mName;
	if (!(next_owner_mask & PERM_COPY))
	{
		text.append(sInstance->getString("no_copy_text"));
	}
	if (!(next_owner_mask & PERM_MODIFY))
	{
		text.append(sInstance->getString("no_modify_text"));
	}
	if (!(next_owner_mask & PERM_TRANSFER))
	{
		text.append(sInstance->getString("no_transfer_text"));
	}

	row["columns"][1]["column"] = "text";
	row["columns"][1]["color"] = gColors.getColor("DefaultListText").getValue();
	row["columns"][1]["value"] = text;
	row["columns"][1]["font"] = "SANSSERIF";

	// Add after columns added so appropriate heights are correct.
	object_list->addElement(row);

	sInstance->childSetTextArg("buy_text", "[AMOUNT]", llformat("%d", sale_info.getSalePrice()));
	sInstance->childSetTextArg("buy_text", "[NAME]", owner_name);

	// Must do this after the floater is created, because
	// sometimes the inventory is already there and 
	// the callback is called immediately.
	LLViewerObject* obj = selection->getFirstRootObject();
	sInstance->registerVOInventoryListener(obj,NULL);
	sInstance->requestVOInventory();
}