diff options
Diffstat (limited to 'indra')
9 files changed, 126 insertions, 45 deletions
diff --git a/indra/newview/llcurrencyuimanager.cpp b/indra/newview/llcurrencyuimanager.cpp index c4bfd71999..319cbf8209 100644 --- a/indra/newview/llcurrencyuimanager.cpp +++ b/indra/newview/llcurrencyuimanager.cpp @@ -76,8 +76,15 @@ public: bool mUserEnteredCurrencyBuy; // from website - bool mSiteCurrencyEstimated; - S32 mSiteCurrencyEstimatedCost; + + // pre-viewer 2.0, the server returned estimates as an + // integer US cents value, e.g., "1000" for $10.00 + // post-viewer 2.0, the server may also return estimates + // as a string with currency embedded, e.g., "10.00 Euros" + bool mUSDCurrencyEstimated; + S32 mUSDCurrencyEstimatedCost; + bool mLocalCurrencyEstimated; + std::string mLocalCurrencyEstimatedCost; std::string mSiteConfirm; bool mBought; @@ -101,6 +108,10 @@ public: void startCurrencyBuy(const std::string& password); void finishCurrencyBuy(); + + void clearEstimate(); + bool hasEstimate() const; + std::string getLocalEstimate() const; void startTransaction(TransactionType type, const char* method, LLXMLRPCValue params); @@ -126,12 +137,11 @@ LLCurrencyUIManager::Impl::Impl(LLPanel& dialog) mError(false), mUserCurrencyBuy(2000), // note, this is a default, real value set in llfloaterbuycurrency.cpp mUserEnteredCurrencyBuy(false), - mSiteCurrencyEstimated(false), - mSiteCurrencyEstimatedCost(0), mBought(false), mTransactionType(TransactionNone), mTransaction(0), mCurrencyChanged(false) { + clearEstimate(); } LLCurrencyUIManager::Impl::~Impl() @@ -141,14 +151,13 @@ LLCurrencyUIManager::Impl::~Impl() void LLCurrencyUIManager::Impl::updateCurrencyInfo() { - mSiteCurrencyEstimated = false; - mSiteCurrencyEstimatedCost = 0; + clearEstimate(); mBought = false; mCurrencyChanged = false; if (mUserCurrencyBuy == 0) { - mSiteCurrencyEstimated = true; + mLocalCurrencyEstimated = true; return; } @@ -185,9 +194,21 @@ void LLCurrencyUIManager::Impl::finishCurrencyInfo() } LLXMLRPCValue currency = result["currency"]; - mSiteCurrencyEstimated = true; - mSiteCurrencyEstimatedCost = currency["estimatedCost"].asInt(); - + + // old XML-RPC server: estimatedCost = value in US cents + mUSDCurrencyEstimated = currency["estimatedCost"].isValid(); + if (mUSDCurrencyEstimated) + { + mUSDCurrencyEstimatedCost = currency["estimatedCost"].asInt(); + } + + // newer XML-RPC server: estimatedLocalCost = local currency string + mLocalCurrencyEstimated = currency["estimatedLocalCost"].isValid(); + if (mLocalCurrencyEstimated) + { + mLocalCurrencyEstimatedCost = currency["estimatedLocalCost"].asString(); + } + S32 newCurrencyBuy = currency["currencyBuy"].asInt(); if (newCurrencyBuy != mUserCurrencyBuy) { @@ -200,17 +221,20 @@ void LLCurrencyUIManager::Impl::finishCurrencyInfo() void LLCurrencyUIManager::Impl::startCurrencyBuy(const std::string& password) { - mSiteCurrencyEstimated = false; - mSiteCurrencyEstimatedCost = 0; - mCurrencyChanged = false; - LLXMLRPCValue keywordArgs = LLXMLRPCValue::createStruct(); keywordArgs.appendString("agentId", gAgent.getID().asString()); keywordArgs.appendString( "secureSessionId", gAgent.getSecureSessionID().asString()); keywordArgs.appendInt("currencyBuy", mUserCurrencyBuy); - keywordArgs.appendInt("estimatedCost", mSiteCurrencyEstimatedCost); + if (mUSDCurrencyEstimated) + { + keywordArgs.appendInt("estimatedCost", mUSDCurrencyEstimatedCost); + } + if (mLocalCurrencyEstimated) + { + keywordArgs.appendString("estimatedLocalCost", mLocalCurrencyEstimatedCost); + } keywordArgs.appendString("confirm", mSiteConfirm); if (!password.empty()) { @@ -226,6 +250,9 @@ void LLCurrencyUIManager::Impl::startCurrencyBuy(const std::string& password) params.append(keywordArgs); startTransaction(TransactionBuy, "buyCurrency", params); + + clearEstimate(); + mCurrencyChanged = false; } void LLCurrencyUIManager::Impl::finishCurrencyBuy() @@ -270,6 +297,34 @@ void LLCurrencyUIManager::Impl::startTransaction(TransactionType type, clearError(); } +void LLCurrencyUIManager::Impl::clearEstimate() +{ + mUSDCurrencyEstimated = false; + mUSDCurrencyEstimatedCost = 0; + mLocalCurrencyEstimated = false; + mLocalCurrencyEstimatedCost = "0"; +} + +bool LLCurrencyUIManager::Impl::hasEstimate() const +{ + return (mUSDCurrencyEstimated || mLocalCurrencyEstimated); +} + +std::string LLCurrencyUIManager::Impl::getLocalEstimate() const +{ + if (mLocalCurrencyEstimated) + { + // we have the new-style local currency string + return mLocalCurrencyEstimatedCost; + } + if (mUSDCurrencyEstimated) + { + // we have the old-style USD-specific value + return "US$ " + llformat("%#.2f", mUSDCurrencyEstimatedCost / 100.0); + } + return ""; +} + bool LLCurrencyUIManager::Impl::checkTransaction() { if (!mTransaction) @@ -342,8 +397,8 @@ void LLCurrencyUIManager::Impl::currencyKey(S32 value) mUserCurrencyBuy = value; - if (mSiteCurrencyEstimated) { - mSiteCurrencyEstimated = false; + if (hasEstimate()) { + clearEstimate(); //cannot just simply refresh the whole UI, as the edit field will // get reset and the cursor will change... @@ -406,8 +461,8 @@ void LLCurrencyUIManager::Impl::updateUI() } } - mPanel.childSetTextArg("currency_est", "[LOCALAMOUNT]", "US$ " + llformat("%#.2f", mSiteCurrencyEstimatedCost / 100.0)); - mPanel.childSetVisible("currency_est", mSiteCurrencyEstimated && mUserCurrencyBuy > 0); + mPanel.childSetTextArg("currency_est", "[LOCALAMOUNT]", getLocalEstimate()); + mPanel.childSetVisible("currency_est", hasEstimate() && mUserCurrencyBuy > 0); if (mPanel.childIsEnabled("buy_btn") ||mPanel.childIsVisible("currency_est") @@ -448,18 +503,32 @@ void LLCurrencyUIManager::setZeroMessage(const std::string& message) impl.mZeroMessage = message; } -void LLCurrencyUIManager::setEstimate(int amount) +void LLCurrencyUIManager::setUSDEstimate(int amount) +{ + impl.mUSDCurrencyEstimatedCost = amount; + impl.mUSDCurrencyEstimated = true; + impl.updateUI(); + + impl.mCurrencyChanged = false; +} + +int LLCurrencyUIManager::getUSDEstimate() +{ + return impl.mUSDCurrencyEstimated ? impl.mUSDCurrencyEstimatedCost : 0; +} + +void LLCurrencyUIManager::setLocalEstimate(const std::string &amount) { - impl.mSiteCurrencyEstimatedCost = amount; - impl.mSiteCurrencyEstimated = true; + impl.mLocalCurrencyEstimatedCost = amount; + impl.mLocalCurrencyEstimated = true; impl.updateUI(); impl.mCurrencyChanged = false; } -int LLCurrencyUIManager::getEstimate() +std::string LLCurrencyUIManager::getLocalEstimate() const { - return impl.mSiteCurrencyEstimated ? impl.mSiteCurrencyEstimatedCost : 0; + return impl.getLocalEstimate(); } void LLCurrencyUIManager::prepare() @@ -490,7 +559,7 @@ void LLCurrencyUIManager::buy(const std::string& buy_msg) LLUIString msg = buy_msg; msg.setArg("[LINDENS]", llformat("%d", impl.mUserCurrencyBuy)); - msg.setArg("[LOCALAMOUNT]", "US$ " + llformat("%#.2f", impl.mSiteCurrencyEstimatedCost / 100.0)); + msg.setArg("[LOCALAMOUNT]", getLocalEstimate()); LLConfirmationManager::confirm(impl.mSiteConfirm, msg, impl, @@ -511,7 +580,7 @@ bool LLCurrencyUIManager::canCancel() bool LLCurrencyUIManager::canBuy() { return impl.mTransactionType == Impl::TransactionNone - && impl.mSiteCurrencyEstimated + && impl.hasEstimate() && impl.mUserCurrencyBuy > 0; } diff --git a/indra/newview/llcurrencyuimanager.h b/indra/newview/llcurrencyuimanager.h index 93427aed7f..dfe027098d 100644 --- a/indra/newview/llcurrencyuimanager.h +++ b/indra/newview/llcurrencyuimanager.h @@ -57,11 +57,16 @@ public: void setZeroMessage(const std::string& message); // sets the gray message to show when zero - void setEstimate(int); - int getEstimate(); + void setUSDEstimate(int); // deprecated in 2.0 + int getUSDEstimate(); // deprecated in 2.0 // the amount in US$ * 100 (in otherwords, in cents) // use set when you get this information from elsewhere + void setLocalEstimate(const std::string &local_est); + std::string getLocalEstimate() const; + // the estimated cost in the user's local currency + // for example, "US$ 10.00" or "10.00 Euros" + void prepare(); // call once after dialog is built, from postBuild() void updateUI(bool show = true); 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); } diff --git a/indra/newview/skins/default/xui/en/floater_buy_land.xml b/indra/newview/skins/default/xui/en/floater_buy_land.xml index 0f710a8047..6e0c3dfe54 100644 --- a/indra/newview/skins/default/xui/en/floater_buy_land.xml +++ b/indra/newview/skins/default/xui/en/floater_buy_land.xml @@ -115,7 +115,7 @@ Try selecting a smaller area. </floater.string> <floater.string name="buy_for_US"> - Buy L$ [AMOUNT] for approx. US$ [AMOUNT2], + Buy L$ [AMOUNT] for approx. [LOCAL_AMOUNT], </floater.string> <floater.string name="parcel_meters"> @@ -172,10 +172,6 @@ supports [AMOUNT2] objects name="no_parcel_selected"> (no parcel selected) </floater.string> - <floater.string - name="buy_currency"> - Buy L$ [LINDENS] for approx. US$ [USD] - </floater.string> <text type="string" length="1" @@ -667,7 +663,7 @@ This parcel is 512 m² of land. name="currency_est" top="409" width="178"> - for approx. US$ [AMOUNT2] + for approx. [LOCAL_AMOUNT] </text> <text type="string" diff --git a/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml b/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml index 93c53981f3..04a247fd54 100644 --- a/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml @@ -73,7 +73,7 @@ <menu_item_call label="Edit" layout="topleft" - name="report"> + name="edit"> <menu_item_call.on_click function="Object.Edit" /> <menu_item_call.on_enable diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml index 255b92844f..a90337d31a 100644 --- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml @@ -145,7 +145,8 @@ top_delta="0" width="200" > <combo_editor - label="Search Second Life" /> + label="Search [SECOND_LIFE]" + name="search_combo_editor"/> </search_combo_box> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml index 613decad8d..06f0710406 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml @@ -272,7 +272,7 @@ Avatars: width="315" /> <radio_item height="16" - label="In window" + label="In a window" layout="topleft" left_delta="175" name="1" @@ -284,13 +284,13 @@ Avatars: enabled_control="EnableVoiceChat" control_name="PushToTalkToggle" height="20" - label="Use Push-to-talk in toggle mode" + label="Toggle mode for microphone when I press the Speak trigger key:" layout="topleft" left="30" name="push_to_talk_toggle_check" width="237" top_pad="-25" - tool_tip="When in toggle mode, press and release the push-to-talk trigger to switch your microphone on and off. When not in toggle mode, the microphone is active only when the trigger is held down."/> + tool_tip="When in toggle mode, press and release the trigger key ONCE to switch your microphone on or off. When not in toggle mode, the microphone broadcasts your voice only while the trigger is being held down."/> <line_editor follows="top|left" control_name="PushToTalkButton" @@ -300,7 +300,7 @@ Avatars: left_delta="50" max_length="254" name="modifier_combo" - label="Push-to-talk trigger" + label="Push-to-Speak trigger" top_pad="0" width="280" /> <button diff --git a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml index ce7939c00f..acf4601bfe 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml @@ -94,6 +94,7 @@ layout="topleft" left="30" mouse_opaque="false" + name="Logs:" top_pad="10" width="350"> Logs: @@ -184,6 +185,7 @@ layout="topleft" left_delta="0" mouse_opaque="false" + name="log_path_desc" top_pad="1" width="128" text_color="LtGray_50"> diff --git a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml index ba2ddd8b32..d454b9e5c8 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml @@ -336,7 +336,7 @@ follows="left|bottom" height="19" is_toggle="true" - label="Input / Output Devices" + label="Input/Output Devices" layout="topleft" left="165" top_pad="12" |