From b011afaa81608c1d1c19bfa808bf9c2b99e8e5c8 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Mon, 23 Feb 2015 19:09:56 -0500 Subject: STORM-2082 Clicking on Ok/Cancel in Advanced floater only closes it now --- indra/newview/llfloaterpreference.cpp | 32 ++++++++++++++++------ indra/newview/llfloaterpreference.h | 4 +-- .../en/floater_preferences_graphics_advanced.xml | 6 ++-- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 21c684ab25..3cbd5cc684 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -333,8 +333,8 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) registered_dialog = true; } - mCommitCallbackRegistrar.add("Pref.Cancel", boost::bind(&LLFloaterPreference::onBtnCancel, this)); - mCommitCallbackRegistrar.add("Pref.OK", boost::bind(&LLFloaterPreference::onBtnOK, this)); + mCommitCallbackRegistrar.add("Pref.Cancel", boost::bind(&LLFloaterPreference::onBtnCancel, this, _2)); + mCommitCallbackRegistrar.add("Pref.OK", boost::bind(&LLFloaterPreference::onBtnOK, this, _2)); mCommitCallbackRegistrar.add("Pref.ClearCache", boost::bind(&LLFloaterPreference::onClickClearCache, this)); mCommitCallbackRegistrar.add("Pref.WebClearCache", boost::bind(&LLFloaterPreference::onClickBrowserClearCache, this)); @@ -877,7 +877,7 @@ void LLFloaterPreference::onClose(bool app_quitting) } // static -void LLFloaterPreference::onBtnOK() +void LLFloaterPreference::onBtnOK(const LLSD& userdata) { // commit any outstanding text entry if (hasFocus()) @@ -893,7 +893,15 @@ void LLFloaterPreference::onBtnOK() { saveSettings(); apply(); - closeFloater(false); + + if (userdata.asString() == "closeadvanced") + { + LLFloaterReg::hideInstance("prefs_graphics_advanced"); + } + else + { + closeFloater(false); + } //Conversation transcript and log path changed so reload conversations based on new location if(mPriorInstantMessageLogPath.length()) @@ -938,7 +946,7 @@ void LLFloaterPreference::onBtnOK() } // static -void LLFloaterPreference::onBtnCancel() +void LLFloaterPreference::onBtnCancel(const LLSD& userdata) { if (hasFocus()) { @@ -950,7 +958,15 @@ void LLFloaterPreference::onBtnCancel() refresh(); } cancel(); - closeFloater(); + + if (userdata.asString() == "closeadvanced") + { + LLFloaterReg::hideInstance("prefs_graphics_advanced"); + } + else + { + closeFloater(); + } } // static @@ -1545,8 +1561,8 @@ void LLFloaterPreferenceGraphicsAdvanced::refresh() updateSliderText(getChild("SkyMeshDetail", true), getChild("SkyMeshDetailText", true)); updateSliderText(getChild("TerrainDetail", true), getChild("TerrainDetailText", true)); setIndirectControls(); - setMaxNonImpostorsText(gSavedSettings.getU32("RenderAvatarMaxNonImpostors"),getChild("IndirectMaxNonImpostorsText", true)); - setMaxComplexityText(gSavedSettings.getU32("RenderAvatarMaxComplexity"),getChild("IndirectMaxComplexityText", true)); + setMaxNonImpostorsText(gSavedSettings.getU32("RenderAvatarMaxNonImpostors"),getChild("IndirectMaxNonImpostorsText", true)); + setMaxComplexityText(gSavedSettings.getU32("RenderAvatarMaxComplexity"),getChild("IndirectMaxComplexityText", true)); refreshEnabledState(); } diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 5058e7bb23..9730722558 100755 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -95,8 +95,8 @@ public: void getControlNames(std::vector& names); protected: - void onBtnOK(); - void onBtnCancel(); + void onBtnOK(const LLSD& userdata); + void onBtnCancel(const LLSD& userdata); void onClickClearCache(); // Clear viewer texture cache, vfs, and VO cache on next startup void onClickBrowserClearCache(); // Clear web history and caches as well as viewer caches above diff --git a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml index 054337dfc0..3f68efdc70 100644 --- a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml +++ b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml @@ -870,7 +870,8 @@ top_delta="0" width="80"> + function="Pref.OK" + parameter="closeadvanced" /> -- cgit v1.2.3