aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llprefschat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llprefschat.cpp')
-rw-r--r--linden/indra/newview/llprefschat.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/linden/indra/newview/llprefschat.cpp b/linden/indra/newview/llprefschat.cpp
index 6e55cda..2e08cac 100644
--- a/linden/indra/newview/llprefschat.cpp
+++ b/linden/indra/newview/llprefschat.cpp
@@ -18,7 +18,8 @@
18 * There are special exceptions to the terms and conditions of the GPL as 18 * There are special exceptions to the terms and conditions of the GPL as
19 * it is applied to this Source Code. View the full text of the exception 19 * it is applied to this Source Code. View the full text of the exception
20 * in the file doc/FLOSS-exception.txt in this software distribution, or 20 * in the file doc/FLOSS-exception.txt in this software distribution, or
21 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 21 * online at
22 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 * 23 *
23 * By copying, modifying or distributing this software, you acknowledge 24 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above, 25 * that you have read and understood your obligations described above,
@@ -51,7 +52,8 @@ public:
51 void apply(); 52 void apply();
52 void cancel(); 53 void cancel();
53 54
54protected: 55private:
56 void refreshValues();
55 S32 mChatSize; 57 S32 mChatSize;
56 F32 mChatPersist; 58 F32 mChatPersist;
57 S32 mChatMaxLines; 59 S32 mChatMaxLines;
@@ -79,6 +81,8 @@ protected:
79LLPrefsChatImpl::LLPrefsChatImpl() 81LLPrefsChatImpl::LLPrefsChatImpl()
80 : LLPanel(std::string("Chat Panel")) 82 : LLPanel(std::string("Chat Panel"))
81{ 83{
84 refreshValues(); // initialize member data from saved settings
85
82 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_chat.xml"); 86 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_chat.xml");
83 87
84 getChild<LLRadioGroup>("chat_font_size")->setSelectedIndex(gSavedSettings.getS32("ChatFontSize")); 88 getChild<LLRadioGroup>("chat_font_size")->setSelectedIndex(gSavedSettings.getS32("ChatFontSize"));
@@ -106,7 +110,10 @@ LLPrefsChatImpl::LLPrefsChatImpl()
106 childSetValue("toggle_channel_control", gSavedSettings.getBOOL("ChatChannelSelect")); 110 childSetValue("toggle_channel_control", gSavedSettings.getBOOL("ChatChannelSelect"));
107 childSetValue("console_opacity", gSavedSettings.getF32("ConsoleBackgroundOpacity")); 111 childSetValue("console_opacity", gSavedSettings.getF32("ConsoleBackgroundOpacity"));
108 childSetValue("bubble_chat_opacity", gSavedSettings.getF32("ChatBubbleOpacity")); 112 childSetValue("bubble_chat_opacity", gSavedSettings.getF32("ChatBubbleOpacity"));
113}
109 114
115void LLPrefsChatImpl::refreshValues()
116{
110 //set values 117 //set values
111 mChatSize = gSavedSettings.getS32("ChatFontSize"); 118 mChatSize = gSavedSettings.getS32("ChatFontSize");
112 mChatPersist = gSavedSettings.getF32("ChatPersistTime"); 119 mChatPersist = gSavedSettings.getF32("ChatPersistTime");
@@ -198,8 +205,9 @@ void LLPrefsChatImpl::apply()
198 } 205 }
199 mChatChannel = chan_check; 206 mChatChannel = chan_check;
200 } 207 }
201}
202 208
209 refreshValues(); // member values become the official values and cancel becomes a no-op.
210}
203 211
204//--------------------------------------------------------------------------- 212//---------------------------------------------------------------------------
205 213