diff options
author | Leslie Linden <leslie@lindenlab.com> | 2012-01-11 10:05:15 -0800 |
---|---|---|
committer | Leslie Linden <leslie@lindenlab.com> | 2012-01-11 10:05:15 -0800 |
commit | 00b767e5a91d9e3379119c867164f9be40f888cc (patch) | |
tree | 4ed0a7980bfa2cb6ae4755e858b4894b34dc47b5 /indra/newview/llfloateroutbox.cpp | |
parent | b2b421acb6ddea83c9cc25c3593c534f7ff22e57 (diff) |
EXP-1791 - Handle case where initialization with SLM fails in the Merchant Outbox floater in the viewer
* Added code to clear and re-initialize the SLM cookie when authentication errors are encountered.
* Re-organized logic for outbox import a bit to hopefully be more robust when errors are encountered.
Diffstat (limited to 'indra/newview/llfloateroutbox.cpp')
-rw-r--r-- | indra/newview/llfloateroutbox.cpp | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index 6ecf715588..28589f5e9a 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -250,12 +250,12 @@ void LLFloaterOutbox::setupOutbox(const LLUUID& outboxId) // Initialize the marketplace import API // - mImportBusy = true; - setStatusString(getString("OutboxInitializing")); - - LLMarketplaceInventoryImporter::getInstance()->initialize(); - LLMarketplaceInventoryImporter::getInstance()->setStatusChangedCallback(boost::bind(&LLFloaterOutbox::importStatusChanged, this, _1)); - LLMarketplaceInventoryImporter::getInstance()->setStatusReportCallback(boost::bind(&LLFloaterOutbox::importReportResults, this, _1, _2)); + LLMarketplaceInventoryImporter& importer = LLMarketplaceInventoryImporter::instance(); + + importer.setInitializationErrorCallback(boost::bind(&LLFloaterOutbox::initializationReportError, this, _1, _2)); + importer.setStatusChangedCallback(boost::bind(&LLFloaterOutbox::importStatusChanged, this, _1)); + importer.setStatusReportCallback(boost::bind(&LLFloaterOutbox::importReportResults, this, _1, _2)); + importer.initialize(); } void LLFloaterOutbox::setStatusString(const std::string& statusString) @@ -403,7 +403,7 @@ void LLFloaterOutbox::onImportButtonClicked() { mOutboxInventoryPanel->clearSelection(); - LLMarketplaceInventoryImporter::instance().triggerImport(); + mImportBusy = LLMarketplaceInventoryImporter::instance().triggerImport(); } void LLFloaterOutbox::onOutboxChanged() @@ -449,10 +449,14 @@ void LLFloaterOutbox::importStatusChanged(bool inProgress) { if (inProgress) { - if (!mImportBusy) + if (mImportBusy) { setStatusString(getString("OutboxImporting")); } + else + { + setStatusString(getString("OutboxInitializing")); + } mImportBusy = true; mImportButton->setEnabled(false); @@ -463,9 +467,25 @@ void LLFloaterOutbox::importStatusChanged(bool inProgress) mImportBusy = false; mImportButton->setEnabled(mOutboxItemCount > 0); mInventoryImportInProgress->setVisible(false); + } + + updateView(); +} - updateView(); +void LLFloaterOutbox::initializationReportError(U32 status, const LLSD& content) +{ + if (status != MarketplaceErrorCodes::IMPORT_DONE) + { + char status_string[16]; + sprintf(status_string, "%d", status); + + LLSD subs; + subs["[ERROR_CODE]"] = status_string; + + LLNotificationsUtil::add("OutboxInitFailed", subs); } + + updateView(); } void LLFloaterOutbox::showNotification(const LLSD& notify) |