summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatersellland.cpp
diff options
context:
space:
mode:
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 9dddbd998a..b10a297bb8 100644
--- a/indra/newview/llfloatersellland.cpp
+++ b/indra/newview/llfloatersellland.cpp
@@ -163,7 +163,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);
@@ -207,20 +207,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();
@@ -232,7 +232,7 @@ void LLFloaterSellLandUI::updateParcelInfo()
{
std::string name;
gCacheName->getFullName(mAuthorizedBuyer, name);
- childSetText("sell_to_agent", name);
+ getChild<LLUICtrl>("sell_to_agent")->setValue(name);
}
}
@@ -253,7 +253,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()
@@ -264,10 +264,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));
@@ -275,14 +275,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)
{
@@ -296,26 +296,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());
@@ -328,7 +328,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)
{
@@ -341,11 +341,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);
}
}
@@ -354,7 +354,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")
{
@@ -371,9 +371,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;
}
@@ -402,7 +402,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();
}
@@ -445,13 +445,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;
}
@@ -498,7 +498,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)
@@ -520,12 +520,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);
}