ER-858: Add viewer checkbox to toggle parcel privacy settings. Reviewed by Kelly

meow-7.2.2
Dave SIMmONs 2011-05-02 16:35:55 -07:00
parent f393774caf
commit 9bfae21706
7 changed files with 51 additions and 4 deletions

View File

@ -702,7 +702,7 @@ void LLParcel::packMessage(LLSD& msg)
msg["user_location"] = ll_sd_from_vector3(mUserLocation);
msg["user_look_at"] = ll_sd_from_vector3(mUserLookAt);
msg["landing_type"] = (U8)mLandingType;
msg["privacy"] = (LLSD::Boolean) getPrivacy();
}
@ -721,6 +721,14 @@ void LLParcel::unpackMessage(LLMessageSystem* msg)
msg->getStringFast( _PREHASH_ParcelData,_PREHASH_MediaURL, buffer );
setMediaURL(buffer);
BOOL private_parcel = FALSE;
bool have_privacy_data = (msg->getSizeFast(_PREHASH_ParcelData, _PREHASH_Privacy) > 0);
if (have_privacy_data)
{
msg->getBOOLFast(_PREHASH_ParcelData, _PREHASH_Privacy, private_parcel);
}
setPrivacy((bool) private_parcel);
// non-optimized version
msg->getU8 ( "ParcelData", "MediaAutoScale", mMediaAutoScale );

View File

