diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 99b06047ea..4cee27e363 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -173,6 +173,7 @@ #include "llavatarpropertiesprocessor.h" #include "llcheckboxctrl.h" #include "llfloatergridstatus.h" +#include "llfloatermarketplace.h" #include "llfloaterpreference.h" #include "llkeyconflict.h" #include "lllogininstance.h" @@ -8798,6 +8799,29 @@ class LLPromptShowURL : public view_listener_t } }; +// For the SL Marketplace, use the already preloaded CEF instance +class FSLoadSLMarketplace : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + static LLCachedControl marketplace_url(gSavedSettings, "MarketplaceURL", "https://marketplace.secondlife.com/"); + if (LLWeb::useExternalBrowser(marketplace_url)) + { + LLWeb::loadURL(marketplace_url); + } + else + { + LLFloaterReg::showInstanceOrBringToFront("marketplace"); + if (LLFloaterMarketplace* marketplace = LLFloaterReg::getTypedInstance("marketplace")) + { + marketplace->openMarketplace(); + } + } + return true; + } +}; +// + bool callback_show_file(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); @@ -13241,6 +13265,9 @@ void initialize_menus() commit.add("Camera.LoadView", boost::bind(&LLAgentCamera::loadCameraPosition, &gAgentCamera)); // + // For the SL Marketplace, use the already preloaded CEF instance + view_listener_t::addMenu(new FSLoadSLMarketplace(), "LoadSLMarketplace"); + // Script debug floater commit.add("ShowScriptDebug", boost::bind(&LLFloaterScriptDebug::show, LLUUID::null)); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index be487dd2c8..80248d7d77 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -2505,9 +2505,7 @@ label="SL Marketplace" name="SL Marketplace"> + function="LoadSLMarketplace"/>