diff options
-rw-r--r-- | indra/llui/llurlentry.cpp | 10 | ||||
-rw-r--r-- | indra/llui/llurlentry.h | 2 | ||||
-rw-r--r-- | indra/llui/tests/llurlentry_test.cpp | 9 | ||||
-rw-r--r-- | indra/newview/app_settings/settings.xml | 22 | ||||
-rw-r--r-- | indra/newview/llweb.cpp | 7 |
5 files changed, 49 insertions, 1 deletions
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 5680ab8bd4..13c729ace9 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -27,6 +27,7 @@ #include "linden_common.h" #include "llurlentry.h" +#include "lluictrl.h" #include "lluri.h" #include "llurlmatch.h" #include "llurlregistry.h" @@ -146,6 +147,15 @@ void LLUrlEntryBase::callObservers(const std::string &id, const std::string &lab } } +/// is this a match for a URL that should not be hyperlinked? +bool LLUrlEntryBase::isLinkDisabled() const +{ + // this allows us to have a global setting to turn off text hyperlink highlighting/action + bool globally_disabled = LLUI::sSettingGroups["config"]->getBOOL("DisableTextHyperlinkActions"); + + return mDisabledLink || globally_disabled; +} + static std::string getStringAfterToken(const std::string str, const std::string token) { size_t pos = str.find(token); diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h index e25eaa7555..623856c320 100644 --- a/indra/llui/llurlentry.h +++ b/indra/llui/llurlentry.h @@ -86,7 +86,7 @@ public: virtual std::string getLocation(const std::string &url) const { return ""; } /// is this a match for a URL that should not be hyperlinked? - bool isLinkDisabled() const { return mDisabledLink; } + bool isLinkDisabled() const; /// Should this link text be underlined only when mouse is hovered over it? virtual bool underlineOnHoverOnly(const std::string &string) const { return false; } diff --git a/indra/llui/tests/llurlentry_test.cpp b/indra/llui/tests/llurlentry_test.cpp index 95affe4460..4c2b3a8d59 100644 --- a/indra/llui/tests/llurlentry_test.cpp +++ b/indra/llui/tests/llurlentry_test.cpp @@ -27,12 +27,21 @@ #include "linden_common.h" #include "../llurlentry.h" +#include "../lluictrl.h" #include "llurlentry_stub.cpp" #include "lltut.h" #include "../lluicolortable.h" #include <boost/regex.hpp> +typedef std::map<std::string, LLControlGroup*> settings_map_t; +settings_map_t LLUI::sSettingGroups; + +BOOL LLControlGroup::getBOOL(const std::string& name) +{ + return false; +} + LLUIColor LLUIColorTable::getColor(const std::string& name, const LLColor4& default_color) const { return LLUIColor(); diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 09f74e5508..204097769a 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2545,6 +2545,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>DisableExternalBrowser</key> + <map> + <key>Comment</key> + <string>Disable opening an external browser.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>DisableRendering</key> <map> <key>Comment</key> @@ -2556,6 +2567,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>DisableTextHyperlinkActions</key> + <map> + <key>Comment</key> + <string>Disable highlighting and linking of URLs in XUI text boxes</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>DisableVerticalSync</key> <map> <key>Comment</key> diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index 73a37a6993..6028a8fbea 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -116,6 +116,13 @@ void LLWeb::loadURLExternal(const std::string& url, bool async, const std::strin // Act like the proxy window was closed, since we won't be able to track targeted windows in the external browser. LLViewerMedia::proxyWindowClosed(uuid); + if(gSavedSettings.getBOOL("DisableExternalBrowser")) + { + // Don't open an external browser under any circumstances. + llwarns << "Blocked attempt to open external browser." << llendl; + return; + } + LLSD payload; payload["url"] = url; LLNotificationsUtil::add( "WebLaunchExternalTarget", LLSD(), payload, boost::bind(on_load_url_external_response, _1, _2, async)); |