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 ++++ indra/newview/llpresetsmanager.cpp | 23 +++++++++++++++++++---- indra/newview/llpresetsmanager.h | 6 +++--- 3 files changed, 26 insertions(+), 7 deletions(-) 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 diff --git a/indra/newview/llpresetsmanager.cpp b/indra/newview/llpresetsmanager.cpp index 8aad37e505..152001eb46 100644 --- a/indra/newview/llpresetsmanager.cpp +++ b/indra/newview/llpresetsmanager.cpp @@ -134,9 +134,14 @@ void LLPresetsManager::loadPresetNamesFromDir(const std::string& dir, preset_nam presets = mPresetNames; } -bool LLPresetsManager::savePreset(const std::string& subdirectory, const std::string& name) +bool LLPresetsManager::savePreset(const std::string& subdirectory, std::string name) { - bool saved = false; + if (LLTrans::getString(PRESETS_DEFAULT) == name) + { + name = PRESETS_DEFAULT; + } + + bool saved = false; std::vector name_list; if(PRESETS_GRAPHIC == subdirectory) @@ -244,8 +249,13 @@ void LLPresetsManager::setPresetNamesInComboBox(const std::string& subdirectory, } } -void LLPresetsManager::loadPreset(const std::string& subdirectory, const std::string& name) +void LLPresetsManager::loadPreset(const std::string& subdirectory, std::string name) { + if (LLTrans::getString(PRESETS_DEFAULT) == name) + { + name = PRESETS_DEFAULT; + } + std::string full_path(getPresetsDir(subdirectory) + gDirUtilp->getDirDelimiter() + LLURI::escape(name) + ".xml"); LL_DEBUGS() << "attempting to load preset '"<