diff options
author | Dave Parks <none@none> | 2010-06-07 23:05:22 -0500 |
---|---|---|
committer | Dave Parks <none@none> | 2010-06-07 23:05:22 -0500 |
commit | f461ae214c8c998f5a0e3661696a30d27ad2814e (patch) | |
tree | e9430d423ee46fad6cb8319575d37ec925b88e99 /indra/newview/llweb.cpp | |
parent | 84e619a6dc9e5a5967c4ce035ac530a4588f72a5 (diff) | |
parent | 48809cb3a9350a0357a0fc710140e2437f3e068e (diff) |
Merge with render-pipeline
Diffstat (limited to 'indra/newview/llweb.cpp')
-rw-r--r-- | indra/newview/llweb.cpp | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index 1a64f9d881..5c9633c036 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -54,6 +54,10 @@ #include "llviewerparcelmgr.h" #include "llviewerregion.h" #include "llviewerwindow.h" +#include "llnotificationsutil.h" + +bool on_load_url_external_response(const LLSD& notification, const LLSD& response, bool async ); + class URLLoader : public LLToastAlertPanel::URLLoader { @@ -110,11 +114,26 @@ void LLWeb::loadURLExternal(const std::string& url) // static void LLWeb::loadURLExternal(const std::string& url, bool async) { - std::string escaped_url = escapeURL(url); - if (gViewerWindow) + LLSD payload; + payload["url"] = url; + LLNotificationsUtil::add( "WebLaunchExternalTarget", LLSD(), payload, boost::bind(on_load_url_external_response, _1, _2, async)); +} + +// static +bool on_load_url_external_response(const LLSD& notification, const LLSD& response, bool async ) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if ( 0 == option ) { - gViewerWindow->getWindow()->spawnWebBrowser(escaped_url, async); + LLSD payload = notification["payload"]; + std::string url = payload["url"].asString(); + std::string escaped_url = LLWeb::escapeURL(url); + if (gViewerWindow) + { + gViewerWindow->getWindow()->spawnWebBrowser(escaped_url, async); + } } + return false; } @@ -155,7 +174,7 @@ std::string LLWeb::expandURLSubstitutions(const std::string &url, substitution["VERSION_PATCH"] = LLVersionInfo::getPatch(); substitution["VERSION_BUILD"] = LLVersionInfo::getBuild(); substitution["CHANNEL"] = LLVersionInfo::getChannel(); - substitution["GRID"] = LLViewerLogin::getInstance()->getGridLabel(); + substitution["GRID"] = LLGridManager::getInstance()->getGridLabel(); substitution["OS"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple(); substitution["SESSION_ID"] = gAgent.getSessionID(); substitution["FIRST_LOGIN"] = gAgent.isFirstLogin(); |