diff options
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/newview/llagent.cpp | 6 | ||||
-rwxr-xr-x | indra/newview/llmarketplacefunctions.cpp | 19 | ||||
-rwxr-xr-x | indra/newview/llmarketplacefunctions.h | 2 | ||||
-rwxr-xr-x | indra/newview/llstartup.cpp | 7 | ||||
-rwxr-xr-x | indra/newview/llviewermenu.cpp | 21 |
5 files changed, 32 insertions, 23 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index e5a90e8a28..392fe8fc2e 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3867,6 +3867,12 @@ void LLAgent::handleTeleportFinished() LLNotificationsUtil::add("PreferredMaturityChanged", args); mIsMaturityRatingChangingDuringTeleport = false; } + + // Init SLM Marketplace connection so we know which UI should be used for the user as a merchant + // Note: Eventually, all merchant will be migrated to the new SLM system and there will be no reason to show the old UI at all. + // Note: Some regions will not support the SLM cap for a while so we need to do that check for each teleport. + // *TODO : Suppress that line from here once the whole grid migrated to SLM and move it to idle_startup() (llstartup.cpp) + check_merchant_status(); } void LLAgent::handleTeleportFailed() diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index d900d29925..c35b251c7e 100755 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -1178,10 +1178,13 @@ void LLMarketplaceData::initializeSLM(const status_updated_signal_t::slot_type& else { // Initiate SLM connection and set responder - mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_INITIALIZING; std::string url = getSLMConnectURL("/merchant"); - log_SLM_infos("LLHTTPClient::get", url, ""); - LLHTTPClient::get(url, new LLSLMGetMerchantResponder(), LLSD()); + if (url != "") + { + mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_INITIALIZING; + log_SLM_infos("LLHTTPClient::get", url, ""); + LLHTTPClient::get(url, new LLSLMGetMerchantResponder(), LLSD()); + } } } @@ -1325,16 +1328,10 @@ std::string LLMarketplaceData::getSLMConnectURL(const std::string& route) { // Get DirectDelivery cap url = regionp->getCapability("DirectDelivery"); - // *TODO : Take this DirectDelivery cap coping mechanism hack out - if (url == "") - { - url = "https://marketplace.secondlife-staging.com/api/1/viewer/" + gAgentID.asString(); - } - else + if (url != "") { - llinfos << "Merov : DD cap = " << url << ", agent = " << gAgentID.asString() << llendl; + url += route; } - url += route; } return url; } diff --git a/indra/newview/llmarketplacefunctions.h b/indra/newview/llmarketplacefunctions.h index 391ab8a733..4aca88cba1 100755 --- a/indra/newview/llmarketplacefunctions.h +++ b/indra/newview/llmarketplacefunctions.h @@ -187,6 +187,7 @@ public: typedef boost::signals2::signal<void ()> status_updated_signal_t; void initializeSLM(const status_updated_signal_t::slot_type& cb); U32 getSLMStatus() const { return mMarketPlaceStatus; } + void setSLMStatus(U32 status); void getSLMListings(); bool isEmpty() { return (mMarketplaceItems.size() == 0); } @@ -234,7 +235,6 @@ private: bool setCountOnHand(const LLUUID& folder_id, S32 count, bool update = true); // Private SLM API : package data and get/post/put requests to the SLM Server through the SLM API - void setSLMStatus(U32 status); void createSLMListing(const LLUUID& folder_id); void getSLMListing(S32 listing_id); void updateSLMListing(const LLUUID& folder_id, S32 listing_id, const LLUUID& version_id, bool is_listed, S32 count); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index fa8a6eb87a..cfc654eb98 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1876,11 +1876,8 @@ bool idle_startup() display_startup(); - // Init SLM Marketplace connection so we know which UI should be used for the user as a merchant - // Note: Eventually, all merchant will be migrated to the new SLM system and there will be no - // reason to show the old UI at all. - // *TODO : Suppress the Merchant Outbox UI completely - check_merchant_status(); + // *TODO : Uncomment that line once the whole grid migrated to SLM and suppress it from LLAgent::handleTeleportFinished() (llagent.cpp) + //check_merchant_status(); display_startup(); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 2fb1713062..1de615aa6e 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -422,8 +422,10 @@ void check_merchant_status() { if (!gSavedSettings.getBOOL("InventoryOutboxDisplayBoth")) { - // Hide both merchant related menu items - gMenuHolder->getChild<LLView>("MerchantOutbox")->setVisible(FALSE); + // Reset the SLM status: we actually want to check again, that's the point of calling check_merchant_status() + LLMarketplaceData::instance().setSLMStatus(MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED); + + // Hide SLM related menu item gMenuHolder->getChild<LLView>("MarketplaceListings")->setVisible(FALSE); // Also disable the toolbar button for Marketplace Listings @@ -432,10 +434,17 @@ void check_merchant_status() // Launch an SLM test connection to get the merchant status LLMarketplaceData::instance().initializeSLM(boost::bind(&set_merchant_SLM_menu)); - - // Launch a Merchant Outbox test connection to get the migration status - LLMarketplaceInventoryImporter::instance().setStatusReportCallback(boost::bind(&set_merchant_outbox_menu,_1, _2)); - LLMarketplaceInventoryImporter::instance().initialize(); + + // Do the Merchant Outbox init only once per session + if (LLMarketplaceInventoryImporter::instance().getMarketPlaceStatus() == MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED) + { + // Hide merchant outbox related menu item + gMenuHolder->getChild<LLView>("MerchantOutbox")->setVisible(FALSE); + + // Launch a Merchant Outbox test connection to get the migration status + LLMarketplaceInventoryImporter::instance().setStatusReportCallback(boost::bind(&set_merchant_outbox_menu,_1, _2)); + LLMarketplaceInventoryImporter::instance().initialize(); + } } } |