diff options
author | Oz Linden <oz@lindenlab.com> | 2016-03-09 23:12:16 -0500 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2016-03-09 23:12:16 -0500 |
commit | 6fb7c6b43cfbe4cc56c8123780a8272ca06222a1 (patch) | |
tree | 78caf775d7c06469bc93f15564b93fd04d78bfa6 /indra/newview | |
parent | 27fd7fdee6e80aa3520d5740d0197c64ad3837e9 (diff) | |
parent | b6f6eeb02e2eae93f2de2bd3224e33cbbb0e8c8a (diff) |
Merged in andreyl_productengine/391-blizzard-marchcat (pull request #23)
MAINT-6174 FIXED Graphics parameters are wrong after closing the Advanced Graphics floater
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloaterpreference.cpp | 19 | ||||
-rw-r--r-- | indra/newview/llfloaterpreference.h | 4 |
2 files changed, 19 insertions, 4 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 718b068c8a..c4e9292d90 100644 --- 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<LLFloaterPreference>("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<LLFloaterPreference>("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 diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 8de65b733b..ed692c903e 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -125,12 +125,10 @@ protected: // updates click/double-click action controls depending on values from settings.xml void updateClickActionControls(); +public: // This function squirrels away the current values of the controls so that // cancel() can restore them. void saveSettings(); - - -public: void setCacheLocation(const LLStringExplicit& location); |