diff options
author | Nyx (Neal Orman) <nyx@lindenlab.com> | 2009-12-16 12:16:24 -0500 |
---|---|---|
committer | Nyx (Neal Orman) <nyx@lindenlab.com> | 2009-12-16 12:16:24 -0500 |
commit | ace0be2a7c0665e382e47aeedfcffed7410e11a9 (patch) | |
tree | 2d437342310d52806c6b378f1046ad56d9eb6456 /indra/newview/llweb.cpp | |
parent | 90bb29245cbd9626f840f1d16c351ac415f7c35e (diff) | |
parent | 1e5f2f5d8c4264cc704c687aa1b624296b6444e2 (diff) |
merge with avp-tip
--HG--
branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llweb.cpp')
-rw-r--r-- | indra/newview/llweb.cpp | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index 72431bd22f..f8bb7336db 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -38,14 +38,20 @@ // Library includes #include "llwindow.h" // spawnWebBrowser() -#include "llviewerwindow.h" -#include "llviewercontrol.h" +#include "llappviewer.h" #include "llfloatermediabrowser.h" #include "llfloaterreg.h" -#include "llalertdialog.h" +#include "lllogininstance.h" +#include "llsd.h" #include "lltoastalertpanel.h" +#include "llui.h" +#include "lluri.h" +#include "llversioninfo.h" +#include "llviewercontrol.h" +#include "llviewernetwork.h" +#include "llviewerwindow.h" -class URLLoader : public LLAlertURLLoader +class URLLoader : public LLToastAlertPanel::URLLoader { virtual void load(const std::string& url , bool force_open_externally) { @@ -65,7 +71,6 @@ static URLLoader sAlertURLLoader; // static void LLWeb::initClass() { - LLAlertDialog::setURLLoader(&sAlertURLLoader); LLToastAlertPanel::setURLLoader(&sAlertURLLoader); } @@ -124,3 +129,24 @@ std::string LLWeb::escapeURL(const std::string& url) } return escaped_url; } + +//static +std::string LLWeb::expandURLSubstitutions(const std::string &url, + const LLSD &default_subs) +{ + LLSD substitution = default_subs; + substitution["VERSION"] = LLVersionInfo::getVersion(); + substitution["VERSION_MAJOR"] = LLVersionInfo::getMajor(); + substitution["VERSION_MINOR"] = LLVersionInfo::getMinor(); + substitution["VERSION_PATCH"] = LLVersionInfo::getPatch(); + substitution["VERSION_BUILD"] = LLVersionInfo::getBuild(); + substitution["CHANNEL"] = LLVersionInfo::getChannel(); + substitution["LANGUAGE"] = LLUI::getLanguage(); + substitution["GRID"] = LLViewerLogin::getInstance()->getGridLabel(); + substitution["OS"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple(); + + std::string expanded_url = url; + LLStringUtil::format(expanded_url, substitution); + + return LLWeb::escapeURL(expanded_url); +} |