aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-09-11 00:33:33 -0700
committerMcCabe Maxsted2009-09-11 00:33:33 -0700
commitefa0d701845542e9ef555260fe6d2ad0beeb0760 (patch)
tree4527fe04a062d3353e4d1a77c547d1c2b1d475e9 /linden
parentFixed missing 'm' for draw distance slider (diff)
downloadmeta-impy-efa0d701845542e9ef555260fe6d2ad0beeb0760.zip
meta-impy-efa0d701845542e9ef555260fe6d2ad0beeb0760.tar.gz
meta-impy-efa0d701845542e9ef555260fe6d2ad0beeb0760.tar.bz2
meta-impy-efa0d701845542e9ef555260fe6d2ad0beeb0760.tar.xz
Backported clickable object names from 1.23
Diffstat (limited to 'linden')
-rw-r--r--linden/indra/llcommon/CMakeLists.txt2
-rw-r--r--linden/indra/llcommon/llchat.h6
-rw-r--r--linden/indra/llcommon/llcursortypes.cpp89
-rw-r--r--linden/indra/llcommon/llcursortypes.h81
-rw-r--r--linden/indra/llui/llpanel.cpp4
-rw-r--r--linden/indra/llui/llpanel.h2
-rw-r--r--linden/indra/llui/lltextbox.cpp7
-rw-r--r--linden/indra/llui/lltextbox.h3
-rw-r--r--linden/indra/llui/lltexteditor.cpp16
-rw-r--r--linden/indra/llui/lltexteditor.h8
-rw-r--r--linden/indra/llui/llview.cpp20
-rw-r--r--linden/indra/llui/llview.h5
-rw-r--r--linden/indra/llwindow/llwindow.h43
-rw-r--r--linden/indra/newview/CMakeLists.txt3
-rw-r--r--linden/indra/newview/app_settings/settings.xml19
-rw-r--r--linden/indra/newview/llfloaterabout.cpp4
-rw-r--r--linden/indra/newview/llfloaterchat.cpp18
-rw-r--r--linden/indra/newview/llfloaterobjectiminfo.cpp204
-rw-r--r--linden/indra/newview/llfloaterobjectiminfo.h45
-rw-r--r--linden/indra/newview/llgroupnotify.cpp4
-rw-r--r--linden/indra/newview/llimpanel.cpp4
-rw-r--r--linden/indra/newview/llstylemap.cpp37
-rw-r--r--linden/indra/newview/llstylemap.h3
-rw-r--r--linden/indra/newview/llviewermessage.cpp50
-rw-r--r--linden/indra/newview/skins/default/colors_base.xml4
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_object_im_info.xml54
-rw-r--r--linden/indra/newview/skins/silver/colors_base.xml2
27 files changed, 643 insertions, 94 deletions
diff --git a/linden/indra/llcommon/CMakeLists.txt b/linden/indra/llcommon/CMakeLists.txt
index 4001e1f..3f14be6 100644
--- a/linden/indra/llcommon/CMakeLists.txt
+++ b/linden/indra/llcommon/CMakeLists.txt
@@ -20,6 +20,7 @@ set(llcommon_SOURCE_FILES
20 llcommon.cpp 20 llcommon.cpp
21 llcrc.cpp 21 llcrc.cpp
22 llcriticaldamp.cpp 22 llcriticaldamp.cpp
23 llcursortypes.cpp
23 lldate.cpp 24 lldate.cpp
24 llerror.cpp 25 llerror.cpp
25 llerrorthread.cpp 26 llerrorthread.cpp
@@ -90,6 +91,7 @@ set(llcommon_HEADER_FILES
90 llcommon.h 91 llcommon.h
91 llcrc.h 92 llcrc.h
92 llcriticaldamp.h 93 llcriticaldamp.h
94 llcursortypes.h
93 lldarray.h 95 lldarray.h
94 lldarrayptr.h 96 lldarrayptr.h
95 lldate.h 97 lldate.h
diff --git a/linden/indra/llcommon/llchat.h b/linden/indra/llcommon/llchat.h
index 1bb3f3b..ec86450 100644
--- a/linden/indra/llcommon/llchat.h
+++ b/linden/indra/llcommon/llchat.h
@@ -77,9 +77,10 @@ public:
77 mAudible(CHAT_AUDIBLE_FULLY), 77 mAudible(CHAT_AUDIBLE_FULLY),
78 mMuted(FALSE), 78 mMuted(FALSE),
79 mTime(0.0), 79 mTime(0.0),
80 mPosAgent() 80 mPosAgent(),
81 mURL()
81 { } 82 { }
82 83
83 std::string mText; // UTF-8 line of text 84 std::string mText; // UTF-8 line of text
84 std::string mFromName; // agent or object name 85 std::string mFromName; // agent or object name
85 LLUUID mFromID; // agent id or object id 86 LLUUID mFromID; // agent id or object id
@@ -89,6 +90,7 @@ public:
89 BOOL mMuted; // pass muted chat to maintain list of chatters 90 BOOL mMuted; // pass muted chat to maintain list of chatters
90 F64 mTime; // viewer only, seconds from viewer start 91 F64 mTime; // viewer only, seconds from viewer start
91 LLVector3 mPosAgent; 92 LLVector3 mPosAgent;
93 std::string mURL;
92}; 94};
93 95
94#endif 96#endif
diff --git a/linden/indra/llcommon/llcursortypes.cpp b/linden/indra/llcommon/llcursortypes.cpp
new file mode 100644
index 0000000..858414b
--- /dev/null
+++ b/linden/indra/llcommon/llcursortypes.cpp
@@ -0,0 +1,89 @@
1/**
2 * @file llcursortypes.cpp
3 * @brief Cursor types and lookup of types from a string
4 *
5 * $LicenseInfo:firstyear=2008&license=viewergpl$
6 *
7 * Copyright (c) 2008, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 *
22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above,
24 * and agree to abide by those obligations.
25 *
26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
28 * COMPLETENESS OR PERFORMANCE.
29 * $/LicenseInfo$
30 */
31
32#include "llcursortypes.h"
33
34ECursorType getCursorFromString(const std::string& cursor_string)
35{
36 static std::map<std::string,U32> cursor_string_table;
37 if (cursor_string_table.empty())
38 {
39 cursor_string_table["UI_CURSOR_ARROW"] = UI_CURSOR_ARROW;
40 cursor_string_table["UI_CURSOR_WAIT"] = UI_CURSOR_WAIT;
41 cursor_string_table["UI_CURSOR_HAND"] = UI_CURSOR_HAND;
42 cursor_string_table["UI_CURSOR_IBEAM"] = UI_CURSOR_IBEAM;
43 cursor_string_table["UI_CURSOR_CROSS"] = UI_CURSOR_CROSS;
44 cursor_string_table["UI_CURSOR_SIZENWSE"] = UI_CURSOR_SIZENWSE;
45 cursor_string_table["UI_CURSOR_SIZENESW"] = UI_CURSOR_SIZENESW;
46 cursor_string_table["UI_CURSOR_SIZEWE"] = UI_CURSOR_SIZEWE;
47 cursor_string_table["UI_CURSOR_SIZENS"] = UI_CURSOR_SIZENS;
48 cursor_string_table["UI_CURSOR_NO"] = UI_CURSOR_NO;
49 cursor_string_table["UI_CURSOR_WORKING"] = UI_CURSOR_WORKING;
50 cursor_string_table["UI_CURSOR_TOOLGRAB"] = UI_CURSOR_TOOLGRAB;
51 cursor_string_table["UI_CURSOR_TOOLLAND"] = UI_CURSOR_TOOLLAND;
52 cursor_string_table["UI_CURSOR_TOOLFOCUS"] = UI_CURSOR_TOOLFOCUS;
53 cursor_string_table["UI_CURSOR_TOOLCREATE"] = UI_CURSOR_TOOLCREATE;
54 cursor_string_table["UI_CURSOR_ARROWDRAG"] = UI_CURSOR_ARROWDRAG;
55 cursor_string_table["UI_CURSOR_ARROWCOPY"] = UI_CURSOR_ARROWCOPY;
56 cursor_string_table["UI_CURSOR_ARROWDRAGMULTI"] = UI_CURSOR_ARROWDRAGMULTI;
57 cursor_string_table["UI_CURSOR_ARROWCOPYMULTI"] = UI_CURSOR_ARROWCOPYMULTI;
58 cursor_string_table["UI_CURSOR_NOLOCKED"] = UI_CURSOR_NOLOCKED;
59 cursor_string_table["UI_CURSOR_ARROWLOCKED"] = UI_CURSOR_ARROWLOCKED;
60 cursor_string_table["UI_CURSOR_GRABLOCKED"] = UI_CURSOR_GRABLOCKED;
61 cursor_string_table["UI_CURSOR_TOOLTRANSLATE"] = UI_CURSOR_TOOLTRANSLATE;
62 cursor_string_table["UI_CURSOR_TOOLROTATE"] = UI_CURSOR_TOOLROTATE;
63 cursor_string_table["UI_CURSOR_TOOLSCALE"] = UI_CURSOR_TOOLSCALE;
64 cursor_string_table["UI_CURSOR_TOOLCAMERA"] = UI_CURSOR_TOOLCAMERA;
65 cursor_string_table["UI_CURSOR_TOOLPAN"] = UI_CURSOR_TOOLPAN;
66 cursor_string_table["UI_CURSOR_TOOLZOOMIN"] = UI_CURSOR_TOOLZOOMIN;
67 cursor_string_table["UI_CURSOR_TOOLPICKOBJECT3"] = UI_CURSOR_TOOLPICKOBJECT3;
68 cursor_string_table["UI_CURSOR_TOOLSIT"] = UI_CURSOR_TOOLSIT;
69 cursor_string_table["UI_CURSOR_TOOLBUY"] = UI_CURSOR_TOOLBUY;
70 cursor_string_table["UI_CURSOR_TOOLPAY"] = UI_CURSOR_TOOLPAY;
71 cursor_string_table["UI_CURSOR_TOOLOPEN"] = UI_CURSOR_TOOLOPEN;
72 cursor_string_table["UI_CURSOR_TOOLPLAY"] = UI_CURSOR_TOOLPLAY;
73 cursor_string_table["UI_CURSOR_TOOLPAUSE"] = UI_CURSOR_TOOLPAUSE;
74 cursor_string_table["UI_CURSOR_TOOLMEDIAOPEN"] = UI_CURSOR_TOOLMEDIAOPEN;
75 cursor_string_table["UI_CURSOR_PIPETTE"] = UI_CURSOR_PIPETTE;
76 }
77
78 std::map<std::string,U32>::const_iterator iter = cursor_string_table.find(cursor_string);
79
80 if (iter != cursor_string_table.end())
81 {
82 return (ECursorType)iter->second;
83 }
84
85 return UI_CURSOR_ARROW;
86}
87
88
89
diff --git a/linden/indra/llcommon/llcursortypes.h b/linden/indra/llcommon/llcursortypes.h
new file mode 100644
index 0000000..9be064f
--- /dev/null
+++ b/linden/indra/llcommon/llcursortypes.h
@@ -0,0 +1,81 @@
1/**
2 * @file llcursortypes.h
3 * @brief Cursor types
4 *
5 * $LicenseInfo:firstyear=2008&license=viewergpl$
6 *
7 * Copyright (c) 2008, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 *
22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above,
24 * and agree to abide by those obligations.
25 *
26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
28 * COMPLETENESS OR PERFORMANCE.
29 * $/LicenseInfo$
30 */
31
32#ifndef LL_LLCURSORTYPES_H
33#define LL_LLCURSORTYPES_H
34
35#include "linden_common.h"
36
37// If you add types here, add them in LLCursor::getCursorFromString
38enum ECursorType {
39 UI_CURSOR_ARROW,
40 UI_CURSOR_WAIT,
41 UI_CURSOR_HAND,
42 UI_CURSOR_IBEAM,
43 UI_CURSOR_CROSS,
44 UI_CURSOR_SIZENWSE,
45 UI_CURSOR_SIZENESW,
46 UI_CURSOR_SIZEWE,
47 UI_CURSOR_SIZENS,
48 UI_CURSOR_NO,
49 UI_CURSOR_WORKING,
50 UI_CURSOR_TOOLGRAB,
51 UI_CURSOR_TOOLLAND,
52 UI_CURSOR_TOOLFOCUS,
53 UI_CURSOR_TOOLCREATE,
54 UI_CURSOR_ARROWDRAG,
55 UI_CURSOR_ARROWCOPY, // drag with copy
56 UI_CURSOR_ARROWDRAGMULTI,
57 UI_CURSOR_ARROWCOPYMULTI, // drag with copy
58 UI_CURSOR_NOLOCKED,
59 UI_CURSOR_ARROWLOCKED,
60 UI_CURSOR_GRABLOCKED,
61 UI_CURSOR_TOOLTRANSLATE,
62 UI_CURSOR_TOOLROTATE,
63 UI_CURSOR_TOOLSCALE,
64 UI_CURSOR_TOOLCAMERA,
65 UI_CURSOR_TOOLPAN,
66 UI_CURSOR_TOOLZOOMIN,
67 UI_CURSOR_TOOLPICKOBJECT3,
68 UI_CURSOR_TOOLSIT,
69 UI_CURSOR_TOOLBUY,
70 UI_CURSOR_TOOLPAY,
71 UI_CURSOR_TOOLOPEN,
72 UI_CURSOR_TOOLPLAY,
73 UI_CURSOR_TOOLPAUSE,
74 UI_CURSOR_TOOLMEDIAOPEN,
75 UI_CURSOR_PIPETTE,
76 UI_CURSOR_COUNT // Number of elements in this enum (NOT a cursor)
77};
78
79ECursorType getCursorFromString(const std::string& cursor_string);
80
81#endif // LL_LLCURSORTYPES_H
diff --git a/linden/indra/llui/llpanel.cpp b/linden/indra/llui/llpanel.cpp
index d37517f..05103dc 100644
--- a/linden/indra/llui/llpanel.cpp
+++ b/linden/indra/llui/llpanel.cpp
@@ -982,12 +982,12 @@ void LLPanel::childSetAction(const std::string& id, void(*function)(void*), void
982 } 982 }
983} 983}
984 984
985void LLPanel::childSetActionTextbox(const std::string& id, void(*function)(void*)) 985void LLPanel::childSetActionTextbox(const std::string& id, void(*function)(void*), void* value)
986{ 986{
987 LLTextBox* textbox = getChild<LLTextBox>(id); 987 LLTextBox* textbox = getChild<LLTextBox>(id);
988 if (textbox) 988 if (textbox)
989 { 989 {
990 textbox->setClickedCallback(function); 990 textbox->setClickedCallback(function, value);
991 } 991 }
992} 992}
993 993
diff --git a/linden/indra/llui/llpanel.h b/linden/indra/llui/llpanel.h
index 46022e5..8dea9b1 100644
--- a/linden/indra/llui/llpanel.h
+++ b/linden/indra/llui/llpanel.h
@@ -220,7 +220,7 @@ public:
220 220
221 // LLButton 221 // LLButton
222 void childSetAction(const std::string& id, void(*function)(void*), void* value); 222 void childSetAction(const std::string& id, void(*function)(void*), void* value);
223 void childSetActionTextbox(const std::string& id, void(*function)(void*)); 223 void childSetActionTextbox(const std::string& id, void(*function)(void*), void* value = NULL);
224 void childSetControlName(const std::string& id, const std::string& control_name); 224 void childSetControlName(const std::string& id, const std::string& control_name);
225 225
226 // Error reporting 226 // Error reporting
diff --git a/linden/indra/llui/lltextbox.cpp b/linden/indra/llui/lltextbox.cpp
index f43b7d2..e45f97b 100644
--- a/linden/indra/llui/lltextbox.cpp
+++ b/linden/indra/llui/lltextbox.cpp
@@ -33,6 +33,7 @@
33#include "lltextbox.h" 33#include "lltextbox.h"
34#include "lluictrlfactory.h" 34#include "lluictrlfactory.h"
35#include "llfocusmgr.h" 35#include "llfocusmgr.h"
36#include "llwindow.h"
36 37
37static LLRegisterWidget<LLTextBox> r("text"); 38static LLRegisterWidget<LLTextBox> r("text");
38 39
@@ -193,12 +194,14 @@ BOOL LLTextBox::handleMouseUp(S32 x, S32 y, MASK mask)
193 194
194BOOL LLTextBox::handleHover(S32 x, S32 y, MASK mask) 195BOOL LLTextBox::handleHover(S32 x, S32 y, MASK mask)
195{ 196{
197 BOOL handled = LLView::handleHover(x,y,mask);
196 if(mHoverActive) 198 if(mHoverActive)
197 { 199 {
198 mHasHover = TRUE; // This should be set every frame during a hover. 200 mHasHover = TRUE; // This should be set every frame during a hover.
199 return TRUE; 201 getWindow()->setCursor(UI_CURSOR_ARROW);
200 } 202 }
201 return LLView::handleHover(x,y,mask); 203
204 return (handled || mHasHover);
202} 205}
203 206
204void LLTextBox::setText(const LLStringExplicit& text) 207void LLTextBox::setText(const LLStringExplicit& text)
diff --git a/linden/indra/llui/lltextbox.h b/linden/indra/llui/lltextbox.h
index 83e4a9b..aac5344 100644
--- a/linden/indra/llui/lltextbox.h
+++ b/linden/indra/llui/lltextbox.h
@@ -88,8 +88,7 @@ public:
88 void setVPad(S32 pixels) { mVPad = pixels; } 88 void setVPad(S32 pixels) { mVPad = pixels; }
89 void setRightAlign() { mHAlign = LLFontGL::RIGHT; } 89 void setRightAlign() { mHAlign = LLFontGL::RIGHT; }
90 void setHAlign( LLFontGL::HAlign align ) { mHAlign = align; } 90 void setHAlign( LLFontGL::HAlign align ) { mHAlign = align; }
91 void setClickedCallback( void (*cb)(void *data) ){ mClickedCallback = cb; } // mouse down and up within button 91 void setClickedCallback( void (*cb)(void *data), void* data = NULL ){ mClickedCallback = cb; mCallbackUserData = data; } // mouse down and up within button
92 void setCallbackUserData( void* data ) { mCallbackUserData = data; }
93 92
94 const LLFontGL* getFont() const { return mFontGL; } 93 const LLFontGL* getFont() const { return mFontGL; }
95 94
diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp
index 95cce60..8fa253a 100644
--- a/linden/indra/llui/lltexteditor.cpp
+++ b/linden/indra/llui/lltexteditor.cpp
@@ -3605,13 +3605,13 @@ void LLTextEditor::appendColoredText(const std::string &new_text,
3605 style->setVisible(true); 3605 style->setVisible(true);
3606 style->setColor(color); 3606 style->setColor(color);
3607 style->setFontName(font_name); 3607 style->setFontName(font_name);
3608 appendStyledText(new_text, allow_undo, prepend_newline, &style); 3608 appendStyledText(new_text, allow_undo, prepend_newline, style);
3609} 3609}
3610 3610
3611void LLTextEditor::appendStyledText(const std::string &new_text, 3611void LLTextEditor::appendStyledText(const std::string &new_text,
3612 bool allow_undo, 3612 bool allow_undo,
3613 bool prepend_newline, 3613 bool prepend_newline,
3614 const LLStyleSP *stylep) 3614 const LLStyleSP stylep)
3615{ 3615{
3616 if(mParseHTML) 3616 if(mParseHTML)
3617 { 3617 {
@@ -3626,14 +3626,14 @@ void LLTextEditor::appendStyledText(const std::string &new_text,
3626 html->setColor(mLinkColor); 3626 html->setColor(mLinkColor);
3627 if (stylep) 3627 if (stylep)
3628 { 3628 {
3629 html->setFontName((*stylep)->getFontString()); 3629 html->setFontName(stylep->getFontString());
3630 } 3630 }
3631 html->mUnderline = TRUE; 3631 html->mUnderline = TRUE;
3632 3632
3633 if (start > 0) appendText(text.substr(0,start),allow_undo, prepend_newline, stylep); 3633 if (start > 0) appendText(text.substr(0,start),allow_undo, prepend_newline, stylep);
3634 html->setLinkHREF(text.substr(start,end-start)); 3634 html->setLinkHREF(text.substr(start,end-start));
3635 appendText(text.substr(start, end-start),allow_undo, prepend_newline, &html); 3635 appendText(text.substr(start, end-start),allow_undo, prepend_newline, html);
3636 if (end < (S32)text.length()) 3636 if (end < (S32)text.length())
3637 { 3637 {
3638 text = text.substr(end,text.length() - end); 3638 text = text.substr(end,text.length() - end);
3639 end=0; 3639 end=0;
@@ -3653,7 +3653,7 @@ void LLTextEditor::appendStyledText(const std::string &new_text,
3653 3653
3654// Appends new text to end of document 3654// Appends new text to end of document
3655void LLTextEditor::appendText(const std::string &new_text, bool allow_undo, bool prepend_newline, 3655void LLTextEditor::appendText(const std::string &new_text, bool allow_undo, bool prepend_newline,
3656 const LLStyleSP *stylep) 3656 const LLStyleSP stylep)
3657{ 3657{
3658 // Save old state 3658 // Save old state
3659 BOOL was_scrolled_to_bottom = (mScrollbar->getDocPos() == mScrollbar->getDocPosMax()); 3659 BOOL was_scrolled_to_bottom = (mScrollbar->getDocPos() == mScrollbar->getDocPosMax());
@@ -3685,7 +3685,7 @@ void LLTextEditor::appendText(const std::string &new_text, bool allow_undo, bool
3685 { 3685 {
3686 S32 segment_start = old_length; 3686 S32 segment_start = old_length;
3687 S32 segment_end = getLength(); 3687 S32 segment_end = getLength();
3688 LLTextSegment* segment = new LLTextSegment(*stylep, segment_start, segment_end ); 3688 LLTextSegment* segment = new LLTextSegment(stylep, segment_start, segment_end );
3689 mSegments.push_back(segment); 3689 mSegments.push_back(segment);
3690 } 3690 }
3691 3691
diff --git a/linden/indra/llui/lltexteditor.h b/linden/indra/llui/lltexteditor.h
index 0777e5f..7e93de1 100644
--- a/linden/indra/llui/lltexteditor.h
+++ b/linden/indra/llui/lltexteditor.h
@@ -146,16 +146,16 @@ public:
146 void insertText(const std::string &text); 146 void insertText(const std::string &text);
147 // appends text at end 147 // appends text at end
148 void appendText(const std::string &wtext, bool allow_undo, bool prepend_newline, 148 void appendText(const std::string &wtext, bool allow_undo, bool prepend_newline,
149 const LLStyleSP *stylep = NULL); 149 const LLStyleSP stylep = NULL);
150 150
151 void appendColoredText(const std::string &wtext, bool allow_undo, 151 void appendColoredText(const std::string &wtext, bool allow_undo,
152 bool prepend_newline, 152 bool prepend_newline,
153 const LLColor4 &color, 153 const LLColor4 &color,
154 const std::string& font_name = LLStringUtil::null); 154 const std::string& font_name = LLStringUtil::null);
155 // if styled text starts a line, you need to prepend a newline. 155 // if styled text starts a line, you need to prepend a newline.
156 void appendStyledText(const std::string &new_text, bool allow_undo, 156 void appendStyledText(const std::string &new_text, bool allow_undo,
157 bool prepend_newline, 157 bool prepend_newline,
158 const LLStyleSP *stylep = NULL); 158 const LLStyleSP stylep = NULL);
159 159
160 // Removes text from the end of document 160 // Removes text from the end of document
161 // Does not change highlight or cursor position. 161 // Does not change highlight or cursor position.
diff --git a/linden/indra/llui/llview.cpp b/linden/indra/llui/llview.cpp
index 78bf168..e3652b7 100644
--- a/linden/indra/llui/llview.cpp
+++ b/linden/indra/llui/llview.cpp
@@ -85,7 +85,8 @@ LLView::LLView() :
85 mLastVisible(TRUE), 85 mLastVisible(TRUE),
86 mUseBoundingRect(FALSE), 86 mUseBoundingRect(FALSE),
87 mVisible(TRUE), 87 mVisible(TRUE),
88 mNextInsertionOrdinal(0) 88 mNextInsertionOrdinal(0),
89 mHoverCursor(UI_CURSOR_ARROW)
89{ 90{
90} 91}
91 92
@@ -102,7 +103,8 @@ LLView::LLView(const std::string& name, BOOL mouse_opaque) :
102 mLastVisible(TRUE), 103 mLastVisible(TRUE),
103 mUseBoundingRect(FALSE), 104 mUseBoundingRect(FALSE),
104 mVisible(TRUE), 105 mVisible(TRUE),
105 mNextInsertionOrdinal(0) 106 mNextInsertionOrdinal(0),
107 mHoverCursor(UI_CURSOR_ARROW)
106{ 108{
107} 109}
108 110
@@ -123,7 +125,8 @@ LLView::LLView(
123 mLastVisible(TRUE), 125 mLastVisible(TRUE),
124 mUseBoundingRect(FALSE), 126 mUseBoundingRect(FALSE),
125 mVisible(TRUE), 127 mVisible(TRUE),
126 mNextInsertionOrdinal(0) 128 mNextInsertionOrdinal(0),
129 mHoverCursor(UI_CURSOR_ARROW)
127{ 130{
128} 131}
129 132
@@ -657,7 +660,7 @@ BOOL LLView::handleHover(S32 x, S32 y, MASK mask)
657 if( !handled 660 if( !handled
658 && blockMouseEvent(x, y) ) 661 && blockMouseEvent(x, y) )
659 { 662 {
660 LLUI::sWindow->setCursor(UI_CURSOR_ARROW); 663 LLUI::sWindow->setCursor(mHoverCursor);
661 lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << llendl; 664 lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << llendl;
662 handled = TRUE; 665 handled = TRUE;
663 } 666 }
@@ -2622,7 +2625,14 @@ void LLView::initFromXML(LLXMLNodePtr node, LLView* parent)
2622 node->getAttributeBOOL("visible", visible); 2625 node->getAttributeBOOL("visible", visible);
2623 setVisible(visible); 2626 setVisible(visible);
2624 } 2627 }
2625 2628
2629 if (node->hasAttribute("hover_cursor"))
2630 {
2631 std::string cursor_string;
2632 node->getAttributeString("hover_cursor", cursor_string);
2633 mHoverCursor = getCursorFromString(cursor_string);
2634 }
2635
2626 node->getAttributeBOOL("use_bounding_rect", mUseBoundingRect); 2636 node->getAttributeBOOL("use_bounding_rect", mUseBoundingRect);
2627 node->getAttributeBOOL("mouse_opaque", mMouseOpaque); 2637 node->getAttributeBOOL("mouse_opaque", mMouseOpaque);
2628 2638
diff --git a/linden/indra/llui/llview.h b/linden/indra/llui/llview.h
index da7f164..df34a3e 100644
--- a/linden/indra/llui/llview.h
+++ b/linden/indra/llui/llview.h
@@ -51,6 +51,7 @@
51#include "llxmlnode.h" 51#include "llxmlnode.h"
52#include "stdenums.h" 52#include "stdenums.h"
53#include "lluistring.h" 53#include "lluistring.h"
54#include "llcursortypes.h"
54 55
55const U32 FOLLOWS_NONE = 0x00; 56const U32 FOLLOWS_NONE = 0x00;
56const U32 FOLLOWS_LEFT = 0x01; 57const U32 FOLLOWS_LEFT = 0x01;
@@ -653,7 +654,9 @@ private:
653 mutable dummy_widget_map_t mDummyWidgets; 654 mutable dummy_widget_map_t mDummyWidgets;
654 655
655 boost::signals::connection mControlConnection; 656 boost::signals::connection mControlConnection;
656 657
658 ECursorType mHoverCursor;
659
657public: 660public:
658 static BOOL sDebugRects; // Draw debug rects behind everything. 661 static BOOL sDebugRects; // Draw debug rects behind everything.
659 static BOOL sDebugKeys; 662 static BOOL sDebugKeys;
diff --git a/linden/indra/llwindow/llwindow.h b/linden/indra/llwindow/llwindow.h
index 821de2f..0acbcb9 100644
--- a/linden/indra/llwindow/llwindow.h
+++ b/linden/indra/llwindow/llwindow.h
@@ -35,48 +35,7 @@
35#include "llrect.h" 35#include "llrect.h"
36#include "llcoord.h" 36#include "llcoord.h"
37#include "llstring.h" 37#include "llstring.h"
38 38#include "llcursortypes.h"
39
40enum ECursorType {
41 UI_CURSOR_ARROW,
42 UI_CURSOR_WAIT,
43 UI_CURSOR_HAND,
44 UI_CURSOR_IBEAM,
45 UI_CURSOR_CROSS,
46 UI_CURSOR_SIZENWSE,
47 UI_CURSOR_SIZENESW,
48 UI_CURSOR_SIZEWE,
49 UI_CURSOR_SIZENS,
50 UI_CURSOR_NO,
51 UI_CURSOR_WORKING,
52 UI_CURSOR_TOOLGRAB,
53 UI_CURSOR_TOOLLAND,
54 UI_CURSOR_TOOLFOCUS,
55 UI_CURSOR_TOOLCREATE,
56 UI_CURSOR_ARROWDRAG,
57 UI_CURSOR_ARROWCOPY, // drag with copy
58 UI_CURSOR_ARROWDRAGMULTI,
59 UI_CURSOR_ARROWCOPYMULTI, // drag with copy
60 UI_CURSOR_NOLOCKED,
61 UI_CURSOR_ARROWLOCKED,
62 UI_CURSOR_GRABLOCKED,
63 UI_CURSOR_TOOLTRANSLATE,
64 UI_CURSOR_TOOLROTATE,
65 UI_CURSOR_TOOLSCALE,
66 UI_CURSOR_TOOLCAMERA,
67 UI_CURSOR_TOOLPAN,
68 UI_CURSOR_TOOLZOOMIN,
69 UI_CURSOR_TOOLPICKOBJECT3,
70 UI_CURSOR_TOOLSIT,
71 UI_CURSOR_TOOLBUY,
72 UI_CURSOR_TOOLPAY,
73 UI_CURSOR_TOOLOPEN,
74 UI_CURSOR_TOOLPLAY,
75 UI_CURSOR_TOOLPAUSE,
76 UI_CURSOR_TOOLMEDIAOPEN,
77 UI_CURSOR_PIPETTE,
78 UI_CURSOR_COUNT // Number of elements in this enum (NOT a cursor)
79};
80 39
81class LLSplashScreen; 40class LLSplashScreen;
82 41
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt
index 2f2bdd1..6f54a41 100644
--- a/linden/indra/newview/CMakeLists.txt
+++ b/linden/indra/newview/CMakeLists.txt
@@ -168,6 +168,7 @@ set(viewer_SOURCE_FILES
168 llfloatermute.cpp 168 llfloatermute.cpp
169 llfloaternamedesc.cpp 169 llfloaternamedesc.cpp
170 llfloaternewim.cpp 170 llfloaternewim.cpp
171 llfloaterobjectiminfo.cpp
171 llfloateropenobject.cpp 172 llfloateropenobject.cpp
172 llfloaterparcel.cpp 173 llfloaterparcel.cpp
173 llfloaterpermissionsmgr.cpp 174 llfloaterpermissionsmgr.cpp
@@ -566,6 +567,7 @@ set(viewer_HEADER_FILES
566 llfloatermute.h 567 llfloatermute.h
567 llfloaternamedesc.h 568 llfloaternamedesc.h
568 llfloaternewim.h 569 llfloaternewim.h
570 llfloaterobjectiminfo.h
569 llfloateropenobject.h 571 llfloateropenobject.h
570 llfloaterparcel.h 572 llfloaterparcel.h
571 llfloaterpermissionsmgr.h 573 llfloaterpermissionsmgr.h
@@ -1086,6 +1088,7 @@ set(viewer_XUI_FILES
1086 skins/default/xui/en-us/floater_name_description.xml 1088 skins/default/xui/en-us/floater_name_description.xml
1087 skins/default/xui/en-us/floater_new_im.xml 1089 skins/default/xui/en-us/floater_new_im.xml
1088 skins/default/xui/en-us/floater_new_outfit_dialog.xml 1090 skins/default/xui/en-us/floater_new_outfit_dialog.xml
1091 skins/default/xui/en-us/floater_object_im_info.xml
1089 skins/default/xui/en-us/floater_openobject.xml 1092 skins/default/xui/en-us/floater_openobject.xml
1090 skins/default/xui/en-us/floater_pay_object.xml 1093 skins/default/xui/en-us/floater_pay_object.xml
1091 skins/default/xui/en-us/floater_pay.xml 1094 skins/default/xui/en-us/floater_pay.xml
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml
index 39b482b..f8a5d71 100644
--- a/linden/indra/newview/app_settings/settings.xml
+++ b/linden/indra/newview/app_settings/settings.xml
@@ -3117,7 +3117,24 @@
3117 <integer>0</integer> 3117 <integer>0</integer>
3118 </array> 3118 </array>
3119 </map> 3119 </map>
3120 <key>FloaterOpenObjectRect</key> 3120
3121 <key>FloaterObjectIMInfo</key>
3122 <map>
3123 <key>Comment</key>
3124 <string>Rectangle for floater object im info windows</string>
3125 <key>Persist</key>
3126 <integer>1</integer>
3127 <key>Type</key>
3128 <string>Rect</string>
3129 <key>Value</key>
3130 <array>
3131 <integer>0</integer>
3132 <integer>300</integer>
3133 <integer>300</integer>
3134 <integer>0</integer>
3135 </array>
3136 </map>
3137 <key>FloaterOpenObjectRect</key>
3121 <map> 3138 <map>
3122 <key>Comment</key> 3139 <key>Comment</key>
3123 <string>Rectangle for Open Object window</string> 3140 <string>Rectangle for Open Object window</string>
diff --git a/linden/indra/newview/llfloaterabout.cpp b/linden/indra/newview/llfloaterabout.cpp
index 37e9c54..0954a70 100644
--- a/linden/indra/newview/llfloaterabout.cpp
+++ b/linden/indra/newview/llfloaterabout.cpp
@@ -119,7 +119,7 @@ LLFloaterAbout::LLFloaterAbout()
119 __DATE__, __TIME__); 119 __DATE__, __TIME__);
120 120
121 support_widget->appendColoredText(version, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor")); 121 support_widget->appendColoredText(version, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor"));
122 support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), FALSE, FALSE, &viewer_link_style); 122 support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, viewer_link_style);
123 123
124 std::string support; 124 std::string support;
125 support.append("\n\n"); 125 support.append("\n\n");
@@ -155,7 +155,7 @@ LLFloaterAbout::LLFloaterAbout()
155 support.append("\n"); 155 support.append("\n");
156 156
157 support_widget->appendColoredText(support, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor")); 157 support_widget->appendColoredText(support, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor"));
158 support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), FALSE, FALSE, &server_link_style); 158 support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, server_link_style);
159 159
160 support = "\n\n"; 160 support = "\n\n";
161 } 161 }
diff --git a/linden/indra/newview/llfloaterchat.cpp b/linden/indra/newview/llfloaterchat.cpp
index f624ec3..d0713bc 100644
--- a/linden/indra/newview/llfloaterchat.cpp
+++ b/linden/indra/newview/llfloaterchat.cpp
@@ -189,7 +189,7 @@ void LLFloaterChat::updateConsoleVisibility()
189 || (getHost() && getHost()->isMinimized() )); // are we hosted in a minimized floater? 189 || (getHost() && getHost()->isMinimized() )); // are we hosted in a minimized floater?
190} 190}
191 191
192void add_timestamped_line(LLViewerTextEditor* edit, const LLChat &chat, const LLColor4& color) 192void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4& color)
193{ 193{
194 std::string line = chat.mText; 194 std::string line = chat.mText;
195 bool prepend_newline = true; 195 bool prepend_newline = true;
@@ -199,16 +199,22 @@ void add_timestamped_line(LLViewerTextEditor* edit, const LLChat &chat, const LL
199 prepend_newline = false; 199 prepend_newline = false;
200 } 200 }
201 201
202 // If the msg is not from an agent (not yourself though), 202 // If the msg is from an agent (not yourself though),
203 // extract out the sender name and replace it with the hotlinked name. 203 // extract out the sender name and replace it with the hotlinked name.
204 if (chat.mSourceType == CHAT_SOURCE_AGENT && 204 if (chat.mSourceType == CHAT_SOURCE_AGENT &&
205 chat.mFromID != LLUUID::null && 205 chat.mFromID != LLUUID::null)
206 (line.length() > chat.mFromName.length() && line.find(chat.mFromName,0) == 0)) 206 {
207 chat.mURL = llformat("secondlife:///app/agent/%s/about",chat.mFromID.asString().c_str());
208 }
209
210 // If the chat line has an associated url, link it up to the name.
211 if (!chat.mURL.empty()
212 && (line.length() > chat.mFromName.length() && line.find(chat.mFromName,0) == 0))
207 { 213 {
208 std::string start_line = line.substr(0, chat.mFromName.length() + 1); 214 std::string start_line = line.substr(0, chat.mFromName.length() + 1);
209 line = line.substr(chat.mFromName.length() + 1); 215 line = line.substr(chat.mFromName.length() + 1);
210 const LLStyleSP &sourceStyle = LLStyleMap::instance().lookup(chat.mFromID); 216 const LLStyleSP &sourceStyle = LLStyleMap::instance().lookup(chat.mFromID,chat.mURL);
211 edit->appendStyledText(start_line, false, prepend_newline, &sourceStyle); 217 edit->appendStyledText(start_line, false, prepend_newline, sourceStyle);
212 prepend_newline = false; 218 prepend_newline = false;
213 } 219 }
214 edit->appendColoredText(line, false, prepend_newline, color); 220 edit->appendColoredText(line, false, prepend_newline, color);
diff --git a/linden/indra/newview/llfloaterobjectiminfo.cpp b/linden/indra/newview/llfloaterobjectiminfo.cpp
new file mode 100644
index 0000000..6cbc4e2
--- /dev/null
+++ b/linden/indra/newview/llfloaterobjectiminfo.cpp
@@ -0,0 +1,204 @@
1/**
2 * @file llfloaterobjectiminfo.cpp
3 * @brief A floater with information about an object that sent an IM.
4 *
5 * $LicenseInfo:firstyear=2007&license=viewergpl$
6 *
7 * Copyright (c) 2007-2008, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 *
22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above,
24 * and agree to abide by those obligations.
25 *
26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
28 * COMPLETENESS OR PERFORMANCE.
29 * $/LicenseInfo$
30 */
31
32#include "llviewerprecompiledheaders.h"
33
34#include "llfloaterobjectiminfo.h"
35
36#include "llagentdata.h"
37#include "llcachename.h"
38#include "llcommandhandler.h"
39#include "llfloater.h"
40#include "llfloateravatarinfo.h"
41#include "llfloatergroupinfo.h"
42#include "llfloatermute.h"
43#include "llmutelist.h"
44#include "llsdutil.h"
45#include "lluictrlfactory.h"
46#include "llurldispatcher.h"
47#include "llviewercontrol.h"
48
49////////////////////////////////////////////////////////////////////////////
50// LLFloaterObjectIMInfo
51class LLFloaterObjectIMInfo : public LLFloater, public LLFloaterSingleton<LLFloaterObjectIMInfo>
52{
53public:
54 LLFloaterObjectIMInfo(const LLSD& sd);
55 virtual ~LLFloaterObjectIMInfo() { };
56
57 BOOL postBuild(void);
58
59 void update(const LLUUID& id, const std::string& name, const std::string& slurl, const LLUUID& owner, bool owner_is_group);
60
61 // UI Handlers
62 static void onClickMap(void* data);
63 static void onClickOwner(void* data);
64 static void onClickMute(void* data);
65
66 static void nameCallback(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* data);
67
68private:
69 LLUUID mObjectID;
70 std::string mObjectName;
71 std::string mSlurl;
72 LLUUID mOwnerID;
73 std::string mOwnerName;
74 bool mOwnerIsGroup;
75};
76
77LLFloaterObjectIMInfo::LLFloaterObjectIMInfo(const LLSD& seed)
78: mObjectID(), mObjectName(), mSlurl(), mOwnerID(), mOwnerName(), mOwnerIsGroup(false)
79{
80 LLUICtrlFactory::getInstance()->buildFloater(this, "floater_object_im_info.xml");
81
82 if (getRect().mLeft == 0
83 && getRect().mBottom == 0)
84 {
85 center();
86 }
87}
88
89BOOL LLFloaterObjectIMInfo::postBuild(void)
90{
91 childSetAction("Mute",onClickMute,this);
92 childSetActionTextbox("OwnerName",onClickOwner, this);
93 childSetActionTextbox("Slurl",onClickMap, this);
94
95 return true;
96}
97
98void LLFloaterObjectIMInfo::update(const LLUUID& object_id, const std::string& name, const std::string& slurl, const LLUUID& owner_id, bool owner_is_group)
99{
100 // When talking to an old region we won't have a slurl.
101 // The object id isn't really the object id either but we don't use it so who cares.
102 bool have_slurl = !slurl.empty();
103 childSetVisible("Unknown_Slurl",!have_slurl);
104 childSetVisible("Slurl",have_slurl);
105
106 childSetText("ObjectName",name);
107 childSetText("Slurl",slurl);
108 childSetText("OwnerName",std::string(""));
109
110 bool my_object = (owner_id == gAgentID);
111 childSetEnabled("Mute",!my_object);
112
113 mObjectID = object_id;
114 mObjectName = name;
115 mSlurl = slurl;
116 mOwnerID = owner_id;
117 mOwnerIsGroup = owner_is_group;
118
119 if (gCacheName) gCacheName->get(owner_id,owner_is_group,nameCallback,this);
120}
121
122//static
123void LLFloaterObjectIMInfo::onClickMap(void* data)
124{
125 LLFloaterObjectIMInfo* self = (LLFloaterObjectIMInfo*)data;
126
127 std::ostringstream link;
128 link << "secondlife://" << self->mSlurl;
129 LLURLDispatcher::dispatch(link.str(),false);
130}
131
132//static
133void LLFloaterObjectIMInfo::onClickOwner(void* data)
134{
135 LLFloaterObjectIMInfo* self = (LLFloaterObjectIMInfo*)data;
136 if (self->mOwnerIsGroup)
137 {
138 LLFloaterGroupInfo::showFromUUID(self->mOwnerID);
139 }
140 else
141 {
142 LLFloaterAvatarInfo::showFromObject(self->mOwnerID);
143 }
144}
145
146//static
147void LLFloaterObjectIMInfo::onClickMute(void* data)
148{
149 LLFloaterObjectIMInfo* self = (LLFloaterObjectIMInfo*)data;
150
151 LLMute::EType mute_type = (self->mOwnerIsGroup) ? LLMute::GROUP : LLMute::AGENT;
152 LLMute mute(self->mOwnerID, self->mOwnerName, mute_type);
153 LLMuteList::getInstance()->add(mute);
154 LLFloaterMute::showInstance();
155 self->close();
156}
157
158//static
159void LLFloaterObjectIMInfo::nameCallback(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* data)
160{
161 LLFloaterObjectIMInfo* self = (LLFloaterObjectIMInfo*)data;
162 self->mOwnerName = first;
163 if (!last.empty())
164 {
165 self->mOwnerName += " " + last;
166 }
167
168 self->childSetText("OwnerName",self->mOwnerName);
169}
170
171////////////////////////////////////////////////////////////////////////////
172// LLObjectIMInfo
173void LLObjectIMInfo::show(const LLUUID &object_id, const std::string &name, const std::string &location, const LLUUID &owner_id, bool owner_is_group)
174{
175 LLFloaterObjectIMInfo* im_info_floater = LLFloaterObjectIMInfo::showInstance();
176 im_info_floater->update(object_id,name,location,owner_id,owner_is_group);
177}
178
179////////////////////////////////////////////////////////////////////////////
180// LLObjectIMInfoHandler
181class LLObjectIMInfoHandler : public LLCommandHandler
182{
183public:
184 LLObjectIMInfoHandler() : LLCommandHandler("objectim", false) { }
185
186 bool handle(const LLSD& tokens, const LLSD& query_map);
187};
188
189// Creating the object registers with the dispatcher.
190LLObjectIMInfoHandler gObjectIMHandler;
191
192// ex. secondlife:///app/objectim/9426adfc-9c17-8765-5f09-fdf19957d003?owner=a112d245-9095-4e9c-ace4-ffa31717f934&groupowned=true&slurl=ahern/123/123/123&name=Object
193bool LLObjectIMInfoHandler::handle(const LLSD &tokens, const LLSD &query_map)
194{
195 LLUUID task_id = tokens[0].asUUID();
196 std::string name = query_map["name"].asString();
197 std::string slurl = query_map["slurl"].asString();
198 LLUUID owner = query_map["owner"].asUUID();
199 bool group_owned = query_map.has("groupowned");
200
201 LLObjectIMInfo::show(task_id,name,slurl,owner,group_owned);
202
203 return true;
204}
diff --git a/linden/indra/newview/llfloaterobjectiminfo.h b/linden/indra/newview/llfloaterobjectiminfo.h
new file mode 100644
index 0000000..0564c3e
--- /dev/null
+++ b/linden/indra/newview/llfloaterobjectiminfo.h
@@ -0,0 +1,45 @@
1/**
2 * @file llfloaterobjectiminfo.h
3 * @brief Shows a dialog with information about an object.
4 *
5 * $LicenseInfo:firstyear=2006&license=viewergpl$
6 *
7 * Copyright (c) 2006-2008, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 *
22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above,
24 * and agree to abide by those obligations.
25 *
26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
28 * COMPLETENESS OR PERFORMANCE.
29 * $/LicenseInfo$
30 */
31
32#ifndef LL_LLFLOATEROBJECTIMINFO_H
33#define LL_LLFLOATEROBJECTIMINFO_H
34
35namespace LLObjectIMInfo
36{
37 // Show an LLFloaterObjectIMInfo for this object.
38 static void show(const LLUUID& object_id,
39 const std::string& name,
40 const std::string& location,
41 const LLUUID& owner_id,
42 bool owner_is_group);
43};
44
45#endif // LL_LLFLOATERURLDISPLAY_H
diff --git a/linden/indra/newview/llgroupnotify.cpp b/linden/indra/newview/llgroupnotify.cpp
index 37897eb..2f8e838 100644
--- a/linden/indra/newview/llgroupnotify.cpp
+++ b/linden/indra/newview/llgroupnotify.cpp
@@ -220,8 +220,8 @@ LLGroupNotifyBox::LLGroupNotifyBox(const std::string& subject,
220 static const LLStyleSP headerstyle(new LLStyle(true,LLColor4::black,"SansSerifBig")); 220 static const LLStyleSP headerstyle(new LLStyle(true,LLColor4::black,"SansSerifBig"));
221 static const LLStyleSP datestyle(new LLStyle(true,LLColor4::black,"serif")); 221 static const LLStyleSP datestyle(new LLStyle(true,LLColor4::black,"serif"));
222 222
223 text->appendStyledText(subject,false,false,&headerstyle); 223 text->appendStyledText(subject,false,false,headerstyle);
224 text->appendStyledText(time_buf,false,false,&datestyle); 224 text->appendStyledText(time_buf,false,false,datestyle);
225 // Sadly, our LLTextEditor can't handle both styled and unstyled text 225 // Sadly, our LLTextEditor can't handle both styled and unstyled text
226 // at the same time. Hence this space must be styled. JC 226 // at the same time. Hence this space must be styled. JC
227 text->appendColoredText(std::string(" "),false,false,LLColor4::grey4); 227 text->appendColoredText(std::string(" "),false,false,LLColor4::grey4);
diff --git a/linden/indra/newview/llimpanel.cpp b/linden/indra/newview/llimpanel.cpp
index f30ae8c..16b0388 100644
--- a/linden/indra/newview/llimpanel.cpp
+++ b/linden/indra/newview/llimpanel.cpp
@@ -1543,8 +1543,8 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, const LLColor4
1543 else 1543 else
1544 { 1544 {
1545 // Convert the name to a hotlink and add to message. 1545 // Convert the name to a hotlink and add to message.
1546 const LLStyleSP &source_style = LLStyleMap::instance().lookup(source); 1546 const LLStyleSP &source_style = LLStyleMap::instance().lookupAgent(source);
1547 mHistoryEditor->appendStyledText(name,false,prepend_newline,&source_style); 1547 mHistoryEditor->appendStyledText(name,false,prepend_newline,source_style);
1548 } 1548 }
1549 prepend_newline = false; 1549 prepend_newline = false;
1550 } 1550 }
diff --git a/linden/indra/newview/llstylemap.cpp b/linden/indra/newview/llstylemap.cpp
index 6a3415f..e3bd3cd 100644
--- a/linden/indra/newview/llstylemap.cpp
+++ b/linden/indra/newview/llstylemap.cpp
@@ -47,13 +47,13 @@ LLStyleMap::~LLStyleMap()
47 47
48LLStyleMap &LLStyleMap::instance() 48LLStyleMap &LLStyleMap::instance()
49{ 49{
50 static LLStyleMap mStyleMap; 50 static LLStyleMap style_map;
51 return mStyleMap; 51 return style_map;
52} 52}
53 53
54// This is similar to the [] accessor except that if the entry doesn't already exist, 54// This is similar to the [] accessor except that if the entry doesn't already exist,
55// then this will create the entry. 55// then this will create the entry.
56const LLStyleSP &LLStyleMap::lookup(const LLUUID &source) 56const LLStyleSP &LLStyleMap::lookupAgent(const LLUUID &source)
57{ 57{
58 // Find this style in the map or add it if not. This map holds links to residents' profiles. 58 // Find this style in the map or add it if not. This map holds links to residents' profiles.
59 if (find(source) == end()) 59 if (find(source) == end())
@@ -77,6 +77,37 @@ const LLStyleSP &LLStyleMap::lookup(const LLUUID &source)
77 return (*this)[source]; 77 return (*this)[source];
78} 78}
79 79
80// This is similar to lookupAgent for any generic URL encoded style.
81const LLStyleSP &LLStyleMap::lookup(const LLUUID& id, const std::string& link)
82{
83 // Find this style in the map or add it if not.
84 iterator iter = find(id);
85 if (iter == end())
86 {
87 LLStyleSP style(new LLStyle);
88 style->setVisible(true);
89 style->setFontName(LLStringUtil::null);
90 if (id != LLUUID::null && !link.empty())
91 {
92 style->setColor(gSavedSettings.getColor4("HTMLLinkColor"));
93 style->setLinkHREF(link);
94 }
95 else
96 style->setColor(LLColor4::white);
97 (*this)[id] = style;
98 }
99 else
100 {
101 LLStyleSP style = (*iter).second;
102 if ( style->getLinkHREF() != link )
103 {
104 style->setLinkHREF(link);
105 }
106 }
107
108 return (*this)[id];
109}
110
80void LLStyleMap::update() 111void LLStyleMap::update()
81{ 112{
82 for (style_map_t::iterator iter = begin(); iter != end(); ++iter) 113 for (style_map_t::iterator iter = begin(); iter != end(); ++iter)
diff --git a/linden/indra/newview/llstylemap.h b/linden/indra/newview/llstylemap.h
index a38d253..f1eada9 100644
--- a/linden/indra/newview/llstylemap.h
+++ b/linden/indra/newview/llstylemap.h
@@ -47,7 +47,8 @@ public:
47 LLStyleMap(); 47 LLStyleMap();
48 ~LLStyleMap(); 48 ~LLStyleMap();
49 // Just like the [] accessor but it will add the entry in if it doesn't exist. 49 // Just like the [] accessor but it will add the entry in if it doesn't exist.
50 const LLStyleSP &lookup(const LLUUID &source); 50 const LLStyleSP &lookupAgent(const LLUUID &source);
51 const LLStyleSP &lookup(const LLUUID &source, const std::string& link);
51 static LLStyleMap &instance(); 52 static LLStyleMap &instance();
52 53
53 // Forces refresh of the entries, call when something changes (e.g. link color). 54 // Forces refresh of the entries, call when something changes (e.g. link color).
diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp
index 3fb8e9a..26dd86c 100644
--- a/linden/indra/newview/llviewermessage.cpp
+++ b/linden/indra/newview/llviewermessage.cpp
@@ -1802,15 +1802,51 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
1802 break; 1802 break;
1803 1803
1804 case IM_FROM_TASK: 1804 case IM_FROM_TASK:
1805 if (is_busy && !is_owned_by_me)
1806 { 1805 {
1807 return; 1806 if (is_busy && !is_owned_by_me)
1807 {
1808 return;
1809 }
1810 chat.mText = name + separator_string + message.substr(message_offset);
1811 chat.mFromName = name;
1812
1813 // Build a link to open the object IM info window.
1814 std::string location = ll_safe_string((char*)binary_bucket,binary_bucket_size);
1815
1816 LLSD query_string;
1817 query_string["owner"] = from_id;
1818 query_string["slurl"] = location.c_str();
1819 query_string["name"] = name;
1820 if (from_group)
1821 {
1822 query_string["groupowned"] = "true";
1823 }
1824
1825 if (session_id.notNull())
1826 {
1827 chat.mFromID = session_id;
1828 }
1829 else
1830 {
1831 // This message originated on a region without the updated code for task id and slurl information.
1832 // We just need a unique ID for this object that isn't the owner ID.
1833 // If it is the owner ID it will overwrite the style that contains the link to that owner's profile.
1834 // This isn't ideal - it will make 1 style for all objects owned by the the same person/group.
1835 // This works because the only thing we can really do in this case is show the owner name and link to their profile.
1836 chat.mFromID = from_id ^ gAgent.getSessionID();
1837 }
1838
1839 std::ostringstream link;
1840 link << "secondlife:///app/objectim/" << session_id
1841 << LLURI::mapToQueryString(query_string);
1842
1843 chat.mURL = link.str();
1844
1845 // Note: lie to LLFloaterChat::addChat(), pretending that this is NOT an IM, because
1846 // IMs from objcts don't open IM sessions.
1847 chat.mSourceType = CHAT_SOURCE_OBJECT;
1848 LLFloaterChat::addChat(chat, FALSE, FALSE);
1808 } 1849 }
1809 chat.mText = name + separator_string + message.substr(message_offset);
1810 // Note: lie to LLFloaterChat::addChat(), pretending that this is NOT an IM, because
1811 // IMs from objcts don't open IM sessions.
1812 chat.mSourceType = CHAT_SOURCE_OBJECT;
1813 LLFloaterChat::addChat(chat, FALSE, FALSE);
1814 break; 1850 break;
1815 case IM_FROM_TASK_AS_ALERT: 1851 case IM_FROM_TASK_AS_ALERT:
1816 if (is_busy && !is_owned_by_me) 1852 if (is_busy && !is_owned_by_me)
diff --git a/linden/indra/newview/skins/default/colors_base.xml b/linden/indra/newview/skins/default/colors_base.xml
index 42cb0ac..d0f1049 100644
--- a/linden/indra/newview/skins/default/colors_base.xml
+++ b/linden/indra/newview/skins/default/colors_base.xml
@@ -69,7 +69,9 @@
69<TextEmbeddedItemColor value="0, 0, 128, 255" /> <!-- Text of items embedded in notecards --> 69<TextEmbeddedItemColor value="0, 0, 128, 255" /> <!-- Text of items embedded in notecards -->
70<TextDefaultColor value="0, 20, 0, 255"/> <!-- Non-keyword text in the script editor --> 70<TextDefaultColor value="0, 20, 0, 255"/> <!-- Non-keyword text in the script editor -->
71<ScriptBgReadOnlyColor value="100, 100, 100, 255" /> <!-- Not used --> 71<ScriptBgReadOnlyColor value="100, 100, 100, 255" /> <!-- Not used -->
72 72<TextLinkColor value="144, 165, 208, 255"/>
73<TextLinkHoverColor value="255, 255, 255, 255"/>
74
73<!-- LISTBOXES --> 75<!-- LISTBOXES -->
74<ScrollBgReadOnlyColor value="200, 209, 204, 255" /> <!-- Background of read only lists --> 76<ScrollBgReadOnlyColor value="200, 209, 204, 255" /> <!-- Background of read only lists -->
75<ScrollBgWriteableColor value="200, 209, 204, 255" /> <!-- Background of editable lists, e.g. groups--> 77<ScrollBgWriteableColor value="200, 209, 204, 255" /> <!-- Background of editable lists, e.g. groups-->
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_object_im_info.xml b/linden/indra/newview/skins/default/xui/en-us/floater_object_im_info.xml
new file mode 100644
index 0000000..615b7d1
--- /dev/null
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_object_im_info.xml
@@ -0,0 +1,54 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<floater bottom="0" can_close="true" can_drag_on_left="false" can_minimize="true"
3 can_resize="false" can_tear_off="true" enabled="true" height="140" left="0"
4 mouse_opaque="true" name="object im info" width="300"
5 rect_control="FloaterObjectIMInfo" short_title="Object Info" title="Object Information" >
6
7 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
8 bottom="-35" drop_shadow_visible="true" follows="left|top"
9 font="SansSerif" h_pad="0" halign="left" height="10" left="10"
10 mouse_opaque="true" name="LabelItemNameTitle" v_pad="0" width="78">
11 Object:
12 </text>
13 <text bevel_style="none" border_style="line" border_visible="false"
14 border_thickness="0" bottom_delta="-10" enabled="true" follows="left|top"
15 font="SansSerif" height="20" is_unicode="false" left="70"
16 max_length="254" mouse_opaque="false" name="ObjectName"
17 width="200" />
18
19 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
20 bottom="-60" drop_shadow_visible="true" follows="left|top"
21 font="SansSerif" h_pad="0" halign="left" height="10" left="10"
22 mouse_opaque="true" name="LabelSlurlTitle" v_pad="0" width="78">
23 Location:
24 </text>
25 <text bevel_style="none" border_style="line" border_visible="false"
26 border_thickness="0" bottom_delta="-10" enabled="true" follows="left|top"
27 font="SansSerif" height="20" is_unicode="false" left="70" hover="true"
28 max_length="254" mouse_opaque="true" name="Slurl" font-style="UNDERLINE"
29 width="200" hover_cursor="UI_CURSOR_HAND" text_color="TextLinkColor" hover_color="TextLinkHoverColor"/>
30
31 <!-- A new viewer talking to an old sim will not have a slurl available and will show this. -->
32 <text bevel_style="none" border_style="line" border_visible="false"
33 border_thickness="0" bottom_delta="0" enabled="true" follows="left|top"
34 font="SansSerif" height="20" is_unicode="false" left_delta="0" hover="false"
35 max_length="254" mouse_opaque="false" name="Unknown_Slurl" width="200">
36 (Location Info Not Available)
37 </text>
38
39 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
40 bottom="-85" drop_shadow_visible="true" follows="left|top"
41 font="SansSerif" h_pad="0" halign="left" height="10" left="10"
42 mouse_opaque="true" name="LabelOwnerNameTitle" v_pad="0" width="78">
43 Owner:
44 </text>
45 <text bevel_style="none" border_style="line" border_visible="false"
46 border_thickness="0" bottom_delta="-10" enabled="true" follows="left|top"
47 font="SansSerif" height="20" is_unicode="false" left="70" hover="true"
48 max_length="254" mouse_opaque="true" name="OwnerName" font-style="UNDERLINE"
49 width="200" hover_cursor="UI_CURSOR_HAND" text_color="TextLinkColor" hover_color="TextLinkHoverColor"/>
50
51 <button bottom_delta="-30" font="SansSerif" halign="center" height="20" label="Mute Owner"
52 label_selected="Mute Owner" left="70" mouse_opaque="true" name="Mute"
53 width="160" />
54</floater>
diff --git a/linden/indra/newview/skins/silver/colors_base.xml b/linden/indra/newview/skins/silver/colors_base.xml
index a69f43f..abe61bf 100644
--- a/linden/indra/newview/skins/silver/colors_base.xml
+++ b/linden/indra/newview/skins/silver/colors_base.xml
@@ -69,6 +69,8 @@
69<TextEmbeddedItemColor value="0, 0, 128, 255" /> <!-- Text of items embedded in notecards --> 69<TextEmbeddedItemColor value="0, 0, 128, 255" /> <!-- Text of items embedded in notecards -->
70<TextDefaultColor value="0, 20, 0, 255"/> <!-- Non-keyword text in the script editor --> 70<TextDefaultColor value="0, 20, 0, 255"/> <!-- Non-keyword text in the script editor -->
71<ScriptBgReadOnlyColor value="180, 180, 180, 255" /> <!-- Not used --> 71<ScriptBgReadOnlyColor value="180, 180, 180, 255" /> <!-- Not used -->
72<TextLinkColor value="0, 20, 255, 255"/>
73<TextLinkHoverColor value="0, 50, 255, 255"/>
72 74
73<!-- LISTBOXES --> 75<!-- LISTBOXES -->
74<ScrollBgReadOnlyColor value="255, 255, 255, 140" /> <!-- Background of read only lists --> 76<ScrollBgReadOnlyColor value="255, 255, 255, 140" /> <!-- Background of read only lists -->