summaryrefslogtreecommitdiff
path: root/indra/newview/lltoolmgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lltoolmgr.cpp')
-rwxr-xr-xindra/newview/lltoolmgr.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp
index 175227173f..3ecb4015ce 100755
--- a/indra/newview/lltoolmgr.cpp
+++ b/indra/newview/lltoolmgr.cpp
@@ -37,6 +37,7 @@
#include "llfloaterinspect.h"
#include "lltool.h"
#include "llmanipscale.h"
+#include "llmarketplacefunctions.h"
#include "llselectmgr.h"
#include "lltoolbrush.h"
#include "lltoolcomp.h"
@@ -83,6 +84,8 @@ LLToolMgr::LLToolMgr()
LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Active", boost::bind(&LLToolMgr::inEdit, this));
LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Enabled", boost::bind(&LLToolMgr::canEdit, this));
LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Build.Toggle", boost::bind(&LLToolMgr::toggleBuildMode, this, _2));
+ LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Marketplace.Enabled", boost::bind(&LLToolMgr::canAccessMarketplace, this));
+ LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Marketplace.Toggle", boost::bind(&LLToolMgr::toggleMarketplace, this, _2));
gToolNull = new LLTool(LLStringUtil::null); // Does nothing
setCurrentTool(gToolNull);
@@ -345,6 +348,23 @@ bool LLToolMgr::inBuildMode()
return b;
}
+bool LLToolMgr::canAccessMarketplace()
+{
+ return (LLMarketplaceData::instance().getSLMStatus() != MarketplaceStatusCodes::MARKET_PLACE_NOT_MIGRATED_MERCHANT) || gSavedSettings.getBOOL("InventoryOutboxDisplayBoth");
+}
+
+void LLToolMgr::toggleMarketplace(const LLSD& sdname)
+{
+ const std::string& param = sdname.asString();
+
+ if ((param != "marketplace") || !canAccessMarketplace())
+ {
+ return;
+ }
+
+ LLFloaterReg::toggleInstanceOrBringToFront("marketplace_listings");
+}
+
void LLToolMgr::setTransientTool(LLTool* tool)
{
if (!tool)