diff options
author | callum <none@none> | 2010-10-06 15:34:32 -0700 |
---|---|---|
committer | callum <none@none> | 2010-10-06 15:34:32 -0700 |
commit | f5b3fc596d029d3ac2f953ee94ea3ae131d00940 (patch) | |
tree | 565168131e050687f4793fa0d9aabe23ad3dce5e /indra/llui | |
parent | b285fd4d0abf9113fc416c30ac115db06c9f2ebf (diff) |
Add support for debug setting to disable link highlight & follow in URLs that appear in XUI widgets
Diffstat (limited to 'indra/llui')
-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 |
3 files changed, 20 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(); |