From d435e2ee26c7a71ee180ebff66bc793b0566e1a2 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 23 Sep 2020 12:29:54 +0300 Subject: =?UTF-8?q?Revert=20"SL-11867=20Show=20=E2=80=9CUnable=20to=20buy?= =?UTF-8?q?=E2=80=9D=20message=20via=20notification"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7e2e2503c5fb57736844bdad0f309d2d49ee86b2. --- indra/newview/llfloaterbuycurrency.cpp | 37 ++++++++++++++++--- .../skins/default/xui/da/floater_buy_currency.xml | 5 +-- .../skins/default/xui/de/floater_buy_currency.xml | 5 +-- .../skins/default/xui/en/floater_buy_currency.xml | 42 +++++++++++++++++++--- .../newview/skins/default/xui/en/notifications.xml | 12 ------- .../skins/default/xui/es/floater_buy_currency.xml | 5 +-- .../skins/default/xui/fr/floater_buy_currency.xml | 5 +-- .../skins/default/xui/it/floater_buy_currency.xml | 5 +-- .../skins/default/xui/ja/floater_buy_currency.xml | 5 +-- .../skins/default/xui/pl/floater_buy_currency.xml | 5 +-- .../skins/default/xui/pt/floater_buy_currency.xml | 5 +-- .../skins/default/xui/ru/floater_buy_currency.xml | 5 +-- .../skins/default/xui/tr/floater_buy_currency.xml | 5 +-- .../skins/default/xui/zh/floater_buy_currency.xml | 5 +-- 14 files changed, 103 insertions(+), 43 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterbuycurrency.cpp b/indra/newview/llfloaterbuycurrency.cpp index 25348474a1..91436e52fe 100644 --- a/indra/newview/llfloaterbuycurrency.cpp +++ b/indra/newview/llfloaterbuycurrency.cpp @@ -74,6 +74,7 @@ public: void onClickBuy(); void onClickCancel(); + void onClickErrorWeb(); }; LLFloater* LLFloaterBuyCurrency::buildFloater(const LLSD& key) @@ -131,6 +132,7 @@ BOOL LLFloaterBuyCurrencyUI::postBuild() getChild("buy_btn")->setCommitCallback( boost::bind(&LLFloaterBuyCurrencyUI::onClickBuy, this)); getChild("cancel_btn")->setCommitCallback( boost::bind(&LLFloaterBuyCurrencyUI::onClickCancel, this)); + getChild("error_web")->setCommitCallback( boost::bind(&LLFloaterBuyCurrencyUI::onClickErrorWeb, this)); center(); @@ -171,6 +173,7 @@ void LLFloaterBuyCurrencyUI::updateUI() // hide most widgets - we'll turn them on as needed next getChildView("info_buying")->setVisible(FALSE); + getChildView("info_cannot_buy")->setVisible(FALSE); getChildView("info_need_more")->setVisible(FALSE); getChildView("purchase_warning_repurchase")->setVisible(FALSE); getChildView("purchase_warning_notenough")->setVisible(FALSE); @@ -180,16 +183,32 @@ void LLFloaterBuyCurrencyUI::updateUI() if (hasError) { // display an error from the server - LLSD args; - args["TITLE"] = getString("info_cannot_buy"); - args["MESSAGE"] = mManager.errorMessage(); - LLNotificationsUtil::add("CouldNotBuyCurrency", args); - closeFloater(); + getChildView("normal_background")->setVisible(FALSE); + getChildView("error_background")->setVisible(TRUE); + getChildView("info_cannot_buy")->setVisible(TRUE); + getChildView("cannot_buy_message")->setVisible(TRUE); + getChildView("balance_label")->setVisible(FALSE); + getChildView("balance_amount")->setVisible(FALSE); + getChildView("buying_label")->setVisible(FALSE); + getChildView("buying_amount")->setVisible(FALSE); + getChildView("total_label")->setVisible(FALSE); + getChildView("total_amount")->setVisible(FALSE); + + LLTextBox* message = getChild("cannot_buy_message"); + if (message) + { + message->setText(mManager.errorMessage()); + } + + getChildView("error_web")->setVisible( !mManager.errorURI().empty()); } else { // display the main Buy L$ interface getChildView("normal_background")->setVisible(TRUE); + getChildView("error_background")->setVisible(FALSE); + getChildView("cannot_buy_message")->setVisible(FALSE); + getChildView("error_web")->setVisible(FALSE); if (mHasTarget) { @@ -259,6 +278,14 @@ void LLFloaterBuyCurrencyUI::onClickCancel() LLStatusBar::sendMoneyBalanceRequest(); } +void LLFloaterBuyCurrencyUI::onClickErrorWeb() +{ + LLWeb::loadURL(mManager.errorURI()); + closeFloater(); + // Update L$ balance + LLStatusBar::sendMoneyBalanceRequest(); +} + // static void LLFloaterBuyCurrency::buyCurrency() { diff --git a/indra/newview/skins/default/xui/da/floater_buy_currency.xml b/indra/newview/skins/default/xui/da/floater_buy_currency.xml index b7ac181dd4..3c0428b2b0 100644 --- a/indra/newview/skins/default/xui/da/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/da/floater_buy_currency.xml @@ -60,7 +60,8 @@ objektet.