FIXED Graphics presets do not work properly when localized "Default" string

meow-7.2.2
Ansariel 2016-02-19 22:08:28 +01:00
parent 81d5e6e351
commit 95a8b04ba8
3 changed files with 26 additions and 7 deletions

View File

@ -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

View File

@ -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<std::string> 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 '"<<name<<"' from '"<<full_path<<"'" << LL_ENDL;
@ -270,8 +280,13 @@ void LLPresetsManager::loadPreset(const std::string& subdirectory, const std::st
}
}
bool LLPresetsManager::deletePreset(const std::string& subdirectory, const std::string& name)
bool LLPresetsManager::deletePreset(const std::string& subdirectory, std::string name)
{
if (LLTrans::getString(PRESETS_DEFAULT) == name)
{
name = PRESETS_DEFAULT;
}
bool sts = true;
if (PRESETS_DEFAULT == name)

View File

@ -56,9 +56,9 @@ public:
static std::string getPresetsDir(const std::string& subdirectory);
void setPresetNamesInComboBox(const std::string& subdirectory, LLComboBox* combo, EDefaultOptions default_option);
void loadPresetNamesFromDir(const std::string& dir, preset_name_list_t& presets, EDefaultOptions default_option);
bool savePreset(const std::string& subdirectory, const std::string & name);
void loadPreset(const std::string& subdirectory, const std::string & name);
bool deletePreset(const std::string& subdirectory, const std::string& name);
bool savePreset(const std::string& subdirectory, std::string name);
void loadPreset(const std::string& subdirectory, std::string name);
bool deletePreset(const std::string& subdirectory, std::string name);
// Emitted when a preset gets loaded, deleted, or saved.
boost::signals2::connection setPresetListChangeCallback(const preset_list_signal_t::slot_type& cb);