From ce28e056c20bf2723f565bbf464b87781ec248a2 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:45:42 -0500 Subject: Second Life viewer sources 1.20.2 --- linden/indra/newview/llfloaterpreference.cpp | 41 ++++++++++++---------------- 1 file changed, 17 insertions(+), 24 deletions(-) (limited to 'linden/indra/newview/llfloaterpreference.cpp') 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 @@ #include "llagent.h" #include "llviewercontrol.h" #include "llviewernetwork.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerwindow.h" #include "llkeyboard.h" #include "llscrollcontainer.h" @@ -192,7 +192,10 @@ LLPreferenceCore::LLPreferenceCore(LLTabContainer* tab_container, LLButton * def mTabContainer->addTabPanel(mMsgPanel, mMsgPanel->getLabel(), FALSE, onTabChanged, mTabContainer); mMsgPanel->setDefaultBtn(default_btn); - mTabContainer->selectTab(gSavedSettings.getS32("LastPrefTab")); + if (!mTabContainer->selectTab(gSavedSettings.getS32("LastPrefTab"))) + { + mTabContainer->selectFirstTab(); + } } LLPreferenceCore::~LLPreferenceCore() @@ -326,36 +329,36 @@ void LLPreferenceCore::refreshEnabledGraphics() LLFloaterPreference::LLFloaterPreference() { - gUICtrlFactory->buildFloater(this, "floater_preferences.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preferences.xml"); } BOOL LLFloaterPreference::postBuild() { - requires("About...", WIDGET_TYPE_BUTTON); - requires("OK", WIDGET_TYPE_BUTTON); - requires("Cancel", WIDGET_TYPE_BUTTON); - requires("Apply", WIDGET_TYPE_BUTTON); - requires("pref core", WIDGET_TYPE_TAB_CONTAINER); + requires("About..."); + requires("OK"); + requires("Cancel"); + requires("Apply"); + requires("pref core"); if (!checkRequirements()) { return FALSE; } - mAboutBtn = LLUICtrlFactory::getButtonByName(this, "About..."); + mAboutBtn = getChild("About..."); mAboutBtn->setClickedCallback(onClickAbout, this); - mApplyBtn = LLUICtrlFactory::getButtonByName(this, "Apply"); + mApplyBtn = getChild("Apply"); mApplyBtn->setClickedCallback(onBtnApply, this); - mCancelBtn = LLUICtrlFactory::getButtonByName(this, "Cancel"); + mCancelBtn = getChild("Cancel"); mCancelBtn->setClickedCallback(onBtnCancel, this); - mOKBtn = LLUICtrlFactory::getButtonByName(this, "OK"); + mOKBtn = getChild("OK"); mOKBtn->setClickedCallback(onBtnOK, this); mPreferenceCore = new LLPreferenceCore( - LLUICtrlFactory::getTabContainerByName(this, "pref core"), + getChild("pref core"), getChild("OK") ); @@ -371,16 +374,6 @@ LLFloaterPreference::~LLFloaterPreference() delete mPreferenceCore; } - -void LLFloaterPreference::draw() -{ - if( getVisible() ) - { - LLFloater::draw(); - } -} - - void LLFloaterPreference::apply() { this->mPreferenceCore->apply(); @@ -446,7 +439,7 @@ void LLFloaterPreference::onBtnOK( void* userdata ) fp->apply(); fp->close(false); - gSavedSettings.saveToFile( gSettingsFileName, TRUE ); + gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); // save all settings, even if equals defaults -- cgit v1.1