aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterpreference.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:34 -0500
committerJacek Antonelli2008-08-15 23:45:34 -0500
commitcd17687f01420952712a500107e0f93e7ab8d5f8 (patch)
treece48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/newview/llfloaterpreference.cpp
parentSecond Life viewer sources 1.19.0.5 (diff)
downloadmeta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz
Second Life viewer sources 1.19.1.0
Diffstat (limited to 'linden/indra/newview/llfloaterpreference.cpp')
-rw-r--r--linden/indra/newview/llfloaterpreference.cpp58
1 files changed, 24 insertions, 34 deletions
diff --git a/linden/indra/newview/llfloaterpreference.cpp b/linden/indra/newview/llfloaterpreference.cpp
index 09398fd..ff57b5c 100644
--- a/linden/indra/newview/llfloaterpreference.cpp
+++ b/linden/indra/newview/llfloaterpreference.cpp
@@ -73,6 +73,7 @@
73#include "llviewerwindow.h" 73#include "llviewerwindow.h"
74#include "llkeyboard.h" 74#include "llkeyboard.h"
75#include "llscrollcontainer.h" 75#include "llscrollcontainer.h"
76#include "llfloaterhardwaresettings.h"
76 77
77#if LL_WINDOWS 78#if LL_WINDOWS
78// for Logitech LCD keyboards / speakers 79// for Logitech LCD keyboards / speakers
@@ -127,13 +128,12 @@ S32 pref_min_height()
127} 128}
128 129
129 130
130LLPreferenceCore::LLPreferenceCore(LLTabContainerCommon* tab_container, LLButton * default_btn) : 131LLPreferenceCore::LLPreferenceCore(LLTabContainer* tab_container, LLButton * default_btn) :
131 mTabContainer(tab_container), 132 mTabContainer(tab_container),
132 mGeneralPanel(NULL), 133 mGeneralPanel(NULL),
133 mInputPanel(NULL), 134 mInputPanel(NULL),
134 mNetworkPanel(NULL), 135 mNetworkPanel(NULL),
135 mDisplayPanel(NULL), 136 mDisplayPanel(NULL),
136 mDisplayPanel2(NULL),
137 mAudioPanel(NULL), 137 mAudioPanel(NULL),
138 mMsgPanel(NULL), 138 mMsgPanel(NULL),
139 mLCDPanel(NULL) 139 mLCDPanel(NULL)
@@ -150,24 +150,14 @@ LLPreferenceCore::LLPreferenceCore(LLTabContainerCommon* tab_container, LLButton
150 mTabContainer->addTabPanel(mNetworkPanel, mNetworkPanel->getLabel(), FALSE, onTabChanged, mTabContainer); 150 mTabContainer->addTabPanel(mNetworkPanel, mNetworkPanel->getLabel(), FALSE, onTabChanged, mTabContainer);
151 mNetworkPanel->setDefaultBtn(default_btn); 151 mNetworkPanel->setDefaultBtn(default_btn);
152 152
153 #if LL_LIBXUL_ENABLED
154 mWebPanel = new LLPanelWeb(); 153 mWebPanel = new LLPanelWeb();
155 mTabContainer->addTabPanel(mWebPanel, mWebPanel->getLabel(), FALSE, onTabChanged, mTabContainer); 154 mTabContainer->addTabPanel(mWebPanel, mWebPanel->getLabel(), FALSE, onTabChanged, mTabContainer);
156 mWebPanel->setDefaultBtn(default_btn); 155 mWebPanel->setDefaultBtn(default_btn);
157 #endif
158 156
159 mDisplayPanel = new LLPanelDisplay(); 157 mDisplayPanel = new LLPanelDisplay();
160 mTabContainer->addTabPanel(mDisplayPanel, mDisplayPanel->getLabel(), FALSE, onTabChanged, mTabContainer); 158 mTabContainer->addTabPanel(mDisplayPanel, mDisplayPanel->getLabel(), FALSE, onTabChanged, mTabContainer);
161 mDisplayPanel->setDefaultBtn(default_btn); 159 mDisplayPanel->setDefaultBtn(default_btn);
162 160
163 mDisplayPanel3 = new LLPanelDisplay3();
164 mTabContainer->addTabPanel(mDisplayPanel3, mDisplayPanel3->getLabel(), FALSE, onTabChanged, mTabContainer);
165 mDisplayPanel3->setDefaultBtn(default_btn);
166
167 mDisplayPanel2 = new LLPanelDisplay2();
168 mTabContainer->addTabPanel(mDisplayPanel2, mDisplayPanel2->getLabel(), FALSE, onTabChanged, mTabContainer);
169 mDisplayPanel2->setDefaultBtn(default_btn);
170
171 mAudioPanel = new LLPanelAudioPrefs(); 161 mAudioPanel = new LLPanelAudioPrefs();
172 mTabContainer->addTabPanel(mAudioPanel, mAudioPanel->getLabel(), FALSE, onTabChanged, mTabContainer); 162 mTabContainer->addTabPanel(mAudioPanel, mAudioPanel->getLabel(), FALSE, onTabChanged, mTabContainer);
173 mAudioPanel->setDefaultBtn(default_btn); 163 mAudioPanel->setDefaultBtn(default_btn);
@@ -227,16 +217,7 @@ LLPreferenceCore::~LLPreferenceCore()
227 delete mDisplayPanel; 217 delete mDisplayPanel;
228 mDisplayPanel = NULL; 218 mDisplayPanel = NULL;
229 } 219 }
230 if (mDisplayPanel2) 220
231 {
232 delete mDisplayPanel2;
233 mDisplayPanel2 = NULL;
234 }
235 if (mDisplayPanel3)
236 {
237 delete mDisplayPanel3;
238 mDisplayPanel3 = NULL;
239 }
240 if (mAudioPanel) 221 if (mAudioPanel)
241 { 222 {
242 delete mAudioPanel; 223 delete mAudioPanel;
@@ -257,13 +238,11 @@ LLPreferenceCore::~LLPreferenceCore()
257 delete mMsgPanel; 238 delete mMsgPanel;
258 mMsgPanel = NULL; 239 mMsgPanel = NULL;
259 } 240 }
260 #if LL_LIBXUL_ENABLED
261 if (mWebPanel) 241 if (mWebPanel)
262 { 242 {
263 delete mWebPanel; 243 delete mWebPanel;
264 mWebPanel = NULL; 244 mWebPanel = NULL;
265 } 245 }
266 #endif
267} 246}
268 247
269 248
@@ -273,15 +252,15 @@ void LLPreferenceCore::apply()
273 mInputPanel->apply(); 252 mInputPanel->apply();
274 mNetworkPanel->apply(); 253 mNetworkPanel->apply();
275 mDisplayPanel->apply(); 254 mDisplayPanel->apply();
276 mDisplayPanel2->apply();
277 mDisplayPanel3->apply();
278 mPrefsChat->apply(); 255 mPrefsChat->apply();
279 mPrefsVoice->apply(); 256 mPrefsVoice->apply();
280 mPrefsIM->apply(); 257 mPrefsIM->apply();
281 mMsgPanel->apply(); 258 mMsgPanel->apply();
282 #if LL_LIBXUL_ENABLED 259
260 // hardware menu apply
261 LLFloaterHardwareSettings::instance()->apply();
262
283 mWebPanel->apply(); 263 mWebPanel->apply();
284 #endif
285#if LL_WINDOWS && LL_LCD_COMPILE 264#if LL_WINDOWS && LL_LCD_COMPILE
286 // only add this option if we actually have a logitech keyboard / speaker set 265 // only add this option if we actually have a logitech keyboard / speaker set
287 if (gLcdScreen->Enabled()) 266 if (gLcdScreen->Enabled())
@@ -299,16 +278,16 @@ void LLPreferenceCore::cancel()
299 mInputPanel->cancel(); 278 mInputPanel->cancel();
300 mNetworkPanel->cancel(); 279 mNetworkPanel->cancel();
301 mDisplayPanel->cancel(); 280 mDisplayPanel->cancel();
302 mDisplayPanel2->cancel();
303 mDisplayPanel3->cancel();
304 mAudioPanel->cancel(); 281 mAudioPanel->cancel();
305 mPrefsChat->cancel(); 282 mPrefsChat->cancel();
306 mPrefsVoice->cancel(); 283 mPrefsVoice->cancel();
307 mPrefsIM->cancel(); 284 mPrefsIM->cancel();
308 mMsgPanel->cancel(); 285 mMsgPanel->cancel();
309 #if LL_LIBXUL_ENABLED 286
287 // cancel hardware menu
288 LLFloaterHardwareSettings::instance()->cancel();
289
310 mWebPanel->cancel(); 290 mWebPanel->cancel();
311 #endif
312#if LL_WINDOWS && LL_LCD_COMPILE 291#if LL_WINDOWS && LL_LCD_COMPILE
313 // only add this option if we actually have a logitech keyboard / speaker set 292 // only add this option if we actually have a logitech keyboard / speaker set
314 if (gLcdScreen->Enabled()) 293 if (gLcdScreen->Enabled())
@@ -322,7 +301,7 @@ void LLPreferenceCore::cancel()
322// static 301// static
323void LLPreferenceCore::onTabChanged(void* user_data, bool from_click) 302void LLPreferenceCore::onTabChanged(void* user_data, bool from_click)
324{ 303{
325 LLTabContainerCommon* self = (LLTabContainerCommon*)user_data; 304 LLTabContainer* self = (LLTabContainer*)user_data;
326 305
327 gSavedSettings.setS32("LastPrefTab", self->getCurrentPanelIndex()); 306 gSavedSettings.setS32("LastPrefTab", self->getCurrentPanelIndex());
328} 307}
@@ -336,6 +315,12 @@ void LLPreferenceCore::setPersonalInfo(
336 mPrefsIM->setPersonalInfo(visibility, im_via_email, email); 315 mPrefsIM->setPersonalInfo(visibility, im_via_email, email);
337} 316}
338 317
318void LLPreferenceCore::refreshEnabledGraphics()
319{
320 LLFloaterHardwareSettings::instance()->refreshEnabledState();
321 mDisplayPanel->refreshEnabledState();
322}
323
339////////////////////////////////////////////// 324//////////////////////////////////////////////
340// LLFloaterPreference 325// LLFloaterPreference
341 326
@@ -371,7 +356,7 @@ BOOL LLFloaterPreference::postBuild()
371 356
372 mPreferenceCore = new LLPreferenceCore( 357 mPreferenceCore = new LLPreferenceCore(
373 LLUICtrlFactory::getTabContainerByName(this, "pref core"), 358 LLUICtrlFactory::getTabContainerByName(this, "pref core"),
374 static_cast<LLButton *>(getChildByName("OK")) 359 getChild<LLButton>("OK")
375 ); 360 );
376 361
377 sInstance = this; 362 sInstance = this;
@@ -529,3 +514,8 @@ void LLFloaterPreference::updateUserInfo(
529 visibility, im_via_email, email); 514 visibility, im_via_email, email);
530 } 515 }
531} 516}
517
518void LLFloaterPreference::refreshEnabledGraphics()
519{
520 sInstance->mPreferenceCore->refreshEnabledGraphics();
521}