diff options
Diffstat (limited to 'linden/indra/newview/llprefschat.cpp')
-rw-r--r-- | linden/indra/newview/llprefschat.cpp | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/linden/indra/newview/llprefschat.cpp b/linden/indra/newview/llprefschat.cpp index 82ae07c..f3b7278 100644 --- a/linden/indra/newview/llprefschat.cpp +++ b/linden/indra/newview/llprefschat.cpp | |||
@@ -47,13 +47,10 @@ class LLPrefsChatImpl : public LLPanel | |||
47 | public: | 47 | public: |
48 | LLPrefsChatImpl(); | 48 | LLPrefsChatImpl(); |
49 | /*virtual*/ ~LLPrefsChatImpl(){}; | 49 | /*virtual*/ ~LLPrefsChatImpl(){}; |
50 | /*virtual*/ BOOL postBuild(); | ||
51 | 50 | ||
52 | void apply(); | 51 | void apply(); |
53 | void cancel(); | 52 | void cancel(); |
54 | 53 | ||
55 | static void onCheckToggleChannel(LLUICtrl* ctrl, void* user_data); | ||
56 | |||
57 | protected: | 54 | protected: |
58 | S32 mChatSize; | 55 | S32 mChatSize; |
59 | F32 mChatPersist; | 56 | F32 mChatPersist; |
@@ -74,6 +71,7 @@ protected: | |||
74 | BOOL mPlayTypingAnim; | 71 | BOOL mPlayTypingAnim; |
75 | BOOL mChatBubbles; | 72 | BOOL mChatBubbles; |
76 | BOOL mScriptErrorAsChat; | 73 | BOOL mScriptErrorAsChat; |
74 | BOOL mChatChannel; | ||
77 | F32 mConsoleOpacity; | 75 | F32 mConsoleOpacity; |
78 | F32 mBubbleOpacity; | 76 | F32 mBubbleOpacity; |
79 | }; | 77 | }; |
@@ -105,6 +103,7 @@ LLPrefsChatImpl::LLPrefsChatImpl() | |||
105 | childSetValue("chat_full_width_check", gSavedSettings.getBOOL("ChatFullWidth")); | 103 | childSetValue("chat_full_width_check", gSavedSettings.getBOOL("ChatFullWidth")); |
106 | childSetValue("close_chat_on_return_check", gSavedSettings.getBOOL("CloseChatOnReturn")); | 104 | childSetValue("close_chat_on_return_check", gSavedSettings.getBOOL("CloseChatOnReturn")); |
107 | childSetValue("play_typing_animation", gSavedSettings.getBOOL("PlayTypingAnim")); | 105 | childSetValue("play_typing_animation", gSavedSettings.getBOOL("PlayTypingAnim")); |
106 | childSetValue("toggle_channel_control", gSavedSettings.getBOOL("ChatChannelSelect")); | ||
108 | childSetValue("console_opacity", gSavedSettings.getF32("ConsoleBackgroundOpacity")); | 107 | childSetValue("console_opacity", gSavedSettings.getF32("ConsoleBackgroundOpacity")); |
109 | childSetValue("bubble_chat_opacity", gSavedSettings.getF32("ChatBubbleOpacity")); | 108 | childSetValue("bubble_chat_opacity", gSavedSettings.getF32("ChatBubbleOpacity")); |
110 | 109 | ||
@@ -128,17 +127,11 @@ LLPrefsChatImpl::LLPrefsChatImpl() | |||
128 | mChatFullWidth = gSavedSettings.getBOOL("ChatFullWidth"); | 127 | mChatFullWidth = gSavedSettings.getBOOL("ChatFullWidth"); |
129 | mCloseChatOnReturn = gSavedSettings.getBOOL("CloseChatOnReturn"); | 128 | mCloseChatOnReturn = gSavedSettings.getBOOL("CloseChatOnReturn"); |
130 | mPlayTypingAnim = gSavedSettings.getBOOL("PlayTypingAnim"); | 129 | mPlayTypingAnim = gSavedSettings.getBOOL("PlayTypingAnim"); |
130 | mChatChannel = gSavedSettings.getBOOL("ChatChannelSelect"); | ||
131 | mConsoleOpacity = gSavedSettings.getF32("ConsoleBackgroundOpacity"); | 131 | mConsoleOpacity = gSavedSettings.getF32("ConsoleBackgroundOpacity"); |
132 | mBubbleOpacity = gSavedSettings.getF32("ChatBubbleOpacity"); | 132 | mBubbleOpacity = gSavedSettings.getF32("ChatBubbleOpacity"); |
133 | } | 133 | } |
134 | 134 | ||
135 | BOOL LLPrefsChatImpl::postBuild() | ||
136 | { | ||
137 | childSetCommitCallback("toggle_channel_control",onCheckToggleChannel, this); | ||
138 | |||
139 | return TRUE; | ||
140 | } | ||
141 | |||
142 | void LLPrefsChatImpl::cancel() | 135 | void LLPrefsChatImpl::cancel() |
143 | { | 136 | { |
144 | gSavedSettings.setS32("ChatFontSize", mChatSize); | 137 | gSavedSettings.setS32("ChatFontSize", mChatSize); |
@@ -160,6 +153,7 @@ void LLPrefsChatImpl::cancel() | |||
160 | gSavedSettings.setBOOL("ChatFullWidth", mChatFullWidth); | 153 | gSavedSettings.setBOOL("ChatFullWidth", mChatFullWidth); |
161 | gSavedSettings.setBOOL("CloseChatOnReturn", mCloseChatOnReturn); | 154 | gSavedSettings.setBOOL("CloseChatOnReturn", mCloseChatOnReturn); |
162 | gSavedSettings.setBOOL("PlayTypingAnim", mPlayTypingAnim); | 155 | gSavedSettings.setBOOL("PlayTypingAnim", mPlayTypingAnim); |
156 | gSavedSettings.setBOOL("ChatChannelSelect", mChatChannel); | ||
163 | gSavedSettings.setF32("ConsoleBackgroundOpacity", mConsoleOpacity); | 157 | gSavedSettings.setF32("ConsoleBackgroundOpacity", mConsoleOpacity); |
164 | gSavedSettings.setF32("ChatBubbleOpacity", mBubbleOpacity); | 158 | gSavedSettings.setF32("ChatBubbleOpacity", mBubbleOpacity); |
165 | } | 159 | } |
@@ -192,18 +186,21 @@ void LLPrefsChatImpl::apply() | |||
192 | 186 | ||
193 | gSavedSettings.setF32("ConsoleBackgroundOpacity", childGetValue("console_opacity").asReal()); | 187 | gSavedSettings.setF32("ConsoleBackgroundOpacity", childGetValue("console_opacity").asReal()); |
194 | gSavedSettings.setF32("ChatBubbleOpacity", childGetValue("bubble_chat_opacity").asReal()); | 188 | gSavedSettings.setF32("ChatBubbleOpacity", childGetValue("bubble_chat_opacity").asReal()); |
195 | } | ||
196 | 189 | ||
197 | // static | 190 | BOOL chan_check = childGetValue("toggle_channel_control"); |
198 | void LLPrefsChatImpl::onCheckToggleChannel(LLUICtrl* ctrl, void* user_data) | 191 | gSavedSettings.setBOOL("ChatChannelSelect", chan_check); |
199 | { | 192 | if (mChatChannel != chan_check) |
200 | if (gChatBar) | ||
201 | { | 193 | { |
202 | gChatBar->toggleChannelControl(); | 194 | if (gChatBar) |
203 | LLFloaterChat::toggleHistoryChannelControl(); | 195 | { |
196 | gChatBar->toggleChannelControl(); | ||
197 | LLFloaterChat::toggleHistoryChannelControl(); | ||
198 | } | ||
199 | mChatChannel = chan_check; | ||
204 | } | 200 | } |
205 | } | 201 | } |
206 | 202 | ||
203 | |||
207 | //--------------------------------------------------------------------------- | 204 | //--------------------------------------------------------------------------- |
208 | 205 | ||
209 | LLPrefsChat::LLPrefsChat() | 206 | LLPrefsChat::LLPrefsChat() |