summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/lltextbase.cpp26
-rw-r--r--indra/llui/lltextbase.h7
-rw-r--r--indra/llui/llurlentry.cpp24
-rw-r--r--indra/llui/llurlentry.h14
-rw-r--r--indra/llui/llurlmatch.cpp8
-rw-r--r--indra/llui/llurlmatch.h6
-rw-r--r--indra/llui/llurlregistry.cpp14
-rw-r--r--indra/llui/tests/llurlentry_test.cpp8
-rw-r--r--indra/llui/tests/llurlmatch_test.cpp30
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/llfloaterabout.cpp6
-rw-r--r--indra/newview/llfloatersnapshot.cpp1
-rw-r--r--indra/newview/llviewerwindow.cpp17
-rw-r--r--indra/newview/skins/default/xui/en/floater_about.xml2
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml4
-rw-r--r--indra/newview/skins/default/xui/en/panel_pick_info.xml1
16 files changed, 108 insertions, 71 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 8abbc833e5..978bd317e2 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -1512,25 +1512,6 @@ void LLTextBase::setText(const LLStringExplicit &utf8str, const LLStyle::Params&
onValueChange(0, getLength());
}
-void LLTextBase::addBlackListUrl(const std::string &url)
-{
- mBlackListUrls.push_back(url);
-}
-
-bool LLTextBase::isBlackListUrl(const std::string &url) const
-{
- std::vector<std::string>::const_iterator it;
- for (it = mBlackListUrls.begin(); it != mBlackListUrls.end(); ++it)
- {
- const std::string &blacklist_url = *it;
- if (url.find(blacklist_url) != std::string::npos)
- {
- return true;
- }
- }
- return false;
-}
-
//virtual
std::string LLTextBase::getText() const
{
@@ -1606,11 +1587,10 @@ void LLTextBase::appendText(const std::string &new_text, bool prepend_newline, c
}
}
- // output the styled Url (unless we've been asked to suppress it)
- if (isBlackListUrl(match.getUrl()))
+ // output the styled Url (unless we've been asked to suppress hyperlinking)
+ if (match.isLinkDisabled())
{
- std::string orig_url = text.substr(start, end-start);
- appendAndHighlightText(orig_url, prepend_newline, part, style_params);
+ appendAndHighlightText(match.getLabel(), prepend_newline, part, style_params);
}
else
{
diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h
index e1c6cc36ab..dc3671eab1 100644
--- a/indra/llui/lltextbase.h
+++ b/indra/llui/lltextbase.h
@@ -187,9 +187,6 @@ public:
const LLFontGL* getDefaultFont() const { return mDefaultFont; }
LLStyle::Params getDefaultStyle();
- // tell the text object to suppress auto highlighting of a specific URL
- void addBlackListUrl(const std::string &url);
-
public:
// Fired when a URL link is clicked
commit_signal_t mURLClickSignal;
@@ -312,7 +309,6 @@ protected:
void updateRects();
void needsScroll() { mScrollNeeded = TRUE; }
void replaceUrlLabel(const std::string &url, const std::string &label);
- bool isBlackListUrl(const std::string &url) const;
protected:
// text segmentation and flow
@@ -364,9 +360,6 @@ protected:
LLView* mDocumentView;
class LLScrollContainer* mScroller;
- // list of URLs to suppress from automatic hyperlinking
- std::vector<std::string> mBlackListUrls;
-
// transient state
bool mReflowNeeded; // need to reflow text because of change to text contents or display region
bool mScrollNeeded; // need to change scroll region because of change to cursor position
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp
index 4927e57a52..58148ad2aa 100644
--- a/indra/llui/llurlentry.cpp
+++ b/indra/llui/llurlentry.cpp
@@ -39,8 +39,9 @@
#include "lltrans.h"
#include "lluicolortable.h"
-LLUrlEntryBase::LLUrlEntryBase()
-: mColor(LLUIColorTable::instance().getColor("HTMLLinkColor"))
+LLUrlEntryBase::LLUrlEntryBase() :
+ mColor(LLUIColorTable::instance().getColor("HTMLLinkColor")),
+ mDisabledLink(false)
{
}
@@ -204,7 +205,7 @@ LLUrlEntryHTTPNoProtocol::LLUrlEntryHTTPNoProtocol()
mPattern = boost::regex("("
"\\bwww\\.\\S+\\.\\S+" // i.e. www.FOO.BAR
"|" // or
- "(?<!@)\\b[^[:space:]:@/]+\\.(?:com|net|edu|org)([/:]\\S*)?\\b" // i.e. FOO.net
+ "(?<!@)\\b[^[:space:]:@/>]+\\.(?:com|net|edu|org)([/:][^[:space:]<]*)?\\b" // i.e. FOO.net
")",
boost::regex::perl|boost::regex::icase);
mMenuName = "menu_url_http.xml";
@@ -641,3 +642,20 @@ std::string LLUrlEntryWorldMap::getLocation(const std::string &url) const
// return the part of the Url after secondlife:///app/worldmap/ part
return ::getStringAfterToken(url, "app/worldmap/");
}
+
+//
+// LLUrlEntryNoLink lets us turn of URL detection with <nolink>...</nolink> tags
+//
+LLUrlEntryNoLink::LLUrlEntryNoLink()
+{
+ mPattern = boost::regex("<nolink>[^[:space:]<]+</nolink>",
+ boost::regex::perl|boost::regex::icase);
+ mDisabledLink = true;
+}
+
+std::string LLUrlEntryNoLink::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
+{
+ // return the text between the <nolink> and </nolink> tags
+ return url.substr(8, url.size()-8-9);
+}
+
diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h
index 4adffde99c..94455ac247 100644
--- a/indra/llui/llurlentry.h
+++ b/indra/llui/llurlentry.h
@@ -91,6 +91,9 @@ public:
/// Return the name of a SL location described by this Url, if any
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; }
+
protected:
std::string getIDStringFromUrl(const std::string &url) const;
std::string escapeUrl(const std::string &url) const;
@@ -111,6 +114,7 @@ protected:
std::string mTooltip;
LLUIColor mColor;
std::multimap<std::string, LLUrlEntryObserver> mObservers;
+ bool mDisabledLink;
};
///
@@ -267,4 +271,14 @@ public:
/*virtual*/ std::string getLocation(const std::string &url) const;
};
+///
+/// LLUrlEntryNoLink lets us turn of URL detection with <nolink>...</nolink> tags
+///
+class LLUrlEntryNoLink : public LLUrlEntryBase
+{
+public:
+ LLUrlEntryNoLink();
+ /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
+};
+
#endif
diff --git a/indra/llui/llurlmatch.cpp b/indra/llui/llurlmatch.cpp
index 3b47145a22..72a199c220 100644
--- a/indra/llui/llurlmatch.cpp
+++ b/indra/llui/llurlmatch.cpp
@@ -41,14 +41,17 @@ LLUrlMatch::LLUrlMatch() :
mLabel(""),
mTooltip(""),
mIcon(""),
- mMenuName("")
+ mMenuName(""),
+ mLocation(""),
+ mDisabledLink(false)
{
}
void LLUrlMatch::setValues(U32 start, U32 end, const std::string &url,
const std::string &label, const std::string &tooltip,
const std::string &icon, const LLUIColor& color,
- const std::string &menu, const std::string &location)
+ const std::string &menu, const std::string &location,
+ bool disabled_link)
{
mStart = start;
mEnd = end;
@@ -59,4 +62,5 @@ void LLUrlMatch::setValues(U32 start, U32 end, const std::string &url,
mColor = color;
mMenuName = menu;
mLocation = location;
+ mDisabledLink = disabled_link;
}
diff --git a/indra/llui/llurlmatch.h b/indra/llui/llurlmatch.h
index 7f5767923a..e86762548b 100644
--- a/indra/llui/llurlmatch.h
+++ b/indra/llui/llurlmatch.h
@@ -83,11 +83,14 @@ public:
/// return the SL location that this Url describes, or "" if none.
std::string getLocation() const { return mLocation; }
+ /// is this a match for a URL that should not be hyperlinked?
+ bool isLinkDisabled() const { return mDisabledLink; }
+
/// Change the contents of this match object (used by LLUrlRegistry)
void setValues(U32 start, U32 end, const std::string &url, const std::string &label,
const std::string &tooltip, const std::string &icon,
const LLUIColor& color, const std::string &menu,
- const std::string &location);
+ const std::string &location, bool disabled_link);
private:
U32 mStart;
@@ -99,6 +102,7 @@ private:
std::string mMenuName;
std::string mLocation;
LLUIColor mColor;
+ bool mDisabledLink;
};
#endif
diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp
index ad5c0911f8..55eb8950e9 100644
--- a/indra/llui/llurlregistry.cpp
+++ b/indra/llui/llurlregistry.cpp
@@ -44,6 +44,7 @@ void LLUrlRegistryNullCallback(const std::string &url, const std::string &label)
LLUrlRegistry::LLUrlRegistry()
{
// Urls are matched in the order that they were registered
+ registerUrl(new LLUrlEntryNoLink());
registerUrl(new LLUrlEntrySLURL());
registerUrl(new LLUrlEntryHTTP());
registerUrl(new LLUrlEntryHTTPLabel());
@@ -176,7 +177,8 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL
match_entry->getIcon(),
match_entry->getColor(),
match_entry->getMenuName(),
- match_entry->getLocation(url));
+ match_entry->getLocation(url),
+ match_entry->isLinkDisabled());
return true;
}
@@ -204,9 +206,13 @@ bool LLUrlRegistry::findUrl(const LLWString &text, LLUrlMatch &match, const LLUr
S32 end = start + wurl.size() - 1;
match.setValues(start, end, match.getUrl(),
- match.getLabel(), match.getTooltip(),
- match.getIcon(), match.getColor(),
- match.getMenuName(), match.getLocation());
+ match.getLabel(),
+ match.getTooltip(),
+ match.getIcon(),
+ match.getColor(),
+ match.getMenuName(),
+ match.getLocation(),
+ match.isLinkDisabled());
return true;
}
return false;
diff --git a/indra/llui/tests/llurlentry_test.cpp b/indra/llui/tests/llurlentry_test.cpp
index 80be8fcbf7..6fec1d3e10 100644
--- a/indra/llui/tests/llurlentry_test.cpp
+++ b/indra/llui/tests/llurlentry_test.cpp
@@ -610,5 +610,13 @@ namespace tut
testRegex("invalid .net URL", r,
"foo.netty",
"");
+
+ testRegex("XML tags around URL [1]", r,
+ "<foo>secondlife.com</foo>",
+ "secondlife.com");
+
+ testRegex("XML tags around URL [2]", r,
+ "<foo>secondlife.com/status?bar=1</foo>",
+ "secondlife.com/status?bar=1");
}
}
diff --git a/indra/llui/tests/llurlmatch_test.cpp b/indra/llui/tests/llurlmatch_test.cpp
index e8cf135346..f9dfee931b 100644
--- a/indra/llui/tests/llurlmatch_test.cpp
+++ b/indra/llui/tests/llurlmatch_test.cpp
@@ -53,7 +53,7 @@ namespace tut
LLUrlMatch match;
ensure("empty()", match.empty());
- match.setValues(0, 1, "http://secondlife.com", "Second Life", "", "", LLUIColor(), "", "");
+ match.setValues(0, 1, "http://secondlife.com", "Second Life", "", "", LLUIColor(), "", "", false);
ensure("! empty()", ! match.empty());
}
@@ -66,7 +66,7 @@ namespace tut
LLUrlMatch match;
ensure_equals("getStart() == 0", match.getStart(), 0);
- match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "");
+ match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false);
ensure_equals("getStart() == 10", match.getStart(), 10);
}
@@ -79,7 +79,7 @@ namespace tut
LLUrlMatch match;
ensure_equals("getEnd() == 0", match.getEnd(), 0);
- match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "");
+ match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false);
ensure_equals("getEnd() == 20", match.getEnd(), 20);
}
@@ -92,10 +92,10 @@ namespace tut
LLUrlMatch match;
ensure_equals("getUrl() == ''", match.getUrl(), "");
- match.setValues(10, 20, "http://slurl.com/", "", "", "", LLUIColor(), "", "");
+ match.setValues(10, 20, "http://slurl.com/", "", "", "", LLUIColor(), "", "", false);
ensure_equals("getUrl() == 'http://slurl.com/'", match.getUrl(), "http://slurl.com/");
- match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "");
+ match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false);
ensure_equals("getUrl() == '' (2)", match.getUrl(), "");
}
@@ -108,10 +108,10 @@ namespace tut
LLUrlMatch match;
ensure_equals("getLabel() == ''", match.getLabel(), "");
- match.setValues(10, 20, "", "Label", "", "", LLUIColor(), "", "");
+ match.setValues(10, 20, "", "Label", "", "", LLUIColor(), "", "", false);
ensure_equals("getLabel() == 'Label'", match.getLabel(), "Label");
- match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "");
+ match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false);
ensure_equals("getLabel() == '' (2)", match.getLabel(), "");
}
@@ -124,10 +124,10 @@ namespace tut
LLUrlMatch match;
ensure_equals("getTooltip() == ''", match.getTooltip(), "");
- match.setValues(10, 20, "", "", "Info", "", LLUIColor(), "", "");
+ match.setValues(10, 20, "", "", "Info", "", LLUIColor(), "", "", false);
ensure_equals("getTooltip() == 'Info'", match.getTooltip(), "Info");
- match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "");
+ match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false);
ensure_equals("getTooltip() == '' (2)", match.getTooltip(), "");
}
@@ -140,10 +140,10 @@ namespace tut
LLUrlMatch match;
ensure_equals("getIcon() == ''", match.getIcon(), "");
- match.setValues(10, 20, "", "", "", "Icon", LLUIColor(), "", "");
+ match.setValues(10, 20, "", "", "", "Icon", LLUIColor(), "", "", false);
ensure_equals("getIcon() == 'Icon'", match.getIcon(), "Icon");
- match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "");
+ match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false);
ensure_equals("getIcon() == '' (2)", match.getIcon(), "");
}
@@ -156,10 +156,10 @@ namespace tut
LLUrlMatch match;
ensure("getMenuName() empty", match.getMenuName().empty());
- match.setValues(10, 20, "", "", "", "Icon", LLUIColor(), "xui_file.xml", "");
+ match.setValues(10, 20, "", "", "", "Icon", LLUIColor(), "xui_file.xml", "", false);
ensure_equals("getMenuName() == \"xui_file.xml\"", match.getMenuName(), "xui_file.xml");
- match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "");
+ match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false);
ensure("getMenuName() empty (2)", match.getMenuName().empty());
}
@@ -172,10 +172,10 @@ namespace tut
LLUrlMatch match;
ensure("getLocation() empty", match.getLocation().empty());
- match.setValues(10, 20, "", "", "", "Icon", LLUIColor(), "xui_file.xml", "Paris");
+ match.setValues(10, 20, "", "", "", "Icon", LLUIColor(), "xui_file.xml", "Paris", false);
ensure_equals("getLocation() == \"Paris\"", match.getLocation(), "Paris");
- match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "");
+ match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false);
ensure("getLocation() empty (2)", match.getLocation().empty());
}
}
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 1ef79aeec0..f3bda19ed1 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -2377,6 +2377,17 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>DisableMouseWarp</key>
+ <map>
+ <key>Comment</key>
+ <string>Disable warping of the mouse to the center of the screen during alt-zoom and mouse look. Useful with certain input devices, mouse sharing programs like Synergy, or running under Parallels.</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>
diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp
index 04f4ddf996..ef69f39ad2 100644
--- a/indra/newview/llfloaterabout.cpp
+++ b/indra/newview/llfloaterabout.cpp
@@ -187,12 +187,6 @@ BOOL LLFloaterAbout::postBuild()
support << '\n' << getString("AboutTraffic", args);
}
- // don't make the sim hostname be a hyperlink
- if (info.has("HOSTNAME"))
- {
- support_widget->addBlackListUrl(info["HOSTNAME"].asString());
- }
-
support_widget->appendText(support.str(),
FALSE,
LLStyle::Params()
diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index 94c7ff6f94..a0031f0193 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -378,6 +378,7 @@ void LLSnapshotLivePreview::setSnapshotQuality(S32 quality)
{
mSnapshotQuality = quality;
gSavedSettings.setS32("SnapshotQuality", quality);
+ mSnapshotUpToDate = FALSE;
}
}
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index b4c73dba26..8692cdcc57 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -2269,15 +2269,18 @@ void LLViewerWindow::handleScrollWheel(S32 clicks)
void LLViewerWindow::moveCursorToCenter()
{
- S32 x = getWorldViewWidthScaled() / 2;
- S32 y = getWorldViewHeightScaled() / 2;
+ if (! gSavedSettings.getBOOL("DisableMouseWarp"))
+ {
+ S32 x = getWorldViewWidthScaled() / 2;
+ S32 y = getWorldViewHeightScaled() / 2;
- //on a forced move, all deltas get zeroed out to prevent jumping
- mCurrentMousePoint.set(x,y);
- mLastMousePoint.set(x,y);
- mCurrentMouseDelta.set(0,0);
+ //on a forced move, all deltas get zeroed out to prevent jumping
+ mCurrentMousePoint.set(x,y);
+ mLastMousePoint.set(x,y);
+ mCurrentMouseDelta.set(0,0);
- LLUI::setMousePositionScreen(x, y);
+ LLUI::setMousePositionScreen(x, y);
+ }
}
diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml
index b6443c4c21..bfdd48e2f4 100644
--- a/indra/newview/skins/default/xui/en/floater_about.xml
+++ b/indra/newview/skins/default/xui/en/floater_about.xml
@@ -21,7 +21,7 @@ Built with [COMPILER] version [COMPILER_VERSION]
</floater.string>
<floater.string
name="AboutPosition">
-You are at [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] in [REGION] located at [HOSTNAME] ([HOSTIP])
+You are at [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] in [REGION] located at &lt;nolink&gt;[HOSTNAME]&lt;/nolink&gt; ([HOSTIP])
[SERVER_VERSION]
[[SERVER_RELEASE_NOTES_URL] [ReleaseNotes]]
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 41f4621d66..d3e08cad3a 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -3088,7 +3088,7 @@ Join me in [REGION]
icon="alertmodal.tga"
name="TeleportFromLandmark"
type="alertmodal">
-Are you sure you want to teleport to [LOCATION]?
+Are you sure you want to teleport to &lt;nolink&gt;[LOCATION]&lt;/nolink&gt;?
<usetemplate
ignoretext="Confirm that I want to teleport to a landmark"
name="okcancelignore"
@@ -3851,7 +3851,7 @@ Are you sure you want to quit?
type="alertmodal">
Use this tool to report violations of the [http://secondlife.com/corporate/tos.php Terms of Service] and [http://secondlife.com/corporate/cs.php Community Standards].
-All reported abuses are investigated and resolved. You can view the resolution by reading the [http://secondlife.com/support/incidentreport.php Incident Report].
+All reported abuses are investigated and resolved.
<unique/>
</notification>
diff --git a/indra/newview/skins/default/xui/en/panel_pick_info.xml b/indra/newview/skins/default/xui/en/panel_pick_info.xml
index 65ccd10cf0..7489988722 100644
--- a/indra/newview/skins/default/xui/en/panel_pick_info.xml
+++ b/indra/newview/skins/default/xui/en/panel_pick_info.xml
@@ -88,6 +88,7 @@
follows="all"
height="100"
width="280"
+ allow_html="true"
hide_scrollbar="false"
layout="topleft"
left="10"