diff options
| author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2026-08-11 19:13:13 +0300 |
|---|---|---|
| committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2026-09-04 14:44:41 +0300 |
| commit | 7be4a67abbb484f8c91604f947a9942253919baa (patch) | |
| tree | b7884ecd4b9228f002e44675fa9113366d0058c6 | |
| parent | 09cdedb147db175e38d08b9a6020b8bd3d07dc91 (diff) | |
Refresh L$ balance on floater close and on successful purchase navigation
| -rw-r--r-- | indra/newview/llbuycurrencyhtml.cpp | 3 | ||||
| -rw-r--r-- | indra/newview/llfloaterbuycurrencyhtml.cpp | 19 | ||||
| -rw-r--r-- | indra/newview/llfloaterbuycurrencyhtml.h | 6 |
3 files changed, 24 insertions, 4 deletions
diff --git a/indra/newview/llbuycurrencyhtml.cpp b/indra/newview/llbuycurrencyhtml.cpp index 8469eaa6ff..0ae3b6eb4a 100644 --- a/indra/newview/llbuycurrencyhtml.cpp +++ b/indra/newview/llbuycurrencyhtml.cpp @@ -160,7 +160,4 @@ void LLBuyCurrencyHTML::closeDialog() { buy_currency_floater->closeFloater(); }; - - // Update L$ balance in the status bar in case L$ were purchased - LLStatusBar::sendMoneyBalanceRequest(); } diff --git a/indra/newview/llfloaterbuycurrencyhtml.cpp b/indra/newview/llfloaterbuycurrencyhtml.cpp index 24ec43e7e4..488bd088c1 100644 --- a/indra/newview/llfloaterbuycurrencyhtml.cpp +++ b/indra/newview/llfloaterbuycurrencyhtml.cpp @@ -28,6 +28,7 @@ #include "llfloaterbuycurrencyhtml.h" #include "llmediactrl.h" +#include "llstatusbar.h" #include "llviewercontrol.h" #include "llweb.h" @@ -42,9 +43,18 @@ LLFloaterBuyCurrencyHTML::~LLFloaterBuyCurrencyHTML() { } +void LLFloaterBuyCurrencyHTML::onClose(bool app_quitting) +{ + if (!app_quitting) + LLStatusBar::sendMoneyBalanceRequest(); + + LLFloater::onClose(app_quitting); +} + bool LLFloaterBuyCurrencyHTML::postBuild() { mBrowser = getChild<LLMediaCtrl>("browser"); + mBrowser->addObserver(this); mBrowser->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL")); LLViewerMedia::getInstance()->getOpenIDCookie(mBrowser); return true; @@ -70,3 +80,12 @@ void LLFloaterBuyCurrencyHTML::navigateToFinalURL() mBrowser->navigateTo(buy_currency_url, HTTP_CONTENT_TEXT_HTML); } + +void LLFloaterBuyCurrencyHTML::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) +{ + if ((LLPluginClassMediaOwner::MEDIA_EVENT_NAVIGATE_COMPLETE == event) && + (self->getNavigateURI().find("done=success") != std::string::npos)) + { + LLStatusBar::sendMoneyBalanceRequest(); + } +} diff --git a/indra/newview/llfloaterbuycurrencyhtml.h b/indra/newview/llfloaterbuycurrencyhtml.h index e8dbd0a716..80e368e607 100644 --- a/indra/newview/llfloaterbuycurrencyhtml.h +++ b/indra/newview/llfloaterbuycurrencyhtml.h @@ -30,7 +30,8 @@ #include "llmediactrl.h" class LLFloaterBuyCurrencyHTML: - public LLFloater + public LLFloater, + public LLViewerMediaObserver { friend class LLFloaterReg; @@ -38,6 +39,9 @@ public: LLFloaterBuyCurrencyHTML(const LLSD& key); ~LLFloaterBuyCurrencyHTML(); bool postBuild() override; + void onClose(bool app_quitting) override; + void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) override; + void navigateToFinalURL(); void setShortfall(S32 shortfall) { mShortfall = shortfall; } |
