Exemplo n.º 1
0
void LLPanelPickEdit::onOpen(const LLSD& key)
{
	LLUUID pick_id = key["pick_id"];
	mNeedData = true;

	// creating new Pick
	if(pick_id.isNull())
	{
		mNewPick = true;

		setAvatarId(gAgent.getID());

		resetData();
		resetControls();

		setPosGlobal(gAgent.getPositionGlobal());

		LLUUID parcel_id = LLUUID::null, snapshot_id = LLUUID::null;
		std::string pick_name, pick_desc, region_name;

		LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
		if(parcel)
		{
			parcel_id = parcel->getID();
			pick_name = parcel->getName();
			pick_desc = parcel->getDesc();
			snapshot_id = parcel->getSnapshotID();
		}

		LLViewerRegion* region = gAgent.getRegion();
		if(region)
		{
			region_name = region->getName();
		}

		setParcelID(parcel_id);
		childSetValue("pick_name", pick_name.empty() ? region_name : pick_name);
		childSetValue("pick_desc", pick_desc);
		setSnapshotId(snapshot_id);
		setPickLocation(createLocationText(getLocationNotice(), pick_name, region_name, getPosGlobal()));

		enableSaveButton(true);
	}
	// editing existing pick
	else
	{
		mNewPick = false;
		LLPanelPickInfo::onOpen(key);

		enableSaveButton(false);
	}

	resetDirty();
}
void KCWindlightInterface::ParcelChange()
{
	if (!gSavedSettings.getBOOL("PhoenixWLParcelEnabled") ||
	(rlv_handler_t::isEnabled() && gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) )
		return;

	LLParcel *parcel = NULL;
	S32 this_parcel_id = 0;
	std::string desc;
 
 	parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
 
	if (parcel)
	{
		this_parcel_id = parcel->getLocalID();
		desc = parcel->getDesc();
	}

	if ( (this_parcel_id != mLastParcelID) || (mLastParcelDesc != desc) ) //parcel changed
	{
		//llinfos << "agent in new parcel: "<< this_parcel_id << " : "  << parcel->getName() << llendl;

		mLastParcelID = this_parcel_id;
		mLastParcelDesc = desc;
		mCurrentSpace = -2.f;
		mCurrentSettings.clear();
		setWL_Status(false); //clear the status bar icon
		const LLVector3& agent_pos_region = gAgent.getPositionAgent();
		mLastZ = lltrunc( agent_pos_region.mV[VZ] );

		//clear the last notification if its still open
		if (mSetWLNotification && !mSetWLNotification->isRespondedTo())
		{
			LLSD response = mSetWLNotification->getResponseTemplate();
			response["Ignore"] = true;
			mSetWLNotification->respond(response);
		}
		
		mEventTimer.reset();
		mEventTimer.start();
		
		// Apply new WL settings instantly on TP
		if (mTPing)
		{
			mTPing = false;
			tick();
		}
	}
}
Exemplo n.º 3
0
void LLPanelClassifiedEdit::fillIn(const LLSD& key)
{
	setAvatarId(gAgent.getID());

	if(key.isUndefined())
	{
		setPosGlobal(gAgent.getPositionGlobal());

		LLUUID snapshot_id = LLUUID::null;
		std::string desc;
		LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();

		if(parcel)
		{
			desc = parcel->getDesc();
			snapshot_id = parcel->getSnapshotID();
		}

		std::string region_name = LLTrans::getString("ClassifiedUpdateAfterPublish");
		LLViewerRegion* region = gAgent.getRegion();
		if (region)
		{
			region_name = region->getName();
		}

		getChild<LLUICtrl>("classified_name")->setValue(makeClassifiedName());
		getChild<LLUICtrl>("classified_desc")->setValue(desc);
		setSnapshotId(snapshot_id);
		setClassifiedLocation(createLocationText(getLocationNotice(), region_name, getPosGlobal()));
		// server will set valid parcel id
		setParcelId(LLUUID::null);
	}
	else
	{
		setClassifiedId(key["classified_id"]);
		setClassifiedName(key["name"]);
		setDescription(key["desc"]);
		setSnapshotId(key["snapshot_id"]);
		setCategory((U32)key["category"].asInteger());
		setContentType((U32)key["content_type"].asInteger());
		setClassifiedLocation(key["location_text"]);
		getChild<LLUICtrl>("auto_renew")->setValue(key["auto_renew"]);
		getChild<LLUICtrl>("price_for_listing")->setValue(key["price_for_listing"].asInteger());
	}
}
Exemplo n.º 4
0
// Fill in some reasonable defaults for a new pick.
void LLPanelPick::initNewPick()
{
	mPickID.generate();

	mCreatorID = gAgent.getID();

	mPosGlobal = gAgent.getPositionGlobal();

	// Try to fill in the current parcel
	LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
	if (parcel)
	{
		mNameEditor->setText(parcel->getName());
		mDescEditor->setText(parcel->getDesc());
		mSnapshotCtrl->setImageAssetID(parcel->getSnapshotID());
	}

	// Commit to the database, since we've got "new" values.
	sendPickInfoUpdate();
}