bool LLFloaterSellLandUI::onConfirmSale(const LLSD& notification, const LLSD& response)
{
	S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
	if (option != 0)
	{
		return false;
	}
	S32  sale_price	= getChild<LLUICtrl>("price")->getValue();

	// Valid extracted data
	if (sale_price < 0)
	{
		// TomY TODO: Throw an error
		return false;
	}

	LLParcel* parcel = mParcelSelection->getParcel();
	if (!parcel) return false;

	// can_agent_modify_parcel deprecated by GROUPS
// 	if (!can_agent_modify_parcel(parcel))
// 	{
// 		close();
// 		return;
// 	}

	parcel->setParcelFlag(PF_FOR_SALE, TRUE);
	parcel->setSalePrice(sale_price);
	bool sell_with_objects = false;
	if ("yes" == getChild<LLUICtrl>("sell_objects")->getValue().asString())
	{
		sell_with_objects = true;
	}
	parcel->setSellWithObjects(sell_with_objects);
	if ("user" == getChild<LLUICtrl>("sell_to")->getValue().asString())
	{
		parcel->setAuthorizedBuyerID(mAuthorizedBuyer);
	}
	else
	{
		parcel->setAuthorizedBuyerID(LLUUID::null);
	}

	// Send update to server
	LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel );

	closeFloater();
	return false;
}
void LLFloaterSellLandUI::callbackAvatarPick(const uuid_vec_t& ids, const std::vector<LLAvatarName> names)
{	
	LLParcel* parcel = mParcelSelection->getParcel();

	if (names.empty() || ids.empty()) return;
	
	LLUUID id = ids[0];
	parcel->setAuthorizedBuyerID(id);

	mAuthorizedBuyer = ids[0];

	getChild<LLUICtrl>("sell_to_agent")->setValue(names[0].getCompleteName());

	refreshUI();
}
Пример #3
0
// static
void LLFloaterSellLandUI::callbackAvatarPick(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data)
{	
	LLFloaterSellLandUI* floaterp = (LLFloaterSellLandUI*)data;
	LLParcel* parcel = floaterp->mParcelSelection->getParcel();

	if (names.empty() || ids.empty()) return;
	
	LLUUID id = ids[0];
	parcel->setAuthorizedBuyerID(id);

	floaterp->mAuthorizedBuyer = ids[0];

	floaterp->childSetText("sell_to_agent", names[0]);

	floaterp->refreshUI();
}