summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Reddy <lynx@lindenlab.com>2009-10-08 11:45:44 +0000
committerMartin Reddy <lynx@lindenlab.com>2009-10-08 11:45:44 +0000
commit5787d576d11ca5e3747ce7c88c6fd0be3803f047 (patch)
tree1eedbadc3788311375a5aeaddf61ff877f5bd790
parentfad53523aed2e1218c8fdcebffcbe7cb4c78cba9 (diff)
EXT-1356: Updated the Buy L$ floater so that we now display any error
message that we received from the server. It wasn't a good idea to ignore these and assume that any problem could be dealt with by going to the secondlife.com billing webpage. I also improved the layout of the main Buy L$ page. For example, the "Getting data..." message now appears in the same place where the actual currency figure will be updated. I also generally improved the placement of text and buttons.
-rw-r--r--indra/newview/llfloaterbuycurrency.cpp92
-rw-r--r--indra/newview/skins/default/xui/en/floater_buy_currency.xml74
2 files changed, 76 insertions, 90 deletions
diff --git a/indra/newview/llfloaterbuycurrency.cpp b/indra/newview/llfloaterbuycurrency.cpp
index 5c4b8552a6..e160cd01be 100644
--- a/indra/newview/llfloaterbuycurrency.cpp
+++ b/indra/newview/llfloaterbuycurrency.cpp
@@ -175,48 +175,54 @@ void LLFloaterBuyCurrencyUI::updateUI()
bool hasError = mManager.hasError();
mManager.updateUI(!hasError && !mManager.buying());
- // section zero: title area
- {
- childSetVisible("info_buying", false);
- childSetVisible("info_cannot_buy", false);
- childSetVisible("info_need_more", false);
- if (hasError)
- {
- childSetVisible("info_cannot_buy", true);
- }
- else if (mHasTarget)
- {
- childSetVisible("info_need_more", true);
- }
- else
- {
- childSetVisible("info_buying", true);
- }
- }
-
- // error section
+ // hide most widgets - we'll turn them on as needed next
+ childHide("info_buying");
+ childHide("info_cannot_buy");
+ childHide("info_need_more");
+ childHide("purchase_warning_repurchase");
+ childHide("purchase_warning_notenough");
+ childHide("contacting");
+ childHide("buy_action");
+
if (hasError)
{
+ // display an error from the server
childHide("normal_background");
childShow("error_background");
+ childShow("info_cannot_buy");
childShow("cannot_buy_message");
- childShow("error_web");
+ childHide("balance_label");
+ childHide("balance_amount");
+ childHide("buying_label");
+ childHide("buying_amount");
+ childHide("total_label");
+ childHide("total_amount");
+
+ LLTextBox* message = getChild<LLTextBox>("cannot_buy_message");
+ if (message)
+ {
+ message->setText(mManager.errorMessage());
+ }
+
+ childSetVisible("error_web", !mManager.errorURI().empty());
}
else
{
+ // display the main Buy L$ interface
childShow("normal_background");
childHide("error_background");
childHide("cannot_buy_message");
childHide("error_web");
- }
- // currency
- childSetVisible("contacting", false);
- childSetVisible("buy_action", false);
- childSetVisible("buy_action_unknown", false);
-
- if (!hasError)
- {
+ if (mHasTarget)
+ {
+ childShow("info_need_more");
+ }
+ else
+ {
+ childShow("info_buying");
+ }
+
if (mManager.buying())
{
childSetVisible("contacting", true);
@@ -229,10 +235,6 @@ void LLFloaterBuyCurrencyUI::updateUI()
childSetTextArg("buy_action", "[NAME]", mTargetName);
childSetTextArg("buy_action", "[PRICE]", llformat("%d",mTargetPrice));
}
- else
- {
- childSetVisible("buy_action_unknown", true);
- }
}
S32 balance = gStatusBar->getBalance();
@@ -250,8 +252,6 @@ void LLFloaterBuyCurrencyUI::updateUI()
childShow("total_amount");
childSetTextArg("total_amount", "[AMT]", llformat("%d", total));
- childSetVisible("purchase_warning_repurchase", false);
- childSetVisible("purchase_warning_notenough", false);
if (mHasTarget)
{
if (total >= mTargetPrice)
@@ -264,24 +264,8 @@ void LLFloaterBuyCurrencyUI::updateUI()
}
}
}
- else
- {
- childHide("step_1");
- childHide("balance_label");
- childHide("balance_amount");
- childHide("buying_label");
- childHide("buying_amount");
- childHide("total_label");
- childHide("total_amount");
- childHide("purchase_warning_repurchase");
- childHide("purchase_warning_notenough");
- }
-
- childHide("getting_data");
- if (!mManager.canBuy() && !hasError)
- {
- childShow("getting_data");
- }
+
+ childSetVisible("getting_data", !mManager.canBuy() && !hasError);
}
void LLFloaterBuyCurrencyUI::onClickBuy()
@@ -297,7 +281,7 @@ void LLFloaterBuyCurrencyUI::onClickCancel()
void LLFloaterBuyCurrencyUI::onClickErrorWeb()
{
- LLWeb::loadURLExternal(getString("account_website"));
+ LLWeb::loadURLExternal(mManager.errorURI());
closeFloater();
}
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 991c9a84a3..041cd2a118 100644
--- a/indra/newview/skins/default/xui/en/floater_buy_currency.xml
+++ b/indra/newview/skins/default/xui/en/floater_buy_currency.xml
@@ -12,10 +12,6 @@
name="buy_currency">
Buy L$ [LINDENS] for approx. [LOCALAMOUNT]
</floater.string>
- <floater.string
- name="account_website">
- http://secondlife.com/account/billing.php
- </floater.string>
<icon
height="215"
image_name="Linden_Dollar_Background"
@@ -35,7 +31,7 @@
top="30"
width="300"
name="info_need_more">
- You need more L$:
+ You need more L$
</text>
<text
type="string"
@@ -43,7 +39,8 @@
follows="top|left"
height="16"
layout="topleft"
- left="20"
+ top="246"
+ left="15"
width="300"
name="contacting">
Contacting LindeX...
@@ -70,7 +67,7 @@
layout="topleft"
left="20"
name="balance_label"
- top_pad="10"
+ top="70"
width="210">
I have
</text>
@@ -85,7 +82,7 @@
left="200"
name="balance_amount"
top_delta="0"
- width="100">
+ width="120">
L$ [AMT]
</text>
<text
@@ -94,7 +91,7 @@
follows="top|left"
font="SansSerifMedium"
height="16"
- top_pad="15"
+ top="100"
layout="topleft"
left="20"
name="currency_action"
@@ -109,7 +106,7 @@
height="16"
layout="topleft"
top_delta="0"
- left="222"
+ left="242"
name="currency_label"
width="15">
L$
@@ -136,7 +133,7 @@
height="16"
layout="topleft"
left="20"
- top_pad="10"
+ top="130"
name="buying_label"
width="210">
For the price
@@ -153,7 +150,7 @@
layout="topleft"
left="170"
name="currency_est"
- width="130">
+ width="150">
[LOCALAMOUNT]
</text>
<text
@@ -164,8 +161,9 @@
follows="top|left"
height="16"
layout="topleft"
- left="40"
- width="100"
+ top="130"
+ left="170"
+ width="150"
halign="right"
name="getting_data">
Estimating...
@@ -173,13 +171,13 @@
<text
type="string"
font="SansSerifSmall"
- top_delta="0"
+ top="150"
length="1"
follows="top|left"
halign="right"
height="16"
- left_pad="10"
- width="150"
+ left="150"
+ width="170"
layout="topleft"
name="buy_action">
[NAME] L$ [PRICE]
@@ -193,6 +191,7 @@
layout="topleft"
left="20"
name="total_label"
+ top="170"
width="210">
My new balance will be
</text>
@@ -207,7 +206,7 @@
left="200"
halign="right"
name="total_amount"
- width="100">
+ width="120">
L$ [AMT]
</text>
<text
@@ -215,8 +214,10 @@
length="1"
follows="top|left"
layout="topleft"
+ top="195"
left="20"
width="300"
+ height="30"
name="purchase_warning_repurchase">
Confirming this purchase only buys the L$.
You&apos;ll need to try again.
@@ -226,7 +227,10 @@ You&apos;ll need to try again.
length="1"
follows="top|left"
layout="topleft"
+ top="195"
left="20"
+ width="300"
+ height="30"
name="purchase_warning_notenough">
You aren&apos;t buying enough L$.
Increase the amount to buy.
@@ -239,7 +243,7 @@ Increase the amount to buy.
layout="topleft"
left="151"
name="buy_btn"
- top="248"
+ top="242"
width="90"/>
<button
follows="bottom|right"
@@ -260,15 +264,23 @@ Increase the amount to buy.
<text
type="string"
font="SansSerifHuge"
- left="170"
+ left="165"
width="170"
- height="80"
- top="30"
+ height="25"
+ top="25"
name="info_cannot_buy">
- Take your
-[SECOND_LIFE] to
-the next level...
+ Unable to Buy
</text>
+ <text
+ type="string"
+ width="175"
+ height="125"
+ top="60"
+ left="165"
+ word_wrap="true"
+ follows="bottom|right"
+ name="cannot_buy_message">
+ </text>
<button
follows="bottom|left"
height="20"
@@ -276,16 +288,6 @@ the next level...
layout="topleft"
left="170"
name="error_web"
- top="120"
+ top="200"
width="160"/>
- <text
- type="string"
- width="350"
- height="20"
- top_pad="92"
- left_pad="-300"
- follows="bottom|right"
- name="cannot_buy_message">
- Continue to the web site and enter payment information
- </text>
</floater>