diff options
author | Merov Linden <merov@lindenlab.com> | 2014-10-05 20:17:29 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2014-10-05 20:17:29 -0700 |
commit | 6b8916e7604d47f37d30ae0c1a6ab2465da1f39d (patch) | |
tree | eaf797d9424fa07528c401cfa273a5961d28c498 /indra/newview/llviewermenu.cpp | |
parent | 31d5383417000738a29c8f664124e140b1afce5d (diff) |
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).
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rwxr-xr-x | indra/newview/llviewermenu.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
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<LLView>("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<LLView>("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<LLView>("MerchantOutbox")->setVisible(FALSE); + gMenuHolder->getChild<LLView>("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 |