From 7cabb9de683cd3177f9ddbe2e7af873f0c9155c9 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Sun, 8 Nov 2009 17:24:08 +0000 Subject: EXT-332: Added support for local currency estimates to the Buy L$ and Buy Land floaters. We now check for a new estimatedLocalCost key from the XML-RPC server, which provides the estimated cost in the user's local currency, e.g., "US$ 10.00" or "10.00 Euros". Note: the server is not currently sending this information. The previous codepath still exists and should be unaffected. That is, we will continue to check for an estimatedCost key from the server with a value specified in US cents. We give precedence to estimatedLocalCost though and may want to remove this code once the international billing server changes go live. HG: branch 'default' HG: changed indra/newview/llcurrencyuimanager.cpp HG: changed indra/newview/llcurrencyuimanager.h HG: changed indra/newview/llfloaterbuyland.cpp HG: changed indra/newview/skins/default/xui/en/floater_buy_land.xml --- indra/newview/llfloaterbuyland.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'indra/newview/llfloaterbuyland.cpp') diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp index 36f0315790..467796b4a3 100644 --- a/indra/newview/llfloaterbuyland.cpp +++ b/indra/newview/llfloaterbuyland.cpp @@ -685,7 +685,14 @@ void LLFloaterBuyLandUI::finishWebSiteInfo() mSiteLandUseAction = landUse["action"].asString(); LLXMLRPCValue currency = result["currency"]; - mCurrency.setEstimate(currency["estimatedCost"].asInt()); + if (currency["estimatedCost"].isValid()) + { + mCurrency.setUSDEstimate(currency["estimatedCost"].asInt()); + } + if (currency["estimatedLocalCost"].isValid()) + { + mCurrency.setLocalEstimate(currency["estimatedLocalCost"].asString()); + } mSiteConfirm = result["confirm"].asString(); } @@ -733,7 +740,8 @@ void LLFloaterBuyLandUI::runWebSitePrep(const std::string& password) keywordArgs.appendInt("billableArea", mIsForGroup ? 0 : mParcelBillableArea); keywordArgs.appendInt("currencyBuy", mCurrency.getAmount()); - keywordArgs.appendInt("estimatedCost", mCurrency.getEstimate()); + keywordArgs.appendInt("estimatedCost", mCurrency.getUSDEstimate()); + keywordArgs.appendString("estimatedLocalCost", mCurrency.getLocalEstimate()); keywordArgs.appendString("confirm", mSiteConfirm); if (!password.empty()) { @@ -1217,7 +1225,7 @@ void LLFloaterBuyLandUI::refreshUI() childSetText("currency_reason", getString("not_enough_lindens", string_args)); - childSetTextArg("currency_est", "[AMOUNT2]", llformat("%#.2f", mCurrency.getEstimate() / 100.0)); + childSetTextArg("currency_est", "[LOCAL_AMOUNT]", mCurrency.getLocalEstimate()); } if (willHaveEnough) @@ -1297,7 +1305,7 @@ void LLFloaterBuyLandUI::startBuyPreConfirm() { LLStringUtil::format_map_t string_args; string_args["[AMOUNT]"] = llformat("%d", mCurrency.getAmount()); - string_args["[AMOUNT2]"] = llformat("%#.2f", mCurrency.getEstimate() / 100.0); + string_args["[LOCAL_AMOUNT]"] = mCurrency.getLocalEstimate(); action += getString("buy_for_US", string_args); } -- cgit v1.2.3