diff options
author | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
commit | 38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch) | |
tree | adca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/newview/llprefschat.cpp | |
parent | README.txt (diff) | |
download | meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2 meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz |
Second Life viewer sources 1.13.2.12
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llprefschat.cpp | 164 |
1 files changed, 164 insertions, 0 deletions
diff --git a/linden/indra/newview/llprefschat.cpp b/linden/indra/newview/llprefschat.cpp new file mode 100644 index 0000000..2d98ad5 --- /dev/null +++ b/linden/indra/newview/llprefschat.cpp | |||
@@ -0,0 +1,164 @@ | |||
1 | /** | ||
2 | * @file llprefschat.cpp | ||
3 | * @author James Cook, Richard Nelson | ||
4 | * @brief Chat preferences panel | ||
5 | * | ||
6 | * Copyright (c) 2003-2007, Linden Research, Inc. | ||
7 | * | ||
8 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
9 | * to you under the terms of the GNU General Public License, version 2.0 | ||
10 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
11 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
12 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
13 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
14 | * | ||
15 | * There are special exceptions to the terms and conditions of the GPL as | ||
16 | * it is applied to this Source Code. View the full text of the exception | ||
17 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
18 | * online at http://secondlife.com/developers/opensource/flossexception | ||
19 | * | ||
20 | * By copying, modifying or distributing this software, you acknowledge | ||
21 | * that you have read and understood your obligations described above, | ||
22 | * and agree to abide by those obligations. | ||
23 | * | ||
24 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
25 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
26 | * COMPLETENESS OR PERFORMANCE. | ||
27 | */ | ||
28 | |||
29 | #include "llviewerprecompiledheaders.h" | ||
30 | |||
31 | #include "llprefschat.h" | ||
32 | |||
33 | #include "llcheckboxctrl.h" | ||
34 | #include "llcolorswatch.h" | ||
35 | #include "llpanel.h" | ||
36 | #include "llradiogroup.h" | ||
37 | |||
38 | #include "llchatbar.h" | ||
39 | #include "llconsole.h" | ||
40 | #include "llspinctrl.h" | ||
41 | #include "llsliderctrl.h" | ||
42 | #include "llviewercontrol.h" | ||
43 | #include "llvieweruictrlfactory.h" | ||
44 | #include "message.h" | ||
45 | #include "viewer.h" | ||
46 | #include "lltexteditor.h" | ||
47 | |||
48 | class LLPrefsChatImpl : public LLPanel | ||
49 | { | ||
50 | public: | ||
51 | LLPrefsChatImpl(); | ||
52 | /*virtual*/ ~LLPrefsChatImpl(){}; | ||
53 | |||
54 | virtual void refresh(); | ||
55 | |||
56 | void apply(); | ||
57 | void cancel(); | ||
58 | |||
59 | protected: | ||
60 | S32 mChatSize; | ||
61 | F32 mChatPersist; | ||
62 | S32 mChatMaxLines; | ||
63 | LLColor4 mSystemChatColor; | ||
64 | LLColor4 mAgentChatColor; | ||
65 | LLColor4 mObjectChatColor; | ||
66 | LLColor4 mBGChatColor; | ||
67 | LLColor4 mScriptErrorColor; | ||
68 | LLColor4 mHTMLLinkColor; | ||
69 | BOOL mChatFullWidth; | ||
70 | BOOL mCloseChatOnReturn; | ||
71 | BOOL mArrowKeysMoveAvatar; | ||
72 | BOOL mShowTimestamps; | ||
73 | BOOL mPlayTypingAnim; | ||
74 | BOOL mChatBubbles; | ||
75 | BOOL mScriptErrorAsChat; | ||
76 | F32 mConsoleOpacity; | ||
77 | F32 mBubbleOpacity; | ||
78 | }; | ||
79 | |||
80 | |||
81 | LLPrefsChatImpl::LLPrefsChatImpl() | ||
82 | : LLPanel("Chat Panel") | ||
83 | { | ||
84 | gUICtrlFactory->buildPanel(this, "panel_preferences_chat.xml"); | ||
85 | |||
86 | refresh(); | ||
87 | } | ||
88 | |||
89 | void LLPrefsChatImpl::refresh() | ||
90 | { | ||
91 | LLPanel::refresh(); | ||
92 | |||
93 | //set values | ||
94 | mChatSize = gSavedSettings.getS32("ChatFontSize"); | ||
95 | mChatPersist = gSavedSettings.getF32("ChatPersistTime"); | ||
96 | mChatMaxLines = gSavedSettings.getS32("ConsoleMaxLines"); | ||
97 | mSystemChatColor = gSavedSettings.getColor4("SystemChatColor"); | ||
98 | mAgentChatColor = gSavedSettings.getColor4("AgentChatColor"); | ||
99 | mObjectChatColor = gSavedSettings.getColor4("ObjectChatColor"); | ||
100 | mBGChatColor = gSavedSettings.getColor4("BackgroundChatColor"); | ||
101 | mScriptErrorColor = gSavedSettings.getColor4("ScriptErrorColor"); | ||
102 | mHTMLLinkColor = gSavedSettings.getColor4("HTMLLinkColor"); | ||
103 | mArrowKeysMoveAvatar = gSavedSettings.getBOOL("ArrowKeysMoveAvatar"); | ||
104 | mShowTimestamps = gSavedSettings.getBOOL("ChatShowTimestamps"); | ||
105 | mScriptErrorAsChat = gSavedSettings.getBOOL("ScriptErrorsAsChat"); | ||
106 | mChatBubbles = gSavedSettings.getBOOL("UseChatBubbles"); | ||
107 | mChatFullWidth = gSavedSettings.getBOOL("ChatFullWidth"); | ||
108 | mCloseChatOnReturn = gSavedSettings.getBOOL("CloseChatOnReturn"); | ||
109 | mConsoleOpacity = gSavedSettings.getF32("ConsoleBackgroundOpacity"); | ||
110 | mBubbleOpacity = gSavedSettings.getF32("ChatBubbleOpacity"); | ||
111 | } | ||
112 | |||
113 | void LLPrefsChatImpl::cancel() | ||
114 | { | ||
115 | gSavedSettings.setS32("ChatFontSize", mChatSize); | ||
116 | gSavedSettings.setF32("ChatPersistTime", mChatPersist); | ||
117 | gSavedSettings.setS32("ConsoleMaxLines", mChatMaxLines); | ||
118 | gSavedSettings.setColor4("SystemChatColor", mSystemChatColor); | ||
119 | gSavedSettings.setColor4("AgentChatColor", mAgentChatColor); | ||
120 | gSavedSettings.setColor4("ObjectChatColor", mObjectChatColor); | ||
121 | gSavedSettings.setColor4("BackgroundChatColor", mBGChatColor); | ||
122 | gSavedSettings.setColor4("ScriptErrorColor", mScriptErrorColor); | ||
123 | gSavedSettings.setColor4("HTMLLinkColor", mHTMLLinkColor); | ||
124 | gSavedSettings.setBOOL("ArrowKeysMoveAvatar", mArrowKeysMoveAvatar); | ||
125 | gSavedSettings.setBOOL("ChatShowTimestamps", mShowTimestamps); | ||
126 | gSavedSettings.setBOOL("ScriptErrorsAsChat", mScriptErrorAsChat); | ||
127 | gSavedSettings.setBOOL("UseChatBubbles", mChatBubbles); | ||
128 | gSavedSettings.setBOOL("ChatFullWidth", mChatFullWidth); | ||
129 | gSavedSettings.setBOOL("CloseChatOnReturn", mCloseChatOnReturn); | ||
130 | gSavedSettings.setF32("ConsoleBackgroundOpacity", mConsoleOpacity); | ||
131 | gSavedSettings.setF32("ChatBubbleOpacity", mBubbleOpacity); | ||
132 | } | ||
133 | |||
134 | void LLPrefsChatImpl::apply() | ||
135 | { | ||
136 | |||
137 | } | ||
138 | |||
139 | //--------------------------------------------------------------------------- | ||
140 | |||
141 | LLPrefsChat::LLPrefsChat() | ||
142 | : impl( * new LLPrefsChatImpl() ) | ||
143 | { } | ||
144 | |||
145 | LLPrefsChat::~LLPrefsChat() | ||
146 | { | ||
147 | delete &impl; | ||
148 | } | ||
149 | |||
150 | void LLPrefsChat::apply() | ||
151 | { | ||
152 | impl.apply(); | ||
153 | LLTextEditor::setLinkColor( gSavedSettings.getColor4("HTMLLinkColor") ); | ||
154 | } | ||
155 | |||
156 | void LLPrefsChat::cancel() | ||
157 | { | ||
158 | impl.cancel(); | ||
159 | } | ||
160 | |||
161 | LLPanel* LLPrefsChat::getPanel() | ||
162 | { | ||
163 | return &impl; | ||
164 | } | ||