diff options
author | McCabe Maxsted | 2009-09-09 05:45:37 -0700 |
---|---|---|
committer | McCabe Maxsted | 2009-09-09 05:45:37 -0700 |
commit | 9627eac5c07c9e1f2b3be34f942af445414c14c5 (patch) | |
tree | 731cca4bca05d627386fc86c956f36c7848476be /linden | |
parent | Created my own version of Emerald's chat channel tool (diff) | |
download | meta-impy-9627eac5c07c9e1f2b3be34f942af445414c14c5.zip meta-impy-9627eac5c07c9e1f2b3be34f942af445414c14c5.tar.gz meta-impy-9627eac5c07c9e1f2b3be34f942af445414c14c5.tar.bz2 meta-impy-9627eac5c07c9e1f2b3be34f942af445414c14c5.tar.xz |
New chat channel preference should change only on apply
Diffstat (limited to 'linden')
-rw-r--r-- | linden/indra/newview/llprefschat.cpp | 31 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/panel_preferences_chat.xml | 2 |
2 files changed, 15 insertions, 18 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() |
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_chat.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_chat.xml index 0704666..b0384cf 100644 --- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_chat.xml +++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_chat.xml | |||
@@ -145,7 +145,7 @@ | |||
145 | label="Play typing animation when chatting" left="148" mouse_opaque="true" | 145 | label="Play typing animation when chatting" left="148" mouse_opaque="true" |
146 | name="play_typing_animation" radio_style="false" width="237" /> | 146 | name="play_typing_animation" radio_style="false" width="237" /> |
147 | <check_box bottom_delta="-18" enabled="true" follows="left|top" | 147 | <check_box bottom_delta="-18" enabled="true" follows="left|top" |
148 | font="SansSerifSmall" height="16" initial_value="false" control_name="ChatChannelSelect" | 148 | font="SansSerifSmall" height="16" initial_value="false" |
149 | label="Show custom chat channel" left="148" mouse_opaque="true" | 149 | label="Show custom chat channel" left="148" mouse_opaque="true" |
150 | name="toggle_channel_control" radio_style="false" width="237" /> | 150 | name="toggle_channel_control" radio_style="false" width="237" /> |
151 | <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" | 151 | <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" |