From 5dfdb0d5a41143512180390193ce79644bcb9469 Mon Sep 17 00:00:00 2001 From: gabriel lee Date: Mon, 1 Feb 2010 16:12:47 +0000 Subject: DEV-44904 and other fixes --- indra/newview/llfloaterland.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterland.cpp') diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 0ad283d7c6..1b1e4ef612 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -427,8 +427,17 @@ BOOL LLPanelLandGeneral::postBuild() mBtnBuyLand = getChild("Buy Land..."); mBtnBuyLand->setClickedCallback(onClickBuyLand, (void*)&BUY_PERSONAL_LAND); - mBtnScriptLimits = getChild("Scripts..."); - mBtnScriptLimits->setClickedCallback(onClickScriptLimits, this); + std::string url = gAgent.getRegion()->getCapability("LandResources"); + if (!url.empty()) + { + mBtnScriptLimits = getChild("Scripts..."); + mBtnScriptLimits->setClickedCallback(onClickScriptLimits, this); + } + else + { + mBtnScriptLimits = getChild("Scripts..."); + mBtnScriptLimits->setVisible(false); + } mBtnBuyGroupLand = getChild("Buy For Group..."); mBtnBuyGroupLand->setClickedCallback(onClickBuyLand, (void*)&BUY_GROUP_LAND); -- cgit v1.2.3 From 7c7bea034467987781774fef8c27b54eae434cce Mon Sep 17 00:00:00 2001 From: gabriel lee Date: Tue, 2 Feb 2010 14:28:47 +0000 Subject: acted on code review advise, check some return pointers for nullness etc --- indra/newview/llfloaterland.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterland.cpp') diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 1b1e4ef612..8cd63deebe 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -427,16 +427,25 @@ BOOL LLPanelLandGeneral::postBuild() mBtnBuyLand = getChild("Buy Land..."); mBtnBuyLand->setClickedCallback(onClickBuyLand, (void*)&BUY_PERSONAL_LAND); + // note: on region change this will not be re checked, should not matter on Agni as + // 99% of the time all regions will return the same caps. In case of an erroneous setting + // to enabled the floater will just throw an error when trying to get it's cap std::string url = gAgent.getRegion()->getCapability("LandResources"); if (!url.empty()) { mBtnScriptLimits = getChild("Scripts..."); - mBtnScriptLimits->setClickedCallback(onClickScriptLimits, this); + if(mBtnScriptLimits) + { + mBtnScriptLimits->setClickedCallback(onClickScriptLimits, this); + } } else { mBtnScriptLimits = getChild("Scripts..."); - mBtnScriptLimits->setVisible(false); + if(mBtnScriptLimits) + { + mBtnScriptLimits->setVisible(false); + } } mBtnBuyGroupLand = getChild("Buy For Group..."); -- cgit v1.2.3