summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMartin Reddy <lynx@lindenlab.com>2009-09-04 12:11:27 +0000
committerMartin Reddy <lynx@lindenlab.com>2009-09-04 12:11:27 +0000
commit330840af7c363accc8e12d073ba91b871c578d27 (patch)
tree4539a78e8201ee2508b6d598639efe9a989b6531 /indra/newview
parent2273376dffb80af0cbf1bc1d8cc8990e1d1456f3 (diff)
Merging the SLURLs Everywhere branch (viewer-2.0.0-slurls-3) into
Viewer 2.0 (viewer-2.0.0-3). This provides support for clickable Urls in text editors and textboxes, with right-click context menus, tooltips, and alternate link labels. This includes alert boxes, the login progress window, local chat and IM interfaces, etc. As well as context menus for avatars and groups in list widgets. Includes fixes for the following individual JIRAs: DEV-8763 VWR-10636: Hyperlinks in alert dialogs should be selectable (clickable)! DEV-38829 EXT-742: Remove LLLink class DEV-35459 VWR-14679: SLURLs and teleport Links not parsed properly DEV-19842 VWR-8773: Closing parenthesis ")" breaks urls DEV-21577 VWR-9405: In-world SLURLs containing "(" or ")" are not treated as a hyperlink in chat DEV-37652 SEC-435: Object Chat/IMs are untraceable (VWR-2388) Fix has left flaw DEV-10353: URLs in chat log terminated incorrectly when newline in chat DEV-2925: In chat history, use a teleport hyperlink as source name for object IMs DEV-36192: Need a way to copy Avatar names and Group names DEV-2926: Allow viewer hyperlinks to have different text than the actual url DEV-27253: Add easy way to copy URLs from viewer chat DEV-38274: Make About Second Life window use new Url hyperlinking features DEV-39076: No url support in Text Editors DEV-7476 VWR-2172: Add hyperlinks to chat console for easier access DEV-7475: Add hyperlinks to notecards! DEV-35375 EXT-128: HTTPS urls aren't loaded in the internal browser by click Master JIRA issues: DEV-32819, DEV-323820, DEV-7474 Testing performed against QAR-1789 svn merge -r 131623:131889 svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-2.0.0-slurl-3 svn merge -r 131978:132515 svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-2.0.0-slurl-3
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llappviewer.cpp12
-rw-r--r--indra/newview/llavatarlist.cpp3
-rw-r--r--indra/newview/llchatmsgbox.cpp372
-rw-r--r--indra/newview/llchatmsgbox.h129
-rw-r--r--indra/newview/llfloaterabout.cpp52
-rw-r--r--indra/newview/llfloaterfriends.cpp1
-rw-r--r--indra/newview/llfloatergroups.cpp19
-rw-r--r--indra/newview/llfloaterland.cpp7
-rw-r--r--indra/newview/llgrouplist.cpp2
-rw-r--r--indra/newview/llimpanel.cpp1
-rw-r--r--indra/newview/llnamelistctrl.cpp4
-rw-r--r--indra/newview/llpanelavatar.cpp19
-rw-r--r--indra/newview/llpanelavatar.h3
-rw-r--r--indra/newview/llpanelgroupgeneral.cpp1
-rw-r--r--indra/newview/llpanelgrouproles.cpp4
-rw-r--r--indra/newview/llpreviewnotecard.cpp3
-rw-r--r--indra/newview/llprogressview.cpp6
-rw-r--r--indra/newview/llprogressview.h1
-rw-r--r--indra/newview/llviewermessage.cpp8
-rw-r--r--indra/newview/llviewertexteditor.cpp45
-rw-r--r--indra/newview/llviewertexteditor.h4
-rw-r--r--indra/newview/llweb.cpp10
-rw-r--r--indra/newview/llweb.h20
-rw-r--r--indra/newview/skins/default/xui/en/menu_url_agent.xml28
-rw-r--r--indra/newview/skins/default/xui/en/menu_url_group.xml28
-rw-r--r--indra/newview/skins/default/xui/en/menu_url_http.xml37
-rw-r--r--indra/newview/skins/default/xui/en/menu_url_objectim.xml37
-rw-r--r--indra/newview/skins/default/xui/en/menu_url_parcel.xml21
-rw-r--r--indra/newview/skins/default/xui/en/menu_url_slapp.xml21
-rw-r--r--indra/newview/skins/default/xui/en/menu_url_slurl.xml30
-rw-r--r--indra/newview/skins/default/xui/en/menu_url_teleport.xml21
-rw-r--r--indra/newview/skins/default/xui/en/panel_edit_profile.xml12
-rw-r--r--indra/newview/skins/default/xui/en/panel_profile.xml13
-rw-r--r--indra/newview/skins/default/xui/en/panel_progress.xml4
-rw-r--r--indra/newview/skins/default/xui/en/strings.xml13
35 files changed, 438 insertions, 553 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index de4f7ab091..3d7465f2cb 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -80,6 +80,7 @@
// Linden library includes
#include "llmemory.h"
+#include "llurlaction.h"
// Third party library includes
#include <boost/bind.hpp>
@@ -685,9 +686,14 @@ bool LLAppViewer::init()
LLTransUtil::parseLanguageStrings("language_settings.xml");
LLWeb::initClass(); // do this after LLUI
- LLTextEditor::setURLCallbacks(&LLWeb::loadURL,
- &LLURLDispatcher::dispatchFromTextEditor,
- &LLURLDispatcher::dispatchFromTextEditor);
+ // Provide the text fields with callbacks for opening Urls
+ LLUrlAction::setOpenURLCallback(&LLWeb::loadURL);
+ LLUrlAction::setOpenURLInternalCallback(&LLWeb::loadURLInternal);
+ LLUrlAction::setOpenURLExternalCallback(&LLWeb::loadURLExternal);
+ LLUrlAction::setExecuteSLURLCallback(&LLURLDispatcher::dispatchFromTextEditor);
+
+ // Set the link color for any Urls in text fields
+ LLTextBase::setLinkColor( LLUIColorTable::instance().getColor("HTMLLinkColor") );
// Load translations for tooltips
LLFloater::initClass();
diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp
index 080d540f4a..e0322e26b9 100644
--- a/indra/newview/llavatarlist.cpp
+++ b/indra/newview/llavatarlist.cpp
@@ -62,6 +62,9 @@ LLAvatarList::LLAvatarList(const Params& p)
{
setCommitOnSelectionChange(TRUE); // there's no such param in LLScrollListCtrl::Params
+ // display a context menu appropriate for a list of avatar names
+ setContextMenu(LLScrollListCtrl::MENU_AVATAR);
+
// "volume" column
{
LLScrollListColumn::Params col_params;
diff --git a/indra/newview/llchatmsgbox.cpp b/indra/newview/llchatmsgbox.cpp
index fb5ab8ec5a..e6398dd47a 100644
--- a/indra/newview/llchatmsgbox.cpp
+++ b/indra/newview/llchatmsgbox.cpp
@@ -1,10 +1,11 @@
/**
* @file llchatmsgbox.cpp
+ * @author Martin Reddy
* @brief chat history text box, able to show array of strings with separator
*
- * $LicenseInfo:firstyear=2004&license=viewergpl$
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
*
- * Copyright (c) 2004-2009, Linden Research, Inc.
+ * Copyright (c) 2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
@@ -30,361 +31,96 @@
* $/LicenseInfo$
*/
-
#include "llviewerprecompiledheaders.h"
#include "llchatmsgbox.h"
#include "llwindow.h"
-#include "llfocusmgr.h"
-
-static LLDefaultChildRegistry::Register<LLChatMsgBox> r("text_chat");
-LLChatMsgBox::Params::Params()
-: text_color("text_color"),
- highlight_on_hover("hover", false),
- border_visible("border_visible", false),
- border_drop_shadow_visible("border_drop_shadow_visible", false),
- bg_visible("bg_visible", false),
- use_ellipses("use_ellipses"),
- word_wrap("word_wrap", false),
- hover_color("hover_color"),
- disabled_color("disabled_color"),
- background_color("background_color"),
- border_color("border_color"),
- line_spacing("line_spacing", 4),
- block_spacing("block_spacing",10),
- text("text"),
- font_shadow("font_shadow", LLFontGL::NO_SHADOW)
-{}
-LLChatMsgBox::LLChatMsgBox(const LLChatMsgBox::Params& p)
-: LLUICtrl(p),
- mFontGL(p.font),
- mHoverActive( p.highlight_on_hover ),
- mHasHover( FALSE ),
- mBackgroundVisible( p.bg_visible ),
- mBorderVisible( p.border_visible ),
- mShadowType( p.font_shadow ),
- mBorderDropShadowVisible( p.border_drop_shadow_visible ),
- mUseEllipses( p.use_ellipses ),
- mVAlign( LLFontGL::TOP ),
- mClickedCallback(NULL),
- mTextColor(p.text_color()),
- mDisabledColor(p.disabled_color()),
- mBackgroundColor(p.background_color()),
- mBorderColor(p.border_color()),
- mHoverColor(p.hover_color()),
- mHAlign(p.font_halign),
- mLineSpacing(p.line_spacing),
- mBlockSpasing(p.block_spacing),
- mWordWrap( p.word_wrap ),
- mFontStyle(LLFontGL::getStyleFromString(p.font.style))
-{
- setText( p.text() );
-}
+static LLDefaultChildRegistry::Register<LLChatMsgBox> r("text_chat");
-BOOL LLChatMsgBox::handleMouseDown(S32 x, S32 y, MASK mask)
+LLChatMsgBox::Params::Params() :
+ block_spacing("block_spacing", 10)
{
- BOOL handled = FALSE;
-
- // HACK: Only do this if there actually is a click callback, so that
- // overly large text boxes in the older UI won't start eating clicks.
- if (mClickedCallback)
- {
- handled = TRUE;
-
- // Route future Mouse messages here preemptively. (Release on mouse up.)
- gFocusMgr.setMouseCapture( this );
-
- if (getSoundFlags() & MOUSE_DOWN)
- {
- make_ui_sound("UISndClick");
- }
- }
-
- return handled;
+ line_spacing = 4;
}
-BOOL LLChatMsgBox::handleMouseUp(S32 x, S32 y, MASK mask)
-{
- BOOL handled = FALSE;
-
- // We only handle the click if the click both started and ended within us
-
- // HACK: Only do this if there actually is a click callback, so that
- // overly large text boxes in the older UI won't start eating clicks.
- if (mClickedCallback
- && hasMouseCapture())
- {
- handled = TRUE;
-
- // Release the mouse
- gFocusMgr.setMouseCapture( NULL );
-
- if (getSoundFlags() & MOUSE_UP)
- {
- make_ui_sound("UISndClickRelease");
- }
-
- // DO THIS AT THE VERY END to allow the button to be destroyed as a result of being clicked.
- // If mouseup in the widget, it's been clicked
- if (mClickedCallback)
- {
- mClickedCallback();
- }
- }
-
- return handled;
-}
+LLChatMsgBox::LLChatMsgBox(const Params& p) :
+ LLTextBox(p),
+ mBlockSpacing(p.block_spacing)
+{}
-BOOL LLChatMsgBox::handleHover(S32 x, S32 y, MASK mask)
+void LLChatMsgBox::addText( const LLStringExplicit& text )
{
- BOOL handled = LLView::handleHover(x,y,mask);
- if(mHoverActive)
+ LLWString t = mText.getWString();
+ if (! t.empty())
{
- mHasHover = TRUE; // This should be set every frame during a hover.
- getWindow()->setCursor(UI_CURSOR_ARROW);
+ t += '\n';
}
-
- return (handled || mHasHover);
-}
-
-void LLChatMsgBox::addText( const LLStringExplicit& text )
-{
- boost::shared_ptr<text_block> t(new text_block());
- t->text = wrapText(text);
- setLineLengths(*t);
- mTextStrings.push_back(t);
+ t += getWrappedText(text);
+ LLTextBox::setText(wstring_to_utf8str(t));
+ mSeparatorOffset.push_back(getLength());
}
void LLChatMsgBox::setText(const LLStringExplicit& text)
{
- mTextStrings.clear();
-
+ mSeparatorOffset.clear();
+ mText.clear();
addText(text);
-
-}
-
-void LLChatMsgBox::resetLineLengths()
-{
- for(std::vector< boost::shared_ptr<text_block> >::iterator it = mTextStrings.begin();
- it!=mTextStrings.end();++it)
- {
- boost::shared_ptr<text_block> tblock = *it;
- setLineLengths(*tblock);
- }
-}
-
-void LLChatMsgBox::setLineLengths(text_block& t)
-{
- t.lines.clear();
-
- std::string::size_type cur = 0;
- std::string::size_type len = t.text.length();
-
- while (cur < len)
- {
- std::string::size_type end = t.text.getWString().find('\n', cur);
- std::string::size_type runLen;
-
- if (end == std::string::npos)
- {
- runLen = len - cur;
- cur = len;
- }
- else
- {
- runLen = end - cur;
- cur = end + 1; // skip the new line character
- }
-
- t.lines.push_back( (S32)runLen );
- }
-}
-
-std::string LLChatMsgBox::wrapText(const LLStringExplicit& in_text, F32 max_width)
-{
- if (max_width < 0.0f)
- {
- max_width = (F32)getRect().getWidth();
- }
-
- LLWString wtext = utf8str_to_wstring(in_text);
- LLWString final_wtext;
-
- LLWString::size_type cur = 0;;
- LLWString::size_type len = wtext.size();
- while (cur < len)
- {
- LLWString::size_type end = wtext.find('\n', cur);
- if (end == LLWString::npos)
- {
- end = len;
- }
-
- LLWString::size_type runLen = end - cur;
- if (runLen > 0)
- {
- LLWString run(wtext, cur, runLen);
- LLWString::size_type useLen =
- mFontGL->maxDrawableChars(run.c_str(), max_width, runLen, TRUE);
-
- final_wtext.append(wtext, cur, useLen);
- cur += useLen;
- // not enough room to add any more characters
- if (useLen == 0) break;
- }
-
- if (cur < len)
- {
- if (wtext[cur] == '\n')
- cur += 1;
-
- // There is no need to to cut line ending symbols found in origin string, see EXT-702.
- final_wtext += '\n';
- }
- }
-
- std::string final_text = wstring_to_utf8str(final_wtext);
- return final_text;
}
-S32 LLChatMsgBox::getTextLinesNum()
-{
- S32 num_lines = 0;
- for(std::vector< boost::shared_ptr<text_block> >::iterator it = mTextStrings.begin();
- it!=mTextStrings.end();++it)
- {
- boost::shared_ptr<text_block> tblock = *it;
- num_lines+=tblock->lines.size();
- }
-
- if( num_lines < 1 )
- {
- num_lines = 1;
- }
-
- return num_lines;
+void LLChatMsgBox::setValue(const LLSD& value )
+{
+ setText(value.asString());
}
S32 LLChatMsgBox::getTextPixelHeight()
{
+ S32 num_blocks = mSeparatorOffset.size();
S32 num_lines = getTextLinesNum();
- return (S32)(num_lines * mFontGL->getLineHeight() + (num_lines-1)*mLineSpacing + mBlockSpasing*(mTextStrings.size()-1) + 2*mLineSpacing);//some extra space
-}
-
-void LLChatMsgBox::setValue(const LLSD& value )
-{
- setText(value.asString());
+ return (S32)(num_lines * mDefaultFont->getLineHeight() + \
+ (num_lines-1) * mLineSpacing + \
+ (num_blocks-1) * mBlockSpacing + \
+ 2 * mLineSpacing);
}
-
-void LLChatMsgBox::draw()
+S32 LLChatMsgBox::getTextLinesNum()
{
- if (mBorderVisible)
- {
- gl_rect_2d_offset_local(getLocalRect(), 2, FALSE);
- }
-
- if( mBorderDropShadowVisible )
- {
- static LLUICachedControl<LLColor4> color_drop_shadow ("ColorDropShadow", *(new LLColor4));
- static LLUICachedControl<S32> drop_shadow_tooltip ("DropShadowTooltip", 0);
- gl_drop_shadow(0, getRect().getHeight(), getRect().getWidth(), 0,
- color_drop_shadow, drop_shadow_tooltip);
- }
-
- if (mBackgroundVisible)
- {
- LLRect r( 0, getRect().getHeight(), getRect().getWidth(), 0 );
- gl_rect_2d( r, mBackgroundColor.get() );
- }
-
- S32 text_x = 0;
- switch( mHAlign )
- {
- case LLFontGL::LEFT:
- break;
- case LLFontGL::HCENTER:
- text_x = getRect().getWidth() / 2;
- break;
- case LLFontGL::RIGHT:
- text_x = getRect().getWidth() ;
- break;
- }
-
- S32 text_y = getRect().getHeight() ;
-
- if ( getEnabled() )
- {
- if(mHasHover)
- {
- drawText( text_x, text_y, mHoverColor.get() );
- }
- else
- {
- drawText( text_x, text_y, mTextColor.get() );
- }
- }
- else
- {
- drawText( text_x, text_y, mDisabledColor.get() );
- }
-
- if (sDebugRects)
+ S32 num_lines = getLineCount();
+ if (num_lines < 1)
{
- drawDebugRect();
+ num_lines = 1;
}
-
- //// *HACK: also draw debug rectangles around currently-being-edited LLView, and any elements that are being highlighted by GUI preview code (see LLFloaterUIPreview)
- //std::set<LLView*>::iterator iter = std::find(sPreviewHighlightedElements.begin(), sPreviewHighlightedElements.end(), this);
- //if ((sEditingUI && this == sEditingUIView) || (iter != sPreviewHighlightedElements.end() && sDrawPreviewHighlights))
- //{
- // drawDebugRect();
- //}
-
- mHasHover = FALSE; // This is reset every frame.
-}
-
-void LLChatMsgBox::reshape(S32 width, S32 height, BOOL called_from_parent)
-{
- // reparse line lengths
- LLView::reshape(width, height, called_from_parent);
- resetLineLengths();
+
+ return num_lines;
}
-void LLChatMsgBox::drawText( S32 x, S32 y, const LLColor4& color )
+void LLChatMsgBox::drawText(S32 x, S32 y, const LLWString &text, const LLColor4 &color)
{
+ S32 start = 0;
S32 width = getRect().getWidth()-10;
-
- for(std::vector< boost::shared_ptr<text_block> >::iterator it = mTextStrings.begin();
- it!=mTextStrings.end();++it)
+ // iterate through each block of text that has been added
+ y -= mLineSpacing;
+ for (std::vector<S32>::iterator it = mSeparatorOffset.begin(); true ;)
{
- boost::shared_ptr<text_block> tblock = *it;
+ // display the text for this block
+ S32 num_chars = *it - start;
+ LLWString text = mDisplayText.substr(start, num_chars);
+ LLTextBox::drawText(x, y, text, color);
- S32 cur_pos = 0;
- for (std::vector<S32>::iterator iter = tblock->lines.begin();
- iter != tblock->lines.end(); ++iter)
+ // exit the loop if this is the last text block
+ start += num_chars + 1; // skip the newline
+ if (++it == mSeparatorOffset.end())
{
- S32 line_length = *iter;
- mFontGL->render(tblock->text, cur_pos, (F32)x, (F32)y, color,
- mHAlign, mVAlign,
- mFontStyle,
- mShadowType,
- line_length, getRect().getWidth(), NULL, mUseEllipses );
- cur_pos += line_length + 1;
- y -= llfloor(mFontGL->getLineHeight()) + mLineSpacing;
-
- }
- std::vector< boost::shared_ptr<text_block> >::iterator next = it;
- ++next;
- if(next == mTextStrings.end())
break;
- //separator
- gl_line_2d(5,y-mBlockSpasing/2,width,y-mBlockSpasing/2,LLColor4::grey);
- y-=mBlockSpasing;
- }
+ }
+ // output a separator line between blocks
+ S32 num_lines = std::count(text.begin(), text.end(), '\n') + 1;
+ y -= num_lines * (llfloor(mDefaultFont->getLineHeight()) + mLineSpacing);
+ S32 sep_y = y - mBlockSpacing/2 + mLineSpacing/2;
+ gl_line_2d(5, sep_y, width, sep_y, LLColor4::grey);
+ y -= mBlockSpacing;
+ }
}
-
diff --git a/indra/newview/llchatmsgbox.h b/indra/newview/llchatmsgbox.h
index 61035499c7..b81b740bdc 100644
--- a/indra/newview/llchatmsgbox.h
+++ b/indra/newview/llchatmsgbox.h
@@ -1,10 +1,11 @@
/**
* @file llchatmsgbox.h
+ * @author Martin Reddy
* @brief chat history text box, able to show array of strings with separator
*
- * $LicenseInfo:firstyear=2004&license=viewergpl$
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
*
- * Copyright (c) 2004-2009, Linden Research, Inc.
+ * Copyright (c) 2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
@@ -33,127 +34,45 @@
#ifndef LL_LLCHATMSGBOX_H
#define LL_LLCHATMSGBOX_H
-
+#include "lltextbox.h"
#include "lluictrl.h"
#include "v4color.h"
#include "llstring.h"
-#include "lluistring.h"
-
-class LLChatMsgBox
-: public LLUICtrl
+///
+/// LLChatMsgBox provides a text box with support for multiple blocks
+/// of text that can be added incrementally. Each block of text is
+/// visual separated from the previous block (e.g., with a horizontal
+/// line).
+///
+class LLChatMsgBox :
+ public LLTextBox
{
-protected:
- struct text_block
- {
- LLUIString text;
- std::vector<S32> lines;
- };
public:
- typedef boost::function<void (void)> callback_t;
-
- struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
+ struct Params : public LLInitParam::Block<Params, LLTextBox::Params>
{
- Optional<std::string> text;
-
- Optional<bool> highlight_on_hover,
- border_visible,
- border_drop_shadow_visible,
- bg_visible,
- use_ellipses,
- word_wrap;
-
- Optional<LLFontGL::ShadowType> font_shadow;
-
- Optional<LLUIColor> text_color,
- hover_color,
- disabled_color,
- background_color,
- border_color;
-
- Optional<S32> line_spacing;
-
- Optional<S32> block_spacing;
+ Optional<S32> block_spacing;
Params();
};
+
protected:
LLChatMsgBox(const Params&);
friend class LLUICtrlFactory;
-public:
- virtual void draw();
- virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
- virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
- virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);
- virtual BOOL handleHover(S32 x, S32 y, MASK mask);
-
- void setColor( const LLColor4& c ) { mTextColor = c; }
- void setDisabledColor( const LLColor4& c) { mDisabledColor = c; }
- void setBackgroundColor( const LLColor4& c) { mBackgroundColor = c; }
- void setBorderColor( const LLColor4& c) { mBorderColor = c; }
-
- void setHoverColor( const LLColor4& c ) { mHoverColor = c; }
- void setHoverActive( BOOL active ) { mHoverActive = active; }
-
- void setText( const LLStringExplicit& text );
- void addText( const LLStringExplicit& text );
-
- void setUseEllipses( BOOL use_ellipses ) { mUseEllipses = use_ellipses; }
+public:
+ void setText(const LLStringExplicit &text);
+ void addText(const LLStringExplicit &text);
- void setBackgroundVisible(BOOL visible) { mBackgroundVisible = visible; }
- void setBorderVisible(BOOL visible) { mBorderVisible = visible; }
- void setBorderDropshadowVisible(BOOL visible){ mBorderDropShadowVisible = visible; }
- void setRightAlign() { mHAlign = LLFontGL::RIGHT; }
- void setHAlign( LLFontGL::HAlign align ) { mHAlign = align; }
- void setClickedCallback( boost::function<void (void*)> cb, void* userdata = NULL ){ mClickedCallback = boost::bind(cb, userdata); } // mouse down and up within button
-
- const LLFontGL* getFont() const { return mFontGL; }
-
- S32 getTextPixelHeight();
- S32 getTextLinesNum();
-
- virtual void setValue(const LLSD& value );
-
+ S32 getTextPixelHeight();
+ S32 getTextLinesNum();
+ /*virtual*/ void setValue(const LLSD &value);
+ /*virtual*/ void drawText(S32 x, S32 y, const LLWString &text, const LLColor4 &color);
private:
- std::string wrapText (const LLStringExplicit& in_text, F32 max_width = -1.0);
-
- void setLineLengths (text_block& t);
- void resetLineLengths ();
- void drawText (S32 x, S32 y, const LLColor4& color );
-
- const LLFontGL* mFontGL;
- LLUIColor mTextColor;
- LLUIColor mDisabledColor;
- LLUIColor mBackgroundColor;
- LLUIColor mBorderColor;
- LLUIColor mHoverColor;
-
- BOOL mHoverActive;
- BOOL mHasHover;
- BOOL mBackgroundVisible;
- BOOL mBorderVisible;
- BOOL mWordWrap;
-
- U8 mFontStyle; // style bit flags for font
- LLFontGL::ShadowType mShadowType;
- BOOL mBorderDropShadowVisible;
- BOOL mUseEllipses;
-
- S32 mLineSpacing;
- S32 mBlockSpasing;
-
- LLFontGL::HAlign mHAlign;
- LLFontGL::VAlign mVAlign;
-
- callback_t mClickedCallback;
-
-
- //same as mLineLengthList and mText in LLTextBox
- std::vector< boost::shared_ptr<text_block> > mTextStrings;
-
+ S32 mBlockSpacing;
+ std::vector<S32> mSeparatorOffset;
};
#endif
diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp
index 56c5eaa70e..caa10e9452 100644
--- a/indra/newview/llfloaterabout.cpp
+++ b/indra/newview/llfloaterabout.cpp
@@ -99,24 +99,20 @@ BOOL LLFloaterAbout::postBuild()
LLViewerTextEditor *credits_widget =
getChild<LLViewerTextEditor>("credits_editor", true);
- // For some reason, adding style doesn't work unless this is true.
+ // make sure that we handle hyperlinks in the About text
support_widget->setParseHTML(TRUE);
- // Text styles for release notes hyperlinks
- LLStyle::Params link_style_params;
- link_style_params.color.control = "HTMLLinkColor";
- link_style_params.link_href = get_viewer_release_notes_url();
-
// Version string
std::string version = LLTrans::getString("APP_NAME")
+ llformat(" %d.%d.%d (%d) %s %s (%s)\n",
LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VIEWER_BUILD,
__DATE__, __TIME__,
gSavedSettings.getString("VersionChannelName").c_str());
- support_widget->appendColoredText(version, FALSE, FALSE, LLUIColorTable::instance().getColor("TextFgReadOnlyColor"));
- support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, link_style_params);
std::string support;
+ support.append(version);
+ support.append("[" + get_viewer_release_notes_url() + " " +
+ LLTrans::getString("ReleaseNotes") + "]");
support.append("\n\n");
#if LL_MSVC
@@ -131,10 +127,6 @@ BOOL LLFloaterAbout::postBuild()
LLViewerRegion* region = gAgent.getRegion();
if (region)
{
- LLStyle::Params server_link_style_params;
- server_link_style_params.color.control = "HTMLLinkColor";
- server_link_style_params.link_href = region->getCapability("ServerReleaseNotes");
-
const LLVector3d &pos = gAgent.getPositionGlobal();
LLUIString pos_text = getString("you_are_at");
pos_text.setArg("[POSITION]",
@@ -154,11 +146,9 @@ BOOL LLFloaterAbout::postBuild()
support.append(")\n");
support.append(gLastVersionChannel);
support.append("\n");
-
- support_widget->appendColoredText(support, FALSE, FALSE, LLUIColorTable::instance().getColor("TextFgReadOnlyColor"));
- support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, server_link_style_params);
-
- support = "\n\n";
+ support.append("[" + LLWeb::escapeURL(region->getCapability("ServerReleaseNotes")) +
+ " " + LLTrans::getString("ReleaseNotes") + "]");
+ support.append("\n\n");
}
// *NOTE: Do not translate text like GPU, Graphics Card, etc -
@@ -248,20 +238,20 @@ BOOL LLFloaterAbout::postBuild()
}
- static std::string get_viewer_release_notes_url()
- {
- std::ostringstream version;
- version << LL_VERSION_MAJOR << "."
- << LL_VERSION_MINOR << "."
- << LL_VERSION_PATCH << "."
- << LL_VERSION_BUILD;
+static std::string get_viewer_release_notes_url()
+{
+ std::ostringstream version;
+ version << LL_VERSION_MAJOR << "."
+ << LL_VERSION_MINOR << "."
+ << LL_VERSION_PATCH << "."
+ << LL_VERSION_BUILD;
- LLSD query;
- query["channel"] = gSavedSettings.getString("VersionChannelName");
- query["version"] = version.str();
+ LLSD query;
+ query["channel"] = gSavedSettings.getString("VersionChannelName");
+ query["version"] = version.str();
- std::ostringstream url;
- url << LLTrans::getString("RELEASE_NOTES_BASE_URL") << LLURI::mapToQueryString(query);
+ std::ostringstream url;
+ url << LLTrans::getString("RELEASE_NOTES_BASE_URL") << LLURI::mapToQueryString(query);
- return url.str();
- }
+ return LLWeb::escapeURL(url.str());
+}
diff --git a/indra/newview/llfloaterfriends.cpp b/indra/newview/llfloaterfriends.cpp
index eb73bd6d8f..0c77d88efb 100644
--- a/indra/newview/llfloaterfriends.cpp
+++ b/indra/newview/llfloaterfriends.cpp
@@ -194,6 +194,7 @@ BOOL LLPanelFriends::postBuild()
mFriendsList->setMaxSelectable(MAX_FRIEND_SELECT);
mFriendsList->setMaximumSelectCallback(boost::bind(&LLPanelFriends::onMaximumSelect));
mFriendsList->setCommitOnSelectionChange(TRUE);
+ mFriendsList->setContextMenu(LLScrollListCtrl::MENU_AVATAR);
childSetCommitCallback("friend_list", onSelectName, this);
getChild<LLScrollListCtrl>("friend_list")->setDoubleClickCallback(onClickIM, this);
diff --git a/indra/newview/llfloatergroups.cpp b/indra/newview/llfloatergroups.cpp
index 7a88612f1a..b1f40d9d1d 100644
--- a/indra/newview/llfloatergroups.cpp
+++ b/indra/newview/llfloatergroups.cpp
@@ -82,7 +82,12 @@ void LLFloaterGroupPicker::setPowersMask(U64 powers_mask)
BOOL LLFloaterGroupPicker::postBuild()
{
LLScrollListCtrl* list_ctrl = getChild<LLScrollListCtrl>("group list");
- init_group_list(list_ctrl, gAgent.getGroupID(), mPowersMask);
+ if (list_ctrl)
+ {
+ init_group_list(list_ctrl, gAgent.getGroupID(), mPowersMask);
+ list_ctrl->setDoubleClickCallback(onBtnOK, this);
+ list_ctrl->setContextMenu(LLScrollListCtrl::MENU_GROUP);
+ }
// Remove group "none" from list. Group "none" is added in init_group_list().
// Some UI elements use group "none", we need to manually delete it here.
@@ -100,8 +105,6 @@ BOOL LLFloaterGroupPicker::postBuild()
setDefaultBtn("OK");
- getChild<LLScrollListCtrl>("group list")->setDoubleClickCallback(onBtnOK, this);
-
childEnable("OK");
return TRUE;
@@ -183,7 +186,13 @@ BOOL LLPanelGroups::postBuild()
childSetTextArg("groupcount", "[COUNT]", llformat("%d",gAgent.mGroups.count()));
childSetTextArg("groupcount", "[MAX]", llformat("%d",MAX_AGENT_GROUPS));
- init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID());
+ LLScrollListCtrl *list = getChild<LLScrollListCtrl>("group list");
+ if (list)
+ {
+ init_group_list(list, gAgent.getGroupID());
+ list->setDoubleClickCallback(onBtnIM, this);
+ list->setContextMenu(LLScrollListCtrl::MENU_GROUP);
+ }
childSetAction("Activate", onBtnActivate, this);
@@ -199,8 +208,6 @@ BOOL LLPanelGroups::postBuild()
setDefaultBtn("IM");
- getChild<LLScrollListCtrl>("group list")->setDoubleClickCallback(onBtnIM, this);
-
reset();
return TRUE;
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index 4cd09faaaf..e5f5e8eedb 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -1061,6 +1061,7 @@ BOOL LLPanelLandObjects::postBuild()
mOwnerList->sortByColumnIndex(3, FALSE);
childSetCommitCallback("owner list", onCommitList, this);
mOwnerList->setDoubleClickCallback(onDoubleClickOwner, this);
+ mOwnerList->setContextMenu(LLScrollListCtrl::MENU_AVATAR);
return TRUE;
}
@@ -2297,11 +2298,17 @@ BOOL LLPanelLandAccess::postBuild()
mListAccess = getChild<LLNameListCtrl>("AccessList");
if (mListAccess)
+ {
mListAccess->sortByColumnIndex(0, TRUE); // ascending
+ mListAccess->setContextMenu(LLScrollListCtrl::MENU_AVATAR);
+ }
mListBanned = getChild<LLNameListCtrl>("BannedList");
if (mListBanned)
+ {
mListBanned->sortByColumnIndex(0, TRUE); // ascending
+ mListBanned->setContextMenu(LLScrollListCtrl::MENU_AVATAR);
+ }
return TRUE;
}
diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp
index 278fd5b9f6..73d3a60701 100644
--- a/indra/newview/llgrouplist.cpp
+++ b/indra/newview/llgrouplist.cpp
@@ -51,6 +51,8 @@ LLGroupList::Params::Params()
LLGroupList::LLGroupList(const Params& p)
: LLAvatarList(p)
{
+ // display a context menu appropriate for a list of group names
+ setContextMenu(LLScrollListCtrl::MENU_GROUP);
}
static bool findInsensitive(std::string haystack, const std::string& needle_upper)
diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp
index 9cf3e57e22..674fff4040 100644
--- a/indra/newview/llimpanel.cpp
+++ b/indra/newview/llimpanel.cpp
@@ -2125,6 +2125,7 @@ BOOL LLIMFloater::postBuild()
childSetCommitCallback("chat_editor", onSendMsg, this);
mHistoryEditor = getChild<LLViewerTextEditor>("im_text");
+ mHistoryEditor->setParseHTML(TRUE);
setTitle(LLIMModel::instance().getName(mSessionID));
setDocked(true);
diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp
index 1b82c2dc18..8ef6b25c50 100644
--- a/indra/newview/llnamelistctrl.cpp
+++ b/indra/newview/llnamelistctrl.cpp
@@ -61,9 +61,9 @@ LLNameListCtrl::Params::Params()
LLNameListCtrl::LLNameListCtrl(const LLNameListCtrl::Params& p)
: LLScrollListCtrl(p),
- mAllowCallingCardDrop(p.allow_calling_card_drop),
+ mNameColumnIndex(p.name_column.column_index),
mNameColumn(p.name_column.column_name),
- mNameColumnIndex(p.name_column.column_index)
+ mAllowCallingCardDrop(p.allow_calling_card_drop)
{}
// public
diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp
index 6e94b087a6..b2d606ab4d 100644
--- a/indra/newview/llpanelavatar.cpp
+++ b/indra/newview/llpanelavatar.cpp
@@ -595,9 +595,8 @@ BOOL LLPanelAvatarMeProfile::postBuild()
childSetCommitCallback("status_combo", boost::bind(&LLPanelAvatarMeProfile::onStatusChanged, this), NULL);
childSetCommitCallback("status_me_message_text", boost::bind(&LLPanelAvatarMeProfile::onStatusMessageChanged, this), NULL);
- childSetActionTextbox("payment_update_link", boost::bind(&LLPanelAvatarMeProfile::onUpdateAccountTextboxClicked, this));
- childSetActionTextbox("my_account_link", boost::bind(&LLPanelAvatarMeProfile::onMyAccountTextboxClicked, this));
- childSetActionTextbox("partner_edit_link", boost::bind(&LLPanelAvatarMeProfile::onPartnerEditTextboxClicked, this));
+
+ childSetTextArg("partner_edit_link", "[URL]", getString("partner_edit_link_url"));
resetControls();
resetData();
@@ -677,17 +676,3 @@ void LLPanelAvatarMeProfile::onStatusMessageChanged()
updateData();
}
-void LLPanelAvatarMeProfile::onUpdateAccountTextboxClicked()
-{
- onUrlTextboxClicked(getString("payment_update_link_url"));
-}
-
-void LLPanelAvatarMeProfile::onMyAccountTextboxClicked()
-{
- onUrlTextboxClicked(getString("my_account_link_url"));
-}
-
-void LLPanelAvatarMeProfile::onPartnerEditTextboxClicked()
-{
- onUrlTextboxClicked(getString("partner_edit_link_url"));
-}
diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h
index 51bd619901..4ee4cb6e87 100644
--- a/indra/newview/llpanelavatar.h
+++ b/indra/newview/llpanelavatar.h
@@ -203,9 +203,6 @@ protected:
void onStatusChanged();
void onStatusMessageChanged();
- void onUpdateAccountTextboxClicked();
- void onMyAccountTextboxClicked();
- void onPartnerEditTextboxClicked();
private:
diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp
index 4b2a1a4e48..f3893a104c 100644
--- a/indra/newview/llpanelgroupgeneral.cpp
+++ b/indra/newview/llpanelgroupgeneral.cpp
@@ -113,6 +113,7 @@ BOOL LLPanelGroupGeneral::postBuild()
if (mListVisibleMembers)
{
mListVisibleMembers->setDoubleClickCallback(openProfile, this);
+ mListVisibleMembers->setContextMenu(LLScrollListCtrl::MENU_AVATAR);
}
// Options
diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp
index 59f7319b2b..48c9c16780 100644
--- a/indra/newview/llpanelgrouproles.cpp
+++ b/indra/newview/llpanelgrouproles.cpp
@@ -843,6 +843,7 @@ BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root)
mMembersList->setCommitCallback(onMemberSelect, this);
// Show the member's profile on double click.
mMembersList->setDoubleClickCallback(onMemberDoubleClick, this);
+ mMembersList->setContextMenu(LLScrollListCtrl::MENU_AVATAR);
LLButton* button = parent->getChild<LLButton>("member_invite", recurse);
if ( button )
@@ -1737,6 +1738,8 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root)
mRolesList->setCommitOnSelectionChange(TRUE);
mRolesList->setCommitCallback(onRoleSelect, this);
+ mAssignedMembersList->setContextMenu(LLScrollListCtrl::MENU_AVATAR);
+
mMemberVisibleCheck->setCommitCallback(onMemberVisibilityChange, this);
mAllowedActionsList->setCommitOnSelectionChange(TRUE);
@@ -2403,6 +2406,7 @@ BOOL LLPanelGroupActionsSubTab::postBuildSubTab(LLView* root)
mActionList->setCommitOnSelectionChange(TRUE);
mActionList->setCommitCallback(boost::bind(&LLPanelGroupActionsSubTab::handleActionSelect, this));
+ mActionList->setContextMenu(LLScrollListCtrl::MENU_AVATAR);
update(GC_ALL);
diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp
index cadab71ba8..29320522d9 100644
--- a/indra/newview/llpreviewnotecard.cpp
+++ b/indra/newview/llpreviewnotecard.cpp
@@ -87,6 +87,7 @@ BOOL LLPreviewNotecard::postBuild()
LLViewerTextEditor *ed = getChild<LLViewerTextEditor>("Notecard Editor");
if (ed)
{
+ ed->setParseHTML(TRUE);
ed->setNotecardInfo(mItemUUID, mObjectID, getKey());
ed->makePristine();
}
@@ -126,7 +127,7 @@ void LLPreviewNotecard::draw()
{
LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor");
BOOL changed = !editor->isPristine();
-
+
childSetEnabled("Save", changed && getEnabled());
LLPreview::draw();
diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp
index f70cfc59ec..aa603c417f 100644
--- a/indra/newview/llprogressview.cpp
+++ b/indra/newview/llprogressview.cpp
@@ -72,7 +72,6 @@ const S32 ANIMATION_FRAMES = 1; //13;
LLProgressView::LLProgressView(const LLRect &rect)
: LLPanel(),
mPercentDone( 0.f ),
- mURLInMessage(false),
mMouseDownInActiveArea( false )
{
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_progress.xml");
@@ -207,12 +206,7 @@ void LLProgressView::setPercent(const F32 percent)
void LLProgressView::setMessage(const std::string& msg)
{
mMessage = msg;
- mURLInMessage = (mMessage.find( "https://" ) != std::string::npos ||
- mMessage.find( "http://" ) != std::string::npos ||
- mMessage.find( "ftp://" ) != std::string::npos);
-
getChild<LLTextBox>("message_text")->setWrappedText(LLStringExplicit(mMessage));
- getChild<LLTextBox>("message_text")->setHoverActive(mURLInMessage);
}
void LLProgressView::setCancelButtonVisible(BOOL b, const std::string& label)
diff --git a/indra/newview/llprogressview.h b/indra/newview/llprogressview.h
index 83574ff52a..865646c85d 100644
--- a/indra/newview/llprogressview.h
+++ b/indra/newview/llprogressview.h
@@ -74,7 +74,6 @@ protected:
LLFrameTimer mProgressTimer;
LLRect mOutlineRect;
bool mMouseDownInActiveArea;
- bool mURLInMessage;
static LLProgressView* sInstance;
};
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 18fab3ec2e..dfb1c330e5 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -1,4 +1,3 @@
-
/**
* @file llviewermessage.cpp
* @brief Dumping ground for viewer-side message system callbacks.
@@ -1474,6 +1473,13 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
binary_bucket_size = msg->getSizeFast(_PREHASH_MessageBlock, _PREHASH_BinaryBucket);
EInstantMessage dialog = (EInstantMessage)d;
+ // make sure that we don't have an empty or all-whitespace name
+ LLStringUtil::trim(name);
+ if (name.empty())
+ {
+ name = LLTrans::getString("Unnamed");
+ }
+
BOOL is_busy = gAgent.getBusy();
BOOL is_muted = LLMuteList::getInstance()->isMuted(from_id, name, LLMute::flagTextChat);
BOOL is_linden = LLMuteList::getInstance()->isLinden(name);
diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp
index de01e79803..5bb0c9a120 100644
--- a/indra/newview/llviewertexteditor.cpp
+++ b/indra/newview/llviewertexteditor.cpp
@@ -814,38 +814,18 @@ BOOL LLViewerTextEditor::handleMouseUp(S32 x, S32 y, MASK mask)
BOOL LLViewerTextEditor::handleRightMouseDown(S32 x, S32 y, MASK mask)
{
- BOOL handled = childrenHandleRightMouseDown(x, y, mask) != NULL;
-
- // *TODO: Add right click menus for SLURLs
-// if(! handled)
-// {
-// const LLTextSegment* cur_segment = getSegmentAtLocalPos( x, y );
-// if( cur_segment )
-// {
-// if(cur_segment->getStyle()->isLink())
-// {
-// handled = TRUE;
-// mHTML = cur_segment->getStyle()->getLinkHREF();
-// }
-// }
-// }
-// LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandle.get();
-// if(handled && menu && mParseHTML && mHTML.length() > 0)
-// {
-// menu->setVisible(TRUE);
-// menu->arrange();
-// menu->updateParent(LLMenuGL::sMenuContainer);
-// LLMenuGL::showPopup(this, menu, x, y);
-// mHTML = "";
-// }
-// else
-// {
-// if(menu && menu->getVisible())
-// {
-// menu->setVisible(FALSE);
-// }
-// }
- return handled;
+ // pop up a context menu for any Url under the cursor
+ if (handleRightMouseDownOverUrl(this, x, y))
+ {
+ return TRUE;
+ }
+
+ if (childrenHandleRightMouseDown(x, y, mask) != NULL)
+ {
+ return TRUE;
+ }
+
+ return FALSE;
}
BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask)
@@ -1087,6 +1067,7 @@ llwchar LLViewerTextEditor::pasteEmbeddedItem(llwchar ext_char)
void LLViewerTextEditor::onValueChange(S32 start, S32 end)
{
updateSegments();
+ updateLinkSegments();
findEmbeddedItemSegments(start, end);
}
diff --git a/indra/newview/llviewertexteditor.h b/indra/newview/llviewertexteditor.h
index 9567bfbc48..2dfea4a589 100644
--- a/indra/newview/llviewertexteditor.h
+++ b/indra/newview/llviewertexteditor.h
@@ -35,7 +35,6 @@
#include "lltexteditor.h"
-
//
// Classes
//
@@ -137,9 +136,6 @@ private:
LLPointer<class LLEmbeddedNotecardOpener> mInventoryCallback;
- // *TODO: Add right click menus for SLURLs
- //LLViewHandle mPopupMenuHandle;
-
//
// Inner classes
//
diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp
index 300a5db7c3..3204c2d264 100644
--- a/indra/newview/llweb.cpp
+++ b/indra/newview/llweb.cpp
@@ -67,6 +67,7 @@ void LLWeb::initClass()
LLAlertDialog::setURLLoader(&sAlertURLLoader);
}
+
// static
void LLWeb::loadURL(const std::string& url)
{
@@ -76,12 +77,19 @@ void LLWeb::loadURL(const std::string& url)
}
else
{
- LLFloaterReg::showInstance("media_browser",url);
+ loadURLInternal(url);
}
}
// static
+void LLWeb::loadURLInternal(const std::string &url)
+{
+ LLFloaterReg::showInstance("media_browser", url);
+}
+
+
+// static
void LLWeb::loadURLExternal(const std::string& url)
{
std::string escaped_url = escapeURL(url);
diff --git a/indra/newview/llweb.h b/indra/newview/llweb.h
index 71cc236621..96a53db2ca 100644
--- a/indra/newview/llweb.h
+++ b/indra/newview/llweb.h
@@ -36,23 +36,29 @@
#include <string>
+///
+/// The LLWeb class provides various static methods to display the
+/// contents of a Url in a web browser. Variations are provided to
+/// let you specifically use the Second Life internal browser, the
+/// operating system's default browser, or to respect the user's
+/// setting for which of these two they prefer to use with SL.
+///
class LLWeb
{
public:
static void initClass();
- // Loads unescaped url in either internal web browser or external
- // browser, depending on user settings.
+ /// Load the given url in the user's preferred web browser
static void loadURL(const std::string& url);
-
+ /// Load the given url in the user's preferred web browser
static void loadURL(const char* url) { loadURL( ll_safe_string(url) ); }
-
- // Loads unescaped url in external browser.
+ /// Load the given url in the Second Life internal web browser
+ static void loadURLInternal(const std::string &url);
+ /// Load the given url in the operating system's web browser
static void loadURLExternal(const std::string& url);
- // Returns escaped (eg, " " to "%20") url
+ // Returns escaped url (eg, " " to "%20") - used by all loadURL methods
static std::string escapeURL(const std::string& url);
-
};
#endif
diff --git a/indra/newview/skins/default/xui/en/menu_url_agent.xml b/indra/newview/skins/default/xui/en/menu_url_agent.xml
new file mode 100644
index 0000000000..463a9fccb6
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/menu_url_agent.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<context_menu
+ layout="topleft"
+ name="Url Popup">
+ <menu_item_call
+ label="Show Resident Profile"
+ layout="topleft"
+ name="show_agent">
+ <menu_item_call.on_click
+ function="Url.Execute" />
+ </menu_item_call>
+ <menu_item_separator
+ layout="topleft" />
+ <menu_item_call
+ label="Copy Name To Clipboard"
+ layout="topleft"
+ name="url_copy_label">
+ <menu_item_call.on_click
+ function="Url.CopyLabel" />
+ </menu_item_call>
+ <menu_item_call
+ label="Copy SLURL To Clipboard"
+ layout="topleft"
+ name="url_copy">
+ <menu_item_call.on_click
+ function="Url.CopyUrl" />
+ </menu_item_call>
+</context_menu>
diff --git a/indra/newview/skins/default/xui/en/menu_url_group.xml b/indra/newview/skins/default/xui/en/menu_url_group.xml
new file mode 100644
index 0000000000..cec0aa421e
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/menu_url_group.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<context_menu
+ layout="topleft"
+ name="Url Popup">
+ <menu_item_call
+ label="Show Group Information"
+ layout="topleft"
+ name="show_group">
+ <menu_item_call.on_click
+ function="Url.Execute" />
+ </menu_item_call>
+ <menu_item_separator
+ layout="topleft" />
+ <menu_item_call
+ label="Copy Group To Clipboard"
+ layout="topleft"
+ name="url_copy_label">
+ <menu_item_call.on_click
+ function="Url.CopyLabel" />
+ </menu_item_call>
+ <menu_item_call
+ label="Copy SLURL To Clipboard"
+ layout="topleft"
+ name="url_copy">
+ <menu_item_call.on_click
+ function="Url.CopyUrl" />
+ </menu_item_call>
+</context_menu>
diff --git a/indra/newview/skins/default/xui/en/menu_url_http.xml b/indra/newview/skins/default/xui/en/menu_url_http.xml
new file mode 100644
index 0000000000..2503b4a2a3
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/menu_url_http.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<context_menu
+ layout="topleft"
+ name="Url Popup">
+ <menu_item_call
+ label="Open Web Page"
+ layout="topleft"
+ name="url_open">
+ <menu_item_call.on_click
+ function="Url.Open" />
+ </menu_item_call>
+ <menu_item_separator
+ layout="topleft" />
+ <menu_item_call
+ label="Open in Internal Browser"
+ layout="topleft"
+ name="url_open_internal">
+ <menu_item_call.on_click
+ function="Url.OpenInternal" />
+ </menu_item_call>
+ <menu_item_call
+ label="Open in External Browser"
+ layout="topleft"
+ name="url_open_external">
+ <menu_item_call.on_click
+ function="Url.OpenExternal" />
+ </menu_item_call>
+ <menu_item_separator
+ layout="topleft" />
+ <menu_item_call
+ label="Copy URL To Clipboard"
+ layout="topleft"
+ name="url_copy">
+ <menu_item_call.on_click
+ function="Url.CopyUrl" />
+ </menu_item_call>
+</context_menu>
diff --git a/indra/newview/skins/default/xui/en/menu_url_objectim.xml b/indra/newview/skins/default/xui/en/menu_url_objectim.xml
new file mode 100644
index 0000000000..7d09403b15
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/menu_url_objectim.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<context_menu
+ layout="topleft"
+ name="Url Popup">
+ <menu_item_call
+ label="Show Object Information"
+ layout="topleft"
+ name="show_object">
+ <menu_item_call.on_click
+ function="Url.Execute" />
+ </menu_item_call>
+ <menu_item_separator
+ layout="topleft" />
+ <menu_item_call
+ label="Teleport to Object Location"
+ layout="topleft"
+ name="teleport_to_object">
+ <menu_item_call.on_click
+ function="Url.Teleport" />
+ </menu_item_call>
+ <menu_item_separator
+ layout="topleft" />
+ <menu_item_call
+ label="Copy Object Name To Clipboard"
+ layout="topleft"
+ name="url_copy_label">
+ <menu_item_call.on_click
+ function="Url.CopyLabel" />
+ </menu_item_call>
+ <menu_item_call
+ label="Copy SLURL To Clipboard"
+ layout="topleft"
+ name="url_copy">
+ <menu_item_call.on_click
+ function="Url.CopyUrl" />
+ </menu_item_call>
+</context_menu>
diff --git a/indra/newview/skins/default/xui/en/menu_url_parcel.xml b/indra/newview/skins/default/xui/en/menu_url_parcel.xml
new file mode 100644
index 0000000000..bbd63c6d8c
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/menu_url_parcel.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<context_menu
+ layout="topleft"
+ name="Url Popup">
+ <menu_item_call
+ label="Show Parcel Information"
+ layout="topleft"
+ name="show_parcel">
+ <menu_item_call.on_click
+ function="Url.Execute" />
+ </menu_item_call>
+ <menu_item_separator
+ layout="topleft" />
+ <menu_item_call
+ label="Copy SLURL To Clipboard"
+ layout="topleft"
+ name="url_copy">
+ <menu_item_call.on_click
+ function="Url.CopyUrl" />
+ </menu_item_call>
+</context_menu>
diff --git a/indra/newview/skins/default/xui/en/menu_url_slapp.xml b/indra/newview/skins/default/xui/en/menu_url_slapp.xml
new file mode 100644
index 0000000000..19df721b2b
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/menu_url_slapp.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<context_menu
+ layout="topleft"
+ name="Url Popup">
+ <menu_item_call
+ label="Run This Command"
+ layout="topleft"
+ name="run_slapp">
+ <menu_item_call.on_click
+ function="Url.Execute" />
+ </menu_item_call>
+ <menu_item_separator
+ layout="topleft" />
+ <menu_item_call
+ label="Copy SLURL To Clipboard"
+ layout="topleft"
+ name="url_copy">
+ <menu_item_call.on_click
+ function="Url.CopyUrl" />
+ </menu_item_call>
+</context_menu>
diff --git a/indra/newview/skins/default/xui/en/menu_url_slurl.xml b/indra/newview/skins/default/xui/en/menu_url_slurl.xml
new file mode 100644
index 0000000000..0e9525fa4b
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/menu_url_slurl.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<context_menu
+ layout="topleft"
+ name="Url Popup">
+ <menu_item_call
+ label="Show Place Information"
+ layout="topleft"
+ name="show_place">
+ <menu_item_call.on_click
+ function="Url.Execute" />
+ </menu_item_call>
+ <menu_item_separator
+ layout="topleft" />
+ <menu_item_call
+ label="Teleport to Location"
+ layout="topleft"
+ name="teleport_to_location">
+ <menu_item_call.on_click
+ function="Url.Teleport" />
+ </menu_item_call>
+ <menu_item_separator
+ layout="topleft" />
+ <menu_item_call
+ label="Copy SLURL To Clipboard"
+ layout="topleft"
+ name="url_copy">
+ <menu_item_call.on_click
+ function="Url.CopyUrl" />
+ </menu_item_call>
+</context_menu>
diff --git a/indra/newview/skins/default/xui/en/menu_url_teleport.xml b/indra/newview/skins/default/xui/en/menu_url_teleport.xml
new file mode 100644
index 0000000000..22cc035e49
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/menu_url_teleport.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<context_menu
+ layout="topleft"
+ name="Url Popup">
+ <menu_item_call
+ label="Teleport To This Location"
+ layout="topleft"
+ name="teleport">
+ <menu_item_call.on_click
+ function="Url.Execute" />
+ </menu_item_call>
+ <menu_item_separator
+ layout="topleft" />
+ <menu_item_call
+ label="Copy SLURL To Clipboard"
+ layout="topleft"
+ name="url_copy">
+ <menu_item_call.on_click
+ function="Url.CopyUrl" />
+ </menu_item_call>
+</context_menu>
diff --git a/indra/newview/skins/default/xui/en/panel_edit_profile.xml b/indra/newview/skins/default/xui/en/panel_edit_profile.xml
index c0366437db..fa02cdb4b2 100644
--- a/indra/newview/skins/default/xui/en/panel_edit_profile.xml
+++ b/indra/newview/skins/default/xui/en/panel_edit_profile.xml
@@ -12,6 +12,10 @@
name="edit_profile_panel"
top="10"
width="255">
+ <string
+ name="partner_edit_link_url">
+ http://www.secondlife.com/account/partners.php?lang=en
+ </string>
<scroll_container
color="DkGray2"
follows="left|top|right|bottom"
@@ -243,11 +247,10 @@
top_pad="15"
value="Account Status:"
width="100" />
- <link
+ <text
type="string"
follows="left|top"
font="SansSerifSmall"
- font.style="UNDERLINE"
height="15"
layout="topleft"
left_pad="10"
@@ -277,15 +280,14 @@
top_pad="15"
value="Partner:"
width="100" />
- <link
+ <text
follows="left|top"
height="15"
- font.style="UNDERLINE"
layout="topleft"
left_pad="10"
name="partner_edit_link"
top_delta="0"
- value="Edit"
+ value="[[URL] Edit]"
width="100" />
<panel
follows="left|top|right"
diff --git a/indra/newview/skins/default/xui/en/panel_profile.xml b/indra/newview/skins/default/xui/en/panel_profile.xml
index d90be9ea25..135dcb167b 100644
--- a/indra/newview/skins/default/xui/en/panel_profile.xml
+++ b/indra/newview/skins/default/xui/en/panel_profile.xml
@@ -167,11 +167,10 @@
width="255">
Homepage:
</text>
- <link
+ <text
follows="left|top|right"
height="15"
layout="topleft"
- font.style="UNDERLINE"
left="10"
name="homepage_edit"
top_pad="5"
@@ -212,11 +211,10 @@
top_pad="15"
value="Account Status:"
width="100" />
- <!-- <link
+ <!-- <text
type="string"
follows="left|top"
font="SansSerifSmall"
- font.style="UNDERLINE"
height="15"
layout="topleft"
left_pad="10"
@@ -246,16 +244,15 @@
top_pad="15"
value="Partner:"
width="100" />
- <!--<link
+ <text
follows="left|top"
height="15"
- font.style="UNDERLINE"
layout="topleft"
left_pad="10"
name="partner_edit_link"
top_delta="0"
- value="Edit"
- width="100" /> -->
+ value="[[URL] Edit]"
+ width="100" />
<panel
follows="left|top|right"
height="15"
diff --git a/indra/newview/skins/default/xui/en/panel_progress.xml b/indra/newview/skins/default/xui/en/panel_progress.xml
index 4f23c4d26d..9b2461db7c 100644
--- a/indra/newview/skins/default/xui/en/panel_progress.xml
+++ b/indra/newview/skins/default/xui/en/panel_progress.xml
@@ -99,12 +99,12 @@
halign="left"
height="100"
layout="topleft"
- left="30"
+ left="45"
line_spacing="2"
name="message_text"
text_color="LoginProgressBoxTextColor"
top="145"
- width="610" />
+ width="550" />
</layout_panel>
<layout_panel
height="200"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 323c08ec4c..b8152a4956 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -74,6 +74,18 @@
<string name="TooltipMustSingleDrop">Only a single item can be dragged here</string>
<string name="TooltipAltLeft">Alt-Left arrow for previous tab</string>
<string name="TooltipAltRight">Alt-Right arrow for next tab</string>
+
+ <!-- tooltips for Urls -->
+ <string name="TooltipHttpUrl">Click to view this web page</string>
+ <string name="TooltipSLURL">Click to view this location's information</string>
+ <string name="TooltipAgentUrl">Click to view this resident's profile</string>
+ <string name="TooltipGroupUrl">Click to view this group's description</string>
+ <string name="TooltipEventUrl">Click to view this event's description</string>
+ <string name="TooltipClassifiedUrl">Click to view this classified</string>
+ <string name="TooltipParcelUrl">Click to view this parcel's description</string>
+ <string name="TooltipTeleportUrl">Click to teleport to this location</string>
+ <string name="TooltipObjectIMUrl">Click to view this object's description</string>
+ <string name="TooltipSLAPP">Click to run the secondlife:// command</string>
<!-- ButtonToolTips, llfloater.cpp -->
<string name="BUTTON_CLOSE_DARWIN">Close (&#8984;-W)</string>
@@ -259,6 +271,7 @@
<!-- IM -->
<string name="IM_logging_string">-- Instant message logging enabled --</string>
+ <string name="Unnamed">(Unnamed)</string>
<!-- Sim Access labels -->
<string name="SIM_ACCESS_PG">PG</string>