diff options
Diffstat (limited to 'linden/indra/newview/llprefschat.cpp')
-rw-r--r-- | linden/indra/newview/llprefschat.cpp | 62 |
1 files changed, 52 insertions, 10 deletions
diff --git a/linden/indra/newview/llprefschat.cpp b/linden/indra/newview/llprefschat.cpp index e045e61..4453751 100644 --- a/linden/indra/newview/llprefschat.cpp +++ b/linden/indra/newview/llprefschat.cpp | |||
@@ -5,7 +5,7 @@ | |||
5 | * | 5 | * |
6 | * $LicenseInfo:firstyear=2003&license=viewergpl$ | 6 | * $LicenseInfo:firstyear=2003&license=viewergpl$ |
7 | * | 7 | * |
8 | * Copyright (c) 2003-2008, Linden Research, Inc. | 8 | * Copyright (c) 2003-2009, Linden Research, Inc. |
9 | * | 9 | * |
10 | * Second Life Viewer Source Code | 10 | * Second Life Viewer Source Code |
11 | * The source code in this file ("Source Code") is provided by Linden Lab | 11 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -36,6 +36,8 @@ | |||
36 | #include "lltexteditor.h" | 36 | #include "lltexteditor.h" |
37 | #include "llviewercontrol.h" | 37 | #include "llviewercontrol.h" |
38 | #include "lluictrlfactory.h" | 38 | #include "lluictrlfactory.h" |
39 | #include "llcolorswatch.h" | ||
40 | #include "llradiogroup.h" | ||
39 | #include "llstylemap.h" | 41 | #include "llstylemap.h" |
40 | 42 | ||
41 | class LLPrefsChatImpl : public LLPanel | 43 | class LLPrefsChatImpl : public LLPanel |
@@ -43,8 +45,6 @@ class LLPrefsChatImpl : public LLPanel | |||
43 | public: | 45 | public: |
44 | LLPrefsChatImpl(); | 46 | LLPrefsChatImpl(); |
45 | /*virtual*/ ~LLPrefsChatImpl(){}; | 47 | /*virtual*/ ~LLPrefsChatImpl(){}; |
46 | |||
47 | virtual void refresh(); | ||
48 | 48 | ||
49 | void apply(); | 49 | void apply(); |
50 | void cancel(); | 50 | void cancel(); |
@@ -79,12 +79,30 @@ LLPrefsChatImpl::LLPrefsChatImpl() | |||
79 | { | 79 | { |
80 | LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_chat.xml"); | 80 | LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_chat.xml"); |
81 | 81 | ||
82 | refresh(); | 82 | getChild<LLRadioGroup>("chat_font_size")->setSelectedIndex(gSavedSettings.getS32("ChatFontSize")); |
83 | } | 83 | childSetValue("fade_chat_time", gSavedSettings.getF32("ChatPersistTime")); |
84 | childSetValue("max_chat_count", gSavedSettings.getS32("ConsoleMaxLines")); | ||
85 | |||
86 | getChild<LLColorSwatchCtrl>("system")->set(gSavedSettings.getColor4("SystemChatColor")); | ||
87 | getChild<LLColorSwatchCtrl>("user")->set(gSavedSettings.getColor4("UserChatColor")); | ||
88 | getChild<LLColorSwatchCtrl>("agent")->set(gSavedSettings.getColor4("AgentChatColor")); | ||
89 | getChild<LLColorSwatchCtrl>("im")->set(gSavedSettings.getColor4("IMChatColor")); | ||
90 | getChild<LLColorSwatchCtrl>("script_error")->set(gSavedSettings.getColor4("ScriptErrorColor")); | ||
91 | getChild<LLColorSwatchCtrl>("objects")->set(gSavedSettings.getColor4("ObjectChatColor")); | ||
92 | getChild<LLColorSwatchCtrl>("owner")->set(gSavedSettings.getColor4("llOwnerSayChatColor")); | ||
93 | getChild<LLColorSwatchCtrl>("background")->set(gSavedSettings.getColor4("BackgroundChatColor")); | ||
94 | getChild<LLColorSwatchCtrl>("links")->set(gSavedSettings.getColor4("HTMLLinkColor")); | ||
95 | |||
96 | childSetValue("arrow_keys_move_avatar_check", gSavedSettings.getBOOL("ArrowKeysMoveAvatar")); | ||
97 | childSetValue("show_timestamps_check", gSavedSettings.getBOOL("ChatShowTimestamps")); | ||
98 | childSetValue("script_errors_as_chat", gSavedSettings.getBOOL("ScriptErrorsAsChat")); | ||
84 | 99 | ||
85 | void LLPrefsChatImpl::refresh() | 100 | childSetValue("bubble_text_chat", gSavedSettings.getBOOL("UseChatBubbles")); |
86 | { | 101 | childSetValue("chat_full_width_check", gSavedSettings.getBOOL("ChatFullWidth")); |
87 | LLPanel::refresh(); | 102 | childSetValue("close_chat_on_return_check", gSavedSettings.getBOOL("CloseChatOnReturn")); |
103 | childSetValue("play_typing_animation", gSavedSettings.getBOOL("PlayTypingAnim")); | ||
104 | childSetValue("console_opacity", gSavedSettings.getF32("ConsoleBackgroundOpacity")); | ||
105 | childSetValue("bubble_chat_opacity", gSavedSettings.getF32("ChatBubbleOpacity")); | ||
88 | 106 | ||
89 | //set values | 107 | //set values |
90 | mChatSize = gSavedSettings.getS32("ChatFontSize"); | 108 | mChatSize = gSavedSettings.getS32("ChatFontSize"); |
@@ -137,7 +155,32 @@ void LLPrefsChatImpl::cancel() | |||
137 | 155 | ||
138 | void LLPrefsChatImpl::apply() | 156 | void LLPrefsChatImpl::apply() |
139 | { | 157 | { |
140 | 158 | gSavedSettings.setS32("ChatFontSize", getChild<LLRadioGroup>("chat_font_size")->getSelectedIndex()); | |
159 | gSavedSettings.setF32("ChatPersistTime", childGetValue("fade_chat_time").asReal()); | ||
160 | gSavedSettings.setS32("ConsoleMaxLines", childGetValue("max_chat_count")); | ||
161 | |||
162 | gSavedSettings.setColor4("SystemChatColor", childGetValue("system")); | ||
163 | gSavedSettings.setColor4("UserChatColor", childGetValue("user")); | ||
164 | gSavedSettings.setColor4("AgentChatColor", childGetValue("agent")); | ||
165 | gSavedSettings.setColor4("IMChatColor", childGetValue("im")); | ||
166 | gSavedSettings.setColor4("ScriptErrorColor", childGetValue("script_error")); | ||
167 | gSavedSettings.setColor4("ObjectChatColor", childGetValue("objects")); | ||
168 | gSavedSettings.setColor4("llOwnerSayChatColor", childGetValue("owner")); | ||
169 | gSavedSettings.setColor4("BackgroundChatColor", childGetValue("background")); | ||
170 | |||
171 | gSavedSettings.setColor4("HTMLLinkColor", childGetValue("links")); | ||
172 | LLTextEditor::setLinkColor(childGetValue("links")); | ||
173 | |||
174 | gSavedSettings.setBOOL("ArrowKeysMoveAvatar", childGetValue("arrow_keys_move_avatar_check")); | ||
175 | gSavedSettings.setBOOL("ChatShowTimestamps", childGetValue("show_timestamps_check")); | ||
176 | gSavedSettings.setBOOL("ScriptErrorsAsChat", childGetValue("script_errors_as_chat")); | ||
177 | gSavedSettings.setBOOL("UseChatBubbles", childGetValue("bubble_text_chat")); | ||
178 | gSavedSettings.setBOOL("ChatFullWidth", childGetValue("chat_full_width_check")); | ||
179 | gSavedSettings.setBOOL("CloseChatOnReturn", childGetValue("close_chat_on_return_check")); | ||
180 | gSavedSettings.setBOOL("PlayTypingAnim", childGetValue("play_typing_animation")); | ||
181 | |||
182 | gSavedSettings.setF32("ConsoleBackgroundOpacity", childGetValue("console_opacity").asReal()); | ||
183 | gSavedSettings.setF32("ChatBubbleOpacity", childGetValue("bubble_chat_opacity").asReal()); | ||
141 | } | 184 | } |
142 | 185 | ||
143 | //--------------------------------------------------------------------------- | 186 | //--------------------------------------------------------------------------- |
@@ -154,7 +197,6 @@ LLPrefsChat::~LLPrefsChat() | |||
154 | void LLPrefsChat::apply() | 197 | void LLPrefsChat::apply() |
155 | { | 198 | { |
156 | impl.apply(); | 199 | impl.apply(); |
157 | LLTextEditor::setLinkColor( gSavedSettings.getColor4("HTMLLinkColor") ); | ||
158 | LLStyleMap::instance().update(); | 200 | LLStyleMap::instance().update(); |
159 | } | 201 | } |
160 | 202 | ||