diff options
Diffstat (limited to 'indra/newview/llfloaterland.cpp')
-rw-r--r-- | indra/newview/llfloaterland.cpp | 735 |
1 files changed, 372 insertions, 363 deletions
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index a6afa03e6a..5c5219bcdd 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -93,8 +93,8 @@ static std::string OWNER_GROUP = "2"; static std::string MATURITY = "[MATURITY]"; // constants used in callbacks below - syntactic sugar. -static const BOOL BUY_GROUP_LAND = TRUE; -static const BOOL BUY_PERSONAL_LAND = FALSE; +static const bool BUY_GROUP_LAND = true; +static const bool BUY_PERSONAL_LAND = false; LLPointer<LLParcelSelection> LLPanelLandGeneral::sSelectionForBuyPass = NULL; // Statics @@ -125,7 +125,7 @@ class LLPanelLandExperiences { public: LLPanelLandExperiences(LLSafeHandle<LLParcelSelection>& parcelp); - virtual BOOL postBuild(); + virtual bool postBuild(); void refresh(); void experienceAdded(const LLUUID& id, U32 xp_type, U32 access_type); @@ -155,7 +155,7 @@ public: return ((parcelp) ? (parcelp->getArea() >= MINIMUM_PARCEL_SIZE) : false); } - virtual BOOL postBuild() override; + virtual bool postBuild() override; virtual void refresh() override; virtual LLParcel * getParcel() override; @@ -318,7 +318,7 @@ LLFloaterLand::LLFloaterLand(const LLSD& seed) LLViewerParcelMgr::getInstance()->addObserver( sObserver ); } -BOOL LLFloaterLand::postBuild() +bool LLFloaterLand::postBuild() { setVisibleCallback(boost::bind(&LLFloaterLand::onVisibilityChanged, this, _2)); @@ -331,7 +331,7 @@ BOOL LLFloaterLand::postBuild() tab->selectTab(sLastTab); } - return TRUE; + return true; } @@ -439,19 +439,19 @@ void* LLFloaterLand::createPanelLandEnvironment(void* data) LLPanelLandGeneral::LLPanelLandGeneral(LLParcelSelectionHandle& parcel) : LLPanel(), - mUncheckedSell(FALSE), + mUncheckedSell(false), mParcel(parcel) { } -BOOL LLPanelLandGeneral::postBuild() +bool LLPanelLandGeneral::postBuild() { mEditName = getChild<LLLineEditor>("Name"); mEditName->setCommitCallback(onCommitAny, this); getChild<LLLineEditor>("Name")->setPrevalidate(LLTextValidate::validateASCIIPrintableNoPipe); mEditDesc = getChild<LLTextEditor>("Description"); - mEditDesc->setCommitOnFocusLost(TRUE); + mEditDesc->setCommitOnFocusLost(true); mEditDesc->setCommitCallback(onCommitAny, this); mEditDesc->setContentTrusted(false); // No prevalidate function - historically the prevalidate function was broken, @@ -544,7 +544,7 @@ BOOL LLPanelLandGeneral::postBuild() if(gDisconnected) { - return TRUE; + return true; } // note: on region change this will not be re checked, should not matter on Agni as @@ -566,7 +566,7 @@ BOOL LLPanelLandGeneral::postBuild() } } - return TRUE; + return true; } @@ -578,51 +578,51 @@ LLPanelLandGeneral::~LLPanelLandGeneral() // public void LLPanelLandGeneral::refresh() { - mEditName->setEnabled(FALSE); + mEditName->setEnabled(false); mEditName->setText(LLStringUtil::null); - mEditDesc->setEnabled(FALSE); + mEditDesc->setEnabled(false); mEditDesc->setText(getString("no_selection_text")); mTextSalePending->setText(LLStringUtil::null); - mTextSalePending->setEnabled(FALSE); + mTextSalePending->setEnabled(false); - mBtnDeedToGroup->setEnabled(FALSE); - mBtnSetGroup->setEnabled(FALSE); - mBtnStartAuction->setEnabled(FALSE); + mBtnDeedToGroup->setEnabled(false); + mBtnSetGroup->setEnabled(false); + mBtnStartAuction->setEnabled(false); - mCheckDeedToGroup ->set(FALSE); - mCheckDeedToGroup ->setEnabled(FALSE); - mCheckContributeWithDeed->set(FALSE); - mCheckContributeWithDeed->setEnabled(FALSE); + mCheckDeedToGroup ->set(false); + mCheckDeedToGroup ->setEnabled(false); + mCheckContributeWithDeed->set(false); + mCheckContributeWithDeed->setEnabled(false); mTextOwner->setText(LLStringUtil::null); mContentRating->setText(LLStringUtil::null); mLandType->setText(LLStringUtil::null); mBtnProfile->setLabel(getString("profile_text")); - mBtnProfile->setEnabled(FALSE); + mBtnProfile->setEnabled(false); mTextClaimDate->setText(LLStringUtil::null); mTextGroup->setText(LLStringUtil::null); mTextPrice->setText(LLStringUtil::null); - mSaleInfoForSale1->setVisible(FALSE); - mSaleInfoForSale2->setVisible(FALSE); - mSaleInfoForSaleObjects->setVisible(FALSE); - mSaleInfoForSaleNoObjects->setVisible(FALSE); - mSaleInfoNotForSale->setVisible(FALSE); - mBtnSellLand->setVisible(FALSE); - mBtnStopSellLand->setVisible(FALSE); + mSaleInfoForSale1->setVisible(false); + mSaleInfoForSale2->setVisible(false); + mSaleInfoForSaleObjects->setVisible(false); + mSaleInfoForSaleNoObjects->setVisible(false); + mSaleInfoNotForSale->setVisible(false); + mBtnSellLand->setVisible(false); + mBtnStopSellLand->setVisible(false); mTextPriceLabel->setText(LLStringUtil::null); mTextDwell->setText(LLStringUtil::null); - mBtnBuyLand->setEnabled(FALSE); - mBtnScriptLimits->setEnabled(FALSE); - mBtnBuyGroupLand->setEnabled(FALSE); - mBtnReleaseLand->setEnabled(FALSE); - mBtnReclaimLand->setEnabled(FALSE); - mBtnBuyPass->setEnabled(FALSE); + mBtnBuyLand->setEnabled(false); + mBtnScriptLimits->setEnabled(false); + mBtnBuyGroupLand->setEnabled(false); + mBtnReleaseLand->setEnabled(false); + mBtnReclaimLand->setEnabled(false); + mBtnBuyPass->setEnabled(false); if(gDisconnected) { @@ -635,24 +635,24 @@ void LLPanelLandGeneral::refresh() if(regionp && (regionp->getOwner() == gAgent.getID())) { region_owner = true; - mBtnReleaseLand->setVisible(FALSE); - mBtnReclaimLand->setVisible(TRUE); + mBtnReleaseLand->setVisible(false); + mBtnReclaimLand->setVisible(true); } else { - mBtnReleaseLand->setVisible(TRUE); - mBtnReclaimLand->setVisible(FALSE); + mBtnReleaseLand->setVisible(true); + mBtnReclaimLand->setVisible(false); } LLParcel *parcel = mParcel->getParcel(); if (parcel) { // something selected, hooray! - BOOL is_leased = (LLParcel::OS_LEASED == parcel->getOwnershipStatus()); - BOOL region_xfer = FALSE; + bool is_leased = (LLParcel::OS_LEASED == parcel->getOwnershipStatus()); + bool region_xfer = false; if(regionp && !(regionp->getRegionFlag(REGION_FLAGS_BLOCK_LAND_RESELL))) { - region_xfer = TRUE; + region_xfer = true; } if (regionp) @@ -662,57 +662,57 @@ void LLPanelLandGeneral::refresh() } // estate owner/manager cannot edit other parts of the parcel - BOOL estate_manager_sellable = !parcel->getAuctionID() + bool estate_manager_sellable = !parcel->getAuctionID() && gAgent.canManageEstate() // estate manager/owner can only sell parcels owned by estate owner && regionp && (parcel->getOwnerID() == regionp->getOwner()); - BOOL owner_sellable = region_xfer && !parcel->getAuctionID() + bool owner_sellable = region_xfer && !parcel->getAuctionID() && LLViewerParcelMgr::isParcelModifiableByAgent( parcel, GP_LAND_SET_SALE_INFO); - BOOL can_be_sold = owner_sellable || estate_manager_sellable; + bool can_be_sold = owner_sellable || estate_manager_sellable; const LLUUID &owner_id = parcel->getOwnerID(); - BOOL is_public = parcel->isPublic(); + bool is_public = parcel->isPublic(); // Is it owned? if (is_public) { mTextSalePending->setText(LLStringUtil::null); - mTextSalePending->setEnabled(FALSE); + mTextSalePending->setEnabled(false); mTextOwner->setText(getString("public_text")); - mTextOwner->setEnabled(FALSE); - mBtnProfile->setEnabled(FALSE); + mTextOwner->setEnabled(false); + mBtnProfile->setEnabled(false); mTextClaimDate->setText(LLStringUtil::null); - mTextClaimDate->setEnabled(FALSE); + mTextClaimDate->setEnabled(false); mTextGroup->setText(getString("none_text")); - mTextGroup->setEnabled(FALSE); - mBtnStartAuction->setEnabled(FALSE); + mTextGroup->setEnabled(false); + mBtnStartAuction->setEnabled(false); } else { if(!is_leased && (owner_id == gAgent.getID())) { mTextSalePending->setText(getString("need_tier_to_modify")); - mTextSalePending->setEnabled(TRUE); + mTextSalePending->setEnabled(true); } else if(parcel->getAuctionID()) { mTextSalePending->setText(getString("auction_id_text")); mTextSalePending->setTextArg("[ID]", llformat("%u", parcel->getAuctionID())); - mTextSalePending->setEnabled(TRUE); + mTextSalePending->setEnabled(true); } else { // not the owner, or it is leased mTextSalePending->setText(LLStringUtil::null); - mTextSalePending->setEnabled(FALSE); + mTextSalePending->setEnabled(false); } //refreshNames(); - mTextOwner->setEnabled(TRUE); + mTextOwner->setEnabled(true); // We support both group and personal profiles - mBtnProfile->setEnabled(TRUE); + mBtnProfile->setEnabled(true); if (parcel->getGroupID().isNull()) { @@ -720,7 +720,7 @@ void LLPanelLandGeneral::refresh() mBtnProfile->setLabel(getString("profile_text")); mTextGroup->setText(getString("none_text")); - mTextGroup->setEnabled(FALSE); + mTextGroup->setEnabled(false); } else { @@ -728,37 +728,38 @@ void LLPanelLandGeneral::refresh() mBtnProfile->setLabel(getString("info_text")); //mTextGroup->setText("HIPPOS!");//parcel->getGroupName()); - mTextGroup->setEnabled(TRUE); + mTextGroup->setEnabled(true); } // Display claim date time_t claim_date = parcel->getClaimDate(); - std::string claim_date_str = getString("time_stamp_template"); + static bool use_24h = gSavedSettings.getBOOL("Use24HourClock"); + std::string claim_date_str = use_24h ? getString("time_stamp_template") : getString("time_stamp_template_ampm"); LLSD substitution; substitution["datetime"] = (S32) claim_date; LLStringUtil::format (claim_date_str, substitution); mTextClaimDate->setText(claim_date_str); mTextClaimDate->setEnabled(is_leased); - BOOL enable_auction = (gAgent.getGodLevel() >= GOD_LIAISON) + bool enable_auction = (gAgent.getGodLevel() >= GOD_LIAISON) && (owner_id == GOVERNOR_LINDEN_ID) && (parcel->getAuctionID() == 0); mBtnStartAuction->setEnabled(enable_auction); } // Display options - BOOL can_edit_identity = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_IDENTITY); + bool can_edit_identity = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_IDENTITY); mEditName->setEnabled(can_edit_identity); mEditDesc->setEnabled(can_edit_identity); mEditDesc->setParseURLs(!can_edit_identity); - BOOL can_edit_agent_only = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_NO_POWERS); + bool can_edit_agent_only = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_NO_POWERS); mBtnSetGroup->setEnabled(can_edit_agent_only && !parcel->getIsGroupOwned()); const LLUUID& group_id = parcel->getGroupID(); // Can only allow deeding if you own it and it's got a group. - BOOL enable_deed = (owner_id == gAgent.getID() + bool enable_deed = (owner_id == gAgent.getID() && group_id.notNull() && gAgent.isInGroup(group_id)); // You don't need special powers to allow your object to @@ -770,7 +771,7 @@ void LLPanelLandGeneral::refresh() // Actually doing the deeding requires you to have GP_LAND_DEED // powers in the group. - BOOL can_deed = gAgent.hasPowerInGroup(group_id, GP_LAND_DEED); + bool can_deed = gAgent.hasPowerInGroup(group_id, GP_LAND_DEED); mBtnDeedToGroup->setEnabled( parcel->getAllowDeedToGroup() && group_id.notNull() && can_deed @@ -780,10 +781,10 @@ void LLPanelLandGeneral::refresh() mEditName->setText( parcel->getName() ); mEditDesc->setText( parcel->getDesc() ); - BOOL for_sale = parcel->getForSale(); + bool for_sale = parcel->getForSale(); - mBtnSellLand->setVisible(FALSE); - mBtnStopSellLand->setVisible(FALSE); + mBtnSellLand->setVisible(false); + mBtnStopSellLand->setVisible(false); // show pricing information S32 area; @@ -812,19 +813,19 @@ void LLPanelLandGeneral::refresh() if (for_sale) { - mSaleInfoForSale1->setVisible(TRUE); - mSaleInfoForSale2->setVisible(TRUE); + mSaleInfoForSale1->setVisible(true); + mSaleInfoForSale2->setVisible(true); if (parcel->getSellWithObjects()) { - mSaleInfoForSaleObjects->setVisible(TRUE); - mSaleInfoForSaleNoObjects->setVisible(FALSE); + mSaleInfoForSaleObjects->setVisible(true); + mSaleInfoForSaleNoObjects->setVisible(false); } else { - mSaleInfoForSaleObjects->setVisible(FALSE); - mSaleInfoForSaleNoObjects->setVisible(TRUE); + mSaleInfoForSaleObjects->setVisible(false); + mSaleInfoForSaleNoObjects->setVisible(true); } - mSaleInfoNotForSale->setVisible(FALSE); + mSaleInfoNotForSale->setVisible(false); F32 cost_per_sqm = 0.0f; if (area > 0) @@ -837,19 +838,19 @@ void LLPanelLandGeneral::refresh() mSaleInfoForSale1->setTextArg("[PRICE_PER_SQM]", llformat("%.1f", cost_per_sqm)); if (can_be_sold) { - mBtnStopSellLand->setVisible(TRUE); + mBtnStopSellLand->setVisible(true); } } else { - mSaleInfoForSale1->setVisible(FALSE); - mSaleInfoForSale2->setVisible(FALSE); - mSaleInfoForSaleObjects->setVisible(FALSE); - mSaleInfoForSaleNoObjects->setVisible(FALSE); - mSaleInfoNotForSale->setVisible(TRUE); + mSaleInfoForSale1->setVisible(false); + mSaleInfoForSale2->setVisible(false); + mSaleInfoForSaleObjects->setVisible(false); + mSaleInfoForSaleNoObjects->setVisible(false); + mSaleInfoNotForSale->setVisible(true); if (can_be_sold) { - mBtnSellLand->setVisible(TRUE); + mBtnSellLand->setVisible(true); } } @@ -869,15 +870,15 @@ void LLPanelLandGeneral::refresh() } else { - BOOL is_owner_release = LLViewerParcelMgr::isParcelOwnedByAgent(parcel, GP_LAND_RELEASE); - BOOL is_manager_release = (gAgent.canManageEstate() && + bool is_owner_release = LLViewerParcelMgr::isParcelOwnedByAgent(parcel, GP_LAND_RELEASE); + bool is_manager_release = (gAgent.canManageEstate() && regionp && (parcel->getOwnerID() != regionp->getOwner())); - BOOL can_release = is_owner_release || is_manager_release; + bool can_release = is_owner_release || is_manager_release; mBtnReleaseLand->setEnabled( can_release ); } - BOOL use_pass = parcel->getOwnerID()!= gAgent.getID() && parcel->getParcelFlag(PF_USE_PASS_LIST) && !LLViewerParcelMgr::getInstance()->isCollisionBanned();; + bool use_pass = parcel->getOwnerID()!= gAgent.getID() && parcel->getParcelFlag(PF_USE_PASS_LIST) && !LLViewerParcelMgr::getInstance()->isCollisionBanned();; mBtnBuyPass->setEnabled(use_pass); } @@ -996,7 +997,7 @@ void LLPanelLandGeneral::setGroup(const LLUUID& group_id) // static void LLPanelLandGeneral::onClickBuyLand(void* data) { - BOOL* for_group = (BOOL*)data; + bool* for_group = (bool*)data; LLViewerParcelMgr::getInstance()->startBuyLand(*for_group); } @@ -1035,7 +1036,7 @@ void LLPanelLandGeneral::onClickReclaim(void*) } // static -BOOL LLPanelLandGeneral::enableBuyPass(void* data) +bool LLPanelLandGeneral::enableBuyPass(void* data) { LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data; LLParcel* parcel = panelp != NULL ? panelp->mParcel->getParcel() : LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel(); @@ -1123,8 +1124,8 @@ void LLPanelLandGeneral::onCommitAny(LLUICtrl *ctrl, void *userdata) parcel->setName(name); parcel->setDesc(desc); - BOOL allow_deed_to_group= panelp->mCheckDeedToGroup->get(); - BOOL contribute_with_deed = panelp->mCheckContributeWithDeed->get(); + bool allow_deed_to_group= panelp->mCheckDeedToGroup->get(); + bool contribute_with_deed = panelp->mCheckContributeWithDeed->get(); parcel->setParcelFlag(PF_ALLOW_DEED_TO_GROUP, allow_deed_to_group); parcel->setContributeWithDeed(contribute_with_deed); @@ -1150,7 +1151,7 @@ void LLPanelLandGeneral::onClickStopSellLand(void* data) LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data; LLParcel* parcel = panelp->mParcel->getParcel(); - parcel->setParcelFlag(PF_FOR_SALE, FALSE); + parcel->setParcelFlag(PF_FOR_SALE, false); parcel->setSalePrice(0); parcel->setAuthorizedBuyerID(LLUUID::null); @@ -1183,18 +1184,18 @@ LLPanelLandObjects::LLPanelLandObjects(LLParcelSelectionHandle& parcel) mBtnRefresh(NULL), mBtnReturnOwnerList(NULL), mOwnerList(NULL), - mFirstReply(TRUE), + mFirstReply(true), mSelectedCount(0), - mSelectedIsGroup(FALSE) + mSelectedIsGroup(false) { } -BOOL LLPanelLandObjects::postBuild() +bool LLPanelLandObjects::postBuild() { - mFirstReply = TRUE; + mFirstReply = true; mParcelObjectBonus = getChild<LLTextBox>("parcel_object_bonus"); mSWTotalObjects = getChild<LLTextBox>("objects_available"); mObjectContribution = getChild<LLTextBox>("object_contrib_text"); @@ -1240,12 +1241,12 @@ BOOL LLPanelLandObjects::postBuild() mOwnerList = getChild<LLNameListCtrl>("owner list"); mOwnerList->setIsFriendCallback(LLAvatarActions::isFriend); - mOwnerList->sortByColumnIndex(3, FALSE); + mOwnerList->sortByColumnIndex(3, false); childSetCommitCallback("owner list", onCommitList, this); mOwnerList->setDoubleClickCallback(onDoubleClickOwner, this); mOwnerList->setContextMenu(LLScrollListCtrl::MENU_AVATAR); - return TRUE; + return true; } @@ -1272,7 +1273,7 @@ void LLPanelLandObjects::onDoubleClickOwner(void *userdata) return; } // Is this a group? - BOOL is_group = cell->getValue().asString() == OWNER_GROUP; + bool is_group = cell->getValue().asString() == OWNER_GROUP; if (is_group) { LLGroupActions::show(owner_id); @@ -1289,19 +1290,19 @@ void LLPanelLandObjects::refresh() { LLParcel *parcel = mParcel->getParcel(); - mBtnShowOwnerObjects->setEnabled(FALSE); - mBtnShowGroupObjects->setEnabled(FALSE); - mBtnShowOtherObjects->setEnabled(FALSE); - mBtnReturnOwnerObjects->setEnabled(FALSE); - mBtnReturnGroupObjects->setEnabled(FALSE); - mBtnReturnOtherObjects->setEnabled(FALSE); - mCleanOtherObjectsTime->setEnabled(FALSE); - mBtnRefresh-> setEnabled(FALSE); - mBtnReturnOwnerList-> setEnabled(FALSE); + mBtnShowOwnerObjects->setEnabled(false); + mBtnShowGroupObjects->setEnabled(false); + mBtnShowOtherObjects->setEnabled(false); + mBtnReturnOwnerObjects->setEnabled(false); + mBtnReturnGroupObjects->setEnabled(false); + mBtnReturnOtherObjects->setEnabled(false); + mCleanOtherObjectsTime->setEnabled(false); + mBtnRefresh-> setEnabled(false); + mBtnReturnOwnerList-> setEnabled(false); mSelectedOwners.clear(); mOwnerList->deleteAllItems(); - mOwnerList->setEnabled(FALSE); + mOwnerList->setEnabled(false); if (!parcel || gDisconnected) { @@ -1340,12 +1341,12 @@ void LLPanelLandObjects::refresh() if (parcel_object_bonus != 1.0f) { - mParcelObjectBonus->setVisible(TRUE); + mParcelObjectBonus->setVisible(true); mParcelObjectBonus->setTextArg("[BONUS]", llformat("%.2f", parcel_object_bonus)); } else { - mParcelObjectBonus->setVisible(FALSE); + mParcelObjectBonus->setVisible(false); } if (sw_total > sw_max) @@ -1369,30 +1370,30 @@ void LLPanelLandObjects::refresh() mSelectedObjects->setTextArg("[COUNT]", llformat("%d", selected)); mCleanOtherObjectsTime->setText(llformat("%d", mOtherTime)); - BOOL can_return_owned = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_RETURN_GROUP_OWNED); - BOOL can_return_group_set = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_RETURN_GROUP_SET); - BOOL can_return_other = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_RETURN_NON_GROUP); + bool can_return_owned = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_RETURN_GROUP_OWNED); + bool can_return_group_set = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_RETURN_GROUP_SET); + bool can_return_other = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_RETURN_NON_GROUP); if (can_return_owned || can_return_group_set || can_return_other) { if (owned && can_return_owned) { - mBtnShowOwnerObjects->setEnabled(TRUE); - mBtnReturnOwnerObjects->setEnabled(TRUE); + mBtnShowOwnerObjects->setEnabled(true); + mBtnReturnOwnerObjects->setEnabled(true); } if (group && can_return_group_set) { - mBtnShowGroupObjects->setEnabled(TRUE); - mBtnReturnGroupObjects->setEnabled(TRUE); + mBtnShowGroupObjects->setEnabled(true); + mBtnReturnGroupObjects->setEnabled(true); } if (other && can_return_other) { - mBtnShowOtherObjects->setEnabled(TRUE); - mBtnReturnOtherObjects->setEnabled(TRUE); + mBtnShowOtherObjects->setEnabled(true); + mBtnReturnOtherObjects->setEnabled(true); } - mCleanOtherObjectsTime->setEnabled(TRUE); - mBtnRefresh->setEnabled(TRUE); + mCleanOtherObjectsTime->setEnabled(true); + mBtnRefresh->setEnabled(true); } } } @@ -1617,8 +1618,8 @@ void LLPanelLandObjects::onClickRefresh(void* userdata) // ready the list for results self->mOwnerList->deleteAllItems(); self->mOwnerList->setCommentText(LLTrans::getString("Searching")); - self->mOwnerList->setEnabled(FALSE); - self->mFirstReply = TRUE; + self->mOwnerList->setEnabled(false); + self->mFirstReply = true; // send the message msg->newMessageFast(_PREHASH_ParcelObjectOwnersRequest); @@ -1649,18 +1650,18 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo S32 rows = msg->getNumberOfBlocksFast(_PREHASH_Data); //uuid_list_t return_ids; LLUUID owner_id; - BOOL is_group_owned; + bool is_group_owned; S32 object_count; U32 most_recent_time = 0; - BOOL is_online; + bool is_online; std::string object_count_str; - //BOOL b_need_refresh = FALSE; + //bool b_need_refresh = false; // If we were waiting for the first reply, clear the "Searching..." text. if (self->mFirstReply) { self->mOwnerList->deleteAllItems(); - self->mFirstReply = FALSE; + self->mFirstReply = false; } for(S32 i = 0; i < rows; ++i) @@ -1706,7 +1707,7 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo object_count_str = llformat("%d", object_count); item_params.columns.add().value(object_count_str).font(FONT).column("count"); - item_params.columns.add().value(LLDate((time_t)most_recent_time)).font(FONT).column("mostrecent").type("date"); + item_params.columns.add().value(LLDate((double)most_recent_time)).font(FONT).column("mostrecent").type("date"); self->mOwnerList->addNameItemRow(item_params); LL_DEBUGS() << "object owner " << owner_id << " (" << (is_group_owned ? "group" : "agent") @@ -1720,7 +1721,7 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo } else { - self->mOwnerList->setEnabled(TRUE); + self->mOwnerList->setEnabled(true); } self->mBtnRefresh->setEnabled(true); @@ -1731,7 +1732,7 @@ void LLPanelLandObjects::onCommitList(LLUICtrl* ctrl, void* data) { LLPanelLandObjects* self = (LLPanelLandObjects*)data; - if (FALSE == self->mOwnerList->getCanSelect()) + if (false == self->mOwnerList->getCanSelect()) { return; } @@ -1755,7 +1756,7 @@ void LLPanelLandObjects::onCommitList(LLUICtrl* ctrl, void* data) // Set the selection, and enable the return button. self->mSelectedOwners.clear(); self->mSelectedOwners.insert(item->getUUID()); - self->mBtnReturnOwnerList->setEnabled(TRUE); + self->mBtnReturnOwnerList->setEnabled(true); // Highlight this user's objects clickShowCore(self, RT_LIST, &(self->mSelectedOwners)); @@ -1934,7 +1935,7 @@ LLPanelLandOptions::LLPanelLandOptions(LLParcelSelectionHandle& parcel) } -BOOL LLPanelLandOptions::postBuild() +bool LLPanelLandOptions::postBuild() { mCheckEditObjects = getChild<LLCheckBoxCtrl>( "edit objects check"); childSetCommitCallback("edit objects check", onCommitAny, this); @@ -1992,8 +1993,8 @@ BOOL LLPanelLandOptions::postBuild() if (gAgent.wantsPGOnly()) { // Disable these buttons if they are PG (Teen) users - mMatureCtrl->setVisible(FALSE); - mMatureCtrl->setEnabled(FALSE); + mMatureCtrl->setVisible(false); + mMatureCtrl->setEnabled(false); } @@ -2001,7 +2002,7 @@ BOOL LLPanelLandOptions::postBuild() if (mSnapshotCtrl) { mSnapshotCtrl->setCommitCallback( onCommitAny, this ); - mSnapshotCtrl->setAllowNoTexture ( TRUE ); + mSnapshotCtrl->setAllowNoTexture ( true ); mSnapshotCtrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); mSnapshotCtrl->setDnDFilterPermMask(PERM_COPY | PERM_TRANSFER); } @@ -2024,7 +2025,7 @@ BOOL LLPanelLandOptions::postBuild() mLandingTypeCombo = getChild<LLComboBox>( "landing type"); childSetCommitCallback("landing type", onCommitAny, this); - return TRUE; + return true; } @@ -2041,55 +2042,55 @@ void LLPanelLandOptions::refresh() LLParcel *parcel = mParcel->getParcel(); if (!parcel || gDisconnected) { - mCheckEditObjects ->set(FALSE); - mCheckEditObjects ->setEnabled(FALSE); + mCheckEditObjects ->set(false); + mCheckEditObjects ->setEnabled(false); - mCheckEditGroupObjects ->set(FALSE); - mCheckEditGroupObjects ->setEnabled(FALSE); + mCheckEditGroupObjects ->set(false); + mCheckEditGroupObjects ->setEnabled(false); - mCheckAllObjectEntry ->set(FALSE); - mCheckAllObjectEntry ->setEnabled(FALSE); + mCheckAllObjectEntry ->set(false); + mCheckAllObjectEntry ->setEnabled(false); - mCheckGroupObjectEntry ->set(FALSE); - mCheckGroupObjectEntry ->setEnabled(FALSE); + mCheckGroupObjectEntry ->set(false); + mCheckGroupObjectEntry ->setEnabled(false); - mCheckSafe ->set(FALSE); - mCheckSafe ->setEnabled(FALSE); + mCheckSafe ->set(false); + mCheckSafe ->setEnabled(false); - mCheckFly ->set(FALSE); - mCheckFly ->setEnabled(FALSE); + mCheckFly ->set(false); + mCheckFly ->setEnabled(false); - mCheckGroupScripts ->set(FALSE); - mCheckGroupScripts ->setEnabled(FALSE); + mCheckGroupScripts ->set(false); + mCheckGroupScripts ->setEnabled(false); - mCheckOtherScripts ->set(FALSE); - mCheckOtherScripts ->setEnabled(FALSE); + mCheckOtherScripts ->set(false); + mCheckOtherScripts ->setEnabled(false); - mPushRestrictionCtrl->set(FALSE); - mPushRestrictionCtrl->setEnabled(FALSE); + mPushRestrictionCtrl->set(false); + mPushRestrictionCtrl->setEnabled(false); - mSeeAvatarsCtrl->set(TRUE); - mSeeAvatarsCtrl->setEnabled(FALSE); - mSeeAvatarsText->setEnabled(FALSE); + mSeeAvatarsCtrl->set(true); + mSeeAvatarsCtrl->setEnabled(false); + mSeeAvatarsText->setEnabled(false); mLandingTypeCombo->setCurrentByIndex(0); - mLandingTypeCombo->setEnabled(FALSE); + mLandingTypeCombo->setEnabled(false); mSnapshotCtrl->setImageAssetID(LLUUID::null); - mSnapshotCtrl->setEnabled(FALSE); + mSnapshotCtrl->setEnabled(false); mLocationText->setTextArg("[LANDING]", getString("landing_point_none")); - mSetBtn->setEnabled(FALSE); - mClearBtn->setEnabled(FALSE); + mSetBtn->setEnabled(false); + mClearBtn->setEnabled(false); - mMatureCtrl->setEnabled(FALSE); + mMatureCtrl->setEnabled(false); } else { // something selected, hooray! // Display options - BOOL can_change_options = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_OPTIONS); + bool can_change_options = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_OPTIONS); mCheckEditObjects ->set( parcel->getAllowModify() ); mCheckEditObjects ->setEnabled( can_change_options ); @@ -2119,7 +2120,7 @@ void LLPanelLandOptions::refresh() { mPushRestrictionCtrl->setLabel(getString("push_restrict_region_text")); mPushRestrictionCtrl->setEnabled(false); - mPushRestrictionCtrl->set(TRUE); + mPushRestrictionCtrl->set(true); } else { @@ -2131,7 +2132,7 @@ void LLPanelLandOptions::refresh() mSeeAvatarsCtrl->setEnabled(can_change_options && parcel->getHaveNewParcelLimitData()); mSeeAvatarsText->setEnabled(can_change_options && parcel->getHaveNewParcelLimitData()); - BOOL can_change_landing_point = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, + bool can_change_landing_point = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_SET_LANDING_POINT); mLandingTypeCombo->setCurrentByIndex((S32)parcel->getLandingType()); mLandingTypeCombo->setEnabled( can_change_landing_point ); @@ -2166,13 +2167,13 @@ void LLPanelLandOptions::refresh() if (gAgent.wantsPGOnly()) { // Disable these buttons if they are PG (Teen) users - mMatureCtrl->setVisible(FALSE); - mMatureCtrl->setEnabled(FALSE); + mMatureCtrl->setVisible(false); + mMatureCtrl->setEnabled(false); } else { // not teen so fill in the data for the maturity control - mMatureCtrl->setVisible(TRUE); + mMatureCtrl->setVisible(true); LLStyle::Params style; style.image(LLUI::getUIImage(gFloaterView->getParentFloater(this)->getString("maturity_icon_moderate"))); LLCheckBoxWithTBAcess* fullaccess_mature_ctrl = (LLCheckBoxWithTBAcess*)mMatureCtrl; @@ -2180,7 +2181,7 @@ void LLPanelLandOptions::refresh() fullaccess_mature_ctrl->getTextBox()->appendImageSegment(style); fullaccess_mature_ctrl->getTextBox()->appendText(getString("mature_check_mature"), false); fullaccess_mature_ctrl->setToolTip(getString("mature_check_mature_tooltip")); - fullaccess_mature_ctrl->reshape(fullaccess_mature_ctrl->getRect().getWidth(), fullaccess_mature_ctrl->getRect().getHeight(), FALSE); + fullaccess_mature_ctrl->reshape(fullaccess_mature_ctrl->getRect().getWidth(), fullaccess_mature_ctrl->getRect().getHeight(), false); // they can see the checkbox, but its disposition depends on the // state of the region @@ -2189,8 +2190,8 @@ void LLPanelLandOptions::refresh() { if (regionp->getSimAccess() == SIM_ACCESS_PG) { - mMatureCtrl->setEnabled(FALSE); - mMatureCtrl->set(FALSE); + mMatureCtrl->setEnabled(false); + mMatureCtrl->set(false); } else if (regionp->getSimAccess() == SIM_ACCESS_MATURE) { @@ -2199,8 +2200,8 @@ void LLPanelLandOptions::refresh() } else if (regionp->getSimAccess() == SIM_ACCESS_ADULT) { - mMatureCtrl->setEnabled(FALSE); - mMatureCtrl->set(TRUE); + mMatureCtrl->setEnabled(false); + mMatureCtrl->set(true); mMatureCtrl->setLabel(getString("mature_check_adult")); mMatureCtrl->setToolTip(getString("mature_check_adult_tooltip")); } @@ -2222,12 +2223,12 @@ void LLPanelLandOptions::refreshSearch() LLParcel *parcel = mParcel->getParcel(); if (!parcel || gDisconnected) { - mCheckShowDirectory->set(FALSE); - mCheckShowDirectory->setEnabled(FALSE); + mCheckShowDirectory->set(false); + mCheckShowDirectory->setEnabled(false); const std::string& none_string = LLParcel::getCategoryString(LLParcel::C_NONE); mCategoryCombo->setValue(none_string); - mCategoryCombo->setEnabled(FALSE); + mCategoryCombo->setEnabled(false); return; } @@ -2240,7 +2241,7 @@ void LLPanelLandOptions::refreshSearch() && region && !(region->getRegionFlag(REGION_FLAGS_BLOCK_PARCEL_SEARCH)); - BOOL show_directory = parcel->getParcelFlag(PF_SHOW_DIRECTORY); + bool show_directory = parcel->getParcelFlag(PF_SHOW_DIRECTORY); mCheckShowDirectory->set(show_directory); // Set by string in case the order in UI doesn't match the order by index. @@ -2315,21 +2316,21 @@ void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata) } // Extract data from UI - BOOL create_objects = self->mCheckEditObjects->get(); - BOOL create_group_objects = self->mCheckEditGroupObjects->get() || self->mCheckEditObjects->get(); - BOOL all_object_entry = self->mCheckAllObjectEntry->get(); - BOOL group_object_entry = self->mCheckGroupObjectEntry->get() || self->mCheckAllObjectEntry->get(); - BOOL allow_terraform = false; // removed from UI so always off now - self->mCheckEditLand->get(); - BOOL allow_damage = !self->mCheckSafe->get(); - BOOL allow_fly = self->mCheckFly->get(); - BOOL allow_landmark = TRUE; // cannot restrict landmark creation - BOOL allow_other_scripts = self->mCheckOtherScripts->get(); - BOOL allow_group_scripts = self->mCheckGroupScripts->get() || allow_other_scripts; - BOOL allow_publish = FALSE; - BOOL mature_publish = self->mMatureCtrl->get(); - BOOL push_restriction = self->mPushRestrictionCtrl->get(); - BOOL see_avs = self->mSeeAvatarsCtrl->get(); - BOOL show_directory = self->mCheckShowDirectory->get(); + bool create_objects = self->mCheckEditObjects->get(); + bool create_group_objects = self->mCheckEditGroupObjects->get() || self->mCheckEditObjects->get(); + bool all_object_entry = self->mCheckAllObjectEntry->get(); + bool group_object_entry = self->mCheckGroupObjectEntry->get() || self->mCheckAllObjectEntry->get(); + bool allow_terraform = false; // removed from UI so always off now - self->mCheckEditLand->get(); + bool allow_damage = !self->mCheckSafe->get(); + bool allow_fly = self->mCheckFly->get(); + bool allow_landmark = true; // cannot restrict landmark creation + bool allow_other_scripts = self->mCheckOtherScripts->get(); + bool allow_group_scripts = self->mCheckGroupScripts->get() || allow_other_scripts; + bool allow_publish = false; + bool mature_publish = self->mMatureCtrl->get(); + bool push_restriction = self->mPushRestrictionCtrl->get(); + bool see_avs = self->mSeeAvatarsCtrl->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()); S32 landing_type_index = self->mLandingTypeCombo->getCurrentIndex(); @@ -2441,38 +2442,53 @@ LLPanelLandAccess::LLPanelLandAccess(LLParcelSelectionHandle& parcel) } -BOOL LLPanelLandAccess::postBuild() +bool LLPanelLandAccess::postBuild() { - childSetCommitCallback("public_access", onCommitPublicAccess, this); - childSetCommitCallback("limit_payment", onCommitAny, this); - childSetCommitCallback("limit_age_verified", onCommitAny, this); - childSetCommitCallback("GroupCheck", onCommitGroupCheck, this); - childSetCommitCallback("PassCheck", onCommitAny, this); - childSetCommitCallback("pass_combo", onCommitAny, this); - childSetCommitCallback("PriceSpin", onCommitAny, this); - childSetCommitCallback("HoursSpin", onCommitAny, this); + mPaymentInfoCheck = getChild<LLUICtrl>("limit_payment"); + mPaymentInfoCheck->setCommitCallback(onCommitAny, this); + mAgeVerifiedCheck = getChild<LLUICtrl>("limit_age_verified"); + mAgeVerifiedCheck->setCommitCallback(onCommitAny, this); + mTemporaryPassCheck = getChild<LLUICtrl>("PassCheck"); + mTemporaryPassCheck->setCommitCallback(onCommitAny, this); + mPublicAccessCheck = getChild<LLUICtrl>("public_access"); + mPublicAccessCheck->setCommitCallback(onCommitPublicAccess, this); + mGroupAccessCheck = getChild<LLUICtrl>("GroupCheck"); + mGroupAccessCheck->setCommitCallback(onCommitGroupCheck, this); + mTemporaryPassCombo = getChild<LLComboBox>("pass_combo"); + mGroupAccessCheck->setCommitCallback(onCommitAny, this); + mTemporaryPassPriceSpin = getChild<LLUICtrl>("PriceSpin"); + mGroupAccessCheck->setCommitCallback(onCommitAny, this); + mTemporaryPassHourSpin = getChild<LLUICtrl>("HoursSpin"); + mGroupAccessCheck->setCommitCallback(onCommitAny, this); - childSetAction("add_allowed", boost::bind(&LLPanelLandAccess::onClickAddAccess, this)); - childSetAction("remove_allowed", onClickRemoveAccess, this); - childSetAction("add_banned", boost::bind(&LLPanelLandAccess::onClickAddBanned, this)); - childSetAction("remove_banned", onClickRemoveBanned, this); + mAllowText = getChild<LLUICtrl>("AllowedText"); + mBanText = getChild<LLUICtrl>("BanCheck"); + + mBtnAddAllowed = getChild<LLButton>("add_allowed"); + mBtnAddAllowed->setCommitCallback(boost::bind(&LLPanelLandAccess::onClickAddAccess, this)); + mBtnRemoveAllowed = getChild<LLButton>("remove_allowed"); + mBtnRemoveAllowed->setCommitCallback(boost::bind(&LLPanelLandAccess::onClickRemoveAccess, this)); + mBtnAddBanned = getChild<LLButton>("add_banned"); + mBtnAddBanned->setCommitCallback(boost::bind(&LLPanelLandAccess::onClickAddBanned, this)); + mBtnRemoveBanned = getChild<LLButton>("remove_banned"); + mBtnRemoveBanned->setCommitCallback(boost::bind(&LLPanelLandAccess::onClickRemoveBanned, this)); mListAccess = getChild<LLNameListCtrl>("AccessList"); if (mListAccess) { - mListAccess->sortByColumnIndex(0, TRUE); // ascending + mListAccess->sortByColumnIndex(0, true); // ascending mListAccess->setContextMenu(LLScrollListCtrl::MENU_AVATAR); } mListBanned = getChild<LLNameListCtrl>("BannedList"); if (mListBanned) { - mListBanned->sortByColumnIndex(0, TRUE); // ascending + mListBanned->sortByColumnIndex(0, true); // ascending mListBanned->setContextMenu(LLScrollListCtrl::MENU_AVATAR); mListBanned->setAlternateSort(); } - return TRUE; + return true; } @@ -2488,23 +2504,23 @@ void LLPanelLandAccess::refresh() // Display options if (parcel && !gDisconnected) { - BOOL use_access_list = parcel->getParcelFlag(PF_USE_ACCESS_LIST); - BOOL use_group = parcel->getParcelFlag(PF_USE_ACCESS_GROUP); - BOOL public_access = !use_access_list; + bool use_access_list = parcel->getParcelFlag(PF_USE_ACCESS_LIST); + bool use_group = parcel->getParcelFlag(PF_USE_ACCESS_GROUP); + bool public_access = !use_access_list; if (parcel->getRegionAllowAccessOverride()) { - getChild<LLUICtrl>("public_access")->setValue(public_access); - getChild<LLUICtrl>("GroupCheck")->setValue(use_group); + mPublicAccessCheck->setValue(public_access); + mGroupAccessCheck->setValue(use_group); } else { - getChild<LLUICtrl>("public_access")->setValue(TRUE); - getChild<LLUICtrl>("GroupCheck")->setValue(FALSE); + mPublicAccessCheck->setValue(true); + mGroupAccessCheck->setValue(false); } std::string group_name; gCacheName->getGroupName(parcel->getGroupID(), group_name); - getChild<LLUICtrl>("GroupCheck")->setLabelArg("[GROUP]", group_name ); + mGroupAccessCheck->setLabelArg("[GROUP]", group_name ); // Allow list if (mListAccess) @@ -2512,12 +2528,12 @@ void LLPanelLandAccess::refresh() // Clear the sort order so we don't re-sort on every add. mListAccess->clearSortOrder(); mListAccess->deleteAllItems(); - S32 count = parcel->mAccessList.size(); - getChild<LLUICtrl>("AllowedText")->setTextArg("[COUNT]", llformat("%d",count)); - getChild<LLUICtrl>("AllowedText")->setTextArg("[MAX]", llformat("%d",PARCEL_MAX_ACCESS_LIST)); + auto count = parcel->mAccessList.size(); + mAllowText->setTextArg("[COUNT]", llformat("%d", count)); + mAllowText->setTextArg("[MAX]", llformat("%d",PARCEL_MAX_ACCESS_LIST)); - getChild<LLUICtrl>("AccessList")->setToolTipArg(LLStringExplicit("[LISTED]"), llformat("%d",count)); - getChild<LLUICtrl>("AccessList")->setToolTipArg(LLStringExplicit("[MAX]"), llformat("%d",PARCEL_MAX_ACCESS_LIST)); + mListAccess->setToolTipArg(LLStringExplicit("[LISTED]"), llformat("%d",count)); + mListAccess->setToolTipArg(LLStringExplicit("[MAX]"), llformat("%d",PARCEL_MAX_ACCESS_LIST)); for (LLAccessEntry::map::const_iterator cit = parcel->mAccessList.begin(); cit != parcel->mAccessList.end(); ++cit) @@ -2527,7 +2543,7 @@ void LLPanelLandAccess::refresh() if (entry.mTime != 0) { LLStringUtil::format_map_t args; - S32 now = time(NULL); + S32 now = (S32)time(NULL); S32 seconds = entry.mTime - now; if (seconds < 0) seconds = 0; prefix.assign(" ("); @@ -2549,9 +2565,9 @@ void LLPanelLandAccess::refresh() } prefix.append(" " + parent_floater->getString("Remaining") + ") "); } - mListAccess->addNameItem(entry.mID, ADD_DEFAULT, TRUE, "", prefix); + mListAccess->addNameItem(entry.mID, ADD_DEFAULT, true, "", prefix); } - mListAccess->sortByName(TRUE); + mListAccess->sortByName(true); } // Ban List @@ -2560,12 +2576,12 @@ void LLPanelLandAccess::refresh() // Clear the sort order so we don't re-sort on every add. mListBanned->clearSortOrder(); mListBanned->deleteAllItems(); - S32 count = parcel->mBanList.size(); - getChild<LLUICtrl>("BanCheck")->setTextArg("[COUNT]", llformat("%d",count)); - getChild<LLUICtrl>("BanCheck")->setTextArg("[MAX]", llformat("%d",PARCEL_MAX_ACCESS_LIST)); + auto count = parcel->mBanList.size(); + mBanText->setTextArg("[COUNT]", llformat("%d",count)); + mBanText->setTextArg("[MAX]", llformat("%d",PARCEL_MAX_ACCESS_LIST)); - getChild<LLUICtrl>("BannedList")->setToolTipArg(LLStringExplicit("[LISTED]"), llformat("%d",count)); - getChild<LLUICtrl>("BannedList")->setToolTipArg(LLStringExplicit("[MAX]"), llformat("%d",PARCEL_MAX_ACCESS_LIST)); + mListBanned->setToolTipArg(LLStringExplicit("[LISTED]"), llformat("%d",count)); + mListBanned->setToolTipArg(LLStringExplicit("[MAX]"), llformat("%d",PARCEL_MAX_ACCESS_LIST)); for (LLAccessEntry::map::const_iterator cit = parcel->mBanList.begin(); cit != parcel->mBanList.end(); ++cit) @@ -2576,7 +2592,7 @@ void LLPanelLandAccess::refresh() if (entry.mTime != 0) { LLStringUtil::format_map_t args; - S32 now = time(NULL); + S32 now = (S32)time(NULL); seconds = entry.mTime - now; if (seconds < 0) seconds = 0; @@ -2617,159 +2633,149 @@ void LLPanelLandAccess::refresh() columns[1]["alt_value"] = entry.mTime != 0 ? std::to_string(seconds) : "Always"; mListBanned->addElement(item); } - mListBanned->sortByName(TRUE); + mListBanned->sortByName(true); } if(parcel->getRegionDenyAnonymousOverride()) { - getChild<LLUICtrl>("limit_payment")->setValue(TRUE); - getChild<LLUICtrl>("limit_payment")->setLabelArg("[ESTATE_PAYMENT_LIMIT]", getString("access_estate_defined") ); + mPaymentInfoCheck->setValue(true); + mPaymentInfoCheck->setLabelArg("[ESTATE_PAYMENT_LIMIT]", getString("access_estate_defined") ); } else { - getChild<LLUICtrl>("limit_payment")->setValue((parcel->getParcelFlag(PF_DENY_ANONYMOUS))); - getChild<LLUICtrl>("limit_payment")->setLabelArg("[ESTATE_PAYMENT_LIMIT]", std::string() ); + mPaymentInfoCheck->setValue((parcel->getParcelFlag(PF_DENY_ANONYMOUS))); + mPaymentInfoCheck->setLabelArg("[ESTATE_PAYMENT_LIMIT]", std::string() ); } if(parcel->getRegionDenyAgeUnverifiedOverride()) { - getChild<LLUICtrl>("limit_age_verified")->setValue(TRUE); - getChild<LLUICtrl>("limit_age_verified")->setLabelArg("[ESTATE_AGE_LIMIT]", getString("access_estate_defined") ); + mAgeVerifiedCheck->setValue(true); + mAgeVerifiedCheck->setLabelArg("[ESTATE_AGE_LIMIT]", getString("access_estate_defined") ); } else { - getChild<LLUICtrl>("limit_age_verified")->setValue((parcel->getParcelFlag(PF_DENY_AGEUNVERIFIED))); - getChild<LLUICtrl>("limit_age_verified")->setLabelArg("[ESTATE_AGE_LIMIT]", std::string() ); + mAgeVerifiedCheck->setValue((parcel->getParcelFlag(PF_DENY_AGEUNVERIFIED))); + mAgeVerifiedCheck->setLabelArg("[ESTATE_AGE_LIMIT]", std::string() ); } - BOOL use_pass = parcel->getParcelFlag(PF_USE_PASS_LIST); - getChild<LLUICtrl>("PassCheck")->setValue(use_pass); - LLCtrlSelectionInterface* passcombo = childGetSelectionInterface("pass_combo"); - if (passcombo) + bool use_pass = parcel->getParcelFlag(PF_USE_PASS_LIST); + mTemporaryPassCheck->setValue(use_pass); + if (mTemporaryPassCombo) { if (public_access || !use_pass) { - passcombo->selectByValue("anyone"); + mTemporaryPassCombo->selectByValue("anyone"); } } S32 pass_price = parcel->getPassPrice(); - getChild<LLUICtrl>("PriceSpin")->setValue((F32)pass_price ); + mTemporaryPassPriceSpin->setValue((F32)pass_price); F32 pass_hours = parcel->getPassHours(); - getChild<LLUICtrl>("HoursSpin")->setValue(pass_hours ); + mTemporaryPassHourSpin->setValue(pass_hours); } else { - getChild<LLUICtrl>("public_access")->setValue(FALSE); - getChild<LLUICtrl>("limit_payment")->setValue(FALSE); - getChild<LLUICtrl>("limit_age_verified")->setValue(FALSE); - getChild<LLUICtrl>("GroupCheck")->setValue(FALSE); - getChild<LLUICtrl>("GroupCheck")->setLabelArg("[GROUP]", LLStringUtil::null ); - getChild<LLUICtrl>("PassCheck")->setValue(FALSE); - getChild<LLUICtrl>("PriceSpin")->setValue((F32)PARCEL_PASS_PRICE_DEFAULT); - getChild<LLUICtrl>("HoursSpin")->setValue(PARCEL_PASS_HOURS_DEFAULT ); - getChild<LLUICtrl>("AccessList")->setToolTipArg(LLStringExplicit("[LISTED]"), llformat("%d",0)); - getChild<LLUICtrl>("AccessList")->setToolTipArg(LLStringExplicit("[MAX]"), llformat("%d",0)); - getChild<LLUICtrl>("BannedList")->setToolTipArg(LLStringExplicit("[LISTED]"), llformat("%d",0)); - getChild<LLUICtrl>("BannedList")->setToolTipArg(LLStringExplicit("[MAX]"), llformat("%d",0)); + mPublicAccessCheck->setValue(false); + mPaymentInfoCheck->setValue(false); + mAgeVerifiedCheck->setValue(false); + mGroupAccessCheck->setValue(false); + mGroupAccessCheck->setLabelArg("[GROUP]", LLStringUtil::null ); + mTemporaryPassCheck->setValue(false); + mTemporaryPassPriceSpin->setValue((F32)PARCEL_PASS_PRICE_DEFAULT); + mTemporaryPassHourSpin->setValue(PARCEL_PASS_HOURS_DEFAULT ); + mListAccess->setToolTipArg(LLStringExplicit("[LISTED]"), llformat("%d",0)); + mListAccess->setToolTipArg(LLStringExplicit("[MAX]"), llformat("%d",0)); + mListBanned->setToolTipArg(LLStringExplicit("[LISTED]"), llformat("%d",0)); + mListBanned->setToolTipArg(LLStringExplicit("[MAX]"), llformat("%d",0)); } } void LLPanelLandAccess::refresh_ui() { - getChildView("public_access")->setEnabled(FALSE); - getChildView("limit_payment")->setEnabled(FALSE); - getChildView("limit_age_verified")->setEnabled(FALSE); - getChildView("GroupCheck")->setEnabled(FALSE); - getChildView("PassCheck")->setEnabled(FALSE); - getChildView("pass_combo")->setEnabled(FALSE); - getChildView("PriceSpin")->setEnabled(FALSE); - getChildView("HoursSpin")->setEnabled(FALSE); - getChildView("AccessList")->setEnabled(FALSE); - getChildView("BannedList")->setEnabled(FALSE); - getChildView("add_allowed")->setEnabled(FALSE); - getChildView("remove_allowed")->setEnabled(FALSE); - getChildView("add_banned")->setEnabled(FALSE); - getChildView("remove_banned")->setEnabled(FALSE); + mPublicAccessCheck->setEnabled(false); + mPaymentInfoCheck->setEnabled(false); + mAgeVerifiedCheck->setEnabled(false); + mGroupAccessCheck->setEnabled(false); + mTemporaryPassCheck->setEnabled(false); + mTemporaryPassCombo->setEnabled(false); + mTemporaryPassPriceSpin->setEnabled(false); + mTemporaryPassHourSpin->setEnabled(false); + mListAccess->setEnabled(false); + mListBanned->setEnabled(false); + mBtnAddAllowed->setEnabled(false); + mBtnRemoveAllowed->setEnabled(false); + mBtnAddBanned->setEnabled(false); + mBtnRemoveBanned->setEnabled(false); LLParcel *parcel = mParcel->getParcel(); if (parcel && !gDisconnected) { - BOOL can_manage_allowed = false; - BOOL can_manage_banned = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_MANAGE_BANNED); + bool can_manage_allowed = false; + bool can_manage_banned = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_MANAGE_BANNED); if (parcel->getRegionAllowAccessOverride()) { // Estate owner may have disabled allowing the parcel owner from managing access. can_manage_allowed = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_MANAGE_ALLOWED); } - getChildView("public_access")->setEnabled(can_manage_allowed); - BOOL public_access = getChild<LLUICtrl>("public_access")->getValue().asBoolean(); + mPublicAccessCheck->setEnabled(can_manage_allowed); + bool public_access = mPublicAccessCheck->getValue().asBoolean(); if (public_access) { bool override = false; if(parcel->getRegionDenyAnonymousOverride()) { override = true; - getChildView("limit_payment")->setEnabled(FALSE); + mPaymentInfoCheck->setEnabled(false); } else { - getChildView("limit_payment")->setEnabled(can_manage_allowed); + mPaymentInfoCheck->setEnabled(can_manage_allowed); } if(parcel->getRegionDenyAgeUnverifiedOverride()) { override = true; - getChildView("limit_age_verified")->setEnabled(FALSE); + mAgeVerifiedCheck->setEnabled(false); } else { - getChildView("limit_age_verified")->setEnabled(can_manage_allowed); + mAgeVerifiedCheck->setEnabled(can_manage_allowed); } - if (override) - { - getChildView("Only Allow")->setToolTip(getString("estate_override")); - } - else - { - getChildView("Only Allow")->setToolTip(std::string()); - } - getChildView("PassCheck")->setEnabled(FALSE); - getChildView("pass_combo")->setEnabled(FALSE); - getChildView("AccessList")->setEnabled(FALSE); + mTemporaryPassCheck->setEnabled(false); + mTemporaryPassCombo->setEnabled(false); + mListAccess->setEnabled(false); } else { - getChildView("limit_payment")->setEnabled(FALSE); - getChildView("limit_age_verified")->setEnabled(FALSE); - + mPaymentInfoCheck->setEnabled(false); + mAgeVerifiedCheck->setEnabled(false); - BOOL sell_passes = getChild<LLUICtrl>("PassCheck")->getValue().asBoolean(); - getChildView("PassCheck")->setEnabled(can_manage_allowed); + bool sell_passes = mTemporaryPassCheck->getValue().asBoolean(); + mTemporaryPassCheck->setEnabled(can_manage_allowed); if (sell_passes) { - getChildView("pass_combo")->setEnabled(can_manage_allowed); - getChildView("PriceSpin")->setEnabled(can_manage_allowed); - getChildView("HoursSpin")->setEnabled(can_manage_allowed); + mTemporaryPassCombo->setEnabled(can_manage_allowed); + mTemporaryPassPriceSpin->setEnabled(can_manage_allowed); + mTemporaryPassHourSpin->setEnabled(can_manage_allowed); } } std::string group_name; if (gCacheName->getGroupName(parcel->getGroupID(), group_name)) { - bool can_allow_groups = !public_access || (public_access && (getChild<LLUICtrl>("limit_payment")->getValue().asBoolean() ^ getChild<LLUICtrl>("limit_age_verified")->getValue().asBoolean())); - getChildView("GroupCheck")->setEnabled(can_manage_allowed && can_allow_groups); + bool can_allow_groups = !public_access || (public_access && (mPaymentInfoCheck->getValue().asBoolean() ^ mAgeVerifiedCheck->getValue().asBoolean())); + mGroupAccessCheck->setEnabled(can_manage_allowed && can_allow_groups); } - getChildView("AccessList")->setEnabled(can_manage_allowed); - S32 allowed_list_count = parcel->mAccessList.size(); - getChildView("add_allowed")->setEnabled(can_manage_allowed && allowed_list_count < PARCEL_MAX_ACCESS_LIST); - BOOL has_selected = (mListAccess && mListAccess->getSelectionInterface()->getFirstSelectedIndex() >= 0); - getChildView("remove_allowed")->setEnabled(can_manage_allowed && has_selected); + mListAccess->setEnabled(can_manage_allowed); + auto allowed_list_count = parcel->mAccessList.size(); + mBtnAddAllowed->setEnabled(can_manage_allowed && allowed_list_count < PARCEL_MAX_ACCESS_LIST); + bool has_selected = (mListAccess && mListAccess->getSelectionInterface()->getFirstSelectedIndex() >= 0); + mBtnRemoveAllowed->setEnabled(can_manage_allowed && has_selected); - getChildView("BannedList")->setEnabled(can_manage_banned); - S32 banned_list_count = parcel->mBanList.size(); - getChildView("add_banned")->setEnabled(can_manage_banned && banned_list_count < PARCEL_MAX_ACCESS_LIST); + mListBanned->setEnabled(can_manage_banned); + auto banned_list_count = parcel->mBanList.size(); + mBtnAddBanned->setEnabled(can_manage_banned && banned_list_count < PARCEL_MAX_ACCESS_LIST); has_selected = (mListBanned && mListBanned->getSelectionInterface()->getFirstSelectedIndex() >= 0); - getChildView("remove_banned")->setEnabled(can_manage_banned && has_selected); + mBtnRemoveBanned->setEnabled(can_manage_banned && has_selected); } } @@ -2783,7 +2789,7 @@ void LLPanelLandAccess::refreshNames() { gCacheName->getGroupName(parcel->getGroupID(), group_name); } - getChild<LLUICtrl>("GroupCheck")->setLabelArg("[GROUP]", group_name); + mGroupAccessCheck->setLabelArg("[GROUP]", group_name); } @@ -2817,9 +2823,9 @@ void LLPanelLandAccess::onCommitGroupCheck(LLUICtrl *ctrl, void *userdata) return; } - BOOL use_pass_list = !self->getChild<LLUICtrl>("public_access")->getValue().asBoolean(); - BOOL use_access_group = self->getChild<LLUICtrl>("GroupCheck")->getValue().asBoolean(); - LLCtrlSelectionInterface* passcombo = self->childGetSelectionInterface("pass_combo"); + bool use_pass_list = !self->mPublicAccessCheck->getValue().asBoolean(); + bool use_access_group = self->mGroupAccessCheck->getValue().asBoolean(); + LLCtrlSelectionInterface* passcombo = self->mTemporaryPassCombo; if (passcombo) { if (use_access_group && use_pass_list) @@ -2846,52 +2852,52 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) } // Extract data from UI - BOOL public_access = self->getChild<LLUICtrl>("public_access")->getValue().asBoolean(); - BOOL use_access_group = self->getChild<LLUICtrl>("GroupCheck")->getValue().asBoolean(); + bool public_access = self->mPublicAccessCheck->getValue().asBoolean(); + bool use_access_group = self->mGroupAccessCheck->getValue().asBoolean(); if (use_access_group) { std::string group_name; if (!gCacheName->getGroupName(parcel->getGroupID(), group_name)) { - use_access_group = FALSE; + use_access_group = false; } } - BOOL limit_payment = FALSE, limit_age_verified = FALSE; - BOOL use_access_list = FALSE; - BOOL use_pass_list = FALSE; + bool limit_payment = false, limit_age_verified = false; + bool use_access_list = false; + bool use_pass_list = false; if (public_access) { - use_access_list = FALSE; - limit_payment = self->getChild<LLUICtrl>("limit_payment")->getValue().asBoolean(); - limit_age_verified = self->getChild<LLUICtrl>("limit_age_verified")->getValue().asBoolean(); + use_access_list = false; + limit_payment = self->mPaymentInfoCheck->getValue().asBoolean(); + limit_age_verified = self->mAgeVerifiedCheck->getValue().asBoolean(); } else { - use_access_list = TRUE; - use_pass_list = self->getChild<LLUICtrl>("PassCheck")->getValue().asBoolean(); - LLCtrlSelectionInterface* passcombo = self->childGetSelectionInterface("pass_combo"); + use_access_list = true; + use_pass_list = self->mTemporaryPassCheck->getValue().asBoolean(); + LLCtrlSelectionInterface* passcombo = self->mTemporaryPassCombo; if (passcombo) { if (use_access_group && use_pass_list) { if (passcombo->getSelectedValue().asString() == "group") { - use_access_group = FALSE; + use_access_group = false; } } } } - S32 pass_price = llfloor((F32)self->getChild<LLUICtrl>("PriceSpin")->getValue().asReal()); - F32 pass_hours = (F32)self->getChild<LLUICtrl>("HoursSpin")->getValue().asReal(); + S32 pass_price = llfloor((F32)self->mTemporaryPassPriceSpin->getValue().asReal()); + F32 pass_hours = (F32)self->mTemporaryPassHourSpin->getValue().asReal(); // Push data into current parcel parcel->setParcelFlag(PF_USE_ACCESS_GROUP, use_access_group); parcel->setParcelFlag(PF_USE_ACCESS_LIST, use_access_list); parcel->setParcelFlag(PF_USE_PASS_LIST, use_pass_list); - parcel->setParcelFlag(PF_USE_BAN_LIST, TRUE); + parcel->setParcelFlag(PF_USE_BAN_LIST, true); parcel->setParcelFlag(PF_DENY_ANONYMOUS, limit_payment); parcel->setParcelFlag(PF_DENY_AGEUNVERIFIED, limit_age_verified); @@ -2907,10 +2913,9 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) void LLPanelLandAccess::onClickAddAccess() { - LLView * button = findChild<LLButton>("add_allowed"); LLFloater * root_floater = gFloaterView->getParentFloater(this); LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show( - boost::bind(&LLPanelLandAccess::callbackAvatarCBAccess, this, _1), FALSE, FALSE, FALSE, root_floater->getName(), button); + boost::bind(&LLPanelLandAccess::callbackAvatarCBAccess, this, _1), false, false, false, root_floater->getName(), mBtnAddAllowed); if (picker) { root_floater->addDependentFloater(picker); @@ -2938,16 +2943,14 @@ void LLPanelLandAccess::callbackAvatarCBAccess(const uuid_vec_t& ids) } } -// static -void LLPanelLandAccess::onClickRemoveAccess(void* data) +void LLPanelLandAccess::onClickRemoveAccess() { - LLPanelLandAccess* panelp = (LLPanelLandAccess*)data; - if (panelp && panelp->mListAccess) + if (mListAccess) { - LLParcel* parcel = panelp->mParcel->getParcel(); + LLParcel* parcel = mParcel->getParcel(); if (parcel) { - std::vector<LLScrollListItem*> names = panelp->mListAccess->getAllSelected(); + std::vector<LLScrollListItem*> names = mListAccess->getAllSelected(); for (std::vector<LLScrollListItem*>::iterator iter = names.begin(); iter != names.end(); ) { @@ -2956,18 +2959,16 @@ void LLPanelLandAccess::onClickRemoveAccess(void* data) parcel->removeFromAccessList(agent_id); } LLViewerParcelMgr::getInstance()->sendParcelAccessListUpdate(AL_ACCESS); - panelp->refresh(); + refresh(); } } } -// static void LLPanelLandAccess::onClickAddBanned() { - LLView * button = findChild<LLButton>("add_banned"); LLFloater * root_floater = gFloaterView->getParentFloater(this); LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show( - boost::bind(&LLPanelLandAccess::callbackAvatarCBBanned, this, _1), TRUE, FALSE, FALSE, root_floater->getName(), button); + boost::bind(&LLPanelLandAccess::callbackAvatarCBBanned, this, _1), true, false, false, root_floater->getName(), mBtnAddBanned); if (picker) { root_floater->addDependentFloater(picker); @@ -3014,16 +3015,14 @@ void LLPanelLandAccess::callbackAvatarCBBanned2(const uuid_vec_t& ids, S32 durat } } -// static -void LLPanelLandAccess::onClickRemoveBanned(void* data) +void LLPanelLandAccess::onClickRemoveBanned() { - LLPanelLandAccess* panelp = (LLPanelLandAccess*)data; - if (panelp && panelp->mListBanned) + if (mListBanned) { - LLParcel* parcel = panelp->mParcel->getParcel(); + LLParcel* parcel = mParcel->getParcel(); if (parcel) { - std::vector<LLScrollListItem*> names = panelp->mListBanned->getAllSelected(); + std::vector<LLScrollListItem*> names = mListBanned->getAllSelected(); for (std::vector<LLScrollListItem*>::iterator iter = names.begin(); iter != names.end(); ) { @@ -3032,7 +3031,7 @@ void LLPanelLandAccess::onClickRemoveBanned(void* data) parcel->removeFromBanList(agent_id); } LLViewerParcelMgr::getInstance()->sendParcelAccessListUpdate(AL_BAN); - panelp->refresh(); + refresh(); } } } @@ -3051,13 +3050,13 @@ LLPanelLandCovenant::~LLPanelLandCovenant() { } -BOOL LLPanelLandCovenant::postBuild() +bool LLPanelLandCovenant::postBuild() { mLastRegionID = LLUUID::null; mNextUpdateTime = 0; mTextEstateOwner = getChild<LLTextBox>("estate_owner_text"); mTextEstateOwner->setIsFriendCallback(LLAvatarActions::isFriend); - return TRUE; + return true; } // virtual @@ -3126,6 +3125,16 @@ void LLPanelLandCovenant::refresh() } // static +void LLPanelLandCovenant::updateCovenant(const LLTextBase* source) +{ + if (LLPanelLandCovenant* self = LLFloaterLand::getCurrentPanelLandCovenant()) + { + LLViewerTextEditor* editor = self->getChild<LLViewerTextEditor>("covenant_editor"); + editor->copyContents(source); + } +} + +// static void LLPanelLandCovenant::updateCovenantText(const std::string &string) { LLPanelLandCovenant* self = LLFloaterLand::getCurrentPanelLandCovenant(); @@ -3224,7 +3233,7 @@ LLPanelLandExperiences::LLPanelLandExperiences( LLSafeHandle<LLParcelSelection>& } -BOOL LLPanelLandExperiences::postBuild() +bool LLPanelLandExperiences::postBuild() { mAllowed = setupList("panel_allowed", EXPERIENCE_KEY_TYPE_ALLOWED, AL_ALLOW_EXPERIENCE); mBlocked = setupList("panel_blocked", EXPERIENCE_KEY_TYPE_BLOCKED, AL_BLOCK_EXPERIENCE); @@ -3235,8 +3244,8 @@ BOOL LLPanelLandExperiences::postBuild() // no privileged ones mBlocked->addFilter(boost::bind(LLPanelExperiencePicker::FilterWithoutProperties, _1, LLExperienceCache::PROPERTY_PRIVILEGED|LLExperienceCache::PROPERTY_GRID)); - getChild<LLLayoutPanel>("trusted_layout_panel")->setVisible(FALSE); - getChild<LLTextBox>("experiences_help_text")->setVisible(FALSE); + getChild<LLLayoutPanel>("trusted_layout_panel")->setVisible(false); + getChild<LLTextBox>("experiences_help_text")->setVisible(false); getChild<LLTextBox>("allowed_text_help")->setText(getString("allowed_parcel_text")); getChild<LLTextBox>("blocked_text_help")->setText(getString("blocked_parcel_text")); @@ -3291,13 +3300,13 @@ void LLPanelLandExperiences::refreshPanel(LLPanelExperienceListEditor* panel, U3 if (!parcel || gDisconnected) { // disable the panel - panel->setEnabled(FALSE); + panel->setEnabled(false); panel->setExperienceIds(LLSD::emptyArray()); } else { // enable the panel - panel->setEnabled(TRUE); + panel->setEnabled(true); LLAccessEntry::map entries = parcel->getExperienceKeysByType(xp_type); LLAccessEntry::map::iterator it = entries.begin(); LLSD ids = LLSD::emptyArray(); @@ -3326,17 +3335,17 @@ LLPanelLandEnvironment::LLPanelLandEnvironment(LLParcelSelectionHandle& parcel) { } -BOOL LLPanelLandEnvironment::postBuild() +bool LLPanelLandEnvironment::postBuild() { if (!LLPanelEnvironmentInfo::postBuild()) - return FALSE; + return false; - getChild<LLUICtrl>(BTN_USEDEFAULT)->setLabelArg("[USEDEFAULT]", getString(STR_LABEL_USEREGION)); - getChild<LLUICtrl>(CHK_ALLOWOVERRIDE)->setVisible(FALSE); - getChild<LLUICtrl>(PNL_REGION_MSG)->setVisible(FALSE); - getChild<LLUICtrl>(PNL_ENVIRONMENT_ALTITUDES)->setVisible(TRUE); + mBtnUseDefault->setLabelArg("[USEDEFAULT]", getString(STR_LABEL_USEREGION)); + mCheckAllowOverride->setVisible(false); + mPanelEnvRegionMsg->setVisible(false); + mPanelEnvAltitudes->setVisible(true); - return TRUE; + return true; } void LLPanelLandEnvironment::refresh() |