From 6b8916e7604d47f37d30ae0c1a6ab2465da1f39d Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sun, 5 Oct 2014 20:17:29 -0700 Subject: DD-170 : Handle 503 answer from SLM and added a MARKET_MERCHANT_NOT_MIGRATED state to the UI, showing only the relevant UI to the user (i.e. Merchant Outbox or Marketplace Listings). --- indra/newview/llviewermenu.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 38aaff9279..613ad00809 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -88,6 +88,7 @@ #include "llinventoryfunctions.h" #include "llpanellogin.h" #include "llpanelblockedlist.h" +#include "llmarketplacefunctions.h" #include "llmenuoptionpathfindingrebakenavmesh.h" #include "llmoveview.h" #include "llparcel.h" @@ -98,6 +99,7 @@ #include "llspellcheckmenuhandler.h" #include "llstatusbar.h" #include "lltextureview.h" +#include "lltoolbarview.h" #include "lltoolcomp.h" #include "lltoolmgr.h" #include "lltoolpie.h" @@ -386,6 +388,37 @@ void set_underclothes_menu_options() } } +void set_merchant_menu() +{ + if (LLMarketplaceData::instance().getSLMStatus() == MarketplaceStatusCodes::MARKET_MERCHANT_NOT_MIGRATED) + { + // Merchant not migrated: show only the old Merchant Outbox menu + gMenuHolder->getChild("MerchantOutbox")->setVisible(TRUE); + } + else + { + // All other cases (new merchant, not merchant, migrated merchant): show the new Marketplace Listings menu and enable the tool + gMenuHolder->getChild("MarketplaceListings")->setVisible(TRUE); + LLCommand* command = LLCommandManager::instance().getCommand("marketplacelistings"); + gToolBarView->enableCommand(command->id(), true); + } +} + +void check_merchant_status() +{ + if (!gSavedSettings.getBOOL("InventoryOutboxDisplayBoth")) + { + // Hide both merchant related menu items + gMenuHolder->getChild("MerchantOutbox")->setVisible(FALSE); + gMenuHolder->getChild("MarketplaceListings")->setVisible(FALSE); + // Also disable the toolbar button for Marketplace Listings + LLCommand* command = LLCommandManager::instance().getCommand("marketplacelistings"); + gToolBarView->enableCommand(command->id(), false); + // Launch an SLM test connection to get the merchant status + LLMarketplaceData::instance().initializeSLM(boost::bind(&set_merchant_menu)); + } +} + void init_menus() { // Initialize actions -- cgit v1.2.3 From 5ded6ef85b971a2be9287f11be5acca2b343f364 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 6 Oct 2014 21:09:01 -0700 Subject: DD-170 : Rename enum for consistency --- indra/newview/llviewermenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 613ad00809..b5262a7e1b 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -390,7 +390,7 @@ void set_underclothes_menu_options() void set_merchant_menu() { - if (LLMarketplaceData::instance().getSLMStatus() == MarketplaceStatusCodes::MARKET_MERCHANT_NOT_MIGRATED) + if (LLMarketplaceData::instance().getSLMStatus() == MarketplaceStatusCodes::MARKET_PLACE_NOT_MIGRATED_MERCHANT) { // Merchant not migrated: show only the old Merchant Outbox menu gMenuHolder->getChild("MerchantOutbox")->setVisible(TRUE); -- cgit v1.2.3 From 8ca0ebbb8b3592f146f77e95a8b93ef4d37cf988 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 14 Oct 2014 21:32:00 -0700 Subject: DD-170 : Check the Merchant Outbox API and hide the menu item if getting 503. Show SLM always. --- indra/newview/llviewermenu.cpp | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index b5262a7e1b..1daa74c68f 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -388,19 +388,33 @@ void set_underclothes_menu_options() } } -void set_merchant_menu() +void set_merchant_SLM_menu() { - if (LLMarketplaceData::instance().getSLMStatus() == MarketplaceStatusCodes::MARKET_PLACE_NOT_MIGRATED_MERCHANT) - { + // DD-170 : SLM Alpha and Beta program : for the moment, we always show the SLM menu and + // tools so that all merchants can try out the UI, even if not migrated. + // *TODO : Keep SLM UI hidden for non migrated merchant in released viewer + + //if (LLMarketplaceData::instance().getSLMStatus() == MarketplaceStatusCodes::MARKET_PLACE_NOT_MIGRATED_MERCHANT) + //{ // Merchant not migrated: show only the old Merchant Outbox menu - gMenuHolder->getChild("MerchantOutbox")->setVisible(TRUE); - } - else - { + // gMenuHolder->getChild("MerchantOutbox")->setVisible(TRUE); + //} + //else + //{ // All other cases (new merchant, not merchant, migrated merchant): show the new Marketplace Listings menu and enable the tool gMenuHolder->getChild("MarketplaceListings")->setVisible(TRUE); LLCommand* command = LLCommandManager::instance().getCommand("marketplacelistings"); gToolBarView->enableCommand(command->id(), true); + //} +} + +void set_merchant_outbox_menu(U32 status, const LLSD& content) +{ + // If the merchant is fully migrated, the API is disabled (503) and we won't show the old menu item. + // In all other cases, we show it. + if (status != MarketplaceErrorCodes::IMPORT_SERVER_API_DISABLED) + { + gMenuHolder->getChild("MerchantOutbox")->setVisible(TRUE); } } @@ -411,11 +425,17 @@ void check_merchant_status() // Hide both merchant related menu items gMenuHolder->getChild("MerchantOutbox")->setVisible(FALSE); gMenuHolder->getChild("MarketplaceListings")->setVisible(FALSE); + // Also disable the toolbar button for Marketplace Listings LLCommand* command = LLCommandManager::instance().getCommand("marketplacelistings"); gToolBarView->enableCommand(command->id(), false); + // Launch an SLM test connection to get the merchant status - LLMarketplaceData::instance().initializeSLM(boost::bind(&set_merchant_menu)); + 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(); } } -- cgit v1.2.3 From 00f3850fe2e2527f7f0f663f94cdabc83949b946 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sun, 14 Dec 2014 15:48:46 -0800 Subject: DD-299 : Suppress cap hardcoded fallback. Recheck cap after each teleport. --- indra/newview/llviewermenu.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'indra/newview/llviewermenu.cpp') 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("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("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("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(); + } } } -- cgit v1.2.3