From 40fa0368919da7b4f3c105c6bdf3a497ac29c360 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Tue, 15 Dec 2009 16:18:26 +0200 Subject: Fix for normal bug EXT-3465 - Any changes made in Preferences floater are canceled after viewer shutdown. --HG-- branch : product-engine --- indra/newview/llfloaterpreference.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index ab27375b87..a333868b8c 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -588,6 +588,9 @@ void LLFloaterPreference::onOpen(const LLSD& key) // when the floater is opened. That will make cancel do its // job saveSettings(); + + // This is a "fresh" floater, closing floater shoud cancel any changes + mCancelOnClose = true; } void LLFloaterPreference::onVertexShaderEnable() @@ -633,7 +636,11 @@ void LLFloaterPreference::onBtnOK() // that prevents cancel from undoing our changes when we hit OK mCancelOnClose = false; closeFloater(false); - mCancelOnClose = true; + + // closeFloater() will be called when viewer is quitting, leaving mCancelOnClose = true; + // will cancel all changes we saved here, don't let this happen. + // Fix for EXT-3465 + gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); LLUIColorTable::instance().saveUserSettings(); std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); -- cgit v1.2.3