summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelland.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelland.cpp')
-rw-r--r--indra/newview/llpanelland.cpp114
1 files changed, 51 insertions, 63 deletions
diff --git a/indra/newview/llpanelland.cpp b/indra/newview/llpanelland.cpp
index 92fe082ef2..04c1a86f69 100644
--- a/indra/newview/llpanelland.cpp
+++ b/indra/newview/llpanelland.cpp
@@ -2,31 +2,25 @@
* @file llpanelland.cpp
* @brief Land information in the tool floater, NOT the "About Land" floater
*
- * $LicenseInfo:firstyear=2002&license=viewergpl$
- *
- * Copyright (c) 2002-2009, Linden Research, Inc.
- *
+ * $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab. Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ * Copyright (C) 2010, Linden Research, Inc.
*
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at
- * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
*
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
*
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -40,6 +34,7 @@
#include "llbutton.h"
#include "llcheckboxctrl.h"
#include "llfloaterland.h"
+#include "llfloaterreg.h"
#include "lltextbox.h"
#include "llviewercontrol.h"
#include "llviewerparcelmgr.h"
@@ -63,16 +58,14 @@ public:
BOOL LLPanelLandInfo::postBuild()
{
-
- childSetAction("button buy land",onClickClaim,this);
- childSetAction("button abandon land",onClickRelease,this);
- childSetAction("button subdivide land",onClickDivide,this);
- childSetAction("button join land",onClickJoin,this);
- childSetAction("button about land",onClickAbout,this);
- childSetAction("button show owners help", onShowOwnersHelp, this);
+ childSetAction("button buy land",boost::bind(onClickClaim));
+ childSetAction("button abandon land", boost::bind(onClickRelease));
+ childSetAction("button subdivide land", boost::bind(onClickDivide));
+ childSetAction("button join land", boost::bind(onClickJoin));
+ childSetAction("button about land", boost::bind(onClickAbout));
mCheckShowOwners = getChild<LLCheckBoxCtrl>("checkbox show owners");
- childSetValue("checkbox show owners", gSavedSettings.getBOOL("ShowParcelOwners"));
+ getChild<LLUICtrl>("checkbox show owners")->setValue(gSavedSettings.getBOOL("ShowParcelOwners"));
return TRUE;
}
@@ -126,17 +119,17 @@ void LLPanelLandInfo::refresh()
if (!parcel || !regionp)
{
// nothing selected, disable panel
- childSetVisible("label_area_price",false);
- childSetVisible("label_area",false);
+ getChildView("label_area_price")->setVisible(false);
+ getChildView("label_area")->setVisible(false);
//mTextPrice->setText(LLStringUtil::null);
- childSetText("textbox price",LLStringUtil::null);
+ getChild<LLUICtrl>("textbox price")->setValue(LLStringUtil::null);
- childSetEnabled("button buy land",FALSE);
- childSetEnabled("button abandon land",FALSE);
- childSetEnabled("button subdivide land",FALSE);
- childSetEnabled("button join land",FALSE);
- childSetEnabled("button about land",FALSE);
+ getChildView("button buy land")->setEnabled(FALSE);
+ getChildView("button abandon land")->setEnabled(FALSE);
+ getChildView("button subdivide land")->setEnabled(FALSE);
+ getChildView("button join land")->setEnabled(FALSE);
+ getChildView("button about land")->setEnabled(FALSE);
}
else
{
@@ -154,11 +147,11 @@ void LLPanelLandInfo::refresh()
if (is_public)
{
- childSetEnabled("button buy land",TRUE);
+ getChildView("button buy land")->setEnabled(TRUE);
}
else
{
- childSetEnabled("button buy land",can_buy);
+ getChildView("button buy land")->setEnabled(can_buy);
}
BOOL owner_release = LLViewerParcelMgr::isParcelOwnedByAgent(parcel, GP_LAND_RELEASE);
@@ -170,16 +163,16 @@ void LLPanelLandInfo::refresh()
BOOL manager_divideable = ( gAgent.canManageEstate()
&& ((parcel->getOwnerID() == regionp->getOwner()) || owner_divide) );
- childSetEnabled("button abandon land",owner_release || manager_releaseable || gAgent.isGodlike());
+ getChildView("button abandon land")->setEnabled(owner_release || manager_releaseable || gAgent.isGodlike());
// only mainland sims are subdividable by owner
if (regionp->getRegionFlags() && REGION_FLAGS_ALLOW_PARCEL_CHANGES)
{
- childSetEnabled("button subdivide land",owner_divide || manager_divideable || gAgent.isGodlike());
+ getChildView("button subdivide land")->setEnabled(owner_divide || manager_divideable || gAgent.isGodlike());
}
else
{
- childSetEnabled("button subdivide land",manager_divideable || gAgent.isGodlike());
+ getChildView("button subdivide land")->setEnabled(manager_divideable || gAgent.isGodlike());
}
// To join land, must have something selected,
@@ -190,15 +183,15 @@ void LLPanelLandInfo::refresh()
//&& LLViewerParcelMgr::getInstance()->getSelfCount() > 1
&& !LLViewerParcelMgr::getInstance()->getParcelSelection()->getWholeParcelSelected())
{
- childSetEnabled("button join land",TRUE);
+ getChildView("button join land")->setEnabled(TRUE);
}
else
{
lldebugs << "Invalid selection for joining land" << llendl;
- childSetEnabled("button join land",FALSE);
+ getChildView("button join land")->setEnabled(FALSE);
}
- childSetEnabled("button about land",TRUE);
+ getChildView("button about land")->setEnabled(TRUE);
// show pricing information
S32 area;
@@ -213,48 +206,48 @@ void LLPanelLandInfo::refresh()
&dwell);
if(is_public || (is_for_sale && LLViewerParcelMgr::getInstance()->getParcelSelection()->getWholeParcelSelected()))
{
- childSetTextArg("label_area_price","[PRICE]", llformat("%d",claim_price));
- childSetTextArg("label_area_price","[AREA]", llformat("%d",area));
- childSetVisible("label_area_price",true);
- childSetVisible("label_area",false);
+ getChild<LLUICtrl>("label_area_price")->setTextArg("[PRICE]", llformat("%d",claim_price));
+ getChild<LLUICtrl>("label_area_price")->setTextArg("[AREA]", llformat("%d",area));
+ getChildView("label_area_price")->setVisible(true);
+ getChildView("label_area")->setVisible(false);
}
else
{
- childSetVisible("label_area_price",false);
- childSetTextArg("label_area","[AREA]", llformat("%d",area));
- childSetVisible("label_area",true);
+ getChildView("label_area_price")->setVisible(false);
+ getChild<LLUICtrl>("label_area")->setTextArg("[AREA]", llformat("%d",area));
+ getChildView("label_area")->setVisible(true);
}
}
}
//static
-void LLPanelLandInfo::onClickClaim(void*)
+void LLPanelLandInfo::onClickClaim()
{
LLViewerParcelMgr::getInstance()->startBuyLand();
}
//static
-void LLPanelLandInfo::onClickRelease(void*)
+void LLPanelLandInfo::onClickRelease()
{
LLViewerParcelMgr::getInstance()->startReleaseLand();
}
// static
-void LLPanelLandInfo::onClickDivide(void*)
+void LLPanelLandInfo::onClickDivide()
{
LLViewerParcelMgr::getInstance()->startDivideLand();
}
// static
-void LLPanelLandInfo::onClickJoin(void*)
+void LLPanelLandInfo::onClickJoin()
{
LLViewerParcelMgr::getInstance()->startJoinLand();
}
//static
-void LLPanelLandInfo::onClickAbout(void*)
+void LLPanelLandInfo::onClickAbout()
{
// Promote the rectangle selection to a parcel selection
if (!LLViewerParcelMgr::getInstance()->getParcelSelection()->getWholeParcelSelected())
@@ -262,10 +255,5 @@ void LLPanelLandInfo::onClickAbout(void*)
LLViewerParcelMgr::getInstance()->selectParcelInRectangle();
}
- LLFloaterLand::showInstance();
-}
-
-void LLPanelLandInfo::onShowOwnersHelp(void* user_data)
-{
- LLNotifications::instance().add("ShowOwnersHelp");
+ LLFloaterReg::showInstance("about_land");
}