aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llprefschat.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2009-04-30 13:04:20 -0500
committerJacek Antonelli2009-04-30 13:07:16 -0500
commitca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch)
tree8348301d0ac44a524f1819b777686bf086907d76 /linden/indra/newview/llprefschat.cpp
parentSecond Life viewer sources 1.22.11 (diff)
downloadmeta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.zip
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.gz
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.bz2
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.xz
Second Life viewer sources 1.23.0-RC
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llprefschat.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/linden/indra/newview/llprefschat.cpp b/linden/indra/newview/llprefschat.cpp
index 4453751..559ad2b 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,
@@ -49,7 +50,8 @@ public:
49 void apply(); 50 void apply();
50 void cancel(); 51 void cancel();
51 52
52protected: 53private:
54 void refreshValues();
53 S32 mChatSize; 55 S32 mChatSize;
54 F32 mChatPersist; 56 F32 mChatPersist;
55 S32 mChatMaxLines; 57 S32 mChatMaxLines;
@@ -77,6 +79,8 @@ protected:
77LLPrefsChatImpl::LLPrefsChatImpl() 79LLPrefsChatImpl::LLPrefsChatImpl()
78 : LLPanel(std::string("Chat Panel")) 80 : LLPanel(std::string("Chat Panel"))
79{ 81{
82 refreshValues(); // initialize member data from saved settings
83
80 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_chat.xml"); 84 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_chat.xml");
81 85
82 getChild<LLRadioGroup>("chat_font_size")->setSelectedIndex(gSavedSettings.getS32("ChatFontSize")); 86 getChild<LLRadioGroup>("chat_font_size")->setSelectedIndex(gSavedSettings.getS32("ChatFontSize"));
@@ -103,7 +107,10 @@ LLPrefsChatImpl::LLPrefsChatImpl()
103 childSetValue("play_typing_animation", gSavedSettings.getBOOL("PlayTypingAnim")); 107 childSetValue("play_typing_animation", gSavedSettings.getBOOL("PlayTypingAnim"));
104 childSetValue("console_opacity", gSavedSettings.getF32("ConsoleBackgroundOpacity")); 108 childSetValue("console_opacity", gSavedSettings.getF32("ConsoleBackgroundOpacity"));
105 childSetValue("bubble_chat_opacity", gSavedSettings.getF32("ChatBubbleOpacity")); 109 childSetValue("bubble_chat_opacity", gSavedSettings.getF32("ChatBubbleOpacity"));
110}
106 111
112void LLPrefsChatImpl::refreshValues()
113{
107 //set values 114 //set values
108 mChatSize = gSavedSettings.getS32("ChatFontSize"); 115 mChatSize = gSavedSettings.getS32("ChatFontSize");
109 mChatPersist = gSavedSettings.getF32("ChatPersistTime"); 116 mChatPersist = gSavedSettings.getF32("ChatPersistTime");
@@ -181,6 +188,8 @@ void LLPrefsChatImpl::apply()
181 188
182 gSavedSettings.setF32("ConsoleBackgroundOpacity", childGetValue("console_opacity").asReal()); 189 gSavedSettings.setF32("ConsoleBackgroundOpacity", childGetValue("console_opacity").asReal());
183 gSavedSettings.setF32("ChatBubbleOpacity", childGetValue("bubble_chat_opacity").asReal()); 190 gSavedSettings.setF32("ChatBubbleOpacity", childGetValue("bubble_chat_opacity").asReal());
191
192 refreshValues(); // member values become the official values and cancel becomes a no-op.
184} 193}
185 194
186//--------------------------------------------------------------------------- 195//---------------------------------------------------------------------------