diff options
| author | Mark Palange (Mani) <palange@lindenlab.com> | 2009-10-01 18:19:45 -0700 |
|---|---|---|
| committer | Mark Palange (Mani) <palange@lindenlab.com> | 2009-10-01 18:19:45 -0700 |
| commit | dde2153014cd7d7b8fa704f7067a41344bfbb1c2 (patch) | |
| tree | f7633ccef179644660897c8bf3684abeda3545f8 /indra/newview/llfloaterbuycurrency.cpp | |
| parent | 9b8b0571645f8b607ecc24221c807cc02a03692f (diff) | |
| parent | 85ea690d47208f6dda020c8ff81021179fbdd0b8 (diff) | |
merge of latest lindenlab/svn-imports-viewer-20
Diffstat (limited to 'indra/newview/llfloaterbuycurrency.cpp')
| -rw-r--r-- | indra/newview/llfloaterbuycurrency.cpp | 42 |
1 files changed, 14 insertions, 28 deletions
diff --git a/indra/newview/llfloaterbuycurrency.cpp b/indra/newview/llfloaterbuycurrency.cpp index 0107cb6fe2..5c4b8552a6 100644 --- a/indra/newview/llfloaterbuycurrency.cpp +++ b/indra/newview/llfloaterbuycurrency.cpp @@ -159,6 +159,9 @@ void LLFloaterBuyCurrencyUI::draw() updateUI(); } + // disable the Buy button when we are not able to buy + childSetEnabled("buy_btn", mManager.canBuy()); + LLFloater::draw(); } @@ -194,29 +197,19 @@ void LLFloaterBuyCurrencyUI::updateUI() // error section if (hasError) { - mChildren.setBadge(std::string("step_error"), LLViewChildren::BADGE_ERROR); - - LLTextBox* message = getChild<LLTextBox>("error_message"); - if (message) - { - message->setVisible(true); - message->setWrappedText(mManager.errorMessage()); - } - - childSetVisible("error_web", !mManager.errorURI().empty()); - if (!mManager.errorURI().empty()) - { - childHide("getting_data"); - } + childHide("normal_background"); + childShow("error_background"); + childShow("cannot_buy_message"); + childShow("error_web"); } else { - childHide("step_error"); - childHide("error_message"); + childShow("normal_background"); + childHide("error_background"); + childHide("cannot_buy_message"); childHide("error_web"); } - - + // currency childSetVisible("contacting", false); childSetVisible("buy_action", false); @@ -224,8 +217,6 @@ void LLFloaterBuyCurrencyUI::updateUI() if (!hasError) { - mChildren.setBadge(std::string("step_1"), LLViewChildren::BADGE_NOTE); - if (mManager.buying()) { childSetVisible("contacting", true); @@ -286,9 +277,8 @@ void LLFloaterBuyCurrencyUI::updateUI() childHide("purchase_warning_notenough"); } - childSetEnabled("buy_btn", mManager.canBuy()); - - if (!mManager.canBuy() && !childIsVisible("error_web")) + childHide("getting_data"); + if (!mManager.canBuy() && !hasError) { childShow("getting_data"); } @@ -298,10 +288,6 @@ void LLFloaterBuyCurrencyUI::onClickBuy() { mManager.buy(getString("buy_currency")); updateUI(); - // JC: updateUI() doesn't get called again until progress is made - // with transaction processing, so the "Purchase" button would be - // left enabled for some time. Pre-emptively disable. - childSetEnabled("buy_btn", false); } void LLFloaterBuyCurrencyUI::onClickCancel() @@ -311,7 +297,7 @@ void LLFloaterBuyCurrencyUI::onClickCancel() void LLFloaterBuyCurrencyUI::onClickErrorWeb() { - LLWeb::loadURLExternal(mManager.errorURI()); + LLWeb::loadURLExternal(getString("account_website")); closeFloater(); } |
