diff options
Diffstat (limited to 'indra/newview/llfloatersellland.cpp')
-rw-r--r-- | indra/newview/llfloatersellland.cpp | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/indra/newview/llfloatersellland.cpp b/indra/newview/llfloatersellland.cpp index b10a297bb8..9dddbd998a 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); - getChild<LLLineEditor>("price")->setPrevalidate(LLTextValidate::validateNonNegativeS32); + childSetPrevalidate("price", 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) { - getChild<LLUICtrl>("price")->setValue(mParcelPrice); + childSetValue("price", mParcelPrice); if (mParcelSoldWithObjects) { - getChild<LLUICtrl>("sell_objects")->setValue("yes"); + childSetValue("sell_objects", "yes"); } else { - getChild<LLUICtrl>("sell_objects")->setValue("no"); + childSetValue("sell_objects", "no"); } } else { - getChild<LLUICtrl>("price")->setValue(""); - getChild<LLUICtrl>("sell_objects")->setValue("none"); + childSetValue("price", ""); + childSetValue("sell_objects", "none"); } mParcelSnapshot = parcelp->getSnapshotID(); @@ -232,7 +232,7 @@ void LLFloaterSellLandUI::updateParcelInfo() { std::string name; gCacheName->getFullName(mAuthorizedBuyer, name); - getChild<LLUICtrl>("sell_to_agent")->setValue(name); + childSetText("sell_to_agent", name); } } @@ -253,7 +253,7 @@ void LLFloaterSellLandUI::setBadge(const char* id, Badge badge) case BADGE_ERROR: badgeName = badgeError; break; } - getChild<LLUICtrl>(id)->setValue(badgeName); + childSetValue(id, badgeName); } void LLFloaterSellLandUI::refreshUI() @@ -264,10 +264,10 @@ void LLFloaterSellLandUI::refreshUI() LLTextureCtrl* snapshot = getChild<LLTextureCtrl>("info_image"); snapshot->setImageAssetID(mParcelSnapshot); - getChild<LLUICtrl>("info_parcel")->setValue(parcelp->getName()); - getChild<LLUICtrl>("info_size")->setTextArg("[AREA]", llformat("%d", mParcelActualArea)); + childSetText("info_parcel", parcelp->getName()); + childSetTextArg("info_size", "[AREA]", llformat("%d", mParcelActualArea)); - std::string price_str = getChild<LLUICtrl>("price")->getValue().asString(); + std::string price_str = childGetValue("price").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); - getChild<LLUICtrl>("price_per_m")->setTextArg("[PER_METER]", llformat("%0.2f", per_meter_price)); - getChildView("price_per_m")->setVisible(TRUE); + childSetTextArg("price_per_m", "[PER_METER]", llformat("%0.2f", per_meter_price)); + childShow("price_per_m"); setBadge("step_price", BADGE_OK); } else { - getChildView("price_per_m")->setVisible(FALSE); + childHide("price_per_m"); if ("" == price_str) { @@ -296,26 +296,26 @@ void LLFloaterSellLandUI::refreshUI() if (mSellToBuyer) { - getChild<LLUICtrl>("sell_to")->setValue("user"); - getChildView("sell_to_agent")->setVisible(TRUE); - getChildView("sell_to_select_agent")->setVisible(TRUE); + childSetValue("sell_to", "user"); + childShow("sell_to_agent"); + childShow("sell_to_select_agent"); } else { if (mChoseSellTo) { - getChild<LLUICtrl>("sell_to")->setValue("anyone"); + childSetValue("sell_to", "anyone"); } else { - getChild<LLUICtrl>("sell_to")->setValue("select"); + childSetValue("sell_to", "select"); } - getChildView("sell_to_agent")->setVisible(FALSE); - getChildView("sell_to_select_agent")->setVisible(FALSE); + childHide("sell_to_agent"); + childHide("sell_to_select_agent"); } // Must select Sell To: Anybody, or User (with a specified username) - std::string sell_to = getChild<LLUICtrl>("sell_to")->getValue().asString(); + std::string sell_to = childGetValue("sell_to").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" != getChild<LLUICtrl>("sell_objects")->getValue().asString()); + bool valid_sell_objects = ("none" != childGetValue("sell_objects").asString()); if (!valid_sell_objects) { @@ -341,11 +341,11 @@ void LLFloaterSellLandUI::refreshUI() if (valid_sell_to && valid_price && valid_sell_objects) { - getChildView("sell_btn")->setEnabled(TRUE); + childEnable("sell_btn"); } else { - getChildView("sell_btn")->setEnabled(FALSE); + childDisable("sell_btn"); } } @@ -354,7 +354,7 @@ void LLFloaterSellLandUI::onChangeValue(LLUICtrl *ctrl, void *userdata) { LLFloaterSellLandUI *self = (LLFloaterSellLandUI *)userdata; - std::string sell_to = self->getChild<LLUICtrl>("sell_to")->getValue().asString(); + std::string sell_to = self->childGetValue("sell_to").asString(); if (sell_to == "user") { @@ -371,9 +371,9 @@ void LLFloaterSellLandUI::onChangeValue(LLUICtrl *ctrl, void *userdata) self->mSellToBuyer = false; } - self->mParcelPrice = self->getChild<LLUICtrl>("price")->getValue(); + self->mParcelPrice = self->childGetValue("price"); - if ("yes" == self->getChild<LLUICtrl>("sell_objects")->getValue().asString()) + if ("yes" == self->childGetValue("sell_objects").asString()) { self->mParcelSoldWithObjects = true; } @@ -402,7 +402,7 @@ void LLFloaterSellLandUI::callbackAvatarPick(const std::vector<std::string>& nam mAuthorizedBuyer = ids[0]; - getChild<LLUICtrl>("sell_to_agent")->setValue(names[0]); + childSetText("sell_to_agent", names[0]); refreshUI(); } @@ -445,13 +445,13 @@ void LLFloaterSellLandUI::doSellLand(void *userdata) LLParcel* parcel = self->mParcelSelection->getParcel(); // Do a confirmation - S32 sale_price = self->getChild<LLUICtrl>("price")->getValue(); + S32 sale_price = self->childGetValue("price"); S32 area = parcel->getArea(); std::string authorizedBuyerName = "Anyone"; bool sell_to_anyone = true; - if ("user" == self->getChild<LLUICtrl>("sell_to")->getValue().asString()) + if ("user" == self->childGetValue("sell_to").asString()) { - authorizedBuyerName = self->getChild<LLUICtrl>("sell_to_agent")->getValue().asString(); + authorizedBuyerName = self->childGetText("sell_to_agent"); sell_to_anyone = false; } @@ -498,7 +498,7 @@ bool LLFloaterSellLandUI::onConfirmSale(const LLSD& notification, const LLSD& re { return false; } - S32 sale_price = getChild<LLUICtrl>("price")->getValue(); + S32 sale_price = childGetValue("price"); // 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" == getChild<LLUICtrl>("sell_objects")->getValue().asString()) + if ("yes" == childGetValue("sell_objects").asString()) { sell_with_objects = true; } parcel->setSellWithObjects(sell_with_objects); - if ("user" == getChild<LLUICtrl>("sell_to")->getValue().asString()) + if ("user" == childGetValue("sell_to").asString()) { parcel->setAuthorizedBuyerID(mAuthorizedBuyer); } |