From 00711916fd43927a489bbae9e6927c533b399d4c Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Fri, 30 Jul 2010 09:40:41 -0700 Subject: converted static callbacks to member functions and deprecated LLPanel::child*() methods --- indra/newview/llfloaterland.cpp | 173 +++++++++++++++++++--------------------- 1 file changed, 82 insertions(+), 91 deletions(-) (limited to 'indra/newview/llfloaterland.cpp') diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 913bb676b0..5c26344436 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -371,7 +371,7 @@ BOOL LLPanelLandGeneral::postBuild() { mEditName = getChild("Name"); mEditName->setCommitCallback(onCommitAny, this); - childSetPrevalidate("Name", LLTextValidate::validateASCIIPrintableNoPipe); + getChild("Name")->setPrevalidate(LLTextValidate::validateASCIIPrintableNoPipe); mEditDesc = getChild("Description"); mEditDesc->setCommitOnFocusLost(TRUE); @@ -388,7 +388,7 @@ BOOL LLPanelLandGeneral::postBuild() mLandType = getChild("LandTypeText"); mBtnProfile = getChild("Profile..."); - mBtnProfile->setClickedCallback(onClickProfile, this); + mBtnProfile->setClickedCallback(boost::bind(&LLPanelLandGeneral::onClickProfile, this)); mTextGroupLabel = getChild("Group:"); @@ -865,11 +865,9 @@ void LLPanelLandGeneral::onClickSetGroup() } } -// static -void LLPanelLandGeneral::onClickProfile(void* data) +void LLPanelLandGeneral::onClickProfile() { - LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data; - LLParcel* parcel = panelp->mParcel->getParcel(); + LLParcel* parcel = mParcel->getParcel(); if (!parcel) return; if (parcel->getIsGroupOwned()) @@ -920,13 +918,6 @@ void LLPanelLandGeneral::onClickScriptLimits(void* data) } } -BOOL LLPanelLandGeneral::enableDeedToGroup(void* data) -{ - LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data; - LLParcel* parcel = panelp->mParcel->getParcel(); - return (parcel != NULL) && (parcel->getParcelFlag(PF_ALLOW_DEED_TO_GROUP)); -} - // static void LLPanelLandGeneral::onClickDeed(void*) { @@ -1140,7 +1131,7 @@ BOOL LLPanelLandObjects::postBuild() mCleanOtherObjectsTime->setFocusLostCallback(boost::bind(onLostFocus, _1, this)); mCleanOtherObjectsTime->setCommitCallback(onCommitClean, this); - childSetPrevalidate("clean other time", LLTextValidate::validateNonNegativeS32); + getChild("clean other time")->setPrevalidate(LLTextValidate::validateNonNegativeS32); mBtnRefresh = getChild("Refresh List"); mBtnRefresh->setClickedCallback(onClickRefresh, this); @@ -2404,18 +2395,18 @@ void LLPanelLandAccess::refresh() BOOL use_group = parcel->getParcelFlag(PF_USE_ACCESS_GROUP); BOOL public_access = !use_access_list && !use_group; - childSetValue("public_access", public_access ); - childSetValue("GroupCheck", use_group ); + getChild("public_access")->setValue(public_access ); + getChild("GroupCheck")->setValue(use_group ); std::string group_name; gCacheName->getGroupName(parcel->getGroupID(), group_name); - childSetLabelArg("GroupCheck", "[GROUP]", group_name ); + getChild("GroupCheck")->setLabelArg("[GROUP]", group_name ); // Allow list { S32 count = parcel->mAccessList.size(); - childSetToolTipArg("AccessList", "[LISTED]", llformat("%d",count)); - childSetToolTipArg("AccessList", "[MAX]", llformat("%d",PARCEL_MAX_ACCESS_LIST)); + getChild("AccessList")->setToolTipArg(LLStringExplicit("[LISTED]"), llformat("%d",count)); + getChild("AccessList")->setToolTipArg(LLStringExplicit("[MAX]"), llformat("%d",PARCEL_MAX_ACCESS_LIST)); for (access_map_const_iterator cit = parcel->mAccessList.begin(); cit != parcel->mAccessList.end(); ++cit) @@ -2456,8 +2447,8 @@ void LLPanelLandAccess::refresh() { S32 count = parcel->mBanList.size(); - childSetToolTipArg("BannedList", "[LISTED]", llformat("%d",count)); - childSetToolTipArg("BannedList", "[MAX]", llformat("%d",PARCEL_MAX_ACCESS_LIST)); + getChild("BannedList")->setToolTipArg(LLStringExplicit("[LISTED]"), llformat("%d",count)); + getChild("BannedList")->setToolTipArg(LLStringExplicit("[MAX]"), llformat("%d",PARCEL_MAX_ACCESS_LIST)); for (access_map_const_iterator cit = parcel->mBanList.begin(); cit != parcel->mBanList.end(); ++cit) @@ -2516,27 +2507,27 @@ void LLPanelLandAccess::refresh() if(parcel->getRegionDenyAnonymousOverride()) { - childSetValue("limit_payment", TRUE); - childSetLabelArg( "limit_payment", "[ESTATE_PAYMENT_LIMIT]", getString("access_estate_defined") ); + getChild("limit_payment")->setValue(TRUE); + getChild("limit_payment")->setLabelArg("[ESTATE_PAYMENT_LIMIT]", getString("access_estate_defined") ); } else { - childSetValue("limit_payment", (parcel->getParcelFlag(PF_DENY_ANONYMOUS))); - childSetLabelArg( "limit_payment", "[ESTATE_PAYMENT_LIMIT]", std::string() ); + getChild("limit_payment")->setValue((parcel->getParcelFlag(PF_DENY_ANONYMOUS))); + getChild("limit_payment")->setLabelArg("[ESTATE_PAYMENT_LIMIT]", std::string() ); } if(parcel->getRegionDenyAgeUnverifiedOverride()) { - childSetValue("limit_age_verified", TRUE); - childSetLabelArg( "limit_age_verified", "[ESTATE_AGE_LIMIT]", getString("access_estate_defined") ); + getChild("limit_age_verified")->setValue(TRUE); + getChild("limit_age_verified")->setLabelArg("[ESTATE_AGE_LIMIT]", getString("access_estate_defined") ); } else { - childSetValue("limit_age_verified", (parcel->getParcelFlag(PF_DENY_AGEUNVERIFIED))); - childSetLabelArg( "limit_age_verified", "[ESTATE_AGE_LIMIT]", std::string() ); + getChild("limit_age_verified")->setValue((parcel->getParcelFlag(PF_DENY_AGEUNVERIFIED))); + getChild("limit_age_verified")->setLabelArg("[ESTATE_AGE_LIMIT]", std::string() ); } BOOL use_pass = parcel->getParcelFlag(PF_USE_PASS_LIST); - childSetValue("PassCheck", use_pass ); + getChild("PassCheck")->setValue(use_pass ); LLCtrlSelectionInterface* passcombo = childGetSelectionInterface("pass_combo"); if (passcombo) { @@ -2547,40 +2538,40 @@ void LLPanelLandAccess::refresh() } S32 pass_price = parcel->getPassPrice(); - childSetValue( "PriceSpin", (F32)pass_price ); + getChild("PriceSpin")->setValue((F32)pass_price ); F32 pass_hours = parcel->getPassHours(); - childSetValue( "HoursSpin", pass_hours ); + getChild("HoursSpin")->setValue(pass_hours ); } else { - childSetValue("public_access", FALSE); - childSetValue("limit_payment", FALSE); - childSetValue("limit_age_verified", FALSE); - childSetValue("GroupCheck", FALSE); - childSetLabelArg("GroupCheck", "[GROUP]", LLStringUtil::null ); - childSetValue("PassCheck", FALSE); - childSetValue("PriceSpin", (F32)PARCEL_PASS_PRICE_DEFAULT); - childSetValue( "HoursSpin", PARCEL_PASS_HOURS_DEFAULT ); - childSetToolTipArg("AccessList", "[LISTED]", llformat("%d",0)); - childSetToolTipArg("AccessList", "[MAX]", llformat("%d",0)); - childSetToolTipArg("BannedList", "[LISTED]", llformat("%d",0)); - childSetToolTipArg("BannedList", "[MAX]", llformat("%d",0)); + getChild("public_access")->setValue(FALSE); + getChild("limit_payment")->setValue(FALSE); + getChild("limit_age_verified")->setValue(FALSE); + getChild("GroupCheck")->setValue(FALSE); + getChild("GroupCheck")->setLabelArg("[GROUP]", LLStringUtil::null ); + getChild("PassCheck")->setValue(FALSE); + getChild("PriceSpin")->setValue((F32)PARCEL_PASS_PRICE_DEFAULT); + getChild("HoursSpin")->setValue(PARCEL_PASS_HOURS_DEFAULT ); + getChild("AccessList")->setToolTipArg(LLStringExplicit("[LISTED]"), llformat("%d",0)); + getChild("AccessList")->setToolTipArg(LLStringExplicit("[MAX]"), llformat("%d",0)); + getChild("BannedList")->setToolTipArg(LLStringExplicit("[LISTED]"), llformat("%d",0)); + getChild("BannedList")->setToolTipArg(LLStringExplicit("[MAX]"), llformat("%d",0)); } } void LLPanelLandAccess::refresh_ui() { - childSetEnabled("public_access", FALSE); - childSetEnabled("limit_payment", FALSE); - childSetEnabled("limit_age_verified", FALSE); - childSetEnabled("GroupCheck", FALSE); - childSetEnabled("PassCheck", FALSE); - childSetEnabled("pass_combo", FALSE); - childSetEnabled("PriceSpin", FALSE); - childSetEnabled("HoursSpin", FALSE); - childSetEnabled("AccessList", FALSE); - childSetEnabled("BannedList", FALSE); + 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); LLParcel *parcel = mParcel->getParcel(); if (parcel) @@ -2588,73 +2579,73 @@ void LLPanelLandAccess::refresh_ui() BOOL can_manage_allowed = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_MANAGE_ALLOWED); BOOL can_manage_banned = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_MANAGE_BANNED); - childSetEnabled("public_access", can_manage_allowed); - BOOL public_access = childGetValue("public_access").asBoolean(); + getChildView("public_access")->setEnabled(can_manage_allowed); + BOOL public_access = getChild("public_access")->getValue().asBoolean(); if (public_access) { bool override = false; if(parcel->getRegionDenyAnonymousOverride()) { override = true; - childSetEnabled("limit_payment", FALSE); + getChildView("limit_payment")->setEnabled(FALSE); } else { - childSetEnabled("limit_payment", can_manage_allowed); + getChildView("limit_payment")->setEnabled(can_manage_allowed); } if(parcel->getRegionDenyAgeUnverifiedOverride()) { override = true; - childSetEnabled("limit_age_verified", FALSE); + getChildView("limit_age_verified")->setEnabled(FALSE); } else { - childSetEnabled("limit_age_verified", can_manage_allowed); + getChildView("limit_age_verified")->setEnabled(can_manage_allowed); } if (override) { - childSetToolTip("Only Allow", getString("estate_override")); + getChildView("Only Allow")->setToolTip(getString("estate_override")); } else { - childSetToolTip("Only Allow", std::string()); + getChildView("Only Allow")->setToolTip(std::string()); } - childSetEnabled("GroupCheck", FALSE); - childSetEnabled("PassCheck", FALSE); - childSetEnabled("pass_combo", FALSE); - childSetEnabled("AccessList", FALSE); + getChildView("GroupCheck")->setEnabled(FALSE); + getChildView("PassCheck")->setEnabled(FALSE); + getChildView("pass_combo")->setEnabled(FALSE); + getChildView("AccessList")->setEnabled(FALSE); } else { - childSetEnabled("limit_payment", FALSE); - childSetEnabled("limit_age_verified", FALSE); + getChildView("limit_payment")->setEnabled(FALSE); + getChildView("limit_age_verified")->setEnabled(FALSE); std::string group_name; if (gCacheName->getGroupName(parcel->getGroupID(), group_name)) { - childSetEnabled("GroupCheck", can_manage_allowed); + getChildView("GroupCheck")->setEnabled(can_manage_allowed); } - BOOL group_access = childGetValue("GroupCheck").asBoolean(); - BOOL sell_passes = childGetValue("PassCheck").asBoolean(); - childSetEnabled("PassCheck", can_manage_allowed); + BOOL group_access = getChild("GroupCheck")->getValue().asBoolean(); + BOOL sell_passes = getChild("PassCheck")->getValue().asBoolean(); + getChildView("PassCheck")->setEnabled(can_manage_allowed); if (sell_passes) { - childSetEnabled("pass_combo", group_access && can_manage_allowed); - childSetEnabled("PriceSpin", can_manage_allowed); - childSetEnabled("HoursSpin", can_manage_allowed); + getChildView("pass_combo")->setEnabled(group_access && can_manage_allowed); + getChildView("PriceSpin")->setEnabled(can_manage_allowed); + getChildView("HoursSpin")->setEnabled(can_manage_allowed); } } - childSetEnabled("AccessList", can_manage_allowed); + getChildView("AccessList")->setEnabled(can_manage_allowed); S32 allowed_list_count = parcel->mAccessList.size(); - childSetEnabled("add_allowed", can_manage_allowed && allowed_list_count < PARCEL_MAX_ACCESS_LIST); + getChildView("add_allowed")->setEnabled(can_manage_allowed && allowed_list_count < PARCEL_MAX_ACCESS_LIST); BOOL has_selected = mListAccess->getSelectionInterface()->getFirstSelectedIndex() >= 0; - childSetEnabled("remove_allowed", can_manage_allowed && has_selected); + getChildView("remove_allowed")->setEnabled(can_manage_allowed && has_selected); - childSetEnabled("BannedList", can_manage_banned); + getChildView("BannedList")->setEnabled(can_manage_banned); S32 banned_list_count = parcel->mBanList.size(); - childSetEnabled("add_banned", can_manage_banned && banned_list_count < PARCEL_MAX_ACCESS_LIST); + getChildView("add_banned")->setEnabled(can_manage_banned && banned_list_count < PARCEL_MAX_ACCESS_LIST); has_selected = mListBanned->getSelectionInterface()->getFirstSelectedIndex() >= 0; - childSetEnabled("remove_banned", can_manage_banned && has_selected); + getChildView("remove_banned")->setEnabled(can_manage_banned && has_selected); } } @@ -2668,7 +2659,7 @@ void LLPanelLandAccess::refreshNames() { gCacheName->getGroupName(parcel->getGroupID(), group_name); } - childSetLabelArg("GroupCheck", "[GROUP]", group_name); + getChild("GroupCheck")->setLabelArg("[GROUP]", group_name); } @@ -2691,13 +2682,13 @@ void LLPanelLandAccess::onCommitPublicAccess(LLUICtrl *ctrl, void *userdata) } // If we disabled public access, enable group access by default (if applicable) - BOOL public_access = self->childGetValue("public_access").asBoolean(); + BOOL public_access = self->getChild("public_access")->getValue().asBoolean(); if (public_access == FALSE) { std::string group_name; if (gCacheName->getGroupName(parcel->getGroupID(), group_name)) { - self->childSetValue("GroupCheck", public_access ? FALSE : TRUE); + self->getChild("GroupCheck")->setValue(public_access ? FALSE : TRUE); } } @@ -2716,8 +2707,8 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) } // Extract data from UI - BOOL public_access = self->childGetValue("public_access").asBoolean(); - BOOL use_access_group = self->childGetValue("GroupCheck").asBoolean(); + BOOL public_access = self->getChild("public_access")->getValue().asBoolean(); + BOOL use_access_group = self->getChild("GroupCheck")->getValue().asBoolean(); if (use_access_group) { std::string group_name; @@ -2735,13 +2726,13 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) { use_access_list = FALSE; use_access_group = FALSE; - limit_payment = self->childGetValue("limit_payment").asBoolean(); - limit_age_verified = self->childGetValue("limit_age_verified").asBoolean(); + limit_payment = self->getChild("limit_payment")->getValue().asBoolean(); + limit_age_verified = self->getChild("limit_age_verified")->getValue().asBoolean(); } else { use_access_list = TRUE; - use_pass_list = self->childGetValue("PassCheck").asBoolean(); + use_pass_list = self->getChild("PassCheck")->getValue().asBoolean(); if (use_access_group && use_pass_list) { LLCtrlSelectionInterface* passcombo = self->childGetSelectionInterface("pass_combo"); @@ -2755,8 +2746,8 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) } } - S32 pass_price = llfloor((F32)self->childGetValue("PriceSpin").asReal()); - F32 pass_hours = (F32)self->childGetValue("HoursSpin").asReal(); + S32 pass_price = llfloor((F32)self->getChild("PriceSpin")->getValue().asReal()); + F32 pass_hours = (F32)self->getChild("HoursSpin")->getValue().asReal(); // Push data into current parcel parcel->setParcelFlag(PF_USE_ACCESS_GROUP, use_access_group); -- cgit v1.2.3