summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatersellland.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-08-24 19:22:00 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-08-24 19:22:00 +0100
commite416840f85dc4a367894036b9fe483f17d959c54 (patch)
treee12956cbe7a0082bbaaa545cb80d9e86b13f88e8 /indra/newview/llfloatersellland.cpp
parent98cc2365034a93c69704daa69efb389799cc9627 (diff)
Backed out changeset c3d41f18ce2b
back-out the back-out for this branch. yay.
Diffstat (limited to 'indra/newview/llfloatersellland.cpp')
-rw-r--r--indra/newview/llfloatersellland.cpp70
1 files changed, 35 insertions, 35 deletions
diff --git a/indra/newview/llfloatersellland.cpp b/indra/newview/llfloatersellland.cpp
index af97fb90e1..3d87904dbe 100644
--- a/indra/newview/llfloatersellland.cpp
+++ b/indra/newview/llfloatersellland.cpp
@@ -157,7 +157,7 @@ BOOL LLFloaterSellLandUI::postBuild()
{
childSetCommitCallback("sell_to", onChangeValue, this);
childSetCommitCallback("price", onChangeValue, this);
- childSetPrevalidate("price", LLTextValidate::validateNonNegativeS32);
+ getChild<LLLineEditor>("price")->setPrevalidate(LLTextValidate::validateNonNegativeS32);
childSetCommitCallback("sell_objects", onChangeValue, this);
childSetAction("sell_to_select_agent", boost::bind( &LLFloaterSellLandUI::doSelectAgent, this));
childSetAction("cancel_btn", doCancel, this);
@@ -201,20 +201,20 @@ void LLFloaterSellLandUI::updateParcelInfo()
mParcelSoldWithObjects = parcelp->getSellWithObjects();
if (mParcelIsForSale)
{
- childSetValue("price", mParcelPrice);
+ getChild<LLUICtrl>("price")->setValue(mParcelPrice);
if (mParcelSoldWithObjects)
{
- childSetValue("sell_objects", "yes");
+ getChild<LLUICtrl>("sell_objects")->setValue("yes");
}
else
{
- childSetValue("sell_objects", "no");
+ getChild<LLUICtrl>("sell_objects")->setValue("no");
}
}
else
{
- childSetValue("price", "");
- childSetValue("sell_objects", "none");
+ getChild<LLUICtrl>("price")->setValue("");
+ getChild<LLUICtrl>("sell_objects")->setValue("none");
}
mParcelSnapshot = parcelp->getSnapshotID();
@@ -226,7 +226,7 @@ void LLFloaterSellLandUI::updateParcelInfo()
{
std::string name;
gCacheName->getFullName(mAuthorizedBuyer, name);
- childSetText("sell_to_agent", name);
+ getChild<LLUICtrl>("sell_to_agent")->setValue(name);
}
}
@@ -247,7 +247,7 @@ void LLFloaterSellLandUI::setBadge(const char* id, Badge badge)
case BADGE_ERROR: badgeName = badgeError; break;
}
- childSetValue(id, badgeName);
+ getChild<LLUICtrl>(id)->setValue(badgeName);
}
void LLFloaterSellLandUI::refreshUI()
@@ -258,10 +258,10 @@ void LLFloaterSellLandUI::refreshUI()
LLTextureCtrl* snapshot = getChild<LLTextureCtrl>("info_image");
snapshot->setImageAssetID(mParcelSnapshot);
- childSetText("info_parcel", parcelp->getName());
- childSetTextArg("info_size", "[AREA]", llformat("%d", mParcelActualArea));
+ getChild<LLUICtrl>("info_parcel")->setValue(parcelp->getName());
+ getChild<LLUICtrl>("info_size")->setTextArg("[AREA]", llformat("%d", mParcelActualArea));
- std::string price_str = childGetValue("price").asString();
+ std::string price_str = getChild<LLUICtrl>("price")->getValue().asString();
bool valid_price = false;
valid_price = (price_str != "") && LLTextValidate::validateNonNegativeS32(utf8str_to_wstring(price_str));
@@ -269,14 +269,14 @@ void LLFloaterSellLandUI::refreshUI()
{
F32 per_meter_price = 0;
per_meter_price = F32(mParcelPrice) / F32(mParcelActualArea);
- childSetTextArg("price_per_m", "[PER_METER]", llformat("%0.2f", per_meter_price));
- childShow("price_per_m");
+ getChild<LLUICtrl>("price_per_m")->setTextArg("[PER_METER]", llformat("%0.2f", per_meter_price));
+ getChildView("price_per_m")->setVisible(TRUE);
setBadge("step_price", BADGE_OK);
}
else
{
- childHide("price_per_m");
+ getChildView("price_per_m")->setVisible(FALSE);
if ("" == price_str)
{
@@ -290,26 +290,26 @@ void LLFloaterSellLandUI::refreshUI()
if (mSellToBuyer)
{
- childSetValue("sell_to", "user");
- childShow("sell_to_agent");
- childShow("sell_to_select_agent");
+ getChild<LLUICtrl>("sell_to")->setValue("user");
+ getChildView("sell_to_agent")->setVisible(TRUE);
+ getChildView("sell_to_select_agent")->setVisible(TRUE);
}
else
{
if (mChoseSellTo)
{
- childSetValue("sell_to", "anyone");
+ getChild<LLUICtrl>("sell_to")->setValue("anyone");
}
else
{
- childSetValue("sell_to", "select");
+ getChild<LLUICtrl>("sell_to")->setValue("select");
}
- childHide("sell_to_agent");
- childHide("sell_to_select_agent");
+ getChildView("sell_to_agent")->setVisible(FALSE);
+ getChildView("sell_to_select_agent")->setVisible(FALSE);
}
// Must select Sell To: Anybody, or User (with a specified username)
- std::string sell_to = childGetValue("sell_to").asString();
+ std::string sell_to = getChild<LLUICtrl>("sell_to")->getValue().asString();
bool valid_sell_to = "select" != sell_to &&
("user" != sell_to || mAuthorizedBuyer.notNull());
@@ -322,7 +322,7 @@ void LLFloaterSellLandUI::refreshUI()
setBadge("step_sell_to", BADGE_OK);
}
- bool valid_sell_objects = ("none" != childGetValue("sell_objects").asString());
+ bool valid_sell_objects = ("none" != getChild<LLUICtrl>("sell_objects")->getValue().asString());
if (!valid_sell_objects)
{
@@ -335,11 +335,11 @@ void LLFloaterSellLandUI::refreshUI()
if (valid_sell_to && valid_price && valid_sell_objects)
{
- childEnable("sell_btn");
+ getChildView("sell_btn")->setEnabled(TRUE);
}
else
{
- childDisable("sell_btn");
+ getChildView("sell_btn")->setEnabled(FALSE);
}
}
@@ -348,7 +348,7 @@ void LLFloaterSellLandUI::onChangeValue(LLUICtrl *ctrl, void *userdata)
{
LLFloaterSellLandUI *self = (LLFloaterSellLandUI *)userdata;
- std::string sell_to = self->childGetValue("sell_to").asString();
+ std::string sell_to = self->getChild<LLUICtrl>("sell_to")->getValue().asString();
if (sell_to == "user")
{
@@ -365,9 +365,9 @@ void LLFloaterSellLandUI::onChangeValue(LLUICtrl *ctrl, void *userdata)
self->mSellToBuyer = false;
}
- self->mParcelPrice = self->childGetValue("price");
+ self->mParcelPrice = self->getChild<LLUICtrl>("price")->getValue();
- if ("yes" == self->childGetValue("sell_objects").asString())
+ if ("yes" == self->getChild<LLUICtrl>("sell_objects")->getValue().asString())
{
self->mParcelSoldWithObjects = true;
}
@@ -396,7 +396,7 @@ void LLFloaterSellLandUI::callbackAvatarPick(const std::vector<std::string>& nam
mAuthorizedBuyer = ids[0];
- childSetText("sell_to_agent", names[0]);
+ getChild<LLUICtrl>("sell_to_agent")->setValue(names[0]);
refreshUI();
}
@@ -439,13 +439,13 @@ void LLFloaterSellLandUI::doSellLand(void *userdata)
LLParcel* parcel = self->mParcelSelection->getParcel();
// Do a confirmation
- S32 sale_price = self->childGetValue("price");
+ S32 sale_price = self->getChild<LLUICtrl>("price")->getValue();
S32 area = parcel->getArea();
std::string authorizedBuyerName = "Anyone";
bool sell_to_anyone = true;
- if ("user" == self->childGetValue("sell_to").asString())
+ if ("user" == self->getChild<LLUICtrl>("sell_to")->getValue().asString())
{
- authorizedBuyerName = self->childGetText("sell_to_agent");
+ authorizedBuyerName = self->getChild<LLUICtrl>("sell_to_agent")->getValue().asString();
sell_to_anyone = false;
}
@@ -492,7 +492,7 @@ bool LLFloaterSellLandUI::onConfirmSale(const LLSD& notification, const LLSD& re
{
return false;
}
- S32 sale_price = childGetValue("price");
+ S32 sale_price = getChild<LLUICtrl>("price")->getValue();
// Valid extracted data
if (sale_price < 0)
@@ -514,12 +514,12 @@ bool LLFloaterSellLandUI::onConfirmSale(const LLSD& notification, const LLSD& re
parcel->setParcelFlag(PF_FOR_SALE, TRUE);
parcel->setSalePrice(sale_price);
bool sell_with_objects = false;
- if ("yes" == childGetValue("sell_objects").asString())
+ if ("yes" == getChild<LLUICtrl>("sell_objects")->getValue().asString())
{
sell_with_objects = true;
}
parcel->setSellWithObjects(sell_with_objects);
- if ("user" == childGetValue("sell_to").asString())
+ if ("user" == getChild<LLUICtrl>("sell_to")->getValue().asString())
{
parcel->setAuthorizedBuyerID(mAuthorizedBuyer);
}