@ -75,7 +75,7 @@ const U8 PARCEL_AUCTION = 0x05;
// unused 0x06
// unused 0x07
// flag, unused 0x08
// flag, unused 0x10
const U8 PARCEL_PRIVATE = 0x10;
const U8 PARCEL_SOUND_LOCAL = 0x20;
const U8 PARCEL_WEST_LINE = 0x40; // flag, property line on west edge
const U8 PARCEL_SOUTH_LINE = 0x80; // flag, property line on south edge
@ -130,6 +130,12 @@ class LLSD;
class LLAccessEntry
{
public:
LLAccessEntry()
: mID(),
mTime(0),
mFlags(0)
{}
LLUUID mID; // Agent ID
S32 mTime; // Time (unix seconds) when entry expires
U32 mFlags; // Not used - currently should always be zero
@ -265,6 +271,7 @@ public:
void setUserLocation(const LLVector3& pos) { mUserLocation = pos; }
void setUserLookAt(const LLVector3& rot) { mUserLookAt = rot; }
void setLandingType(const ELandingType type) { mLandingType = type; }
void setPrivacy(bool privacy) { mPrivacy = privacy; }
void setAuctionID(U32 auction_id) { mAuctionID = auction_id;}
@ -367,6 +374,8 @@ public:
const LLVector3& getUserLocation() const { return mUserLocation; }
const LLVector3& getUserLookAt() const { return mUserLookAt; }
ELandingType getLandingType() const { return mLandingType; }
bool getPrivacy() const { return mPrivacy; }
// User-specified snapshot
const LLUUID& getSnapshotID() const { return mSnapshotID; }
@ -602,6 +611,7 @@ protected:
LLVector3 mUserLocation;
LLVector3 mUserLookAt;
ELandingType mLandingType;
bool mPrivacy;
LLTimer mSaleTimerExpires;
LLTimer mMediaResetTimer;

View File

@ -1375,3 +1375,4 @@ char const* const _PREHASH_VCoord = LLMessageStringTable::getInstance()->getStri
char const* const _PREHASH_FaceIndex = LLMessageStringTable::getInstance()->getString("FaceIndex");
char const* const _PREHASH_StatusData = LLMessageStringTable::getInstance()->getString("StatusData");
char const* const _PREHASH_ProductSKU = LLMessageStringTable::getInstance()->getString("ProductSKU");
char const* const _PREHASH_Privacy = LLMessageStringTable::getInstance()->getString("Privacy");

View File

@ -1375,4 +1375,5 @@ extern char const* const _PREHASH_VCoord;
extern char const* const _PREHASH_FaceIndex;
extern char const* const _PREHASH_StatusData;
extern char const* const _PREHASH_ProductSKU;
extern char const* const _PREHASH_Privacy;
#endif

View File

@ -1817,6 +1817,7 @@ LLPanelLandOptions::LLPanelLandOptions(LLParcelSelectionHandle& parcel)
mClearBtn(NULL),
mMatureCtrl(NULL),
mPushRestrictionCtrl(NULL),
mPrivateParcelCtrl(NULL),
mParcel(parcel)
{
}
@ -1859,6 +1860,9 @@ BOOL LLPanelLandOptions::postBuild()
mPushRestrictionCtrl = getChild<LLCheckBoxCtrl>( "PushRestrictCheck");
childSetCommitCallback("PushRestrictCheck", onCommitAny, this);
mPrivateParcelCtrl = getChild<LLCheckBoxCtrl>( "PrivateParcelCheck");
childSetCommitCallback("PrivateParcelCheck", onCommitAny, this);
mCheckShowDirectory = getChild<LLCheckBoxCtrl>( "ShowDirectoryCheck");
childSetCommitCallback("ShowDirectoryCheck", onCommitAny, this);
@ -1967,6 +1971,9 @@ void LLPanelLandOptions::refresh()
mPushRestrictionCtrl->set(FALSE);
mPushRestrictionCtrl->setEnabled(FALSE);
mPrivateParcelCtrl->set(FALSE);
mPrivateParcelCtrl->setEnabled(FALSE);
mLandingTypeCombo->setCurrentByIndex(0);
mLandingTypeCombo->setEnabled(FALSE);
@ -2026,6 +2033,10 @@ void LLPanelLandOptions::refresh()
mPushRestrictionCtrl->setEnabled(can_change_options);
}
mPrivateParcelCtrl->set(parcel->getPrivacy());
mPrivateParcelCtrl->setLabel(getString("private_parcel_text"));
mPrivateParcelCtrl->setEnabled(can_change_options);
BOOL can_change_landing_point = LLViewerParcelMgr::isParcelModifiableByAgent(parcel,
GP_LAND_SET_LANDING_POINT);
mLandingTypeCombo->setCurrentByIndex((S32)parcel->getLandingType());
@ -2230,6 +2241,7 @@ void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata)
BOOL allow_publish = FALSE;
BOOL mature_publish = self->mMatureCtrl->get();
BOOL push_restriction = self->mPushRestrictionCtrl->get();
BOOL private_parcel = self->mPrivateParcelCtrl->get();
BOOL show_directory = self->mCheckShowDirectory->get();
// we have to get the index from a lookup, not from the position in the dropdown!
S32 category_index = LLParcel::getCategoryFromString(self->mCategoryCombo->getSelectedValue());
@ -2263,6 +2275,7 @@ void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata)
parcel->setCategory((LLParcel::ECategory)category_index);
parcel->setLandingType((LLParcel::ELandingType)landing_type_index);
parcel->setSnapshotID(snapshot_id);
parcel->setPrivacy(private_parcel);
// Send current parcel data upstream to server
LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel );

View File

@ -347,6 +347,7 @@ private:
LLCheckBoxCtrl *mMatureCtrl;
LLCheckBoxCtrl *mPushRestrictionCtrl;
LLCheckBoxCtrl *mPrivateParcelCtrl;
LLSafeHandle<LLParcelSelection>& mParcel;
};

View File

@ -1204,6 +1204,10 @@ Only large parcels can be listed in search.
name="push_restrict_region_text">
No Pushing (Region Override)
</panel.string>
<panel.string
name="private_parcel_text">
Private Parcel
</panel.string>
<text
type="string"
length="1"
@ -1333,7 +1337,7 @@ Only large parcels can be listed in search.
name="check safe"
tool_tip="If checked, sets the land to Safe, disabling damage combat. If cleared, damage combat is enabled."
top_pad="5"
width="200" />
width="280" />
<check_box
height="16"
label="No Pushing"
@ -1350,7 +1354,16 @@ Only large parcels can be listed in search.
left="14"
name="ShowDirectoryCheck"
tool_tip="Let people see this parcel in search results"
width="430" />
width="280" />
<check_box
height="16"
label="Private Parcel"
layout="topleft"
left_pad="5"
name="PrivateParcelCheck"
tool_tip="Prevents avatars from seeing into or out of the parcel."
top_delta="0"
width="119" />
<combo_box
enabled="false"
height="23"