summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
authorandreykproductengine <akleshchev@productengine.com>2015-08-04 16:36:30 +0300
committerandreykproductengine <akleshchev@productengine.com>2015-08-04 16:36:30 +0300
commit01ba9f3cd69a40ddffcee84fda95460b0f87629e (patch)
treeebf28dd52bcbc8d53b5e833242c7f36b725b2ec3 /indra/newview/llviewermenu.cpp
parent246758a3b70256f2c776d5372296b858251fd820 (diff)
parent310ec101dfd2c69ecc1a51d0a3a8ea12d5fdaf7a (diff)
Merge downstream code and become version 3.8.3
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rwxr-xr-xindra/newview/llviewermenu.cpp62
1 files changed, 62 insertions, 0 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index b797e0c835..67f8581b9d 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,66 @@ void set_underclothes_menu_options()
}
}
+void set_merchant_SLM_menu()
+{
+ // 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<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 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<LLView>("MerchantOutbox")->setVisible(TRUE);
+ }
+}
+
+void check_merchant_status()
+{
+ if (!gSavedSettings.getBOOL("InventoryOutboxDisplayBoth"))
+ {
+ // 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
+ 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_SLM_menu));
+
+ // 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();
+ }
+ }
+}
+
void init_menus()
{
// Initialize actions