diff options
author | Merov Linden <merov@lindenlab.com> | 2014-04-28 14:11:17 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2014-04-28 14:11:17 -0700 |
commit | fc4939033e089354bc05fd0ca7fe402a4a1198bd (patch) | |
tree | 1cdef2ecf856b25f4455b7839270c5662c8d2b55 /indra/newview/llfloatermarketplacelistings.cpp | |
parent | 6d7b33f77e6d6facd585faf8c5d355f68942fcef (diff) |
DD-22 : WIP : Fix initialization glitch and got rid of old Merchant Outbox remnants in Marketplace
Diffstat (limited to 'indra/newview/llfloatermarketplacelistings.cpp')
-rwxr-xr-x | indra/newview/llfloatermarketplacelistings.cpp | 73 |
1 files changed, 22 insertions, 51 deletions
diff --git a/indra/newview/llfloatermarketplacelistings.cpp b/indra/newview/llfloatermarketplacelistings.cpp index 27b31518a1..ccfca71df9 100755 --- a/indra/newview/llfloatermarketplacelistings.cpp +++ b/indra/newview/llfloatermarketplacelistings.cpp @@ -160,8 +160,7 @@ public: if (added_category_type == LLFolderType::FT_MARKETPLACE_LISTINGS) { - //mMarketplaceListingsFloater->initializeMarketPlace(); - LLMarketplaceData::instance().initializeSLM(); + mMarketplaceListingsFloater->initializeMarketPlace(); } } } @@ -235,11 +234,9 @@ void LLFloaterMarketplaceListings::onOpen(const LLSD& key) // // Initialize the Market Place or go update the marketplace listings // - //if (LLMarketplaceInventoryImporter::getInstance()->getMarketPlaceStatus() == MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED) if (LLMarketplaceData::instance().getSLMStatus() == MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED) { - //initializeMarketPlace(); - LLMarketplaceData::instance().initializeSLM(); + initializeMarketPlace(); } else { @@ -272,7 +269,6 @@ void LLFloaterMarketplaceListings::fetchContents() void LLFloaterMarketplaceListings::setup() { - //if (LLMarketplaceInventoryImporter::getInstance()->getMarketPlaceStatus() != MarketplaceStatusCodes::MARKET_PLACE_MERCHANT) if (LLMarketplaceData::instance().getSLMStatus() != MarketplaceStatusCodes::MARKET_PLACE_MERCHANT) { // If we are *not* a merchant or we have no market place connection established yet, do nothing @@ -327,18 +323,7 @@ void LLFloaterMarketplaceListings::setup() void LLFloaterMarketplaceListings::initializeMarketPlace() { - // - // Initialize the marketplace import API - // - LLMarketplaceInventoryImporter& importer = LLMarketplaceInventoryImporter::instance(); - - if (!importer.isInitialized()) - { - importer.setInitializationErrorCallback(boost::bind(&LLFloaterMarketplaceListings::initializationReportError, this, _1, _2)); - importer.setStatusChangedCallback(boost::bind(&LLFloaterMarketplaceListings::importStatusChanged, this, _1)); - importer.setStatusReportCallback(boost::bind(&LLFloaterMarketplaceListings::importReportResults, this, _1, _2)); - importer.initialize(); - } + LLMarketplaceData::instance().initializeSLM(boost::bind(&LLFloaterMarketplaceListings::updateView, this)); } S32 LLFloaterMarketplaceListings::getFolderCount() @@ -379,9 +364,27 @@ void LLFloaterMarketplaceListings::updateView() std::string tooltip; const LLSD& subs = getMarketplaceStringSubstitutions(); - //U32 mkt_status = LLMarketplaceInventoryImporter::getInstance()->getMarketPlaceStatus(); U32 mkt_status = LLMarketplaceData::instance().getSLMStatus(); + // Get or create the root folder if we are a merchant and it hasn't been done already + if (mRootFolderId.isNull() && (mkt_status == MarketplaceStatusCodes::MARKET_PLACE_MERCHANT)) + { + setup(); + } + + // Update the bottom initializing status and progress dial + if (mkt_status == MarketplaceStatusCodes::MARKET_PLACE_INITIALIZING) + { + setStatusString(getString("MarketplaceListingsInitializing")); + mInventoryInitializationInProgress->setVisible(true); + } + else + { + setStatusString(""); + mInventoryInitializationInProgress->setVisible(false); + } + + // Update the top message or flip to the tabs and folders view // *TODO : check those messages and create better appropriate ones in strings.xml if (mRootFolderId.notNull()) { @@ -483,38 +486,6 @@ void LLFloaterMarketplaceListings::onChanged() } } -void LLFloaterMarketplaceListings::initializationReportError(U32 status, const LLSD& content) -{ - updateView(); -} - -void LLFloaterMarketplaceListings::importStatusChanged(bool inProgress) -{ - //if (mRootFolderId.isNull() && (LLMarketplaceInventoryImporter::getInstance()->getMarketPlaceStatus() == MarketplaceStatusCodes::MARKET_PLACE_MERCHANT)) - if (mRootFolderId.isNull() && (LLMarketplaceData::instance().getSLMStatus() == MarketplaceStatusCodes::MARKET_PLACE_MERCHANT)) - { - setup(); - } - - if (inProgress) - { - setStatusString(getString("MarketplaceListingsInitializing")); - mInventoryInitializationInProgress->setVisible(true); - } - else - { - setStatusString(""); - mInventoryInitializationInProgress->setVisible(false); - } - - updateView(); -} - -void LLFloaterMarketplaceListings::importReportResults(U32 status, const LLSD& content) -{ - updateView(); -} - //----------------------------------------------------------------------------- // LLFloaterAssociateListing //----------------------------------------------------------------------------- |