summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2020-09-23 12:28:34 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2020-09-23 12:28:34 +0300
commitfc7b5186944412d3f2125923aebf921730a79d20 (patch)
treeb7612208741f8f16f3c36b0c7ca9af00016f6ffe
parentf51c6608e1eb6cc5c05e97a558f48bc9fc6ea746 (diff)
Revert "SL-13814 Clarify dialog for insufficient L$ balance"
This reverts commit f150600ffb17232bfa88a6225aab437460fc9520.
-rw-r--r--indra/newview/llcurrencyuimanager.cpp7
-rw-r--r--indra/newview/llfloaterbuycurrency.cpp61
-rw-r--r--indra/newview/skins/default/xui/en/floater_buy_currency.xml624
3 files changed, 276 insertions, 416 deletions
diff --git a/indra/newview/llcurrencyuimanager.cpp b/indra/newview/llcurrencyuimanager.cpp
index cd7332c4d4..df94e337da 100644
--- a/indra/newview/llcurrencyuimanager.cpp
+++ b/indra/newview/llcurrencyuimanager.cpp
@@ -454,7 +454,7 @@ void LLCurrencyUIManager::Impl::updateUI()
if (!mUserEnteredCurrencyBuy)
{
- if (mUserCurrencyBuy == 0)
+ if (!mZeroMessage.empty() && mUserCurrencyBuy == 0)
{
lindenAmount->setText(LLStringUtil::null);
}
@@ -467,9 +467,8 @@ void LLCurrencyUIManager::Impl::updateUI()
}
}
- std::string estimated = (mUserCurrencyBuy == 0) ? mPanel.getString("estimated_zero") : getLocalEstimate();
- mPanel.getChild<LLUICtrl>("currency_est")->setTextArg("[LOCALAMOUNT]", estimated);
- mPanel.getChildView("currency_est")->setVisible( hasEstimate() || mUserCurrencyBuy == 0);
+ mPanel.getChild<LLUICtrl>("currency_est")->setTextArg("[LOCALAMOUNT]", getLocalEstimate());
+ mPanel.getChildView("currency_est")->setVisible( hasEstimate() && mUserCurrencyBuy > 0);
mPanel.getChildView("currency_links")->setVisible( mSupportsInternationalBilling);
mPanel.getChildView("exchange_rate_note")->setVisible( mSupportsInternationalBilling);
diff --git a/indra/newview/llfloaterbuycurrency.cpp b/indra/newview/llfloaterbuycurrency.cpp
index b039475389..25348474a1 100644
--- a/indra/newview/llfloaterbuycurrency.cpp
+++ b/indra/newview/llfloaterbuycurrency.cpp
@@ -32,8 +32,6 @@
#include "llcurrencyuimanager.h"
#include "llfloater.h"
#include "llfloaterreg.h"
-#include "lllayoutstack.h"
-#include "lliconctrl.h"
#include "llnotificationsutil.h"
#include "llstatusbar.h"
#include "lltextbox.h"
@@ -62,7 +60,6 @@ public:
bool mHasTarget;
std::string mTargetName;
S32 mTargetPrice;
- S32 mRequiredAmount;
public:
void noTarget();
@@ -71,7 +68,6 @@ public:
virtual BOOL postBuild();
void updateUI();
- void collapsePanels(bool collapse);
virtual void draw();
virtual BOOL canClose();
@@ -96,9 +92,7 @@ LLFloater* LLFloaterBuyCurrency::buildFloater(const LLSD& key)
LLFloaterBuyCurrencyUI::LLFloaterBuyCurrencyUI(const LLSD& key)
: LLFloater(key),
mChildren(*this),
- mManager(*this),
- mHasTarget(false),
- mTargetPrice(0)
+ mManager(*this)
{
}
@@ -110,8 +104,7 @@ LLFloaterBuyCurrencyUI::~LLFloaterBuyCurrencyUI()
void LLFloaterBuyCurrencyUI::noTarget()
{
mHasTarget = false;
- mTargetPrice = 0;
- mManager.setAmount(0);
+ mManager.setAmount(STANDARD_BUY_AMOUNT);
}
void LLFloaterBuyCurrencyUI::target(const std::string& name, S32 price)
@@ -127,8 +120,7 @@ void LLFloaterBuyCurrencyUI::target(const std::string& name, S32 price)
need = 0;
}
- mRequiredAmount = need + MINIMUM_BALANCE_AMOUNT;
- mManager.setAmount(0);
+ mManager.setAmount(need + MINIMUM_BALANCE_AMOUNT);
}
@@ -183,6 +175,7 @@ void LLFloaterBuyCurrencyUI::updateUI()
getChildView("purchase_warning_repurchase")->setVisible(FALSE);
getChildView("purchase_warning_notenough")->setVisible(FALSE);
getChildView("contacting")->setVisible(FALSE);
+ getChildView("buy_action")->setVisible(FALSE);
if (hasError)
{
@@ -215,8 +208,8 @@ void LLFloaterBuyCurrencyUI::updateUI()
{
if (mHasTarget)
{
- getChild<LLUICtrl>("target_price")->setTextArg("[AMT]", llformat("%d", mTargetPrice));
- getChild<LLUICtrl>("required_amount")->setTextArg("[AMT]", llformat("%d", mRequiredAmount));
+ getChildView("buy_action")->setVisible( true);
+ getChild<LLUICtrl>("buy_action")->setTextArg("[ACTION]", mTargetName);
}
}
@@ -237,40 +230,18 @@ void LLFloaterBuyCurrencyUI::updateUI()
if (mHasTarget)
{
- getChildView("purchase_warning_repurchase")->setVisible( !getChildView("currency_links")->getVisible());
+ if (total >= mTargetPrice)
+ {
+ getChildView("purchase_warning_repurchase")->setVisible( true);
+ }
+ else
+ {
+ getChildView("purchase_warning_notenough")->setVisible( true);
+ }
}
}
- getChildView("getting_data")->setVisible( !mManager.canBuy() && !hasError && !getChildView("currency_est")->getVisible());
-}
-
-void LLFloaterBuyCurrencyUI::collapsePanels(bool collapse)
-{
- LLLayoutPanel* price_panel = getChild<LLLayoutPanel>("layout_panel_price");
-
- if (price_panel->isCollapsed() == collapse)
- return;
-
- LLLayoutStack* outer_stack = getChild<LLLayoutStack>("outer_stack");
- LLLayoutPanel* required_panel = getChild<LLLayoutPanel>("layout_panel_required");
- LLLayoutPanel* msg_panel = getChild<LLLayoutPanel>("layout_panel_msg");
-
- S32 delta_height = price_panel->getRect().getHeight() + required_panel->getRect().getHeight() + msg_panel->getRect().getHeight();
- delta_height *= (collapse ? -1 : 1);
-
- LLIconCtrl* icon = getChild<LLIconCtrl>("normal_background");
- LLRect rect = icon->getRect();
- icon->setRect(rect.setOriginAndSize(rect.mLeft, rect.mBottom - delta_height, rect.getWidth(), rect.getHeight() + delta_height));
-
- outer_stack->collapsePanel(price_panel, collapse);
- outer_stack->collapsePanel(required_panel, collapse);
- outer_stack->collapsePanel(msg_panel, collapse);
-
- outer_stack->updateLayout();
-
- LLRect floater_rect = getRect();
- floater_rect.mBottom -= delta_height;
- setShape(floater_rect, false);
+ getChildView("getting_data")->setVisible( !mManager.canBuy() && !hasError);
}
void LLFloaterBuyCurrencyUI::onClickBuy()
@@ -294,7 +265,6 @@ void LLFloaterBuyCurrency::buyCurrency()
LLFloaterBuyCurrencyUI* ui = LLFloaterReg::showTypedInstance<LLFloaterBuyCurrencyUI>("buy_currency");
ui->noTarget();
ui->updateUI();
- ui->collapsePanels(true);
}
// static
@@ -303,7 +273,6 @@ void LLFloaterBuyCurrency::buyCurrency(const std::string& name, S32 price)
LLFloaterBuyCurrencyUI* ui = LLFloaterReg::showTypedInstance<LLFloaterBuyCurrencyUI>("buy_currency");
ui->target(name, price);
ui->updateUI();
- ui->collapsePanels(false);
}
diff --git a/indra/newview/skins/default/xui/en/floater_buy_currency.xml b/indra/newview/skins/default/xui/en/floater_buy_currency.xml
index e8e83301be..061af1b67c 100644
--- a/indra/newview/skins/default/xui/en/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/en/floater_buy_currency.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<floater
-
+ legacy_header_height="18"
can_minimize="false"
- height="285"
+ height="275"
layout="topleft"
title="BUY L$"
name="buy currency"
@@ -17,385 +17,277 @@
name="info_cannot_buy">
Unable to Buy
</floater.string>
- <floater.string
- name="estimated_zero">
- US$ 0.00
- </floater.string>
<icon
- height="245"
+ height="215"
image_name="Linden_Dollar_Background"
layout="topleft"
left="0"
name="normal_background"
- top="0"
+ top="17"
use_draw_context_alpha="false"
width="350" />
- <layout_stack
- animate="false"
- name="outer_stack"
- layout="topleft"
- follows="all"
- orientation="vertical"
- left="0"
- top="0"
- width="350"
- height="285">
- <layout_panel
- auto_resize="false"
- name="layout_panel_title"
+ <text
+ type="string"
+ length="1"
+ follows="top|left|right"
+ font="SansSerifHuge"
+ layout="topleft"
+ left="20"
+ height="30"
+ top="25"
+ width="340"
+ name="info_need_more">
+ You need more L$
+ </text>
+ <text
+ type="string"
+ length="1"
+ follows="top|left"
+ height="16"
layout="topleft"
- follows="all"
- width="350"
- height="35">
- <text
- type="string"
- length="1"
- follows="top|left|right"
- font="SansSerifLarge"
- layout="topleft"
- left="20"
- height="30"
- top="8"
- width="340"
- name="info_need_more">
- You need more L$
- </text>
- <text
- type="string"
- length="1"
- follows="top|left|right"
- font="SansSerifLarge"
- layout="topleft"
- left="20"
- height="30"
- top="8"
- width="300"
- name="info_buying">
- Buy L$
- </text>
- <view_border
- bevel_style="none"
- height="0"
- layout="topleft"
- left="20"
- name="text_border"
- top_delta="25"
- width="300"/>
- </layout_panel>
- <layout_panel
- auto_resize="false"
- name="layout_panel_price"
+ top="246"
+ left="15"
+ width="300"
+ name="contacting">
+ Contacting LindeX...
+ </text>
+ <text
+ type="string"
+ length="1"
+ follows="top|left"
+ font="SansSerifHuge"
layout="topleft"
- follows="all"
- width="350"
- height="18">
- <text
- type="string"
- length="1"
- follows="top|left"
- font="SansSerifMedium"
- height="16"
- layout="topleft"
- left="20"
- name="target_price_label"
- top_pad="3"
- width="210">
- You need
- </text>
- <text
- type="string"
- length="1"
- font="SansSerifMedium"
- follows="top|left"
- halign="right"
- height="16"
- layout="topleft"
- left="200"
- name="target_price"
- top_delta="0"
- width="120">
- L$ [AMT]
- </text>
- </layout_panel>
- <layout_panel
- auto_resize="false"
- name="layout_panel_balance"
+ left="20"
+ height="30"
+ top="25"
+ width="300"
+ name="info_buying">
+ Buy L$
+ </text>
+ <text
+ type="string"
+ length="1"
+ follows="top|left"
+ font="SansSerifMedium"
+ height="16"
layout="topleft"
- follows="all"
- width="350"
- height="19">
- <text
- type="string"
- length="1"
- follows="top|left"
- font="SansSerifMedium"
- height="16"
- layout="topleft"
- left="20"
- name="balance_label"
- top_pad="5"
- width="210">
- You now have
- </text>
- <text
- type="string"
- length="1"
- font="SansSerifMedium"
- follows="top|left"
- halign="right"
- height="16"
- layout="topleft"
- left="200"
- name="balance_amount"
- top_delta="0"
- width="120">
+ left="20"
+ name="balance_label"
+ top="65"
+ width="210">
+ I have
+ </text>
+ <text
+ type="string"
+ length="1"
+ font="SansSerifMedium"
+ follows="top|left"
+ halign="right"
+ height="16"
+ layout="topleft"
+ left="200"
+ name="balance_amount"
+ top_delta="0"
+ width="120">
L$ [AMT]
- </text>
- </layout_panel>
- <layout_panel
- auto_resize="false"
- name="layout_panel_required"
+ </text>
+ <text
+ type="string"
+ length="1"
+ follows="top|left"
+ font="SansSerifMedium"
+ height="16"
+ top="95"
+ layout="topleft"
+ left="20"
+ name="currency_action"
+ width="210">
+ I want to buy
+ </text>
+ <text
+ font="SansSerifMedium"
+ type="string"
+ length="1"
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ top_delta="0"
+ left="217"
+ name="currency_label"
+ width="15">
+ L$
+ </text>
+ <line_editor
+ type="string"
+ max_length_bytes="10"
+ halign="right"
+ font="SansSerifMedium"
+ select_on_focus="true"
+ follows="top|left"
+ top_delta="-7"
+ height="22"
+ label="L$"
+ left_pad="3"
+ name="currency_amt"
+ width="85">
+ 1234
+ </line_editor>
+ <text
+ type="string"
+ font="SansSerifMedium"
+ length="1"
+ follows="top|left"
+ height="16"
+ layout="topleft"
+ left="20"
+ top="125"
+ name="buying_label"
+ width="210">
+ For the price
+ </text>
+ <text
+ type="string"
+ length="1"
+ font="SansSerifMedium"
+ text_color="EmphasisColor"
+ follows="top|left"
+ halign="right"
+ height="16"
+ top_delta="0"
layout="topleft"
- follows="all"
- width="350"
- height="22">
- <text
- type="string"
- length="1"
- follows="top|left"
- font="SansSerifMedium"
- font.style="BOLD"
- height="16"
- layout="topleft"
- left="20"
- name="required_label"
- top_pad="6"
- width="210">
- You should buy at least
- </text>
- <text
- type="string"
- length="1"
- font="SansSerifMedium"
- follows="top|left"
- halign="right"
- height="16"
- layout="topleft"
- left="200"
- name="required_amount"
- top_delta="0"
- width="120">
+ left="150"
+ name="currency_est"
+ width="170">
+ approx. [LOCALAMOUNT]
+ </text>
+ <text
+ type="string"
+ font="SansSerifSmall"
+ text_color="EmphasisColor"
+ length="1"
+ follows="top|left"
+ height="16"
+ layout="topleft"
+ top="125"
+ left="170"
+ width="150"
+ halign="right"
+ name="getting_data">
+ Estimating...
+ </text>
+ <text
+ type="string"
+ font="SansSerifSmall"
+ top="145"
+ length="1"
+ follows="top|left"
+ height="16"
+ halign="right"
+ left="20"
+ width="300"
+ layout="topleft"
+ name="buy_action">
+ [ACTION]
+ </text>
+ <text
+ type="string"
+ font="SansSerifMedium"
+ length="1"
+ follows="top|left"
+ height="16"
+ layout="topleft"
+ left="20"
+ name="total_label"
+ top="165"
+ width="210">
+ My new balance will be
+ </text>
+ <text
+ type="string"
+ length="1"
+ font="SansSerifMedium"
+ follows="top|left"
+ top_delta="0"
+ height="16"
+ layout="topleft"
+ left="200"
+ halign="right"
+ name="total_amount"
+ width="120">
L$ [AMT]
- </text>
- </layout_panel>
- <layout_panel
- auto_resize="false"
- name="layout_panel_action"
+ </text>
+ <text
+ type="string"
+ length="1"
+ text_color="LtGray_50"
+ follows="top|left"
layout="topleft"
- follows="all"
- width="350"
- height="90">
- <view_border
- bevel_style="none"
- height="0"
- layout="topleft"
- left="20"
- name="text_border_2"
- top_pad="5"
- width="300"/>
- <text
- type="string"
- length="1"
- follows="top|left"
- font="SansSerifMedium"
- height="16"
- top_pad="15"
- layout="topleft"
- left="20"
- name="currency_action"
- width="210">
- Choose amount to buy
- </text>
- <text
- font="SansSerifMedium"
- type="string"
- length="1"
- follows="left|top"
- height="16"
- layout="topleft"
- top_delta="0"
- left="247"
- name="currency_label"
- width="15">
- L$
- </text>
- <line_editor
- type="string"
- max_length_bytes="10"
- halign="right"
- font="SansSerifMedium"
- select_on_focus="true"
- follows="top|left"
- top_delta="-4"
- height="22"
- label="L$"
- left_pad="3"
- name="currency_amt"
- width="55">
- 1234
- </line_editor>
- <text
- type="string"
- length="1"
- font="SansSerifMedium"
- text_color="EmphasisColor"
- follows="top|left"
- halign="right"
- height="16"
- top_pad="4"
- layout="topleft"
- left="150"
- name="currency_est"
- width="170">
- Approx. [LOCALAMOUNT]
- </text>
- <text
- type="string"
- font="SansSerifSmall"
- text_color="EmphasisColor"
- length="1"
- follows="top|left"
- height="16"
- layout="topleft"
- left="170"
- top_delta="0"
- width="150"
- halign="right"
- name="getting_data">
- Estimating...
- </text>
- <text
- type="string"
- font="SansSerifMedium"
- length="1"
- follows="top|left"
- height="16"
- layout="topleft"
- left="20"
- name="total_label"
- top_pad="10"
- width="210">
- Your new balance will be
- </text>
- <text
- type="string"
- length="1"
- font="SansSerifMedium"
- follows="top|left"
- top_delta="0"
- height="16"
- layout="topleft"
- left="200"
- halign="right"
- name="total_amount"
- width="120">
- L$ [AMT]
- </text>
- </layout_panel>
- <layout_panel
- auto_resize="false"
- name="layout_panel_msg"
+ halign="right"
+ top="189"
+ left="20"
+ width="300"
+ height="30"
+ name="currency_links">
+ [http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency]
+ </text>
+ <text
+ type="string"
+ length="1"
+ text_color="LtGray_50"
+ follows="top|left"
layout="topleft"
- follows="all"
- width="350"
- height="50">
- <view_border
- bevel_style="none"
- height="0"
- layout="topleft"
- left="20"
- name="text_border_3"
- top_pad="0"
- width="300"/>
- <text
- type="string"
- length="1"
- text_color="LtGray_50"
- follows="top|left"
- layout="topleft"
- halign="right"
- top_pad="3"
- left="20"
- width="300"
- height="30"
- name="currency_links">
- [http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency]
- </text>
- <text
- type="string"
- length="1"
- text_color="LtGray_50"
- follows="top|left"
- layout="topleft"
- halign="right"
- top="19"
- left="20"
- width="300"
- height="30"
- name="exchange_rate_note">
+ halign="right"
+ top="202"
+ left="20"
+ width="300"
+ height="30"
+ name="exchange_rate_note">
Re-enter amount to see the latest exchange rate.
- </text>
- <text
- type="string"
- length="1"
- follows="top|left"
- layout="topleft"
- font="SansSerifMedium"
- top="10"
- left="20"
- width="310"
- height="35"
- name="purchase_warning_repurchase">
-After you receive your L$, you should try your
-purchase again.
- </text>
- </layout_panel>
- <layout_panel
- auto_resize="false"
- name="layout_panel_buttons"
+ </text>
+ <text
+ type="string"
+ length="1"
+ text_color="LtGray_50"
+ follows="top|left"
+ layout="topleft"
+ halign="right"
+ top="208"
+ left="10"
+ width="310"
+ height="35"
+ name="purchase_warning_repurchase">
+ Confirming this purchase only buys L$, not the object.
+ </text>
+ <text
+ type="string"
+ length="1"
+ text_color="LtGray_50"
+ follows="top|left"
+ layout="topleft"
+ halign="right"
+ top="213"
+ left="20"
+ width="300"
+ height="30"
+ name="purchase_warning_notenough">
+ You aren&apos;t buying enough L$. Please increase the amount.
+ </text>
+
+ <button
+ follows="bottom|left"
+ height="20"
+ label="Buy Now"
+ layout="topleft"
+ left="151"
+ name="buy_btn"
+ top="242"
+ width="90"/>
+ <button
+ follows="bottom|right"
+ height="20"
+ label="Cancel"
layout="topleft"
- follows="all"
- width="350"
- height="40">
- <text
- type="string"
- length="1"
- follows="top|left"
- height="16"
- layout="topleft"
- top_pad="0"
- left="15"
- width="300"
- name="contacting">
- Contacting LindeX...
- </text>
- <button
- follows="top|left|right"
- height="20"
- label="Buy L$ now"
- layout="topleft"
- left="151"
- name="buy_btn"
- bottom_delta ="8"
- width="90"/>
- <button
- follows="top|left|right"
- height="20"
- label="Cancel"
- layout="topleft"
- left_pad="10"
- name="cancel_btn"
- width="90"/>
- </layout_panel>
- </layout_stack>
+ left_pad="10"
+ name="cancel_btn"
+ width="90"/>
</floater>