From b92dd27878c73d23dec9859b317babfde749b33b Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sun, 23 Nov 2014 12:11:51 -0500 Subject: STORM-2082 Allow saving and loading of graphic settings --- indra/newview/llfloaterpreference.cpp | 43 +++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 12 deletions(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index d3773767d0..3b64ffcf4c 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1099,8 +1099,7 @@ void LLFloaterPreference::buildPopupLists() void LLFloaterPreference::refreshEnabledState() { - LLComboBox* ctrl_reflections = getChild("Reflections"); - LLRadioGroup* radio_reflection_detail = getChild("ReflectionDetailRadio"); + LLUICtrl* ctrl_reflections = getChild("Reflections"); // Reflections BOOL reflections = gSavedSettings.getBOOL("VertexShaderEnable") @@ -1113,8 +1112,6 @@ void LLFloaterPreference::refreshEnabledState() bool bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump"); bumpshiny_ctrl->setEnabled(bumpshiny ? TRUE : FALSE); - radio_reflection_detail->setEnabled(reflections); - // Avatar Mode // Enable Avatar Shaders LLCheckBoxCtrl* ctrl_avatar_vp = getChild("AvatarVertexProgram"); @@ -1143,20 +1140,19 @@ void LLFloaterPreference::refreshEnabledState() // Vertex Shaders // Global Shader Enable LLCheckBoxCtrl* ctrl_shader_enable = getChild("BasicShaders"); - // radio set for terrain detail mode - LLRadioGroup* mRadioTerrainDetail = getChild("TerrainDetailRadio"); // can be linked with control var + LLSliderCtrl* terrain_detail = getChild("TerrainDetail"); // can be linked with control var ctrl_shader_enable->setEnabled(LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable")); BOOL shaders = ctrl_shader_enable->get(); if (shaders) { - mRadioTerrainDetail->setValue(1); - mRadioTerrainDetail->setEnabled(FALSE); + terrain_detail->setValue(1); + terrain_detail->setEnabled(FALSE); } else { - mRadioTerrainDetail->setEnabled(TRUE); + terrain_detail->setEnabled(TRUE); } // WindLight @@ -1209,7 +1205,7 @@ void LLFloaterPreference::refreshEnabledState() void LLFloaterPreference::disableUnavailableSettings() { - LLComboBox* ctrl_reflections = getChild("Reflections"); + LLUICtrl* ctrl_reflections = getChild("Reflections"); LLCheckBoxCtrl* ctrl_avatar_vp = getChild("AvatarVertexProgram"); LLCheckBoxCtrl* ctrl_avatar_cloth = getChild("AvatarCloth"); LLCheckBoxCtrl* ctrl_shader_enable = getChild("BasicShaders"); @@ -1360,6 +1356,8 @@ void LLFloaterPreference::refresh() { LLPanel::refresh(); + refreshEnabledState(); + // sliders and their text boxes // mPostProcess = gSavedSettings.getS32("RenderGlowResolutionPow"); // slider text boxes @@ -1372,8 +1370,9 @@ void LLFloaterPreference::refresh() updateSliderText(getChild("TerrainMeshDetail", true), getChild("TerrainMeshDetailText", true)); updateSliderText(getChild("RenderPostProcess", true), getChild("PostProcessText", true)); updateSliderText(getChild("SkyMeshDetail", true), getChild("SkyMeshDetailText", true)); - - refreshEnabledState(); + updateSliderText(getChild("TerrainDetail", true), getChild("TerrainDetailText", true)); + updateReflectionsText(getChild("Reflections", true), getChild("ReflectionsText", true)); + updateRenderShadowDetailText(getChild("RenderShadowDetail", true), getChild("RenderShadowDetailText", true)); } void LLFloaterPreference::onCommitWindowedMode() @@ -1625,6 +1624,23 @@ void LLFloaterPreference::refreshUI() refresh(); } +void LLFloaterPreference::updateReflectionsText(LLSliderCtrl* ctrl, LLTextBox* text_box) +{ + if (text_box == NULL || ctrl== NULL) + return; + + U32 value = (U32)ctrl->getValue().asInteger(); + text_box->setText(getString("Reflections" + llformat("%d", value))); +} +void LLFloaterPreference::updateRenderShadowDetailText(LLSliderCtrl* ctrl, LLTextBox* text_box) +{ + if (text_box == NULL || ctrl== NULL) + return; + + U32 value = (U32)ctrl->getValue().asInteger(); + text_box->setText(getString("RenderShadowDetail" + llformat("%d", value))); +} + void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box) { if (text_box == NULL || ctrl== NULL) @@ -2093,6 +2109,9 @@ static LLPanelInjector t_pref_privacy("panel_preferenc BOOL LLPanelPreferenceGraphics::postBuild() { + LLComboBox* graphic_preset = getChild("graphic_preset_combo"); + graphic_preset->setLabel(getString("graphic_preset_combo_label")); + return LLPanelPreference::postBuild(); } void LLPanelPreferenceGraphics::draw() -- cgit v1.2.3 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 From f71247ea542805819b82640759e1f44fd0599e7f Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 26 Nov 2014 18:03:36 -0500 Subject: STORM-2082 Code now fills combobox --- indra/newview/llfloaterpreference.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index cea17aeef4..39f37f4e50 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -2117,9 +2117,18 @@ BOOL LLPanelPreferenceGraphics::postBuild() graphic_preset->setLabel(getString("graphic_preset_combo_label")); std::string presets_dir = LLPresetsManager::getGraphicPresetsDir(); + if (!presets_dir.empty()) { - LLPresetsManager::getInstance()->getPresetsFromDir(presets_dir); + LLPresetsManager::getInstance()->loadPresetsFromDir(presets_dir); + std::list preset_names; + LLPresetsManager::getInstance()->getPresetNames(preset_names); + + for (std::list::const_iterator it = preset_names.begin(); it != preset_names.end(); ++it) + { + const std::string& name = *it; + graphic_preset->add(name, LLSD().with(0, name)); + } } else { LL_WARNS() << "Could not obtain graphic presets path" << LL_ENDL; -- cgit v1.2.3 From f30e518f1774cc3c1b4641e97c26afa496fb85e5 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Thu, 27 Nov 2014 16:20:39 -0500 Subject: STORM-2082 Get writing out and loading presets working --- indra/newview/llfloaterpreference.cpp | 50 ++++++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 7 deletions(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 39f37f4e50..e8590fc9dc 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -109,6 +109,7 @@ #include "lllogininstance.h" // to check if logged in yet #include "llsdserialize.h" #include "llpresetsmanager.h" +#include "llviewercontrol.h" const F32 MAX_USER_FAR_CLIP = 512.f; const F32 MIN_USER_FAR_CLIP = 64.f; @@ -742,7 +743,13 @@ void LLFloaterPreference::onOpen(const LLSD& key) saveSettings(); // Make sure there is a default preference file - + std::string default_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, PRESETS_DIR, PRESETS_GRAPHIC_DIR, "default.xml"); + if (!gDirUtilp->fileExists(default_file)) + { + LL_WARNS() << "No " << default_file << " found -- creating one" << LL_ENDL; + // Write current graphic settings to default.xml + LLPresetsManager::getInstance()->savePreset("Default"); + } } void LLFloaterPreference::onVertexShaderEnable() @@ -1873,6 +1880,7 @@ LLPanelPreference::LLPanelPreference() { mCommitCallbackRegistrar.add("Pref.setControlFalse", boost::bind(&LLPanelPreference::setControlFalse,this, _2)); mCommitCallbackRegistrar.add("Pref.updateMediaAutoPlayCheckbox", boost::bind(&LLPanelPreference::updateMediaAutoPlayCheckbox, this, _1)); + mCommitCallbackRegistrar.add("Pref.Preset", boost::bind(&LLPanelPreference::onChangePreset, this)); } //virtual @@ -2070,6 +2078,19 @@ void LLPanelPreference::updateMediaAutoPlayCheckbox(LLUICtrl* ctrl) } } +void LLPanelPreference::onChangePreset() +{ + LLComboBox* combo = getChild("graphic_preset_combo"); + std::string name = combo->getSimple(); + + LLPresetsManager::getInstance()->loadPreset(name); + LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); + if (instance) + { + instance->refreshEnabledGraphics(); + } +} + class LLPanelPreferencePrivacy : public LLPanelPreference { public: @@ -2113,28 +2134,43 @@ static LLPanelInjector t_pref_privacy("panel_preferenc BOOL LLPanelPreferenceGraphics::postBuild() { - LLComboBox* graphic_preset = getChild("graphic_preset_combo"); - graphic_preset->setLabel(getString("graphic_preset_combo_label")); + LLComboBox* combo = getChild("graphic_preset_combo"); + combo->setLabel(getString("graphic_preset_combo_label")); + + setPresetNamesInCombobox(); + + LLPresetsManager::instance().setPresetListChangeCallback(boost::bind(&LLPanelPreferenceGraphics::onPresetsListChange, this)); + + return LLPanelPreference::postBuild(); +} + +void LLPanelPreferenceGraphics::onPresetsListChange() +{ + setPresetNamesInCombobox(); +} + +void LLPanelPreferenceGraphics::setPresetNamesInCombobox() +{ + LLComboBox* combo = getChild("graphic_preset_combo"); + combo->clearRows(); std::string presets_dir = LLPresetsManager::getGraphicPresetsDir(); if (!presets_dir.empty()) { - LLPresetsManager::getInstance()->loadPresetsFromDir(presets_dir); + LLPresetsManager::getInstance()->loadPresetNamesFromDir(presets_dir); std::list preset_names; LLPresetsManager::getInstance()->getPresetNames(preset_names); for (std::list::const_iterator it = preset_names.begin(); it != preset_names.end(); ++it) { const std::string& name = *it; - graphic_preset->add(name, LLSD().with(0, name)); + combo->add(name, LLSD().with(0, name)); } } else { LL_WARNS() << "Could not obtain graphic presets path" << LL_ENDL; } - - return LLPanelPreference::postBuild(); } void LLPanelPreferenceGraphics::draw() -- cgit v1.2.3 From 34a79a6ece28fbc560bde907142ecaadf95e910f Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sun, 30 Nov 2014 07:15:00 -0500 Subject: STORM-2082 Implement delete floater --- indra/newview/llfloaterpreference.cpp | 36 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 23 deletions(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index e8590fc9dc..6b798f6549 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -110,6 +110,7 @@ #include "llsdserialize.h" #include "llpresetsmanager.h" #include "llviewercontrol.h" +#include "llpresetsmanager.h" const F32 MAX_USER_FAR_CLIP = 512.f; const F32 MIN_USER_FAR_CLIP = 64.f; @@ -743,7 +744,7 @@ void LLFloaterPreference::onOpen(const LLSD& key) saveSettings(); // Make sure there is a default preference file - std::string default_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, PRESETS_DIR, PRESETS_GRAPHIC_DIR, "default.xml"); + std::string default_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, PRESETS_DIR, PRESETS_GRAPHIC, "default.xml"); if (!gDirUtilp->fileExists(default_file)) { LL_WARNS() << "No " << default_file << " found -- creating one" << LL_ENDL; @@ -1881,6 +1882,7 @@ LLPanelPreference::LLPanelPreference() mCommitCallbackRegistrar.add("Pref.setControlFalse", boost::bind(&LLPanelPreference::setControlFalse,this, _2)); mCommitCallbackRegistrar.add("Pref.updateMediaAutoPlayCheckbox", boost::bind(&LLPanelPreference::updateMediaAutoPlayCheckbox, this, _1)); mCommitCallbackRegistrar.add("Pref.Preset", boost::bind(&LLPanelPreference::onChangePreset, this)); + mCommitCallbackRegistrar.add("Pref.PrefDelete", boost::bind(&LLPanelPreference::onDeletePreset, this)); } //virtual @@ -2078,6 +2080,11 @@ void LLPanelPreference::updateMediaAutoPlayCheckbox(LLUICtrl* ctrl) } } +void LLPanelPreference::onDeletePreset() +{ + LLFloaterReg::showInstance("delete_pref_preset", PRESETS_GRAPHIC); +} + void LLPanelPreference::onChangePreset() { LLComboBox* combo = getChild("graphic_preset_combo"); @@ -2135,9 +2142,9 @@ static LLPanelInjector t_pref_privacy("panel_preferenc BOOL LLPanelPreferenceGraphics::postBuild() { LLComboBox* combo = getChild("graphic_preset_combo"); - combo->setLabel(getString("graphic_preset_combo_label")); + combo->setLabel(LLTrans::getString("preset_combo_label")); - setPresetNamesInCombobox(); + setPresetNamesInComboBox(); LLPresetsManager::instance().setPresetListChangeCallback(boost::bind(&LLPanelPreferenceGraphics::onPresetsListChange, this)); @@ -2146,31 +2153,14 @@ BOOL LLPanelPreferenceGraphics::postBuild() void LLPanelPreferenceGraphics::onPresetsListChange() { - setPresetNamesInCombobox(); + setPresetNamesInComboBox(); } -void LLPanelPreferenceGraphics::setPresetNamesInCombobox() +void LLPanelPreferenceGraphics::setPresetNamesInComboBox() { LLComboBox* combo = getChild("graphic_preset_combo"); - combo->clearRows(); - - std::string presets_dir = LLPresetsManager::getGraphicPresetsDir(); - if (!presets_dir.empty()) - { - LLPresetsManager::getInstance()->loadPresetNamesFromDir(presets_dir); - std::list preset_names; - LLPresetsManager::getInstance()->getPresetNames(preset_names); - - for (std::list::const_iterator it = preset_names.begin(); it != preset_names.end(); ++it) - { - const std::string& name = *it; - combo->add(name, LLSD().with(0, name)); - } - } - else { - LL_WARNS() << "Could not obtain graphic presets path" << LL_ENDL; - } + LLPresetsManager::getInstance()->setPresetNamesInComboBox(combo); } void LLPanelPreferenceGraphics::draw() -- cgit v1.2.3 From 563e22e81c6bf14bca6370b098a257f94f4f843f Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sun, 30 Nov 2014 11:24:22 -0500 Subject: STORM-2082 Make code more generic to handle the future camera presets. --- indra/newview/llfloaterpreference.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 6b798f6549..508d82522e 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -749,7 +749,9 @@ void LLFloaterPreference::onOpen(const LLSD& key) { LL_WARNS() << "No " << default_file << " found -- creating one" << LL_ENDL; // Write current graphic settings to default.xml - LLPresetsManager::getInstance()->savePreset("Default"); + // If this name is to be localized additional code will be needed to delete the old default + // when changing languages. + LLPresetsManager::getInstance()->savePreset(PRESETS_GRAPHIC, "Default"); } } @@ -2160,7 +2162,7 @@ void LLPanelPreferenceGraphics::setPresetNamesInComboBox() { LLComboBox* combo = getChild("graphic_preset_combo"); - LLPresetsManager::getInstance()->setPresetNamesInComboBox(combo); + LLPresetsManager::getInstance()->setPresetNamesInComboBox(PRESETS_GRAPHIC, combo); } void LLPanelPreferenceGraphics::draw() -- cgit v1.2.3 From 6d1296f71640c9c25affcff4e784ea5798ba2d5c Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Mon, 1 Dec 2014 08:09:17 -0500 Subject: STORM-2082 Implement save floater and some code cleanup. --- indra/newview/llfloaterpreference.cpp | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 508d82522e..2e1e1ba318 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1883,8 +1883,9 @@ LLPanelPreference::LLPanelPreference() { mCommitCallbackRegistrar.add("Pref.setControlFalse", boost::bind(&LLPanelPreference::setControlFalse,this, _2)); mCommitCallbackRegistrar.add("Pref.updateMediaAutoPlayCheckbox", boost::bind(&LLPanelPreference::updateMediaAutoPlayCheckbox, this, _1)); - mCommitCallbackRegistrar.add("Pref.Preset", boost::bind(&LLPanelPreference::onChangePreset, this)); - mCommitCallbackRegistrar.add("Pref.PrefDelete", boost::bind(&LLPanelPreference::onDeletePreset, this)); + mCommitCallbackRegistrar.add("Pref.Preset", boost::bind(&LLPanelPreference::onChangePreset, this, _2)); + mCommitCallbackRegistrar.add("Pref.PrefDelete", boost::bind(&LLPanelPreference::DeletePreset, this, _2)); + mCommitCallbackRegistrar.add("Pref.PrefSave", boost::bind(&LLPanelPreference::SavePreset, this, _2)); } //virtual @@ -2082,17 +2083,27 @@ void LLPanelPreference::updateMediaAutoPlayCheckbox(LLUICtrl* ctrl) } } -void LLPanelPreference::onDeletePreset() +void LLPanelPreference::DeletePreset(const LLSD& user_data) { - LLFloaterReg::showInstance("delete_pref_preset", PRESETS_GRAPHIC); + std::string subdirectory = user_data.asString(); + LLFloaterReg::showInstance("delete_pref_preset", subdirectory); } -void LLPanelPreference::onChangePreset() +void LLPanelPreference::SavePreset(const LLSD& user_data) { - LLComboBox* combo = getChild("graphic_preset_combo"); + std::string subdirectory = user_data.asString(); + LLFloaterReg::showInstance("save_pref_preset", subdirectory); +} + +void LLPanelPreference::onChangePreset(const LLSD& user_data) +{ + std::string subdirectory = user_data.asString(); + + LLComboBox* combo = getChild(subdirectory + "_preset_combo"); std::string name = combo->getSimple(); - LLPresetsManager::getInstance()->loadPreset(name); + + LLPresetsManager::getInstance()->loadPreset(subdirectory, name); LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); if (instance) { -- cgit v1.2.3 From e510c786d9b5eea96b9331596c77a79b239de809 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Mon, 1 Dec 2014 13:54:32 -0500 Subject: STORM-2082 Disable preset controls unless logged in --- indra/newview/llfloaterpreference.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 2e1e1ba318..521cc59dda 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -753,6 +753,16 @@ void LLFloaterPreference::onOpen(const LLSD& key) // when changing languages. LLPresetsManager::getInstance()->savePreset(PRESETS_GRAPHIC, "Default"); } + + bool started = (LLStartUp::getStartupState() == STATE_STARTED); + + LLComboBox* combo = getChild("graphic_preset_combo"); + LLButton* save_btn = findChild("PrefSaveButton"); + LLButton* delete_btn = findChild("PrefDeleteButton"); + + combo->setEnabled(started); + save_btn->setEnabled(started); + delete_btn->setEnabled(started); } void LLFloaterPreference::onVertexShaderEnable() -- cgit v1.2.3 From 7360f046634d013fec1e9b37c60840a83b470ce1 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Mon, 1 Dec 2014 15:36:59 -0500 Subject: STORM-2082 Better control on how (or if) to display Default preset Make sure default preset is created when flyout panel is activated Only display deleted notification upon successful deletion --- indra/newview/llfloaterpreference.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 521cc59dda..97af9d6ce0 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -744,15 +744,7 @@ void LLFloaterPreference::onOpen(const LLSD& key) saveSettings(); // Make sure there is a default preference file - std::string default_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, PRESETS_DIR, PRESETS_GRAPHIC, "default.xml"); - if (!gDirUtilp->fileExists(default_file)) - { - LL_WARNS() << "No " << default_file << " found -- creating one" << LL_ENDL; - // Write current graphic settings to default.xml - // If this name is to be localized additional code will be needed to delete the old default - // when changing languages. - LLPresetsManager::getInstance()->savePreset(PRESETS_GRAPHIC, "Default"); - } + LLPresetsManager::getInstance()->createMissingDefault(); bool started = (LLStartUp::getStartupState() == STATE_STARTED); @@ -2121,6 +2113,10 @@ void LLPanelPreference::onChangePreset(const LLSD& user_data) } } +void LLPanelPreference::setHardwareDefaults() +{ +} + class LLPanelPreferencePrivacy : public LLPanelPreference { public: @@ -2183,7 +2179,8 @@ void LLPanelPreferenceGraphics::setPresetNamesInComboBox() { LLComboBox* combo = getChild("graphic_preset_combo"); - LLPresetsManager::getInstance()->setPresetNamesInComboBox(PRESETS_GRAPHIC, combo); + EDefaultOptions option = DEFAULT_POSITION_TOP; + LLPresetsManager::getInstance()->setPresetNamesInComboBox(PRESETS_GRAPHIC, combo, option); } void LLPanelPreferenceGraphics::draw() -- cgit v1.2.3 From ade3953e380d9211ad6d332b9b27fa23e57a7d81 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 2 Dec 2014 07:42:32 -0500 Subject: STORM-2082 Add Recommended button --- indra/newview/llfloaterpreference.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 97af9d6ce0..c80ec1a976 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -111,6 +111,7 @@ #include "llpresetsmanager.h" #include "llviewercontrol.h" #include "llpresetsmanager.h" +#include "llfeaturemanager.h" const F32 MAX_USER_FAR_CLIP = 512.f; const F32 MIN_USER_FAR_CLIP = 64.f; @@ -342,6 +343,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.LogPath", boost::bind(&LLFloaterPreference::onClickLogPath, this)); mCommitCallbackRegistrar.add("Pref.HardwareSettings", boost::bind(&LLFloaterPreference::onOpenHardwareSettings, this)); mCommitCallbackRegistrar.add("Pref.HardwareDefaults", boost::bind(&LLFloaterPreference::setHardwareDefaults, this)); + mCommitCallbackRegistrar.add("Pref.Recommended", boost::bind(&LLFloaterPreference::setRecommended, this)); mCommitCallbackRegistrar.add("Pref.VertexShaderEnable", boost::bind(&LLFloaterPreference::onVertexShaderEnable, this)); mCommitCallbackRegistrar.add("Pref.WindowedMod", boost::bind(&LLFloaterPreference::onCommitWindowedMode, this)); mCommitCallbackRegistrar.add("Pref.UpdateSliderText", boost::bind(&LLFloaterPreference::refreshUI,this)); @@ -798,6 +800,15 @@ void LLFloaterPreference::setHardwareDefaults() } } +void LLFloaterPreference::setRecommended() +{ + LLFeatureManager::getInstance()->applyRecommendedSettings(); + + refreshEnabledGraphics(); + + LLPresetsManager::getInstance()->savePreset(PRESETS_GRAPHIC, PRESETS_DEFAULT); +} + //virtual void LLFloaterPreference::onClose(bool app_quitting) { -- cgit v1.2.3 From cc22efa4c0d6b06bac6f49b6243df7726f89c7c4 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 3 Dec 2014 06:35:46 -0500 Subject: STORM-2082 Remove Apply button. Add new control variable to track which preset is active. Save settings to active preset when clicking on Ok button. Initial work to make pulldown operational. Still to do: add pretty icon for current preset. Notifications do not appear when called from this panel. --- indra/newview/llfloaterpreference.cpp | 39 ++++------------------------------- 1 file changed, 4 insertions(+), 35 deletions(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index c80ec1a976..7b9c4c3035 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -325,7 +325,6 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) registered_dialog = true; } - mCommitCallbackRegistrar.add("Pref.Apply", boost::bind(&LLFloaterPreference::onBtnApply, this)); mCommitCallbackRegistrar.add("Pref.Cancel", boost::bind(&LLFloaterPreference::onBtnCancel, this)); mCommitCallbackRegistrar.add("Pref.OK", boost::bind(&LLFloaterPreference::onBtnOK, this)); @@ -788,6 +787,7 @@ void LLFloaterPreference::setHardwareDefaults() { LLFeatureManager::getInstance()->applyRecommendedSettings(); refreshEnabledGraphics(); + LLTabContainer* tabcontainer = getChild("pref core"); child_list_t::const_iterator iter = tabcontainer->getChildList()->begin(); child_list_t::const_iterator end = tabcontainer->getChildList()->end(); @@ -884,24 +884,11 @@ void LLFloaterPreference::onBtnOK() LLFloaterPathfindingConsole* pPathfindingConsole = pathfindingConsoleHandle.get(); pPathfindingConsole->onRegionBoundaryCross(); } - -} -// static -void LLFloaterPreference::onBtnApply( ) -{ - if (hasFocus()) + if (LLStartUp::getStartupState() == STATE_STARTED) { - LLUICtrl* cur_focus = dynamic_cast(gFocusMgr.getKeyboardFocus()); - if (cur_focus && cur_focus->acceptsTextInput()) - { - cur_focus->onCommit(); - } + LLPresetsManager::getInstance()->savePreset(PRESETS_GRAPHIC, gSavedSettings.getString("PresetGraphicActive")); } - apply(); - saveSettings(); - - LLPanelLogin::updateLocationSelectorsVisibility(); } // static @@ -2115,7 +2102,6 @@ void LLPanelPreference::onChangePreset(const LLSD& user_data) LLComboBox* combo = getChild(subdirectory + "_preset_combo"); std::string name = combo->getSimple(); - LLPresetsManager::getInstance()->loadPreset(subdirectory, name); LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); if (instance) @@ -2194,19 +2180,6 @@ void LLPanelPreferenceGraphics::setPresetNamesInComboBox() LLPresetsManager::getInstance()->setPresetNamesInComboBox(PRESETS_GRAPHIC, combo, option); } -void LLPanelPreferenceGraphics::draw() -{ - LLPanelPreference::draw(); - - LLButton* button_apply = findChild("Apply"); - - if (button_apply && button_apply->getVisible()) - { - bool enable = hasDirtyChilds(); - - button_apply->setEnabled(enable); - } -} bool LLPanelPreferenceGraphics::hasDirtyChilds() { std::list view_stack; @@ -2256,11 +2229,7 @@ void LLPanelPreferenceGraphics::resetDirtyChilds() } } } -void LLPanelPreferenceGraphics::apply() -{ - resetDirtyChilds(); - LLPanelPreference::apply(); -} + void LLPanelPreferenceGraphics::cancel() { resetDirtyChilds(); -- cgit v1.2.3 From 5be238b127ff30f09105ad6f0d9b8ee3dec8b40f Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Thu, 4 Dec 2014 14:27:15 -0500 Subject: STORM-2082 Revert name of Reset button from Undo back to Reset. Hopefully this will be renamed Recommended Settings. Display a test icon (artwork needed) in the pulldown panel --- indra/newview/llfloaterpreference.cpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 7b9c4c3035..7b252ebd4f 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -342,7 +342,6 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.LogPath", boost::bind(&LLFloaterPreference::onClickLogPath, this)); mCommitCallbackRegistrar.add("Pref.HardwareSettings", boost::bind(&LLFloaterPreference::onOpenHardwareSettings, this)); mCommitCallbackRegistrar.add("Pref.HardwareDefaults", boost::bind(&LLFloaterPreference::setHardwareDefaults, this)); - mCommitCallbackRegistrar.add("Pref.Recommended", boost::bind(&LLFloaterPreference::setRecommended, this)); mCommitCallbackRegistrar.add("Pref.VertexShaderEnable", boost::bind(&LLFloaterPreference::onVertexShaderEnable, this)); mCommitCallbackRegistrar.add("Pref.WindowedMod", boost::bind(&LLFloaterPreference::onCommitWindowedMode, this)); mCommitCallbackRegistrar.add("Pref.UpdateSliderText", boost::bind(&LLFloaterPreference::refreshUI,this)); @@ -798,13 +797,6 @@ void LLFloaterPreference::setHardwareDefaults() if (panel) panel->setHardwareDefaults(); } -} - -void LLFloaterPreference::setRecommended() -{ - LLFeatureManager::getInstance()->applyRecommendedSettings(); - - refreshEnabledGraphics(); LLPresetsManager::getInstance()->savePreset(PRESETS_GRAPHIC, PRESETS_DEFAULT); } -- cgit v1.2.3 From 47282ceb7e8b8083cf816dd26bd4907aba313959 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 9 Dec 2014 16:48:00 -0500 Subject: STORM-2082 Improve file error handling, add help topic labels to new floaters. --- indra/newview/llfloaterpreference.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 7b252ebd4f..e0c579f783 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -879,6 +879,9 @@ void LLFloaterPreference::onBtnOK() if (LLStartUp::getStartupState() == STATE_STARTED) { + // Write settings to currently defined preset. This will recreate a missing preset file + // and ensure the preset file matches the current settings (which may have been changed + // via some other means). LLPresetsManager::getInstance()->savePreset(PRESETS_GRAPHIC, gSavedSettings.getString("PresetGraphicActive")); } } -- cgit v1.2.3 From 8d12072979ee46a1eb2d13fdfef8bef62ff3f619 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 12 Dec 2014 11:13:11 -0500 Subject: STORM-2082 Merge Hardware floater into main graphics preferences display Change notifications so they are emitted only when an error occurs Put active preset at top of list Add Maximum ARC slider Merge two small methods into slider update code --- indra/newview/llfloaterpreference.cpp | 168 +++++++++++++++++++++++----------- 1 file changed, 116 insertions(+), 52 deletions(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index e0c579f783..c7b4ae8ddc 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -48,7 +48,6 @@ //#include "llfirstuse.h" #include "llfloaterreg.h" #include "llfloaterabout.h" -#include "llfloaterhardwaresettings.h" #include "llfloatersidepanelcontainer.h" #include "llfloaterimsession.h" #include "llkeyboard.h" @@ -112,6 +111,7 @@ #include "llviewercontrol.h" #include "llpresetsmanager.h" #include "llfeaturemanager.h" +#include "llviewertexturelist.h" const F32 MAX_USER_FAR_CLIP = 512.f; const F32 MIN_USER_FAR_CLIP = 64.f; @@ -549,12 +549,6 @@ void LLFloaterPreference::apply() if (panel) panel->apply(); } - // hardware menu apply - LLFloaterHardwareSettings* hardware_settings = LLFloaterReg::getTypedInstance("prefs_hardware_settings"); - if (hardware_settings) - { - hardware_settings->apply(); - } gViewerWindow->requestResolutionUpdate(); // for UIScaleFactor @@ -632,13 +626,6 @@ void LLFloaterPreference::cancel() // hide spellchecker settings folder LLFloaterReg::hideInstance("prefs_spellchecker"); - // cancel hardware menu - LLFloaterHardwareSettings* hardware_settings = LLFloaterReg::getTypedInstance("prefs_hardware_settings"); - if (hardware_settings) - { - hardware_settings->cancel(); - } - // reverts any changes to current skin gSavedSettings.setString("SkinCurrent", sSkin); @@ -921,11 +908,6 @@ void LLFloaterPreference::refreshEnabledGraphics() instance->refresh(); //instance->refreshEnabledState(); } - LLFloaterHardwareSettings* hardware_settings = LLFloaterReg::getTypedInstance("prefs_hardware_settings"); - if (hardware_settings) - { - hardware_settings->refreshEnabledState(); - } } void LLFloaterPreference::onClickClearCache() @@ -1201,7 +1183,61 @@ void LLFloaterPreference::refreshEnabledState() enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderShadowDetail"); ctrl_shadow->setEnabled(enabled); - + + // Hardware settings + F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple"); + S32Megabytes min_tex_mem = LLViewerTextureList::getMinVideoRamSetting(); + S32Megabytes max_tex_mem = LLViewerTextureList::getMaxVideoRamSetting(false, mem_multiplier); + getChild("GraphicsCardTextureMemory")->setMinValue(min_tex_mem.value()); + getChild("GraphicsCardTextureMemory")->setMaxValue(max_tex_mem.value()); + + if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderVBOEnable") || + !gGLManager.mHasVertexBufferObject) + { + getChildView("vbo")->setEnabled(FALSE); + } + + if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderCompressTextures") || + !gGLManager.mHasVertexBufferObject) + { + getChildView("texture compression")->setEnabled(FALSE); + } + + // if no windlight shaders, turn off nighttime brightness, gamma, and fog distance + LLUICtrl* gamma_ctrl = getChild("gamma"); + gamma_ctrl->setEnabled(!gPipeline.canUseWindLightShaders()); + getChildView("(brightness, lower is brighter)")->setEnabled(!gPipeline.canUseWindLightShaders()); + getChildView("fog")->setEnabled(!gPipeline.canUseWindLightShaders()); + + /* Disabling this block of code because canUseAntiAliasing currently always returns true + // anti-aliasing + LLComboBox* fsaa_ctrl = getChild("fsaa"); + LLTextBox* fsaa_text = getChild("antialiasing label"); + LLTextBox* fsaa_restart = getChild("antialiasing restart"); + + // Enable or disable the control, the "Antialiasing:" label and the restart warning + // based on code support for the feature on the current hardware. + + if (gPipeline.canUseAntiAliasing()) + { + fsaa_ctrl->setEnabled(TRUE); + + LLColor4 color = LLUIColorTable::instance().getColor("LabelTextColor"); + fsaa_text->setColor(color); + + fsaa_restart->setVisible(!gSavedSettings.getBOOL("RenderDeferred")); + } + else + { + fsaa_ctrl->setEnabled(FALSE); + fsaa_ctrl->setValue((LLSD::Integer) 0); + + LLColor4 color = LLUIColorTable::instance().getColor("LabelDisabledColor"); + fsaa_text->setColor(color); + + fsaa_restart->setVisible(FALSE); + } + */ // now turn off any features that are unavailable disableUnavailableSettings(); @@ -1365,23 +1401,26 @@ void LLFloaterPreference::refresh() { LLPanel::refresh(); + getChild("fsaa")->setValue((LLSD::Integer) gSavedSettings.getU32("RenderFSAASamples")); + refreshEnabledState(); // sliders and their text boxes // mPostProcess = gSavedSettings.getS32("RenderGlowResolutionPow"); // slider text boxes - updateSliderText(getChild("ObjectMeshDetail", true), getChild("ObjectMeshDetailText", true)); - updateSliderText(getChild("FlexibleMeshDetail", true), getChild("FlexibleMeshDetailText", true)); - updateSliderText(getChild("TreeMeshDetail", true), getChild("TreeMeshDetailText", true)); - updateSliderText(getChild("AvatarMeshDetail", true), getChild("AvatarMeshDetailText", true)); - updateSliderText(getChild("AvatarMeshDetail2", true), getChild("AvatarMeshDetailText2", true)); - updateSliderText(getChild("AvatarPhysicsDetail", true), getChild("AvatarPhysicsDetailText", true)); - updateSliderText(getChild("TerrainMeshDetail", true), getChild("TerrainMeshDetailText", true)); - updateSliderText(getChild("RenderPostProcess", true), getChild("PostProcessText", true)); - updateSliderText(getChild("SkyMeshDetail", true), getChild("SkyMeshDetailText", true)); - updateSliderText(getChild("TerrainDetail", true), getChild("TerrainDetailText", true)); - updateReflectionsText(getChild("Reflections", true), getChild("ReflectionsText", true)); - updateShadowDetailText(getChild("ShadowDetail", true), getChild("RenderShadowDetailText", true)); + updateSliderText(getChild("ObjectMeshDetail", true), getChild("ObjectMeshDetailText", true), "ObjectMeshDetail"); + updateSliderText(getChild("FlexibleMeshDetail", true), getChild("FlexibleMeshDetailText", true), "FlexibleMeshDetail"); + updateSliderText(getChild("TreeMeshDetail", true), getChild("TreeMeshDetailText", true), "TreeMeshDetail"); + updateSliderText(getChild("AvatarMeshDetail", true), getChild("AvatarMeshDetailText", true), "AvatarMeshDetail"); + updateSliderText(getChild("AvatarMeshDetail2", true), getChild("AvatarMeshDetailText2", true), "AvatarMeshDetail2"); + updateSliderText(getChild("AvatarPhysicsDetail", true), getChild("AvatarPhysicsDetailText", true), "AvatarPhysicsDetail"); + updateSliderText(getChild("TerrainMeshDetail", true), getChild("TerrainMeshDetailText", true), "TerrainMeshDetail"); + updateSliderText(getChild("RenderPostProcess", true), getChild("PostProcessText", true), "RenderPostProcess"); + updateSliderText(getChild("SkyMeshDetail", true), getChild("SkyMeshDetailText", true), "SkyMeshDetail"); + updateSliderText(getChild("TerrainDetail", true), getChild("TerrainDetailText", true), "TerrainDetail"); + updateSliderText(getChild("MaximumARC", true), getChild("MaximumARCText", true), "MaximumARC"); + updateSliderText(getChild("Reflections", true), getChild("ReflectionsText", true), "Reflections"); + updateSliderText(getChild("ShadowDetail", true), getChild("RenderShadowDetailText", true), "ShadowDetail"); } void LLFloaterPreference::onCommitWindowedMode() @@ -1633,24 +1672,7 @@ void LLFloaterPreference::refreshUI() refresh(); } -void LLFloaterPreference::updateReflectionsText(LLSliderCtrl* ctrl, LLTextBox* text_box) -{ - if (text_box == NULL || ctrl== NULL) - return; - - U32 value = (U32)ctrl->getValue().asInteger(); - text_box->setText(getString("Reflections" + llformat("%d", value))); -} -void LLFloaterPreference::updateShadowDetailText(LLSliderCtrl* ctrl, LLTextBox* text_box) -{ - if (text_box == NULL || ctrl== NULL) - return; - - U32 value = (U32)ctrl->getValue().asInteger(); - text_box->setText(getString("RenderShadowDetail" + llformat("%d", value))); -} - -void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box) +void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box, const std::string& name) { if (text_box == NULL || ctrl== NULL) return; @@ -1663,7 +1685,21 @@ void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_b llassert(range > 0); F32 midPoint = min + range / 3.0f; F32 highPoint = min + (2.0f * range / 3.0f); - + + if ("ShadowDetail" == name) + { + U32 value = (U32)ctrl->getValue().asInteger(); + text_box->setText(getString("RenderShadowDetail" + llformat("%d", value))); + return; + } + + if ("Reflections" == name) + { + U32 value = (U32)ctrl->getValue().asInteger(); + text_box->setText(getString("Reflections" + llformat("%d", value))); + return; + } + // choose the right text if (value < midPoint) { @@ -1677,6 +1713,22 @@ void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_b { text_box->setText(LLTrans::getString("GraphicsQualityHigh")); } + + if ("MaximumARC" == name) + { + F32 control_value = value; + if (0.0f == control_value) + { + text_box->setText(LLTrans::getString("Off")); + } + else + { + // 13 is the maximum value of this control set in panel_preferences_graphics1.xml + control_value = exp(13.0f - control_value) + 20000.0f; + } + + gSavedSettings.setU32("RenderAutoMuteRenderWeightLimit", (U32)control_value); + } } void LLFloaterPreference::onChangeMaturity() @@ -2152,6 +2204,18 @@ static LLPanelInjector t_pref_privacy("panel_preferenc BOOL LLPanelPreferenceGraphics::postBuild() { +// Don't do this on Mac as their braindead GL versioning +// sets this when 8x and 16x are indeed available +// +#if !LL_DARWIN + if (gGLManager.mIsIntel || gGLManager.mGLVersion < 3.f) + { //remove FSAA settings above "4x" + LLComboBox* combo = getChild("fsaa"); + combo->remove("8x"); + combo->remove("16x"); + } +#endif + LLComboBox* combo = getChild("graphic_preset_combo"); combo->setLabel(LLTrans::getString("preset_combo_label")); @@ -2171,7 +2235,7 @@ void LLPanelPreferenceGraphics::setPresetNamesInComboBox() { LLComboBox* combo = getChild("graphic_preset_combo"); - EDefaultOptions option = DEFAULT_POSITION_TOP; + EDefaultOptions option = DEFAULT_SHOW; LLPresetsManager::getInstance()->setPresetNamesInComboBox(PRESETS_GRAPHIC, combo, option); } -- cgit v1.2.3 From e713ef765f268af1cba0f7b04f1e331332630e97 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sat, 13 Dec 2014 06:28:12 -0500 Subject: STORM-2082 Write out settings to preset file if settings changed on the login page Code improvements from bitbucket comments --- indra/newview/llfloaterpreference.cpp | 75 ++++++++++++++++++++--------------- 1 file changed, 44 insertions(+), 31 deletions(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index c7b4ae8ddc..6e5b75e80b 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -864,13 +864,10 @@ void LLFloaterPreference::onBtnOK() pPathfindingConsole->onRegionBoundaryCross(); } - if (LLStartUp::getStartupState() == STATE_STARTED) - { - // Write settings to currently defined preset. This will recreate a missing preset file - // and ensure the preset file matches the current settings (which may have been changed - // via some other means). - LLPresetsManager::getInstance()->savePreset(PRESETS_GRAPHIC, gSavedSettings.getString("PresetGraphicActive")); - } + // Write settings to currently defined preset. This will recreate a missing preset file + // and ensure the preset file matches the current settings (which may have been changed + // via some other means). + LLPresetsManager::getInstance()->savePreset(PRESETS_GRAPHIC, gSavedSettings.getString("PresetGraphicActive")); } // static @@ -1208,6 +1205,7 @@ void LLFloaterPreference::refreshEnabledState() gamma_ctrl->setEnabled(!gPipeline.canUseWindLightShaders()); getChildView("(brightness, lower is brighter)")->setEnabled(!gPipeline.canUseWindLightShaders()); getChildView("fog")->setEnabled(!gPipeline.canUseWindLightShaders()); + getChildView("antialiasing restart")->setVisible(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred")); /* Disabling this block of code because canUseAntiAliasing currently always returns true // anti-aliasing @@ -1408,19 +1406,19 @@ void LLFloaterPreference::refresh() // sliders and their text boxes // mPostProcess = gSavedSettings.getS32("RenderGlowResolutionPow"); // slider text boxes - updateSliderText(getChild("ObjectMeshDetail", true), getChild("ObjectMeshDetailText", true), "ObjectMeshDetail"); - updateSliderText(getChild("FlexibleMeshDetail", true), getChild("FlexibleMeshDetailText", true), "FlexibleMeshDetail"); - updateSliderText(getChild("TreeMeshDetail", true), getChild("TreeMeshDetailText", true), "TreeMeshDetail"); - updateSliderText(getChild("AvatarMeshDetail", true), getChild("AvatarMeshDetailText", true), "AvatarMeshDetail"); - updateSliderText(getChild("AvatarMeshDetail2", true), getChild("AvatarMeshDetailText2", true), "AvatarMeshDetail2"); - updateSliderText(getChild("AvatarPhysicsDetail", true), getChild("AvatarPhysicsDetailText", true), "AvatarPhysicsDetail"); - updateSliderText(getChild("TerrainMeshDetail", true), getChild("TerrainMeshDetailText", true), "TerrainMeshDetail"); - updateSliderText(getChild("RenderPostProcess", true), getChild("PostProcessText", true), "RenderPostProcess"); - updateSliderText(getChild("SkyMeshDetail", true), getChild("SkyMeshDetailText", true), "SkyMeshDetail"); - updateSliderText(getChild("TerrainDetail", true), getChild("TerrainDetailText", true), "TerrainDetail"); - updateSliderText(getChild("MaximumARC", true), getChild("MaximumARCText", true), "MaximumARC"); - updateSliderText(getChild("Reflections", true), getChild("ReflectionsText", true), "Reflections"); - updateSliderText(getChild("ShadowDetail", true), getChild("RenderShadowDetailText", true), "ShadowDetail"); + updateSliderText(getChild("ObjectMeshDetail", true), getChild("ObjectMeshDetailText", true)); + updateSliderText(getChild("FlexibleMeshDetail", true), getChild("FlexibleMeshDetailText", true)); + updateSliderText(getChild("TreeMeshDetail", true), getChild("TreeMeshDetailText", true)); + updateSliderText(getChild("AvatarMeshDetail", true), getChild("AvatarMeshDetailText", true)); + updateSliderText(getChild("AvatarMeshDetail2", true), getChild("AvatarMeshDetailText2", true)); + updateSliderText(getChild("AvatarPhysicsDetail", true), getChild("AvatarPhysicsDetailText", true)); + updateSliderText(getChild("TerrainMeshDetail", true), getChild("TerrainMeshDetailText", true)); + updateSliderText(getChild("RenderPostProcess", true), getChild("PostProcessText", true)); + updateSliderText(getChild("SkyMeshDetail", true), getChild("SkyMeshDetailText", true)); + updateSliderText(getChild("TerrainDetail", true), getChild("TerrainDetailText", true)); + updateSliderText(getChild("MaximumARC", true), getChild("MaximumARCText", true)); + updateSliderText(getChild("Reflections", true), getChild("ReflectionsText", true)); + updateSliderText(getChild("ShadowDetail", true), getChild("RenderShadowDetailText", true)); } void LLFloaterPreference::onCommitWindowedMode() @@ -1672,19 +1670,12 @@ void LLFloaterPreference::refreshUI() refresh(); } -void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box, const std::string& name) +void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box) { if (text_box == NULL || ctrl== NULL) return; - // get range and points when text should change - F32 value = (F32)ctrl->getValue().asReal(); - F32 min = ctrl->getMinValue(); - F32 max = ctrl->getMaxValue(); - F32 range = max - min; - llassert(range > 0); - F32 midPoint = min + range / 3.0f; - F32 highPoint = min + (2.0f * range / 3.0f); + std::string name = ctrl->getName(); if ("ShadowDetail" == name) { @@ -1700,6 +1691,15 @@ void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_b return; } + // get range and points when text should change + F32 value = (F32)ctrl->getValue().asReal(); + F32 min = ctrl->getMinValue(); + F32 max = ctrl->getMaxValue(); + F32 range = max - min; + llassert(range > 0); + F32 midPoint = min + range / 3.0f; + F32 highPoint = min + (2.0f * range / 3.0f); + // choose the right text if (value < midPoint) { @@ -1723,8 +1723,21 @@ void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_b } else { - // 13 is the maximum value of this control set in panel_preferences_graphics1.xml - control_value = exp(13.0f - control_value) + 20000.0f; + // 100 is the maximum value of this control set in panel_preferences_graphics1.xml + F32 minp = 0.0f; + F32 maxp = 100.0f; + + // The result should be between 20,000 and 500,000 + F32 minv = log(20000.0f); + F32 maxv = log(500000.0f); + + // calculate adjustment factor + F32 scale = (maxv - minv) / (maxp - minp); + + control_value = exp(minv + scale * (control_value - minp)); + + // Invert result + control_value = 500000.0f - control_value; } gSavedSettings.setU32("RenderAutoMuteRenderWeightLimit", (U32)control_value); -- cgit v1.2.3 From c655ae00a1e9d3540a9280181766bd4f646e1cce Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sat, 13 Dec 2014 20:53:27 -0500 Subject: STORM-2082 When a control is greyed out make sure it's associated text is greyed out. Sky: has two dependencies; grey it out when either one is not available. Remove Basic Shaders from Basic tab --- indra/newview/llfloaterpreference.cpp | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 6e5b75e80b..814e552027 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1088,12 +1088,14 @@ void LLFloaterPreference::buildPopupLists() void LLFloaterPreference::refreshEnabledState() { LLUICtrl* ctrl_reflections = getChild("Reflections"); + LLTextBox* reflections_text = getChild("ReflectionsText"); // Reflections BOOL reflections = gSavedSettings.getBOOL("VertexShaderEnable") && gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps; ctrl_reflections->setEnabled(reflections); + reflections_text->setEnabled(reflections); // Bump & Shiny LLCheckBoxCtrl* bumpshiny_ctrl = getChild("BumpShiny"); @@ -1129,6 +1131,7 @@ void LLFloaterPreference::refreshEnabledState() // Global Shader Enable LLCheckBoxCtrl* ctrl_shader_enable = getChild("BasicShaders"); LLSliderCtrl* terrain_detail = getChild("TerrainDetail"); // can be linked with control var + LLTextBox* terrain_text = getChild("TerrainDetailText"); ctrl_shader_enable->setEnabled(LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable")); @@ -1137,19 +1140,26 @@ void LLFloaterPreference::refreshEnabledState() { terrain_detail->setValue(1); terrain_detail->setEnabled(FALSE); + terrain_text->setEnabled(false); } else { - terrain_detail->setEnabled(TRUE); + terrain_detail->setEnabled(TRUE); + terrain_text->setEnabled(true); } // WindLight LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); - + LLSliderCtrl* sky = getChild("SkyMeshDetail"); + LLTextBox* sky_text = getChild("SkyMeshDetailText"); + // *HACK just checks to see if we can use shaders... // maybe some cards that use shaders, but don't support windlight ctrl_wind_light->setEnabled(ctrl_shader_enable->getEnabled() && shaders); + sky->setEnabled(ctrl_wind_light->get() && shaders); + sky_text->setEnabled(ctrl_wind_light->get() && shaders); + //Deferred/SSAO/Shadows LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); LLCheckBoxCtrl* ctrl_deferred2 = getChild("UseLightShaders2"); @@ -1168,6 +1178,7 @@ void LLFloaterPreference::refreshEnabledState() LLCheckBoxCtrl* ctrl_ssao = getChild("UseSSAO"); LLCheckBoxCtrl* ctrl_dof = getChild("UseDoF"); LLUICtrl* ctrl_shadow = getChild("ShadowDetail"); + LLTextBox* shadow_text = getChild("RenderShadowDetailText"); // 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); @@ -1180,6 +1191,7 @@ void LLFloaterPreference::refreshEnabledState() enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderShadowDetail"); ctrl_shadow->setEnabled(enabled); + shadow_text->setEnabled(enabled); // Hardware settings F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple"); @@ -1249,6 +1261,7 @@ void LLFloaterPreference::refreshEnabledState() void LLFloaterPreference::disableUnavailableSettings() { LLUICtrl* ctrl_reflections = getChild("Reflections"); + LLTextBox* reflections_text = getChild("ReflectionsText"); LLCheckBoxCtrl* ctrl_avatar_vp = getChild("AvatarVertexProgram"); LLCheckBoxCtrl* ctrl_avatar_cloth = getChild("AvatarCloth"); LLCheckBoxCtrl* ctrl_shader_enable = getChild("BasicShaders"); @@ -1257,8 +1270,11 @@ void LLFloaterPreference::disableUnavailableSettings() LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); LLCheckBoxCtrl* ctrl_deferred2 = getChild("UseLightShaders2"); LLUICtrl* ctrl_shadows = getChild("ShadowDetail"); + LLTextBox* shadows_text = getChild("RenderShadowDetailText"); LLCheckBoxCtrl* ctrl_ssao = getChild("UseSSAO"); LLCheckBoxCtrl* ctrl_dof = getChild("UseDoF"); + LLSliderCtrl* sky = getChild("SkyMeshDetail"); + LLTextBox* sky_text = getChild("SkyMeshDetailText"); // if vertex shaders off, disable all shader related products if (!LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable")) @@ -1268,9 +1284,13 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_wind_light->setEnabled(FALSE); ctrl_wind_light->setValue(FALSE); - + + sky->setEnabled(false); + sky_text->setEnabled(false); + ctrl_reflections->setEnabled(FALSE); ctrl_reflections->setValue(0); + reflections_text->setEnabled(false); ctrl_avatar_vp->setEnabled(FALSE); ctrl_avatar_vp->setValue(FALSE); @@ -1280,6 +1300,7 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_shadows->setEnabled(FALSE); ctrl_shadows->setValue(0); + shadows_text->setEnabled(false); ctrl_ssao->setEnabled(FALSE); ctrl_ssao->setValue(FALSE); @@ -1299,9 +1320,13 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_wind_light->setEnabled(FALSE); ctrl_wind_light->setValue(FALSE); + sky->setEnabled(false); + sky_text->setEnabled(false); + //deferred needs windlight, disable deferred ctrl_shadows->setEnabled(FALSE); ctrl_shadows->setValue(0); + shadows_text->setEnabled(false); ctrl_ssao->setEnabled(FALSE); ctrl_ssao->setValue(FALSE); @@ -1321,6 +1346,7 @@ void LLFloaterPreference::disableUnavailableSettings() { ctrl_shadows->setEnabled(FALSE); ctrl_shadows->setValue(0); + shadows_text->setEnabled(false); ctrl_ssao->setEnabled(FALSE); ctrl_ssao->setValue(FALSE); @@ -1346,6 +1372,7 @@ void LLFloaterPreference::disableUnavailableSettings() { ctrl_shadows->setEnabled(FALSE); ctrl_shadows->setValue(0); + shadows_text->setEnabled(false); } // disabled reflections @@ -1353,6 +1380,7 @@ void LLFloaterPreference::disableUnavailableSettings() { ctrl_reflections->setEnabled(FALSE); ctrl_reflections->setValue(FALSE); + reflections_text->setEnabled(false); } // disabled av @@ -1367,6 +1395,7 @@ void LLFloaterPreference::disableUnavailableSettings() //deferred needs AvatarVP, disable deferred ctrl_shadows->setEnabled(FALSE); ctrl_shadows->setValue(0); + shadows_text->setEnabled(false); ctrl_ssao->setEnabled(FALSE); ctrl_ssao->setValue(FALSE); -- cgit v1.2.3 From 8f5ddebf0abfbcf73f25313214b06b98f2c7889c Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sun, 14 Dec 2014 19:17:52 -0500 Subject: STORM-2082 Remove ugly list of control names. Instead, obtain the list from the View data Remove a few remants used by the old hardware floater --- indra/newview/llfloaterpreference.cpp | 42 ++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 6 deletions(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 814e552027..9df7f82275 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -340,7 +340,6 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.ClickEnablePopup", boost::bind(&LLFloaterPreference::onClickEnablePopup, this)); mCommitCallbackRegistrar.add("Pref.ClickDisablePopup", boost::bind(&LLFloaterPreference::onClickDisablePopup, this)); mCommitCallbackRegistrar.add("Pref.LogPath", boost::bind(&LLFloaterPreference::onClickLogPath, this)); - mCommitCallbackRegistrar.add("Pref.HardwareSettings", boost::bind(&LLFloaterPreference::onOpenHardwareSettings, this)); mCommitCallbackRegistrar.add("Pref.HardwareDefaults", boost::bind(&LLFloaterPreference::setHardwareDefaults, this)); mCommitCallbackRegistrar.add("Pref.VertexShaderEnable", boost::bind(&LLFloaterPreference::onVertexShaderEnable, this)); mCommitCallbackRegistrar.add("Pref.WindowedMod", boost::bind(&LLFloaterPreference::onCommitWindowedMode, this)); @@ -788,6 +787,42 @@ void LLFloaterPreference::setHardwareDefaults() LLPresetsManager::getInstance()->savePreset(PRESETS_GRAPHIC, PRESETS_DEFAULT); } +void LLFloaterPreference::getControlNames(std::vector& names) +{ + LLView* view = findChild("display"); + if (view) + { + std::list stack; + stack.push_back(view); + while(!stack.empty()) + { + // Process view on top of the stack + LLView* curview = stack.front(); + stack.pop_front(); + + LLUICtrl* ctrl = dynamic_cast(curview); + if (ctrl) + { + LLControlVariable* control = ctrl->getControlVariable(); + if (control) + { + std::string control_name = control->getName(); + if (std::find(names.begin(), names.end(), control_name) == names.end()) + { + names.push_back(control_name); + } + } + } + + for (child_list_t::const_iterator iter = curview->getChildList()->begin(); + iter != curview->getChildList()->end(); ++iter) + { + stack.push_back(*iter); + } + } + } +} + //virtual void LLFloaterPreference::onClose(bool app_quitting) { @@ -799,11 +834,6 @@ void LLFloaterPreference::onClose(bool app_quitting) } } -void LLFloaterPreference::onOpenHardwareSettings() -{ - LLFloater* floater = LLFloaterReg::showInstance("prefs_hardware_settings"); - addDependentFloater(floater, FALSE); -} // static void LLFloaterPreference::onBtnOK() { -- cgit v1.2.3 From 6de394342d2a3bd15ab8889e04619591a09fd6c6 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 7 Jan 2015 18:38:31 -0500 Subject: STORM-2082 Add back labels for quality and speed slider Change two sliders back to comboboxes. Rename label "Other" to "General" Move Max ARC to top of that list Move Shaders block to above Mesh block --- indra/newview/llfloaterpreference.cpp | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 9df7f82275..6e340864bc 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1117,7 +1117,7 @@ void LLFloaterPreference::buildPopupLists() void LLFloaterPreference::refreshEnabledState() { - LLUICtrl* ctrl_reflections = getChild("Reflections"); + LLComboBox* ctrl_reflections = getChild("Reflections"); LLTextBox* reflections_text = getChild("ReflectionsText"); // Reflections @@ -1207,7 +1207,7 @@ void LLFloaterPreference::refreshEnabledState() LLCheckBoxCtrl* ctrl_ssao = getChild("UseSSAO"); LLCheckBoxCtrl* ctrl_dof = getChild("UseDoF"); - LLUICtrl* ctrl_shadow = getChild("ShadowDetail"); + LLComboBox* ctrl_shadow = getChild("ShadowDetail"); LLTextBox* shadow_text = getChild("RenderShadowDetailText"); // note, okay here to get from ctrl_deferred as it's twin, ctrl_deferred2 will alway match it @@ -1290,7 +1290,7 @@ void LLFloaterPreference::refreshEnabledState() void LLFloaterPreference::disableUnavailableSettings() { - LLUICtrl* ctrl_reflections = getChild("Reflections"); + LLComboBox* ctrl_reflections = getChild("Reflections"); LLTextBox* reflections_text = getChild("ReflectionsText"); LLCheckBoxCtrl* ctrl_avatar_vp = getChild("AvatarVertexProgram"); LLCheckBoxCtrl* ctrl_avatar_cloth = getChild("AvatarCloth"); @@ -1299,7 +1299,7 @@ void LLFloaterPreference::disableUnavailableSettings() LLCheckBoxCtrl* ctrl_avatar_impostors = getChild("AvatarImpostors"); LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); LLCheckBoxCtrl* ctrl_deferred2 = getChild("UseLightShaders2"); - LLUICtrl* ctrl_shadows = getChild("ShadowDetail"); + LLComboBox* ctrl_shadows = getChild("ShadowDetail"); LLTextBox* shadows_text = getChild("RenderShadowDetailText"); LLCheckBoxCtrl* ctrl_ssao = getChild("UseSSAO"); LLCheckBoxCtrl* ctrl_dof = getChild("UseDoF"); @@ -1476,8 +1476,6 @@ void LLFloaterPreference::refresh() updateSliderText(getChild("SkyMeshDetail", true), getChild("SkyMeshDetailText", true)); updateSliderText(getChild("TerrainDetail", true), getChild("TerrainDetailText", true)); updateSliderText(getChild("MaximumARC", true), getChild("MaximumARCText", true)); - updateSliderText(getChild("Reflections", true), getChild("ReflectionsText", true)); - updateSliderText(getChild("ShadowDetail", true), getChild("RenderShadowDetailText", true)); } void LLFloaterPreference::onCommitWindowedMode() @@ -1736,20 +1734,6 @@ void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_b std::string name = ctrl->getName(); - if ("ShadowDetail" == name) - { - U32 value = (U32)ctrl->getValue().asInteger(); - text_box->setText(getString("RenderShadowDetail" + llformat("%d", value))); - return; - } - - if ("Reflections" == name) - { - U32 value = (U32)ctrl->getValue().asInteger(); - text_box->setText(getString("Reflections" + llformat("%d", value))); - return; - } - // get range and points when text should change F32 value = (F32)ctrl->getValue().asReal(); F32 min = ctrl->getMinValue(); -- cgit v1.2.3 From d1bc2fe292edcea60b49ce8111a495974e9415a2 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 14 Jan 2015 19:55:58 -0500 Subject: STORM-2082 Assorted UI tweaks, better MaximumARC formula, pulldowns disappear faster --- indra/newview/llfloaterpreference.cpp | 54 +++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 24 deletions(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 6e340864bc..4b83b104fd 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1475,7 +1475,7 @@ void LLFloaterPreference::refresh() updateSliderText(getChild("RenderPostProcess", true), getChild("PostProcessText", true)); updateSliderText(getChild("SkyMeshDetail", true), getChild("SkyMeshDetailText", true)); updateSliderText(getChild("TerrainDetail", true), getChild("TerrainDetailText", true)); - updateSliderText(getChild("MaximumARC", true), getChild("MaximumARCText", true)); + updateMaximumArcText(getChild("MaximumARC", true), getChild("MaximumARCText", true)); } void LLFloaterPreference::onCommitWindowedMode() @@ -1731,8 +1731,6 @@ void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_b { if (text_box == NULL || ctrl== NULL) return; - - std::string name = ctrl->getName(); // get range and points when text should change F32 value = (F32)ctrl->getValue().asReal(); @@ -1756,35 +1754,43 @@ void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_b { text_box->setText(LLTrans::getString("GraphicsQualityHigh")); } +} + +void LLFloaterPreference::updateMaximumArcText(LLSliderCtrl* ctrl, LLTextBox* text_box) +{ + F32 min_result = 20000.0f; + F32 max_result = 300000.0f; - if ("MaximumARC" == name) + F32 value = (F32)ctrl->getValue().asReal(); + + if (0.0f == value) + { + text_box->setText(LLTrans::getString("Off")); + } + else { - F32 control_value = value; - if (0.0f == control_value) - { - text_box->setText(LLTrans::getString("Off")); - } - else - { - // 100 is the maximum value of this control set in panel_preferences_graphics1.xml - F32 minp = 0.0f; - F32 maxp = 100.0f; - // The result should be between 20,000 and 500,000 - F32 minv = log(20000.0f); - F32 maxv = log(500000.0f); + // Invert value because a higher value on the slider control needs a decreasing final + // value in order to obtain larger numbers of imposters + value = 100.0f - value; - // calculate adjustment factor - F32 scale = (maxv - minv) / (maxp - minp); + // 100 is the maximum value of this control set in panel_preferences_graphics1.xml + F32 minp = 0.0f; + F32 maxp = 99.0f; - control_value = exp(minv + scale * (control_value - minp)); + // The result should be between min_result and max_result + F32 minv = log(min_result); + F32 maxv = log(max_result); - // Invert result - control_value = 500000.0f - control_value; - } + // calculate adjustment factor + F32 scale = (maxv - minv) / (maxp - minp); - gSavedSettings.setU32("RenderAutoMuteRenderWeightLimit", (U32)control_value); + value = exp(minv + scale * (value - minp)); + + text_box->setText(llformat("%0.0f", value)); } + + gSavedSettings.setU32("RenderAutoMuteRenderWeightLimit", (U32)value); } void LLFloaterPreference::onChangeMaturity() -- cgit v1.2.3 From ce324355787bd9c1c864050ca54b4306c30a0e79 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Thu, 15 Jan 2015 16:43:43 -0500 Subject: STORM-2082 Use correct icon for checkmark Redo UI layout to indicate the two dependencies on the Imposters checkbox Reverse the ARC slider --- indra/newview/llfloaterpreference.cpp | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 4b83b104fd..cb59cc27d7 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -341,6 +341,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.ClickDisablePopup", boost::bind(&LLFloaterPreference::onClickDisablePopup, this)); mCommitCallbackRegistrar.add("Pref.LogPath", boost::bind(&LLFloaterPreference::onClickLogPath, this)); mCommitCallbackRegistrar.add("Pref.HardwareDefaults", boost::bind(&LLFloaterPreference::setHardwareDefaults, this)); + mCommitCallbackRegistrar.add("Pref.AvatarImpostorsEnable", boost::bind(&LLFloaterPreference::onAvatarImpostorsEnable, this)); mCommitCallbackRegistrar.add("Pref.VertexShaderEnable", boost::bind(&LLFloaterPreference::onVertexShaderEnable, this)); mCommitCallbackRegistrar.add("Pref.WindowedMod", boost::bind(&LLFloaterPreference::onCommitWindowedMode, this)); mCommitCallbackRegistrar.add("Pref.UpdateSliderText", boost::bind(&LLFloaterPreference::refreshUI,this)); @@ -748,6 +749,11 @@ void LLFloaterPreference::onVertexShaderEnable() refreshEnabledGraphics(); } +void LLFloaterPreference::onAvatarImpostorsEnable() +{ + refreshEnabledGraphics(); +} + //static void LLFloaterPreference::initDoNotDisturbResponse() { @@ -1223,6 +1229,13 @@ void LLFloaterPreference::refreshEnabledState() ctrl_shadow->setEnabled(enabled); shadow_text->setEnabled(enabled); + LLTextBox* maximum_arc_text = getChild("MaximumARCText"); + + enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderUseImpostors") && gSavedSettings.getBOOL("RenderUseImpostors"); + getChildView("MaximumARC")->setEnabled(enabled); + maximum_arc_text->setEnabled(enabled); + getChildView("MaxNumberAvatarDrawn")->setEnabled(enabled); + // Hardware settings F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple"); S32Megabytes min_tex_mem = LLViewerTextureList::getMinVideoRamSetting(); @@ -1297,6 +1310,9 @@ void LLFloaterPreference::disableUnavailableSettings() LLCheckBoxCtrl* ctrl_shader_enable = getChild("BasicShaders"); LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); LLCheckBoxCtrl* ctrl_avatar_impostors = getChild("AvatarImpostors"); + LLSliderCtrl* ctrl_maximum_arc = getChild("MaximumARC"); + LLTextBox* maximum_arc_text = getChild("MaximumARCText"); + LLSliderCtrl* ctrl_max_visible = getChild("MaxNumberAvatarDrawn"); LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); LLCheckBoxCtrl* ctrl_deferred2 = getChild("UseLightShaders2"); LLComboBox* ctrl_shadows = getChild("ShadowDetail"); @@ -1451,6 +1467,9 @@ void LLFloaterPreference::disableUnavailableSettings() { ctrl_avatar_impostors->setEnabled(FALSE); ctrl_avatar_impostors->setValue(FALSE); + ctrl_maximum_arc->setEnabled(FALSE); + maximum_arc_text->setEnabled(FALSE); + ctrl_max_visible->setEnabled(FALSE); } } @@ -1770,13 +1789,9 @@ void LLFloaterPreference::updateMaximumArcText(LLSliderCtrl* ctrl, LLTextBox* te else { - // Invert value because a higher value on the slider control needs a decreasing final - // value in order to obtain larger numbers of imposters - value = 100.0f - value; - // 100 is the maximum value of this control set in panel_preferences_graphics1.xml - F32 minp = 0.0f; - F32 maxp = 99.0f; + F32 minp = 1.0f; + F32 maxp = 100.0f; // The result should be between min_result and max_result F32 minv = log(min_result); -- cgit v1.2.3 From 611391a818746f560ad49847ae643613313ac216 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 20 Jan 2015 09:17:23 -0500 Subject: STORM-2082 Update to new UI design. Bugs are not worked out yet. --- indra/newview/llfloaterpreference.cpp | 123 ++++++++++++++++++++-------------- 1 file changed, 74 insertions(+), 49 deletions(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index cb59cc27d7..6dd030b280 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -107,6 +107,7 @@ #include "lllogininstance.h" // to check if logged in yet #include "llsdserialize.h" +#include "llpanelpresetspulldown.h" #include "llpresetsmanager.h" #include "llviewercontrol.h" #include "llpresetsmanager.h" @@ -735,11 +736,11 @@ void LLFloaterPreference::onOpen(const LLSD& key) bool started = (LLStartUp::getStartupState() == STATE_STARTED); - LLComboBox* combo = getChild("graphic_preset_combo"); + LLButton* load_btn = findChild("PrefLoadButton"); LLButton* save_btn = findChild("PrefSaveButton"); LLButton* delete_btn = findChild("PrefDeleteButton"); - combo->setEnabled(started); + load_btn->setEnabled(started); save_btn->setEnabled(started); delete_btn->setEnabled(started); } @@ -789,8 +790,6 @@ void LLFloaterPreference::setHardwareDefaults() if (panel) panel->setHardwareDefaults(); } - - LLPresetsManager::getInstance()->savePreset(PRESETS_GRAPHIC, PRESETS_DEFAULT); } void LLFloaterPreference::getControlNames(std::vector& names) @@ -899,11 +898,6 @@ void LLFloaterPreference::onBtnOK() LLFloaterPathfindingConsole* pPathfindingConsole = pathfindingConsoleHandle.get(); pPathfindingConsole->onRegionBoundaryCross(); } - - // Write settings to currently defined preset. This will recreate a missing preset file - // and ensure the preset file matches the current settings (which may have been changed - // via some other means). - LLPresetsManager::getInstance()->savePreset(PRESETS_GRAPHIC, gSavedSettings.getString("PresetGraphicActive")); } // static @@ -1156,11 +1150,11 @@ void LLFloaterPreference::refreshEnabledState() if (gSavedSettings.getBOOL("VertexShaderEnable") == FALSE || gSavedSettings.getBOOL("RenderAvatarVP") == FALSE) { - ctrl_avatar_cloth->setEnabled(false); + ctrl_avatar_cloth->setEnabled(FALSE); } else { - ctrl_avatar_cloth->setEnabled(true); + ctrl_avatar_cloth->setEnabled(TRUE); } // Vertex Shaders @@ -1174,14 +1168,16 @@ void LLFloaterPreference::refreshEnabledState() BOOL shaders = ctrl_shader_enable->get(); if (shaders) { +llwarns << "DBG terrain OFF" << llendl; terrain_detail->setValue(1); terrain_detail->setEnabled(FALSE); - terrain_text->setEnabled(false); + terrain_text->setEnabled(FALSE); } else { +llwarns << "DBG terrain ON" << llendl; terrain_detail->setEnabled(TRUE); - terrain_text->setEnabled(true); + terrain_text->setEnabled(TRUE); } // WindLight @@ -1331,12 +1327,12 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_wind_light->setEnabled(FALSE); ctrl_wind_light->setValue(FALSE); - sky->setEnabled(false); - sky_text->setEnabled(false); + sky->setEnabled(FALSE); + sky_text->setEnabled(FALSE); ctrl_reflections->setEnabled(FALSE); ctrl_reflections->setValue(0); - reflections_text->setEnabled(false); + reflections_text->setEnabled(FALSE); ctrl_avatar_vp->setEnabled(FALSE); ctrl_avatar_vp->setValue(FALSE); @@ -1346,7 +1342,7 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_shadows->setEnabled(FALSE); ctrl_shadows->setValue(0); - shadows_text->setEnabled(false); + shadows_text->setEnabled(FALSE); ctrl_ssao->setEnabled(FALSE); ctrl_ssao->setValue(FALSE); @@ -1366,13 +1362,13 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_wind_light->setEnabled(FALSE); ctrl_wind_light->setValue(FALSE); - sky->setEnabled(false); - sky_text->setEnabled(false); + sky->setEnabled(FALSE); + sky_text->setEnabled(FALSE); //deferred needs windlight, disable deferred ctrl_shadows->setEnabled(FALSE); ctrl_shadows->setValue(0); - shadows_text->setEnabled(false); + shadows_text->setEnabled(FALSE); ctrl_ssao->setEnabled(FALSE); ctrl_ssao->setValue(FALSE); @@ -1392,7 +1388,7 @@ void LLFloaterPreference::disableUnavailableSettings() { ctrl_shadows->setEnabled(FALSE); ctrl_shadows->setValue(0); - shadows_text->setEnabled(false); + shadows_text->setEnabled(FALSE); ctrl_ssao->setEnabled(FALSE); ctrl_ssao->setValue(FALSE); @@ -1418,7 +1414,7 @@ void LLFloaterPreference::disableUnavailableSettings() { ctrl_shadows->setEnabled(FALSE); ctrl_shadows->setValue(0); - shadows_text->setEnabled(false); + shadows_text->setEnabled(FALSE); } // disabled reflections @@ -1426,7 +1422,7 @@ void LLFloaterPreference::disableUnavailableSettings() { ctrl_reflections->setEnabled(FALSE); ctrl_reflections->setValue(FALSE); - reflections_text->setEnabled(false); + reflections_text->setEnabled(FALSE); } // disabled av @@ -1441,7 +1437,7 @@ void LLFloaterPreference::disableUnavailableSettings() //deferred needs AvatarVP, disable deferred ctrl_shadows->setEnabled(FALSE); ctrl_shadows->setValue(0); - shadows_text->setEnabled(false); + shadows_text->setEnabled(FALSE); ctrl_ssao->setEnabled(FALSE); ctrl_ssao->setValue(FALSE); @@ -1488,7 +1484,6 @@ void LLFloaterPreference::refresh() updateSliderText(getChild("FlexibleMeshDetail", true), getChild("FlexibleMeshDetailText", true)); updateSliderText(getChild("TreeMeshDetail", true), getChild("TreeMeshDetailText", true)); updateSliderText(getChild("AvatarMeshDetail", true), getChild("AvatarMeshDetailText", true)); - updateSliderText(getChild("AvatarMeshDetail2", true), getChild("AvatarMeshDetailText2", true)); updateSliderText(getChild("AvatarPhysicsDetail", true), getChild("AvatarPhysicsDetailText", true)); updateSliderText(getChild("TerrainMeshDetail", true), getChild("TerrainMeshDetailText", true)); updateSliderText(getChild("RenderPostProcess", true), getChild("PostProcessText", true)); @@ -1782,8 +1777,11 @@ void LLFloaterPreference::updateMaximumArcText(LLSliderCtrl* ctrl, LLTextBox* te F32 value = (F32)ctrl->getValue().asReal(); - if (0.0f == value) + if (101.0f == value) { + // It has been decided that having the slider all the way to the right will be the off position, which + // is a value of 101, so it is necessary to change value to 0 disable impostor generation. + value = 0.0f; text_box->setText(LLTrans::getString("Off")); } else @@ -2007,9 +2005,9 @@ LLPanelPreference::LLPanelPreference() { mCommitCallbackRegistrar.add("Pref.setControlFalse", boost::bind(&LLPanelPreference::setControlFalse,this, _2)); mCommitCallbackRegistrar.add("Pref.updateMediaAutoPlayCheckbox", boost::bind(&LLPanelPreference::updateMediaAutoPlayCheckbox, this, _1)); - mCommitCallbackRegistrar.add("Pref.Preset", boost::bind(&LLPanelPreference::onChangePreset, this, _2)); mCommitCallbackRegistrar.add("Pref.PrefDelete", boost::bind(&LLPanelPreference::DeletePreset, this, _2)); mCommitCallbackRegistrar.add("Pref.PrefSave", boost::bind(&LLPanelPreference::SavePreset, this, _2)); + mCommitCallbackRegistrar.add("Pref.PrefLoad", boost::bind(&LLPanelPreference::LoadPreset, this, _2)); } //virtual @@ -2219,19 +2217,10 @@ void LLPanelPreference::SavePreset(const LLSD& user_data) LLFloaterReg::showInstance("save_pref_preset", subdirectory); } -void LLPanelPreference::onChangePreset(const LLSD& user_data) +void LLPanelPreference::LoadPreset(const LLSD& user_data) { std::string subdirectory = user_data.asString(); - - LLComboBox* combo = getChild(subdirectory + "_preset_combo"); - std::string name = combo->getSimple(); - - LLPresetsManager::getInstance()->loadPreset(subdirectory, name); - LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); - if (instance) - { - instance->refreshEnabledGraphics(); - } + LLFloaterReg::showInstance("load_pref_preset", subdirectory); } void LLPanelPreference::setHardwareDefaults() @@ -2293,27 +2282,52 @@ BOOL LLPanelPreferenceGraphics::postBuild() } #endif - LLComboBox* combo = getChild("graphic_preset_combo"); - combo->setLabel(LLTrans::getString("preset_combo_label")); - - setPresetNamesInComboBox(); - + setPresetText(); LLPresetsManager::instance().setPresetListChangeCallback(boost::bind(&LLPanelPreferenceGraphics::onPresetsListChange, this)); return LLPanelPreference::postBuild(); } +void LLPanelPreferenceGraphics::draw() +{ + LLPanelPreference::draw(); + setPresetText(); +} + void LLPanelPreferenceGraphics::onPresetsListChange() { - setPresetNamesInComboBox(); + resetDirtyChilds(); + setPresetText(); } -void LLPanelPreferenceGraphics::setPresetNamesInComboBox() +void LLPanelPreferenceGraphics::setPresetText() { - LLComboBox* combo = getChild("graphic_preset_combo"); + LLTextBox* preset_text = getChild("preset_text"); - EDefaultOptions option = DEFAULT_SHOW; - LLPresetsManager::getInstance()->setPresetNamesInComboBox(PRESETS_GRAPHIC, combo, option); + if (hasDirtyChilds()) + { + gSavedSettings.setString("PresetGraphicActive", ""); + + LLPanelPresetsPulldown* instance = LLFloaterReg::findTypedInstance("presets_pulldown"); + if (instance) + { +llwarns << "DBG populate" << llendl; + instance->populatePanel(); + } + } + + std::string preset_graphic_active = gSavedSettings.getString("PresetGraphicActive"); + + if (!preset_graphic_active.empty()) + { + preset_text->setText(preset_graphic_active); + } + else + { + preset_text->setText(LLTrans::getString("none_paren_cap")); + } + + preset_text->resetDirty(); } bool LLPanelPreferenceGraphics::hasDirtyChilds() @@ -2330,7 +2344,18 @@ bool LLPanelPreferenceGraphics::hasDirtyChilds() if (ctrl) { if (ctrl->isDirty()) - return true; + { + LLControlVariable* control = ctrl->getControlVariable(); + if (control) + { + std::string control_name = control->getName(); + if ((control_name != "RenderDeferred") && (control_name != "RenderTerrainDetail")) + { +llwarns << "DBG " << control_name << llendl; + return true; + } + } + } } // Push children onto the end of the work stack for (child_list_t::const_iterator iter = curview->getChildList()->begin(); -- cgit v1.2.3 From 56f43a390015f3ba721554ef9a0e436b6bfad5f9 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 20 Jan 2015 13:35:26 -0500 Subject: STORM-2082 Still trying to work out the dirtyChilds issue. Also made some small UI adjustments. --- indra/newview/llfloaterpreference.cpp | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 6dd030b280..34c34ffd65 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -107,7 +107,6 @@ #include "lllogininstance.h" // to check if logged in yet #include "llsdserialize.h" -#include "llpanelpresetspulldown.h" #include "llpresetsmanager.h" #include "llviewercontrol.h" #include "llpresetsmanager.h" @@ -1168,14 +1167,12 @@ void LLFloaterPreference::refreshEnabledState() BOOL shaders = ctrl_shader_enable->get(); if (shaders) { -llwarns << "DBG terrain OFF" << llendl; terrain_detail->setValue(1); terrain_detail->setEnabled(FALSE); terrain_text->setEnabled(FALSE); } else { -llwarns << "DBG terrain ON" << llendl; terrain_detail->setEnabled(TRUE); terrain_text->setEnabled(TRUE); } @@ -2282,7 +2279,9 @@ BOOL LLPanelPreferenceGraphics::postBuild() } #endif + resetDirtyChilds(); setPresetText(); + LLPresetsManager::instance().setPresetListChangeCallback(boost::bind(&LLPanelPreferenceGraphics::onPresetsListChange, this)); return LLPanelPreference::postBuild(); @@ -2290,8 +2289,8 @@ BOOL LLPanelPreferenceGraphics::postBuild() void LLPanelPreferenceGraphics::draw() { - LLPanelPreference::draw(); setPresetText(); + LLPanelPreference::draw(); } void LLPanelPreferenceGraphics::onPresetsListChange() @@ -2307,13 +2306,9 @@ void LLPanelPreferenceGraphics::setPresetText() if (hasDirtyChilds()) { gSavedSettings.setString("PresetGraphicActive", ""); - - LLPanelPresetsPulldown* instance = LLFloaterReg::findTypedInstance("presets_pulldown"); - if (instance) - { -llwarns << "DBG populate" << llendl; - instance->populatePanel(); - } + // This doesn't seem to cause an infinite recursion. This trigger is needed to cause the pulldown + // panel to update. + LLPresetsManager::getInstance()->triggerChangeSignal(); } std::string preset_graphic_active = gSavedSettings.getString("PresetGraphicActive"); @@ -2326,8 +2321,6 @@ llwarns << "DBG populate" << llendl; { preset_text->setText(LLTrans::getString("none_paren_cap")); } - - preset_text->resetDirty(); } bool LLPanelPreferenceGraphics::hasDirtyChilds() @@ -2345,16 +2338,7 @@ bool LLPanelPreferenceGraphics::hasDirtyChilds() { if (ctrl->isDirty()) { - LLControlVariable* control = ctrl->getControlVariable(); - if (control) - { - std::string control_name = control->getName(); - if ((control_name != "RenderDeferred") && (control_name != "RenderTerrainDetail")) - { -llwarns << "DBG " << control_name << llendl; - return true; - } - } + return true; } } // Push children onto the end of the work stack @@ -2363,7 +2347,7 @@ llwarns << "DBG " << control_name << llendl; { view_stack.push_back(*iter); } - } + } return false; } -- cgit v1.2.3 From 58577702a8c185683e089afc3f7fbcbaaf40122c Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 20 Jan 2015 18:24:02 -0500 Subject: STORM-2082 Finally(?) deal properly with dirty UI processing. Code cleanup, some per bitbucket comments. --- indra/newview/llfloaterpreference.cpp | 43 ++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 16 deletions(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 34c34ffd65..5938566b0a 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -735,9 +735,9 @@ void LLFloaterPreference::onOpen(const LLSD& key) bool started = (LLStartUp::getStartupState() == STATE_STARTED); - LLButton* load_btn = findChild("PrefLoadButton"); - LLButton* save_btn = findChild("PrefSaveButton"); - LLButton* delete_btn = findChild("PrefDeleteButton"); + LLButton* load_btn = findChild("PrefLoadButton"); + LLButton* save_btn = findChild("PrefSaveButton"); + LLButton* delete_btn = findChild("PrefDeleteButton"); load_btn->setEnabled(started); save_btn->setEnabled(started); @@ -925,14 +925,12 @@ void LLFloaterPreference::updateUserInfo(const std::string& visibility, bool im_ } } - void LLFloaterPreference::refreshEnabledGraphics() { LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); if (instance) { instance->refresh(); - //instance->refreshEnabledState(); } } @@ -1179,12 +1177,14 @@ void LLFloaterPreference::refreshEnabledState() // WindLight LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); + LLCheckBoxCtrl* ctrl_wind_light2 = getChild("WindLightUseAtmosShaders2"); LLSliderCtrl* sky = getChild("SkyMeshDetail"); LLTextBox* sky_text = getChild("SkyMeshDetailText"); // *HACK just checks to see if we can use shaders... // maybe some cards that use shaders, but don't support windlight ctrl_wind_light->setEnabled(ctrl_shader_enable->getEnabled() && shaders); + ctrl_wind_light2->setEnabled(ctrl_shader_enable->getEnabled() && shaders); sky->setEnabled(ctrl_wind_light->get() && shaders); sky_text->setEnabled(ctrl_wind_light->get() && shaders); @@ -2002,9 +2002,9 @@ LLPanelPreference::LLPanelPreference() { mCommitCallbackRegistrar.add("Pref.setControlFalse", boost::bind(&LLPanelPreference::setControlFalse,this, _2)); mCommitCallbackRegistrar.add("Pref.updateMediaAutoPlayCheckbox", boost::bind(&LLPanelPreference::updateMediaAutoPlayCheckbox, this, _1)); - mCommitCallbackRegistrar.add("Pref.PrefDelete", boost::bind(&LLPanelPreference::DeletePreset, this, _2)); - mCommitCallbackRegistrar.add("Pref.PrefSave", boost::bind(&LLPanelPreference::SavePreset, this, _2)); - mCommitCallbackRegistrar.add("Pref.PrefLoad", boost::bind(&LLPanelPreference::LoadPreset, this, _2)); + mCommitCallbackRegistrar.add("Pref.PrefDelete", boost::bind(&LLPanelPreference::deletePreset, this, _2)); + mCommitCallbackRegistrar.add("Pref.PrefSave", boost::bind(&LLPanelPreference::savePreset, this, _2)); + mCommitCallbackRegistrar.add("Pref.PrefLoad", boost::bind(&LLPanelPreference::loadPreset, this, _2)); } //virtual @@ -2202,19 +2202,19 @@ void LLPanelPreference::updateMediaAutoPlayCheckbox(LLUICtrl* ctrl) } } -void LLPanelPreference::DeletePreset(const LLSD& user_data) +void LLPanelPreference::deletePreset(const LLSD& user_data) { std::string subdirectory = user_data.asString(); LLFloaterReg::showInstance("delete_pref_preset", subdirectory); } -void LLPanelPreference::SavePreset(const LLSD& user_data) +void LLPanelPreference::savePreset(const LLSD& user_data) { std::string subdirectory = user_data.asString(); LLFloaterReg::showInstance("save_pref_preset", subdirectory); } -void LLPanelPreference::LoadPreset(const LLSD& user_data) +void LLPanelPreference::loadPreset(const LLSD& user_data) { std::string subdirectory = user_data.asString(); LLFloaterReg::showInstance("load_pref_preset", subdirectory); @@ -2303,16 +2303,17 @@ void LLPanelPreferenceGraphics::setPresetText() { LLTextBox* preset_text = getChild("preset_text"); - if (hasDirtyChilds()) + std::string preset_graphic_active = gSavedSettings.getString("PresetGraphicActive"); + + if (hasDirtyChilds() && !preset_graphic_active.empty()) { gSavedSettings.setString("PresetGraphicActive", ""); + preset_graphic_active.clear(); // This doesn't seem to cause an infinite recursion. This trigger is needed to cause the pulldown // panel to update. LLPresetsManager::getInstance()->triggerChangeSignal(); } - std::string preset_graphic_active = gSavedSettings.getString("PresetGraphicActive"); - if (!preset_graphic_active.empty()) { preset_text->setText(preset_graphic_active); @@ -2321,6 +2322,8 @@ void LLPanelPreferenceGraphics::setPresetText() { preset_text->setText(LLTrans::getString("none_paren_cap")); } + + preset_text->resetDirty(); } bool LLPanelPreferenceGraphics::hasDirtyChilds() @@ -2338,7 +2341,15 @@ bool LLPanelPreferenceGraphics::hasDirtyChilds() { if (ctrl->isDirty()) { - return true; + LLControlVariable* control = ctrl->getControlVariable(); + if (control) + { + std::string control_name = control->getName(); + if (!control_name.empty()) + { + return true; + } + } } } // Push children onto the end of the work stack @@ -2348,6 +2359,7 @@ bool LLPanelPreferenceGraphics::hasDirtyChilds() view_stack.push_back(*iter); } } + return false; } @@ -2377,7 +2389,6 @@ void LLPanelPreferenceGraphics::resetDirtyChilds() void LLPanelPreferenceGraphics::cancel() { - resetDirtyChilds(); LLPanelPreference::cancel(); } void LLPanelPreferenceGraphics::saveSettings() -- cgit v1.2.3 From bdf55e9ea7106df2a61e352e7f87ad196f6b6f69 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sun, 25 Jan 2015 06:24:44 -0500 Subject: STORM-2082 Clear preset in use when resetting to hardware defaults --- indra/newview/llfloaterpreference.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 5938566b0a..17c93d792e 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -778,6 +778,8 @@ void LLFloaterPreference::setHardwareDefaults() { LLFeatureManager::getInstance()->applyRecommendedSettings(); refreshEnabledGraphics(); + gSavedSettings.setString("PresetGraphicActive", ""); + LLPresetsManager::getInstance()->triggerChangeSignal(); LLTabContainer* tabcontainer = getChild("pref core"); child_list_t::const_iterator iter = tabcontainer->getChildList()->begin(); -- cgit v1.2.3 From 45b59881ebcc19510c7e36398232f057366eb41d Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 3 Feb 2015 08:37:31 -0500 Subject: STORM-2082 Reformat preset floaters. Remove Impostor checkbox. That control is now merged into the right side of the impostors slider. Maximum ARC still depends on impostors being enabled. Once that dependency is removed in llvoavatar then it will be necessary to reflect that change in the UI code. --- indra/newview/llfloaterpreference.cpp | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 17c93d792e..cbd9867107 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1229,7 +1229,6 @@ void LLFloaterPreference::refreshEnabledState() enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderUseImpostors") && gSavedSettings.getBOOL("RenderUseImpostors"); getChildView("MaximumARC")->setEnabled(enabled); maximum_arc_text->setEnabled(enabled); - getChildView("MaxNumberAvatarDrawn")->setEnabled(enabled); // Hardware settings F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple"); @@ -1304,10 +1303,8 @@ void LLFloaterPreference::disableUnavailableSettings() LLCheckBoxCtrl* ctrl_avatar_cloth = getChild("AvatarCloth"); LLCheckBoxCtrl* ctrl_shader_enable = getChild("BasicShaders"); LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); - LLCheckBoxCtrl* ctrl_avatar_impostors = getChild("AvatarImpostors"); LLSliderCtrl* ctrl_maximum_arc = getChild("MaximumARC"); LLTextBox* maximum_arc_text = getChild("MaximumARCText"); - LLSliderCtrl* ctrl_max_visible = getChild("MaxNumberAvatarDrawn"); LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); LLCheckBoxCtrl* ctrl_deferred2 = getChild("UseLightShaders2"); LLComboBox* ctrl_shadows = getChild("ShadowDetail"); @@ -1460,11 +1457,8 @@ void LLFloaterPreference::disableUnavailableSettings() // disabled impostors if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderUseImpostors")) { - ctrl_avatar_impostors->setEnabled(FALSE); - ctrl_avatar_impostors->setValue(FALSE); ctrl_maximum_arc->setEnabled(FALSE); maximum_arc_text->setEnabled(FALSE); - ctrl_max_visible->setEnabled(FALSE); } } @@ -1474,8 +1468,6 @@ void LLFloaterPreference::refresh() getChild("fsaa")->setValue((LLSD::Integer) gSavedSettings.getU32("RenderFSAASamples")); - refreshEnabledState(); - // sliders and their text boxes // mPostProcess = gSavedSettings.getS32("RenderGlowResolutionPow"); // slider text boxes @@ -1488,7 +1480,10 @@ void LLFloaterPreference::refresh() updateSliderText(getChild("RenderPostProcess", true), getChild("PostProcessText", true)); updateSliderText(getChild("SkyMeshDetail", true), getChild("SkyMeshDetailText", true)); updateSliderText(getChild("TerrainDetail", true), getChild("TerrainDetailText", true)); + updateImpostorsText(getChild("MaxNumberAvatarDrawn", true), getChild("ImpostorsText", true)); updateMaximumArcText(getChild("MaximumARC", true), getChild("MaximumARCText", true)); + + refreshEnabledState(); } void LLFloaterPreference::onCommitWindowedMode() @@ -1769,6 +1764,25 @@ void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_b } } +void LLFloaterPreference::updateImpostorsText(LLSliderCtrl* ctrl, LLTextBox* text_box) +{ + F32 value = (F32)ctrl->getValue().asReal(); + + if (value < IMPOSTORS_OFF) + { + text_box->setText(llformat("%0.0f", value)); + if (!gSavedSettings.getBOOL("RenderUseImpostors")) + { + gSavedSettings.setBOOL("RenderUseImpostors", true); + } + } + else + { + text_box->setText(LLTrans::getString("no_limit")); + gSavedSettings.setBOOL("RenderUseImpostors", false); + } +} + void LLFloaterPreference::updateMaximumArcText(LLSliderCtrl* ctrl, LLTextBox* text_box) { F32 min_result = 20000.0f; @@ -1781,7 +1795,7 @@ void LLFloaterPreference::updateMaximumArcText(LLSliderCtrl* ctrl, LLTextBox* te // It has been decided that having the slider all the way to the right will be the off position, which // is a value of 101, so it is necessary to change value to 0 disable impostor generation. value = 0.0f; - text_box->setText(LLTrans::getString("Off")); + text_box->setText(LLTrans::getString("no_limit")); } else { -- cgit v1.2.3 From b4c99cbb0aafc077c67b868ecb2d4c802355f472 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 11 Feb 2015 13:28:39 -0500 Subject: STORM-2082 Attempt to put advanced settings into separate floater --- indra/newview/llfloaterpreference.cpp | 121 ++++++++++++++++++++++++++++------ 1 file changed, 101 insertions(+), 20 deletions(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 0ac18408db..d2dfb63f9d 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -351,6 +351,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.AutoReplace", boost::bind(&LLFloaterPreference::onClickAutoReplace, this)); mCommitCallbackRegistrar.add("Pref.PermsDefault", boost::bind(&LLFloaterPreference::onClickPermsDefault, this)); mCommitCallbackRegistrar.add("Pref.SpellChecker", boost::bind(&LLFloaterPreference::onClickSpellChecker, this)); + mCommitCallbackRegistrar.add("Pref.Advanced", boost::bind(&LLFloaterPreference::onClickAdvanced, this)); sSkin = gSavedSettings.getString("SkinCurrent"); @@ -621,6 +622,9 @@ void LLFloaterPreference::cancel() // hide spellchecker settings folder LLFloaterReg::hideInstance("prefs_spellchecker"); + + // hide advancede floater + LLFloaterReg::hideInstance("prefs_graphics_advanced"); // reverts any changes to current skin gSavedSettings.setString("SkinCurrent", sSkin); @@ -745,6 +749,22 @@ void LLFloaterPreference::onVertexShaderEnable() refreshEnabledGraphics(); } +void LLFloaterPreferenceGraphicsAdvanced::onVertexShaderEnable() +{ + LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); + if (instance) + { + instance->refresh(); + } + + refreshEnabledGraphics(); +} + +void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledGraphics() +{ + refreshEnabledState(); +} + void LLFloaterPreference::onAvatarImpostorsEnable() { refreshEnabledGraphics(); @@ -792,10 +812,12 @@ void LLFloaterPreference::setHardwareDefaults() void LLFloaterPreference::getControlNames(std::vector& names) { LLView* view = findChild("display"); - if (view) + LLFloater* advanced = LLFloaterReg::findTypedInstance("prefs_graphics_advanced"); + if (view && advanced) { std::list stack; stack.push_back(view); + stack.push_back(advanced); while(!stack.empty()) { // Process view on top of the stack @@ -930,6 +952,12 @@ void LLFloaterPreference::refreshEnabledGraphics() { instance->refresh(); } + + LLFloater* advanced = LLFloaterReg::findTypedInstance("prefs_graphics_advanced"); + if (advanced) + { + advanced->refresh(); + } } void LLFloaterPreference::onClickClearCache() @@ -1111,7 +1139,37 @@ void LLFloaterPreference::buildPopupLists() } void LLFloaterPreference::refreshEnabledState() -{ +{ + LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); + LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); + + // if vertex shaders off, disable all shader related products + if (!LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable") || + !LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders")) + { + ctrl_wind_light->setEnabled(FALSE); + ctrl_wind_light->setValue(FALSE); + } + else + { + ctrl_wind_light->setEnabled(gSavedSettings.getBOOL("VertexShaderEnable")); + } + + //Deferred/SSAO/Shadows + BOOL bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump") && gSavedSettings.getBOOL("RenderObjectBump"); + BOOL shaders = gSavedSettings.getBOOL("WindLightUseAtmosShaders") && gSavedSettings.getBOOL("VertexShaderEnable"); + BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && + bumpshiny && + shaders && + gGLManager.mHasFramebufferObject && + gSavedSettings.getBOOL("RenderAvatarVP") && + (ctrl_wind_light->get()) ? TRUE : FALSE; + + ctrl_deferred->setEnabled(enabled); +} + +void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() +{ LLComboBox* ctrl_reflections = getChild("Reflections"); LLTextBox* reflections_text = getChild("ReflectionsText"); @@ -1175,22 +1233,18 @@ void LLFloaterPreference::refreshEnabledState() // WindLight LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); - LLCheckBoxCtrl* ctrl_wind_light2 = getChild("WindLightUseAtmosShaders2"); LLSliderCtrl* sky = getChild("SkyMeshDetail"); LLTextBox* sky_text = getChild("SkyMeshDetailText"); // *HACK just checks to see if we can use shaders... // maybe some cards that use shaders, but don't support windlight ctrl_wind_light->setEnabled(ctrl_shader_enable->getEnabled() && shaders); - ctrl_wind_light2->setEnabled(ctrl_shader_enable->getEnabled() && shaders); sky->setEnabled(ctrl_wind_light->get() && shaders); sky_text->setEnabled(ctrl_wind_light->get() && shaders); //Deferred/SSAO/Shadows LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); - LLCheckBoxCtrl* ctrl_deferred2 = getChild("UseLightShaders2"); - BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && ((bumpshiny_ctrl && bumpshiny_ctrl->get()) ? TRUE : FALSE) && @@ -1200,7 +1254,6 @@ void LLFloaterPreference::refreshEnabledState() (ctrl_wind_light->get()) ? TRUE : FALSE; ctrl_deferred->setEnabled(enabled); - ctrl_deferred2->setEnabled(enabled); LLCheckBoxCtrl* ctrl_ssao = getChild("UseSSAO"); LLCheckBoxCtrl* ctrl_dof = getChild("UseDoF"); @@ -1291,7 +1344,7 @@ void LLFloaterPreference::refreshEnabledState() getChild("default_creation_permissions")->setEnabled(LLStartUp::getStartupState() < STATE_STARTED ? false : true); } -void LLFloaterPreference::disableUnavailableSettings() +void LLFloaterPreferenceGraphicsAdvanced::disableUnavailableSettings() { LLComboBox* ctrl_reflections = getChild("Reflections"); LLTextBox* reflections_text = getChild("ReflectionsText"); @@ -1302,7 +1355,6 @@ void LLFloaterPreference::disableUnavailableSettings() LLSliderCtrl* ctrl_maximum_arc = getChild("MaximumARC"); LLTextBox* maximum_arc_text = getChild("MaximumARCText"); LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); - LLCheckBoxCtrl* ctrl_deferred2 = getChild("UseLightShaders2"); LLComboBox* ctrl_shadows = getChild("ShadowDetail"); LLTextBox* shadows_text = getChild("RenderShadowDetailText"); LLCheckBoxCtrl* ctrl_ssao = getChild("UseSSAO"); @@ -1344,8 +1396,6 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_deferred->setEnabled(FALSE); ctrl_deferred->setValue(FALSE); - ctrl_deferred2->setEnabled(FALSE); - ctrl_deferred2->setValue(FALSE); } // disabled windlight @@ -1370,8 +1420,6 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_deferred->setEnabled(FALSE); ctrl_deferred->setValue(FALSE); - ctrl_deferred2->setEnabled(FALSE); - ctrl_deferred2->setValue(FALSE); } // disabled deferred @@ -1390,8 +1438,6 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_deferred->setEnabled(FALSE); ctrl_deferred->setValue(FALSE); - ctrl_deferred2->setEnabled(FALSE); - ctrl_deferred2->setValue(FALSE); } // disabled deferred SSAO @@ -1439,8 +1485,6 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_deferred->setEnabled(FALSE); ctrl_deferred->setValue(FALSE); - ctrl_deferred2->setEnabled(FALSE); - ctrl_deferred2->setValue(FALSE); } // disabled cloth @@ -1461,6 +1505,18 @@ void LLFloaterPreference::disableUnavailableSettings() void LLFloaterPreference::refresh() { LLPanel::refresh(); + refreshEnabledState(); +} + +void LLFloaterPreferenceGraphicsAdvanced::draw() +{ + refresh(); + LLFloater::draw(); +} + +void LLFloaterPreferenceGraphicsAdvanced::refresh() +{ + refreshEnabledState(); getChild("fsaa")->setValue((LLSD::Integer) gSavedSettings.getU32("RenderFSAASamples")); @@ -1731,7 +1787,7 @@ void LLFloaterPreference::refreshUI() refresh(); } -void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box) +void LLFloaterPreferenceGraphicsAdvanced::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box) { if (text_box == NULL || ctrl== NULL) return; @@ -1760,7 +1816,7 @@ void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_b } } -void LLFloaterPreference::updateImpostorsText(LLSliderCtrl* ctrl, LLTextBox* text_box) +void LLFloaterPreferenceGraphicsAdvanced::updateImpostorsText(LLSliderCtrl* ctrl, LLTextBox* text_box) { F32 value = (F32)ctrl->getValue().asReal(); @@ -1779,7 +1835,7 @@ void LLFloaterPreference::updateImpostorsText(LLSliderCtrl* ctrl, LLTextBox* tex } } -void LLFloaterPreference::updateMaximumArcText(LLSliderCtrl* ctrl, LLTextBox* text_box) +void LLFloaterPreferenceGraphicsAdvanced::updateMaximumArcText(LLSliderCtrl* ctrl, LLTextBox* text_box) { F32 min_result = 20000.0f; F32 max_result = 300000.0f; @@ -1857,6 +1913,11 @@ void LLFloaterPreference::onClickSpellChecker() LLFloaterReg::showInstance("prefs_spellchecker"); } +void LLFloaterPreference::onClickAdvanced() +{ + LLFloaterReg::showInstance("prefs_graphics_advanced"); +} + void LLFloaterPreference::onClickActionChange() { mClickActionDirty = true; @@ -2115,10 +2176,13 @@ void LLPanelPreference::apply() void LLPanelPreference::saveSettings() { + LLFloater* advanced = LLFloaterReg::findTypedInstance("prefs_graphics_advanced"); + // Save the value of all controls in the hierarchy mSavedValues.clear(); std::list view_stack; view_stack.push_back(this); + view_stack.push_back(advanced); while(!view_stack.empty()) { // Process view on top of the stack @@ -2279,6 +2343,9 @@ static LLPanelInjector t_pref_privacy("panel_preferenc BOOL LLPanelPreferenceGraphics::postBuild() { + LLFloaterReg::showInstance("prefs_graphics_advanced"); + LLFloaterReg::hideInstance("prefs_graphics_advanced"); + // Don't do this on Mac as their braindead GL versioning // sets this when 8x and 16x are indeed available // @@ -2340,8 +2407,10 @@ void LLPanelPreferenceGraphics::setPresetText() bool LLPanelPreferenceGraphics::hasDirtyChilds() { + LLFloater* advanced = LLFloaterReg::findTypedInstance("prefs_graphics_advanced"); std::list view_stack; view_stack.push_back(this); + view_stack.push_back(advanced); while(!view_stack.empty()) { // Process view on top of the stack @@ -2377,8 +2446,10 @@ bool LLPanelPreferenceGraphics::hasDirtyChilds() void LLPanelPreferenceGraphics::resetDirtyChilds() { + LLFloater* advanced = LLFloaterReg::findTypedInstance("prefs_graphics_advanced"); std::list view_stack; view_stack.push_back(this); + view_stack.push_back(advanced); while(!view_stack.empty()) { // Process view on top of the stack @@ -2414,6 +2485,16 @@ void LLPanelPreferenceGraphics::setHardwareDefaults() LLPanelPreference::setHardwareDefaults(); } +LLFloaterPreferenceGraphicsAdvanced::LLFloaterPreferenceGraphicsAdvanced(const LLSD& key) + : LLFloater(key) +{ + mCommitCallbackRegistrar.add("Pref.VertexShaderEnable", boost::bind(&LLFloaterPreferenceGraphicsAdvanced::onVertexShaderEnable, this)); +} + +LLFloaterPreferenceGraphicsAdvanced::~LLFloaterPreferenceGraphicsAdvanced() +{ +} + LLFloaterPreferenceProxy::LLFloaterPreferenceProxy(const LLSD& key) : LLFloater(key), mSocksSettingsDirty(false) -- cgit v1.2.3 From c8a0aa99b4b879c4e22307a679053d4bd61dd9ff Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 18 Feb 2015 16:48:23 -0500 Subject: STORM-2082 Fix issue with isDirty --- indra/newview/llfloaterpreference.cpp | 62 +++++++++++------------------------ 1 file changed, 20 insertions(+), 42 deletions(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index d2dfb63f9d..4b45837ec0 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1172,7 +1172,7 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() { LLComboBox* ctrl_reflections = getChild("Reflections"); LLTextBox* reflections_text = getChild("ReflectionsText"); - + // Reflections BOOL reflections = gSavedSettings.getBOOL("VertexShaderEnable") && gGLManager.mHasCubeMap @@ -1213,9 +1213,9 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() // Vertex Shaders // Global Shader Enable LLCheckBoxCtrl* ctrl_shader_enable = getChild("BasicShaders"); - LLSliderCtrl* terrain_detail = getChild("TerrainDetail"); // can be linked with control var + LLSliderCtrl* terrain_detail = getChild("TerrainDetail"); // can be linked with control var LLTextBox* terrain_text = getChild("TerrainDetailText"); - + ctrl_shader_enable->setEnabled(LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable")); BOOL shaders = ctrl_shader_enable->get(); @@ -1305,36 +1305,6 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() getChildView("fog")->setEnabled(!gPipeline.canUseWindLightShaders()); getChildView("antialiasing restart")->setVisible(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred")); - /* Disabling this block of code because canUseAntiAliasing currently always returns true - // anti-aliasing - LLComboBox* fsaa_ctrl = getChild("fsaa"); - LLTextBox* fsaa_text = getChild("antialiasing label"); - LLTextBox* fsaa_restart = getChild("antialiasing restart"); - - // Enable or disable the control, the "Antialiasing:" label and the restart warning - // based on code support for the feature on the current hardware. - - if (gPipeline.canUseAntiAliasing()) - { - fsaa_ctrl->setEnabled(TRUE); - - LLColor4 color = LLUIColorTable::instance().getColor("LabelTextColor"); - fsaa_text->setColor(color); - - fsaa_restart->setVisible(!gSavedSettings.getBOOL("RenderDeferred")); - } - else - { - fsaa_ctrl->setEnabled(FALSE); - fsaa_ctrl->setValue((LLSD::Integer) 0); - - LLColor4 color = LLUIColorTable::instance().getColor("LabelDisabledColor"); - fsaa_text->setColor(color); - - fsaa_restart->setVisible(FALSE); - } - */ - // now turn off any features that are unavailable disableUnavailableSettings(); @@ -1506,12 +1476,11 @@ void LLFloaterPreference::refresh() { LLPanel::refresh(); refreshEnabledState(); -} - -void LLFloaterPreferenceGraphicsAdvanced::draw() -{ - refresh(); - LLFloater::draw(); + LLFloater* advanced = LLFloaterReg::findTypedInstance("prefs_graphics_advanced"); + if (advanced) + { + advanced->refresh(); + } } void LLFloaterPreferenceGraphicsAdvanced::refresh() @@ -2182,7 +2151,10 @@ void LLPanelPreference::saveSettings() mSavedValues.clear(); std::list view_stack; view_stack.push_back(this); - view_stack.push_back(advanced); + if (advanced) + { + view_stack.push_back(advanced); + } while(!view_stack.empty()) { // Process view on top of the stack @@ -2410,7 +2382,10 @@ bool LLPanelPreferenceGraphics::hasDirtyChilds() LLFloater* advanced = LLFloaterReg::findTypedInstance("prefs_graphics_advanced"); std::list view_stack; view_stack.push_back(this); - view_stack.push_back(advanced); + if (advanced) + { + view_stack.push_back(advanced); + } while(!view_stack.empty()) { // Process view on top of the stack @@ -2449,7 +2424,10 @@ void LLPanelPreferenceGraphics::resetDirtyChilds() LLFloater* advanced = LLFloaterReg::findTypedInstance("prefs_graphics_advanced"); std::list view_stack; view_stack.push_back(this); - view_stack.push_back(advanced); + if (advanced) + { + view_stack.push_back(advanced); + } while(!view_stack.empty()) { // Process view on top of the stack -- cgit v1.2.3 From 3cf8a1ce6e81c30cf7231a5ab045bbc45c6757e2 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 20 Feb 2015 12:56:45 -0500 Subject: Clean up impostors and visual muting Rename the settings that control them to be more descriptive Remove the separate boolean setting (RenderUseImpostors) that governed both Establish default values based on gpu class for impostors and visual muting --- indra/newview/llfloaterpreference.cpp | 174 ++++++++++++++++++++++------------ 1 file changed, 116 insertions(+), 58 deletions(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 0ac18408db..a37bebc547 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -120,6 +120,18 @@ char const* const VISIBILITY_HIDDEN = "hidden"; //control value for middle mouse as talk2push button const static std::string MIDDLE_MOUSE_CV = "MiddleMouse"; +/// This must equal the maximum value set for the IndirectMaxComplexity slider in panel_preferences_graphics1.xml +static const U32 INDIRECT_MAX_ARC_OFF = 101; // all the way to the right == disabled +static const U32 MIN_INDIRECT_ARC_LIMIT = 1; // must match minimum of IndirectMaxComplexity in panel_preferences_graphics1.xml +static const U32 MAX_INDIRECT_ARC_LIMIT = INDIRECT_MAX_ARC_OFF-1; // one short of all the way to the right... + +/// These are the effective range of values for RenderAvatarMaxComplexity +static const F32 MIN_ARC_LIMIT = 20000.0f; +static const F32 MAX_ARC_LIMIT = 300000.0f; +static const F32 MIN_ARC_LOG = log(MIN_ARC_LIMIT); +static const F32 MAX_ARC_LOG = log(MAX_ARC_LIMIT); +static const F32 ARC_LIMIT_MAP_SCALE = (MAX_ARC_LOG - MIN_ARC_LOG) / (MAX_INDIRECT_ARC_LIMIT - MIN_INDIRECT_ARC_LIMIT); + class LLVoiceSetKeyDialog : public LLModalDialog { public: @@ -341,6 +353,8 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.VertexShaderEnable", boost::bind(&LLFloaterPreference::onVertexShaderEnable, this)); mCommitCallbackRegistrar.add("Pref.WindowedMod", boost::bind(&LLFloaterPreference::onCommitWindowedMode, this)); mCommitCallbackRegistrar.add("Pref.UpdateSliderText", boost::bind(&LLFloaterPreference::refreshUI,this)); + mCommitCallbackRegistrar.add("Pref.UpdateIndirectMaxNonImpostors", boost::bind(&LLFloaterPreference::updateMaximumNonImpostors,this)); + mCommitCallbackRegistrar.add("Pref.UpdateIndirectMaxComplexity", boost::bind(&LLFloaterPreference::updateMaxComplexity,this)); mCommitCallbackRegistrar.add("Pref.QualityPerformance", boost::bind(&LLFloaterPreference::onChangeQuality, this, _2)); mCommitCallbackRegistrar.add("Pref.applyUIColor", boost::bind(&LLFloaterPreference::applyUIColor, this ,_1, _2)); mCommitCallbackRegistrar.add("Pref.getUIColor", boost::bind(&LLFloaterPreference::getUIColor, this ,_1, _2)); @@ -773,6 +787,9 @@ void LLFloaterPreference::updateShowFavoritesCheckbox(bool val) void LLFloaterPreference::setHardwareDefaults() { LLFeatureManager::getInstance()->applyRecommendedSettings(); + // reset indirects before refresh because we may have changed what they control + setIndirectControls(); + refreshEnabledGraphics(); gSavedSettings.setString("PresetGraphicActive", ""); LLPresetsManager::getInstance()->triggerChangeSignal(); @@ -785,7 +802,9 @@ void LLFloaterPreference::setHardwareDefaults() LLView* view = *iter; LLPanelPreference* panel = dynamic_cast(view); if (panel) + { panel->setHardwareDefaults(); + } } } @@ -930,6 +949,7 @@ void LLFloaterPreference::refreshEnabledGraphics() { instance->refresh(); } + setIndirectControls(); } void LLFloaterPreference::onClickClearCache() @@ -1220,12 +1240,6 @@ void LLFloaterPreference::refreshEnabledState() ctrl_shadow->setEnabled(enabled); shadow_text->setEnabled(enabled); - LLTextBox* maximum_arc_text = getChild("MaximumARCText"); - - enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderUseImpostors") && gSavedSettings.getBOOL("RenderUseImpostors"); - getChildView("MaximumARC")->setEnabled(enabled); - maximum_arc_text->setEnabled(enabled); - // Hardware settings F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple"); S32Megabytes min_tex_mem = LLViewerTextureList::getMinVideoRamSetting(); @@ -1291,6 +1305,48 @@ void LLFloaterPreference::refreshEnabledState() getChild("default_creation_permissions")->setEnabled(LLStartUp::getStartupState() < STATE_STARTED ? false : true); } +// static +void LLFloaterPreference::setIndirectControls() +{ + /* + * We have controls that have an indirect relationship between the control + * values and adjacent text and the underlying setting they influence. + * In each case, the control and its associated setting are named Indirect + * This method interrogates the controlled setting and establishes the + * appropriate value for the indirect control. It must be called whenever the + * underlying setting may have changed other than through the indirect control, + * such as when the 'Reset all to recommended settings' button is used... + */ + setIndirectMaxNonImpostors(); + setIndirectMaxArc(); +} + +// static +void LLFloaterPreference::setIndirectMaxNonImpostors() +{ + U32 max_non_impostors = gSavedSettings.getU32("RenderAvatarMaxNonImpostors"); + // for this one, we just need to make zero, which means off, the max value of the slider + U32 indirect_max_non_impostors = (0 == max_non_impostors) ? LLVOAvatar::IMPOSTORS_OFF : max_non_impostors; + gSavedSettings.setU32("IndirectMaxNonImpostors", indirect_max_non_impostors); +} + +void LLFloaterPreference::setIndirectMaxArc() +{ + U32 max_arc = gSavedSettings.getU32("RenderAvatarMaxComplexity"); + U32 indirect_max_arc; + if (0 == max_arc) + { + // the off position is all the way to the right, so set to control max + indirect_max_arc = INDIRECT_MAX_ARC_OFF; + } + else + { + // This is the inverse of the calculation in updateMaxComplexity + indirect_max_arc = (U32)((log(max_arc) - MIN_ARC_LOG) / ARC_LIMIT_MAP_SCALE) + MIN_INDIRECT_ARC_LIMIT; + } + gSavedSettings.setU32("IndirectMaxComplexity", indirect_max_arc); +} + void LLFloaterPreference::disableUnavailableSettings() { LLComboBox* ctrl_reflections = getChild("Reflections"); @@ -1299,8 +1355,6 @@ void LLFloaterPreference::disableUnavailableSettings() LLCheckBoxCtrl* ctrl_avatar_cloth = getChild("AvatarCloth"); LLCheckBoxCtrl* ctrl_shader_enable = getChild("BasicShaders"); LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); - LLSliderCtrl* ctrl_maximum_arc = getChild("MaximumARC"); - LLTextBox* maximum_arc_text = getChild("MaximumARCText"); LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); LLCheckBoxCtrl* ctrl_deferred2 = getChild("UseLightShaders2"); LLComboBox* ctrl_shadows = getChild("ShadowDetail"); @@ -1449,13 +1503,6 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_avatar_cloth->setEnabled(FALSE); ctrl_avatar_cloth->setValue(FALSE); } - - // disabled impostors - if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderUseImpostors")) - { - ctrl_maximum_arc->setEnabled(FALSE); - maximum_arc_text->setEnabled(FALSE); - } } void LLFloaterPreference::refresh() @@ -1476,9 +1523,9 @@ void LLFloaterPreference::refresh() updateSliderText(getChild("RenderPostProcess", true), getChild("PostProcessText", true)); updateSliderText(getChild("SkyMeshDetail", true), getChild("SkyMeshDetailText", true)); updateSliderText(getChild("TerrainDetail", true), getChild("TerrainDetailText", true)); - updateImpostorsText(getChild("MaxNumberAvatarDrawn", true), getChild("ImpostorsText", true)); - updateMaximumArcText(getChild("MaximumARC", true), getChild("MaximumARCText", true)); - + setIndirectControls(); + setMaximumNonImpostorsText(gSavedSettings.getU32("RenderAvatarMaxNonImpostors"),getChild("IndirectMaxNonImpostorsText", true)); + setMaxComplexityText(gSavedSettings.getU32("RenderAvatarMaxComplexity"),getChild("IndirectMaxComplexityText", true)); refreshEnabledState(); } @@ -1621,12 +1668,12 @@ void LLFloaterPreference::onClickLogPath() //Path changed if(proposed_name != dir_name) { - gSavedPerAccountSettings.setString("InstantMessageLogPath", dir_name); + gSavedPerAccountSettings.setString("InstantMessageLogPath", dir_name); mPriorInstantMessageLogPath = proposed_name; - // enable/disable 'Delete transcripts button - updateDeleteTranscriptsButton(); -} + // enable/disable 'Delete transcripts button + updateDeleteTranscriptsButton(); + } } bool LLFloaterPreference::moveTranscriptsAndLog() @@ -1760,59 +1807,71 @@ void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_b } } -void LLFloaterPreference::updateImpostorsText(LLSliderCtrl* ctrl, LLTextBox* text_box) + +void LLFloaterPreference::updateMaximumNonImpostors() { - F32 value = (F32)ctrl->getValue().asReal(); + // Called when the IndirectMaxNonImpostors control changes + // Responsible for fixing the slider label (IndirectMaxNonImpostorsText) and setting RenderAvatarMaxNonImpostors + LLSliderCtrl* ctrl = getChild("IndirectMaxNonImpostors",true); + U32 value = ctrl->getValue().asInteger(); - if (value < IMPOSTORS_OFF) + if (0 == value || LLVOAvatar::IMPOSTORS_OFF <= value) { - text_box->setText(llformat("%0.0f", value)); - if (!gSavedSettings.getBOOL("RenderUseImpostors")) - { - gSavedSettings.setBOOL("RenderUseImpostors", true); - } + value=0; } - else + gSavedSettings.setU32("RenderAvatarMaxNonImpostors", value); + LLVOAvatar::updateImpostorRendering(value); // make it effective immediately + setMaximumNonImpostorsText(value, getChild("IndirectMaxNonImpostorsText")); +} + +void LLFloaterPreference::setMaximumNonImpostorsText(U32 value, LLTextBox* text_box) +{ + if (0 == value) { text_box->setText(LLTrans::getString("no_limit")); - gSavedSettings.setBOOL("RenderUseImpostors", false); + } + else + { + text_box->setText(llformat("%d", value)); } } -void LLFloaterPreference::updateMaximumArcText(LLSliderCtrl* ctrl, LLTextBox* text_box) +void LLFloaterPreference::updateMaxComplexity() { - F32 min_result = 20000.0f; - F32 max_result = 300000.0f; + // Called when the IndirectMaxComplexity control changes + // Responsible for fixing the slider label (IndirectMaxComplexityText) and setting RenderAvatarMaxComplexity + LLSliderCtrl* ctrl = getChild("IndirectMaxComplexity"); + U32 indirect_value = ctrl->getValue().asInteger(); + U32 max_arc; + + if (INDIRECT_MAX_ARC_OFF == indirect_value) + { + // The 'off' position is when the slider is all the way to the right, + // which is a value of INDIRECT_MAX_ARC_OFF, + // so it is necessary to set max_arc to 0 disable muted avatars. + max_arc = 0; + } + else + { + // if this is changed, the inverse calculation in setIndirectMaxArc + // must be changed to match + max_arc = (U32)exp(MIN_ARC_LOG + (ARC_LIMIT_MAP_SCALE * (indirect_value - MIN_INDIRECT_ARC_LIMIT))); + } - F32 value = (F32)ctrl->getValue().asReal(); + gSavedSettings.setU32("RenderAvatarMaxComplexity", (U32)max_arc); + setMaxComplexityText(max_arc, getChild("IndirectMaxComplexityText")); +} - if (101.0f == value) +void LLFloaterPreference::setMaxComplexityText(U32 value, LLTextBox* text_box) +{ + if (0 == value) { - // It has been decided that having the slider all the way to the right will be the off position, which - // is a value of 101, so it is necessary to change value to 0 disable impostor generation. - value = 0.0f; text_box->setText(LLTrans::getString("no_limit")); } else { - - // 100 is the maximum value of this control set in panel_preferences_graphics1.xml - F32 minp = 1.0f; - F32 maxp = 100.0f; - - // The result should be between min_result and max_result - F32 minv = log(min_result); - F32 maxv = log(max_result); - - // calculate adjustment factor - F32 scale = (maxv - minv) / (maxp - minp); - - value = exp(minv + scale * (value - minp)); - - text_box->setText(llformat("%0.0f", value)); + text_box->setText(llformat("%d", value)); } - - gSavedSettings.setU32("RenderAutoMuteRenderWeightLimit", (U32)value); } void LLFloaterPreference::onChangeMaturity() @@ -2411,7 +2470,6 @@ void LLPanelPreferenceGraphics::saveSettings() void LLPanelPreferenceGraphics::setHardwareDefaults() { resetDirtyChilds(); - LLPanelPreference::setHardwareDefaults(); } LLFloaterPreferenceProxy::LLFloaterPreferenceProxy(const LLSD& key) -- cgit v1.2.3 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 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'indra/newview/llfloaterpreference.cpp') 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(); } -- cgit v1.2.3 From 1db375773f71506116133ffe235938b87dd62cec Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Fri, 4 Sep 2015 14:29:51 +0300 Subject: MAINT-5600 FIXED Chat log dropdown menu is always grayed out --- indra/newview/llfloaterpreference.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 7083c1ddf5..38c9ba2850 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1819,6 +1819,7 @@ void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im getChildView("favorites_on_login_check")->setEnabled(TRUE); getChildView("log_path_button")->setEnabled(TRUE); getChildView("chat_font_size")->setEnabled(TRUE); + getChildView("conversation_log_combo")->setEnabled(TRUE); } -- cgit v1.2.3 From 75d3bc4d6160e0d535067cfb7bbf86f948995384 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Fri, 11 Sep 2015 11:11:28 +0300 Subject: MAINT-5537 FIXED Advanced Graphics Preferences sliders are incorrect if you click Cancel rather than OK --- indra/newview/llfloaterpreference.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 38c9ba2850..898e5d5e1f 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -2572,6 +2572,11 @@ LLFloaterPreferenceProxy::LLFloaterPreferenceProxy(const LLSD& key) mCommitCallbackRegistrar.add("Proxy.Change", boost::bind(&LLFloaterPreferenceProxy::onChangeSocksSettings, this)); } +void LLFloaterPreferenceGraphicsAdvanced::onOpen(const LLSD& key) +{ + refresh(); +} + LLFloaterPreferenceProxy::~LLFloaterPreferenceProxy() { } -- cgit v1.2.3 From 453dee2d21477ad534fa9982b844c40adde9b93e Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 28 Sep 2015 15:00:17 -0400 Subject: MAINT-5542: fix initialization of Default graphics preset so that it is selectable --- indra/newview/llfloaterpreference.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 898e5d5e1f..340959880c 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -2422,8 +2422,10 @@ BOOL LLPanelPreferenceGraphics::postBuild() resetDirtyChilds(); setPresetText(); - LLPresetsManager::instance().setPresetListChangeCallback(boost::bind(&LLPanelPreferenceGraphics::onPresetsListChange, this)); - + LLPresetsManager* presetsMgr = LLPresetsManager::getInstance(); + presetsMgr->setPresetListChangeCallback(boost::bind(&LLPanelPreferenceGraphics::onPresetsListChange, this)); + presetsMgr->createMissingDefault(); // a no-op after the first time, but that's ok + return LLPanelPreference::postBuild(); } -- cgit v1.2.3 From c8726aba303bcf1207b730a344536e25491420bc Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Tue, 10 Nov 2015 09:48:56 -0500 Subject: remove execute permission from many files that should not have it --- indra/newview/llfloaterpreference.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 indra/newview/llfloaterpreference.cpp (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp old mode 100755 new mode 100644 -- cgit v1.2.3 From 95a8b04ba8042f1d51fc8b852f048657268d48b4 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 19 Feb 2016 22:08:28 +0100 Subject: FIXED Graphics presets do not work properly when localized "Default" string --- indra/newview/llfloaterpreference.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 06388b1728..cfaafeb496 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -2474,6 +2474,10 @@ void LLPanelPreferenceGraphics::setPresetText() if (!preset_graphic_active.empty()) { + if (preset_graphic_active == PRESETS_DEFAULT) + { + preset_graphic_active = LLTrans::getString("Default"); + } preset_text->setText(preset_graphic_active); } else -- cgit v1.2.3 From 9d681027b343a68a4e1151855145b79b95717d57 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Fri, 26 Feb 2016 10:52:23 +0200 Subject: MAINT-5699 Graphics preset changes to None each time the Advanced Graphics floater is opened --- indra/newview/llfloaterpreference.cpp | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index cfaafeb496..718b068c8a 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -673,6 +673,12 @@ void LLFloaterPreference::cancel() LLFloaterPathfindingConsole* pPathfindingConsole = pathfindingConsoleHandle.get(); pPathfindingConsole->onRegionBoundaryCross(); } + + if (!mSavedGraphicsPreset.empty()) + { + gSavedSettings.setString("PresetGraphicActive", mSavedGraphicsPreset); + LLPresetsManager::getInstance()->triggerChangeSignal(); + } } void LLFloaterPreference::onOpen(const LLSD& key) @@ -1970,6 +1976,18 @@ void LLFloaterPreference::onClickSpellChecker() void LLFloaterPreference::onClickAdvanced() { LLFloaterReg::showInstance("prefs_graphics_advanced"); + + LLTabContainer* tabcontainer = getChild("pref core"); + for (child_list_t::const_iterator iter = tabcontainer->getChildList()->begin(); + iter != tabcontainer->getChildList()->end(); ++iter) + { + LLView* view = *iter; + LLPanelPreferenceGraphics* panel = dynamic_cast(view); + if (panel) + { + panel->resetDirtyChilds(); + } + } } void LLFloaterPreference::onClickActionChange() @@ -2076,6 +2094,11 @@ void LLFloaterPreference::changed() } +void LLFloaterPreference::saveGraphicsPreset(std::string& preset) +{ + mSavedGraphicsPreset = preset; +} + //------------------------------Updater--------------------------------------- static bool handleBandwidthChanged(const LLSD& newvalue) @@ -2465,6 +2488,11 @@ void LLPanelPreferenceGraphics::setPresetText() if (hasDirtyChilds() && !preset_graphic_active.empty()) { + LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); + if (instance) + { + instance->saveGraphicsPreset(preset_graphic_active); + } gSavedSettings.setString("PresetGraphicActive", ""); preset_graphic_active.clear(); // This doesn't seem to cause an infinite recursion. This trigger is needed to cause the pulldown @@ -2599,6 +2627,15 @@ void LLFloaterPreferenceGraphicsAdvanced::onOpen(const LLSD& key) refresh(); } +void LLFloaterPreferenceGraphicsAdvanced::onClickCloseBtn(bool app_quitting) +{ + LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); + if (instance) + { + instance->cancel(); + } +} + LLFloaterPreferenceProxy::~LLFloaterPreferenceProxy() { } -- cgit v1.2.3 From b6f6eeb02e2eae93f2de2bd3224e33cbbb0e8c8a Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Tue, 1 Mar 2016 10:01:35 +0200 Subject: MAINT-6174 FIXED Graphics parameters are wrong after closing the Advanced Graphics floater --- indra/newview/llfloaterpreference.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 718b068c8a..c4e9292d90 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -824,6 +824,13 @@ void LLFloaterPreference::updateShowFavoritesCheckbox(bool val) void LLFloaterPreference::setHardwareDefaults() { + std::string preset_graphic_active = gSavedSettings.getString("PresetGraphicActive"); + if (!preset_graphic_active.empty()) + { + saveGraphicsPreset(preset_graphic_active); + saveSettings(); // save here to be able to return to the previous preset by Cancel + } + LLFeatureManager::getInstance()->applyRecommendedSettings(); // reset indirects before refresh because we may have changed what they control @@ -2478,6 +2485,12 @@ void LLPanelPreferenceGraphics::onPresetsListChange() { resetDirtyChilds(); setPresetText(); + + LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); + if (instance && !gSavedSettings.getString("PresetGraphicActive").empty()) + { + instance->saveSettings(); //make cancel work correctly after changing the preset + } } void LLPanelPreferenceGraphics::setPresetText() @@ -2486,13 +2499,17 @@ void LLPanelPreferenceGraphics::setPresetText() std::string preset_graphic_active = gSavedSettings.getString("PresetGraphicActive"); - if (hasDirtyChilds() && !preset_graphic_active.empty()) + if (!preset_graphic_active.empty() && preset_graphic_active != preset_text->getText()) { LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); if (instance) { instance->saveGraphicsPreset(preset_graphic_active); } + } + + if (hasDirtyChilds() && !preset_graphic_active.empty()) + { gSavedSettings.setString("PresetGraphicActive", ""); preset_graphic_active.clear(); // This doesn't seem to cause an infinite recursion. This trigger is needed to cause the pulldown -- cgit v1.2.3 From 6f799b0a587c53587edd1dbef8ec69ca974b9a85 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 10 Mar 2016 10:00:03 +0100 Subject: Fix default preset not shown as selected in quick graphics pulldown for non-english languages --- indra/newview/llfloaterpreference.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index c4e9292d90..3a0abc919f 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -2521,7 +2521,7 @@ void LLPanelPreferenceGraphics::setPresetText() { if (preset_graphic_active == PRESETS_DEFAULT) { - preset_graphic_active = LLTrans::getString("Default"); + preset_graphic_active = LLTrans::getString(PRESETS_DEFAULT); } preset_text->setText(preset_graphic_active); } -- cgit v1.2.3 From e81135b5d82701745a6fb324d70312796a1ee855 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 28 Apr 2016 11:28:46 -0400 Subject: adjust avatar complexity defaults to be more generous and more consistent --- indra/newview/llfloaterpreference.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 113b307255..227d0eac77 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -131,7 +131,7 @@ static const U32 MAX_INDIRECT_ARC_LIMIT = INDIRECT_MAX_ARC_OFF-1; // one short o /// These are the effective range of values for RenderAvatarMaxComplexity static const F32 MIN_ARC_LIMIT = 20000.0f; -static const F32 MAX_ARC_LIMIT = 300000.0f; +static const F32 MAX_ARC_LIMIT = 350000.0f; static const F32 MIN_ARC_LOG = log(MIN_ARC_LIMIT); static const F32 MAX_ARC_LOG = log(MAX_ARC_LIMIT); static const F32 ARC_LIMIT_MAP_SCALE = (MAX_ARC_LOG - MIN_ARC_LOG) / (MAX_INDIRECT_ARC_LIMIT - MIN_INDIRECT_ARC_LIMIT); -- cgit v1.2.3 From 0e5c8ed390927f4ad96d0687ecca0f096c0541f5 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 4 May 2016 10:16:53 -0400 Subject: add max avatar complexity slider to basic graphics preferences --- indra/newview/llfloaterpreference.cpp | 47 ++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 12 deletions(-) (limited to 'indra/newview/llfloaterpreference.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 227d0eac77..36bdcf4d89 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -362,6 +362,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.LogPath", boost::bind(&LLFloaterPreference::onClickLogPath, this)); mCommitCallbackRegistrar.add("Pref.HardwareDefaults", boost::bind(&LLFloaterPreference::setHardwareDefaults, this)); mCommitCallbackRegistrar.add("Pref.AvatarImpostorsEnable", boost::bind(&LLFloaterPreference::onAvatarImpostorsEnable, this)); + mCommitCallbackRegistrar.add("Pref.UpdateIndirectMaxComplexity", boost::bind(&LLFloaterPreference::updateMaxComplexity, this)); mCommitCallbackRegistrar.add("Pref.VertexShaderEnable", boost::bind(&LLFloaterPreference::onVertexShaderEnable, this)); mCommitCallbackRegistrar.add("Pref.WindowedMod", boost::bind(&LLFloaterPreference::onCommitWindowedMode, this)); mCommitCallbackRegistrar.add("Pref.UpdateSliderText", boost::bind(&LLFloaterPreference::refreshUI,this)); @@ -838,7 +839,7 @@ void LLFloaterPreference::setHardwareDefaults() LLFeatureManager::getInstance()->applyRecommendedSettings(); // reset indirects before refresh because we may have changed what they control - LLFloaterPreferenceGraphicsAdvanced::setIndirectControls(); + LLAvatarComplexityControls::setIndirectControls(); refreshEnabledGraphics(); gSavedSettings.setString("PresetGraphicActive", ""); @@ -1374,7 +1375,7 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() } // static -void LLFloaterPreferenceGraphicsAdvanced::setIndirectControls() +void LLAvatarComplexityControls::setIndirectControls() { /* * We have controls that have an indirect relationship between the control @@ -1390,7 +1391,7 @@ void LLFloaterPreferenceGraphicsAdvanced::setIndirectControls() } // static -void LLFloaterPreferenceGraphicsAdvanced::setIndirectMaxNonImpostors() +void LLAvatarComplexityControls::setIndirectMaxNonImpostors() { U32 max_non_impostors = gSavedSettings.getU32("RenderAvatarMaxNonImpostors"); // for this one, we just need to make zero, which means off, the max value of the slider @@ -1398,7 +1399,7 @@ void LLFloaterPreferenceGraphicsAdvanced::setIndirectMaxNonImpostors() gSavedSettings.setU32("IndirectMaxNonImpostors", indirect_max_non_impostors); } -void LLFloaterPreferenceGraphicsAdvanced::setIndirectMaxArc() +void LLAvatarComplexityControls::setIndirectMaxArc() { U32 max_arc = gSavedSettings.getU32("RenderAvatarMaxComplexity"); U32 indirect_max_arc; @@ -1567,6 +1568,9 @@ void LLFloaterPreferenceGraphicsAdvanced::disableUnavailableSettings() void LLFloaterPreference::refresh() { LLPanel::refresh(); + LLAvatarComplexityControls::setText( + gSavedSettings.getU32("RenderAvatarMaxComplexity"), + getChild("IndirectMaxComplexityText", true)); refreshEnabledState(); LLFloater* advanced = LLFloaterReg::findTypedInstance("prefs_graphics_advanced"); if (advanced) @@ -1591,9 +1595,13 @@ void LLFloaterPreferenceGraphicsAdvanced::refresh() updateSliderText(getChild("RenderPostProcess", true), getChild("PostProcessText", true)); 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)); + LLAvatarComplexityControls::setIndirectControls(); + setMaxNonImpostorsText( + gSavedSettings.getU32("RenderAvatarMaxNonImpostors"), + getChild("IndirectMaxNonImpostorsText", true)); + LLAvatarComplexityControls::setText( + gSavedSettings.getU32("RenderAvatarMaxComplexity"), + getChild("IndirectMaxComplexityText", true)); refreshEnabledState(); } @@ -1904,12 +1912,11 @@ void LLFloaterPreferenceGraphicsAdvanced::setMaxNonImpostorsText(U32 value, LLTe } } -void LLFloaterPreferenceGraphicsAdvanced::updateMaxComplexity() +void LLAvatarComplexityControls::updateMax(LLSliderCtrl* slider, LLTextBox* value_label) { // Called when the IndirectMaxComplexity control changes // Responsible for fixing the slider label (IndirectMaxComplexityText) and setting RenderAvatarMaxComplexity - LLSliderCtrl* ctrl = getChild("IndirectMaxComplexity"); - U32 indirect_value = ctrl->getValue().asInteger(); + U32 indirect_value = slider->getValue().asInteger(); U32 max_arc; if (INDIRECT_MAX_ARC_OFF == indirect_value) @@ -1927,10 +1934,10 @@ void LLFloaterPreferenceGraphicsAdvanced::updateMaxComplexity() } gSavedSettings.setU32("RenderAvatarMaxComplexity", (U32)max_arc); - setMaxComplexityText(max_arc, getChild("IndirectMaxComplexityText")); + setText(max_arc, value_label); } -void LLFloaterPreferenceGraphicsAdvanced::setMaxComplexityText(U32 value, LLTextBox* text_box) +void LLAvatarComplexityControls::setText(U32 value, LLTextBox* text_box) { if (0 == value) { @@ -1942,6 +1949,22 @@ void LLFloaterPreferenceGraphicsAdvanced::setMaxComplexityText(U32 value, LLText } } +void LLFloaterPreference::updateMaxComplexity() +{ + // Called when the IndirectMaxComplexity control changes + LLAvatarComplexityControls::updateMax( + getChild("IndirectMaxComplexity"), + getChild("IndirectMaxComplexityText")); +} + +void LLFloaterPreferenceGraphicsAdvanced::updateMaxComplexity() +{ + // Called when the IndirectMaxComplexity control changes + LLAvatarComplexityControls::updateMax( + getChild("IndirectMaxComplexity"), + getChild("IndirectMaxComplexityText")); +} + void LLFloaterPreference::onChangeMaturity() { U8 sim_access = gSavedSettings.getU32("PreferredMaturity"); -- cgit v1.2.3