diff options
author | Jonathan Yap <jhwelch@gmail.com> | 2015-01-20 09:17:23 -0500 |
---|---|---|
committer | Jonathan Yap <jhwelch@gmail.com> | 2015-01-20 09:17:23 -0500 |
commit | 611391a818746f560ad49847ae643613313ac216 (patch) | |
tree | 58ffb1435038521d66d96ba321773c583cf1b25f /indra/newview/llpresetsmanager.cpp | |
parent | ce324355787bd9c1c864050ca54b4306c30a0e79 (diff) |
STORM-2082 Update to new UI design. Bugs are not worked out yet.
Diffstat (limited to 'indra/newview/llpresetsmanager.cpp')
-rw-r--r-- | indra/newview/llpresetsmanager.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/indra/newview/llpresetsmanager.cpp b/indra/newview/llpresetsmanager.cpp index 67d06ff5dd..05138ee0c3 100644 --- a/indra/newview/llpresetsmanager.cpp +++ b/indra/newview/llpresetsmanager.cpp @@ -54,14 +54,14 @@ void LLPresetsManager::createMissingDefault() { 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 + // *TODO: If this name is to be localized additional code will be needed to delete the old default // when changing languages. savePreset(PRESETS_GRAPHIC, PRESETS_DEFAULT); - } - if (gSavedSettings.getString("PresetGraphicActive").empty()) - { - gSavedSettings.setString("PresetGraphicActive", PRESETS_DEFAULT); + if (gSavedSettings.getString("PresetGraphicActive").empty()) + { + gSavedSettings.setString("PresetGraphicActive", PRESETS_DEFAULT); + } } } @@ -187,6 +187,8 @@ bool LLPresetsManager::savePreset(const std::string& subdirectory, const std::st formatter->format(paramsData, presetsXML, LLSDFormatter::OPTIONS_PRETTY); presetsXML.close(); + gSavedSettings.setString("PresetGraphicActive", name); + // signal interested parties mPresetListChangeSignal(); @@ -234,6 +236,10 @@ void LLPresetsManager::loadPreset(const std::string& subdirectory, const std::st if(gSavedSettings.loadFromFile(full_path, false, true) > 0) { + if(PRESETS_GRAPHIC == subdirectory) + { + gSavedSettings.setString("PresetGraphicActive", name); + } mPresetListChangeSignal(); } } @@ -252,6 +258,12 @@ bool LLPresetsManager::deletePreset(const std::string& subdirectory, const std:: return false; } + // If you delete the preset that is currently marked as loaded then also indicate that no preset is loaded. + if (gSavedSettings.getString("PresetGraphicActive") == name) + { + gSavedSettings.setString("PresetGraphicActive", ""); + } + // signal interested parties mPresetListChangeSignal(); |