aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterpreference.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:42 -0500
committerJacek Antonelli2008-08-15 23:45:42 -0500
commitce28e056c20bf2723f565bbf464b87781ec248a2 (patch)
treeef7b0501c4de4b631a916305cbc2a5fdc125e52d /linden/indra/newview/llfloaterpreference.cpp
parentSecond Life viewer sources 1.19.1.4b (diff)
downloadmeta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.zip
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.gz
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.bz2
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.xz
Second Life viewer sources 1.20.2
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llfloaterpreference.cpp41
1 files changed, 17 insertions, 24 deletions
diff --git a/linden/indra/newview/llfloaterpreference.cpp b/linden/indra/newview/llfloaterpreference.cpp
index ff57b5c..f267a2d 100644
--- a/linden/indra/newview/llfloaterpreference.cpp
+++ b/linden/indra/newview/llfloaterpreference.cpp
@@ -69,7 +69,7 @@
69#include "llagent.h" 69#include "llagent.h"
70#include "llviewercontrol.h" 70#include "llviewercontrol.h"
71#include "llviewernetwork.h" 71#include "llviewernetwork.h"
72#include "llvieweruictrlfactory.h" 72#include "lluictrlfactory.h"
73#include "llviewerwindow.h" 73#include "llviewerwindow.h"
74#include "llkeyboard.h" 74#include "llkeyboard.h"
75#include "llscrollcontainer.h" 75#include "llscrollcontainer.h"
@@ -192,7 +192,10 @@ LLPreferenceCore::LLPreferenceCore(LLTabContainer* tab_container, LLButton * def
192 mTabContainer->addTabPanel(mMsgPanel, mMsgPanel->getLabel(), FALSE, onTabChanged, mTabContainer); 192 mTabContainer->addTabPanel(mMsgPanel, mMsgPanel->getLabel(), FALSE, onTabChanged, mTabContainer);
193 mMsgPanel->setDefaultBtn(default_btn); 193 mMsgPanel->setDefaultBtn(default_btn);
194 194
195 mTabContainer->selectTab(gSavedSettings.getS32("LastPrefTab")); 195 if (!mTabContainer->selectTab(gSavedSettings.getS32("LastPrefTab")))
196 {
197 mTabContainer->selectFirstTab();
198 }
196} 199}
197 200
198LLPreferenceCore::~LLPreferenceCore() 201LLPreferenceCore::~LLPreferenceCore()
@@ -326,36 +329,36 @@ void LLPreferenceCore::refreshEnabledGraphics()
326 329
327LLFloaterPreference::LLFloaterPreference() 330LLFloaterPreference::LLFloaterPreference()
328{ 331{
329 gUICtrlFactory->buildFloater(this, "floater_preferences.xml"); 332 LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preferences.xml");
330} 333}
331 334
332BOOL LLFloaterPreference::postBuild() 335BOOL LLFloaterPreference::postBuild()
333{ 336{
334 requires("About...", WIDGET_TYPE_BUTTON); 337 requires<LLButton>("About...");
335 requires("OK", WIDGET_TYPE_BUTTON); 338 requires<LLButton>("OK");
336 requires("Cancel", WIDGET_TYPE_BUTTON); 339 requires<LLButton>("Cancel");
337 requires("Apply", WIDGET_TYPE_BUTTON); 340 requires<LLButton>("Apply");
338 requires("pref core", WIDGET_TYPE_TAB_CONTAINER); 341 requires<LLTabContainer>("pref core");
339 342
340 if (!checkRequirements()) 343 if (!checkRequirements())
341 { 344 {
342 return FALSE; 345 return FALSE;
343 } 346 }
344 347
345 mAboutBtn = LLUICtrlFactory::getButtonByName(this, "About..."); 348 mAboutBtn = getChild<LLButton>("About...");
346 mAboutBtn->setClickedCallback(onClickAbout, this); 349 mAboutBtn->setClickedCallback(onClickAbout, this);
347 350
348 mApplyBtn = LLUICtrlFactory::getButtonByName(this, "Apply"); 351 mApplyBtn = getChild<LLButton>("Apply");
349 mApplyBtn->setClickedCallback(onBtnApply, this); 352 mApplyBtn->setClickedCallback(onBtnApply, this);
350 353
351 mCancelBtn = LLUICtrlFactory::getButtonByName(this, "Cancel"); 354 mCancelBtn = getChild<LLButton>("Cancel");
352 mCancelBtn->setClickedCallback(onBtnCancel, this); 355 mCancelBtn->setClickedCallback(onBtnCancel, this);
353 356
354 mOKBtn = LLUICtrlFactory::getButtonByName(this, "OK"); 357 mOKBtn = getChild<LLButton>("OK");
355 mOKBtn->setClickedCallback(onBtnOK, this); 358 mOKBtn->setClickedCallback(onBtnOK, this);
356 359
357 mPreferenceCore = new LLPreferenceCore( 360 mPreferenceCore = new LLPreferenceCore(
358 LLUICtrlFactory::getTabContainerByName(this, "pref core"), 361 getChild<LLTabContainer>("pref core"),
359 getChild<LLButton>("OK") 362 getChild<LLButton>("OK")
360 ); 363 );
361 364
@@ -371,16 +374,6 @@ LLFloaterPreference::~LLFloaterPreference()
371 delete mPreferenceCore; 374 delete mPreferenceCore;
372} 375}
373 376
374
375void LLFloaterPreference::draw()
376{
377 if( getVisible() )
378 {
379 LLFloater::draw();
380 }
381}
382
383
384void LLFloaterPreference::apply() 377void LLFloaterPreference::apply()
385{ 378{
386 this->mPreferenceCore->apply(); 379 this->mPreferenceCore->apply();
@@ -446,7 +439,7 @@ void LLFloaterPreference::onBtnOK( void* userdata )
446 fp->apply(); 439 fp->apply();
447 fp->close(false); 440 fp->close(false);
448 441
449 gSavedSettings.saveToFile( gSettingsFileName, TRUE ); 442 gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE );
450 443
451 std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); 444 std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE);
452 // save all settings, even if equals defaults 445 // save all settings, even if equals defaults