From 78060b7fd2688b113917b58dea25b072779ac4f6 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 26 Nov 2014 16:28:11 -0500 Subject: STORM-2082 Start to convert code to support xml file processing --- indra/newview/llfloaterpreference.cpp | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 3b64ffcf4c..cea17aeef4 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -108,6 +108,7 @@ #include "lllogininstance.h" // to check if logged in yet #include "llsdserialize.h" +#include "llpresetsmanager.h" const F32 MAX_USER_FAR_CLIP = 512.f; const F32 MIN_USER_FAR_CLIP = 64.f; @@ -661,7 +662,7 @@ void LLFloaterPreference::cancel() void LLFloaterPreference::onOpen(const LLSD& key) { - + // this variable and if that follows it are used to properly handle do not disturb mode response message static bool initialized = FALSE; // if user is logged in and we haven't initialized do not disturb mode response yet, do it @@ -739,6 +740,9 @@ void LLFloaterPreference::onOpen(const LLSD& key) // when the floater is opened. That will make cancel do its // job saveSettings(); + + // Make sure there is a default preference file + } void LLFloaterPreference::onVertexShaderEnable() @@ -1179,7 +1183,7 @@ void LLFloaterPreference::refreshEnabledState() LLCheckBoxCtrl* ctrl_ssao = getChild("UseSSAO"); LLCheckBoxCtrl* ctrl_dof = getChild("UseDoF"); - LLComboBox* ctrl_shadow = getChild("ShadowDetail"); + LLUICtrl* ctrl_shadow = getChild("ShadowDetail"); // note, okay here to get from ctrl_deferred as it's twin, ctrl_deferred2 will alway match it enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO") && (ctrl_deferred->get() ? TRUE : FALSE); @@ -1213,7 +1217,7 @@ void LLFloaterPreference::disableUnavailableSettings() LLCheckBoxCtrl* ctrl_avatar_impostors = getChild("AvatarImpostors"); LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); LLCheckBoxCtrl* ctrl_deferred2 = getChild("UseLightShaders2"); - LLComboBox* ctrl_shadows = getChild("ShadowDetail"); + LLUICtrl* ctrl_shadows = getChild("ShadowDetail"); LLCheckBoxCtrl* ctrl_ssao = getChild("UseSSAO"); LLCheckBoxCtrl* ctrl_dof = getChild("UseDoF"); @@ -1372,7 +1376,7 @@ void LLFloaterPreference::refresh() updateSliderText(getChild("SkyMeshDetail", true), getChild("SkyMeshDetailText", true)); updateSliderText(getChild("TerrainDetail", true), getChild("TerrainDetailText", true)); updateReflectionsText(getChild("Reflections", true), getChild("ReflectionsText", true)); - updateRenderShadowDetailText(getChild("RenderShadowDetail", true), getChild("RenderShadowDetailText", true)); + updateShadowDetailText(getChild("ShadowDetail", true), getChild("RenderShadowDetailText", true)); } void LLFloaterPreference::onCommitWindowedMode() @@ -1632,7 +1636,7 @@ void LLFloaterPreference::updateReflectionsText(LLSliderCtrl* ctrl, LLTextBox* t U32 value = (U32)ctrl->getValue().asInteger(); text_box->setText(getString("Reflections" + llformat("%d", value))); } -void LLFloaterPreference::updateRenderShadowDetailText(LLSliderCtrl* ctrl, LLTextBox* text_box) +void LLFloaterPreference::updateShadowDetailText(LLSliderCtrl* ctrl, LLTextBox* text_box) { if (text_box == NULL || ctrl== NULL) return; @@ -2112,8 +2116,18 @@ BOOL LLPanelPreferenceGraphics::postBuild() LLComboBox* graphic_preset = getChild("graphic_preset_combo"); graphic_preset->setLabel(getString("graphic_preset_combo_label")); + std::string presets_dir = LLPresetsManager::getGraphicPresetsDir(); + if (!presets_dir.empty()) + { + LLPresetsManager::getInstance()->getPresetsFromDir(presets_dir); + } + else { + LL_WARNS() << "Could not obtain graphic presets path" << LL_ENDL; + } + return LLPanelPreference::postBuild(); } + void LLPanelPreferenceGraphics::draw() { LLPanelPreference::draw(); -- cgit v1.2.3