Restoring preset loading

This commit is contained in:
Siana Gearz
2012-02-01 09:59:31 +01:00
parent 071745007a
commit 55cce46454
5 changed files with 12 additions and 12 deletions

View File

@@ -172,10 +172,10 @@ void LLDayCycleManager::loadAllPresets()
mDayCycleMap.clear();
// First, load system (coming out of the box) day cycles.
loadPresets(getSysDir());
loadPresets(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/days", ""));
// Then load user presets. Note that user day cycles will modify any system ones already loaded.
loadPresets(getUserDir());
loadPresets(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/days", ""));
}
void LLDayCycleManager::loadPresets(const std::string& dir)
@@ -199,7 +199,7 @@ bool LLDayCycleManager::loadPreset(const std::string& path)
return false;
}
std::string name(gDirUtilp->getBaseFileName(LLURI::unescape(path), /*strip_exten = */ true));
std::string name(LLURI::unescape(gDirUtilp->getBaseFileName(path, true)));
addPreset(name, data);
return true;

View File

@@ -411,7 +411,7 @@ void LLFloaterWindLight::syncMenu()
bool lockY = !param_mgr->mCurParams.getEnableCloudScrollY();
childSetValue("WLCloudLockX", lockX);
childSetValue("WLCloudLockY", lockY);
childSetValue("DrawClassicClouds", gSavedSettings.getBOOL("SkyUseClassicClouds2"));
childSetValue("DrawClassicClouds", gSavedSettings.getBOOL("SkyUseClassicClouds"));
// disable if locked, enable if not
if(lockX)

View File

@@ -102,10 +102,10 @@ LLWaterParamManager::~LLWaterParamManager()
void LLWaterParamManager::loadAllPresets()
{
// First, load system (coming out of the box) water presets.
loadPresetsFromDir(getSysDir());
loadPresetsFromDir(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/water", ""));
// Then load user presets. Note that user day presets will modify any system ones already loaded.
loadPresetsFromDir(getUserDir());
loadPresetsFromDir(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/water", ""));
}
void LLWaterParamManager::loadPresetsFromDir(const std::string& dir)
@@ -132,7 +132,7 @@ void LLWaterParamManager::loadPresetsFromDir(const std::string& dir)
bool LLWaterParamManager::loadPreset(const std::string& path)
{
llifstream xml_file;
std::string name(gDirUtilp->getBaseFileName(LLWeb::curlEscape(path), /*strip_exten = */ true));
std::string name(LLURI::unescape(gDirUtilp->getBaseFileName(path, true)));
xml_file.open(path.c_str());
if (!xml_file)

View File

@@ -284,10 +284,10 @@ void LLWLParamManager::refreshRegionPresets()
void LLWLParamManager::loadAllPresets()
{
// First, load system (coming out of the box) sky presets.
loadPresetsFromDir(getSysDir());
loadPresetsFromDir(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/skies", ""));
// Then load user presets. Note that user day presets will modify any system ones already loaded.
loadPresetsFromDir(getUserDir());
loadPresetsFromDir(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/skies", ""));
}
void LLWLParamManager::loadPresetsFromDir(const std::string& dir)
@@ -314,7 +314,7 @@ void LLWLParamManager::loadPresetsFromDir(const std::string& dir)
bool LLWLParamManager::loadPreset(const std::string& path)
{
llifstream xml_file;
std::string name(gDirUtilp->getBaseFileName(LLURI::unescape(path), /*strip_exten = */ true));
std::string name(LLURI::unescape(gDirUtilp->getBaseFileName(path, true)));
xml_file.open(path.c_str());
if (!xml_file)

View File

@@ -145,10 +145,10 @@ BOOL wlfPanel_AdvSettings::postBuild()
getChild<LLCheckBoxCtrl>("use_estate_wl")->setCommitCallback(onUseRegionSettings);
mWaterPresetCombo = getChild<LLComboBox>("WWPresetsCombo");
mWaterPresetCombo = getChild<LLComboBox>("WLWaterPresetsCombo");
mWaterPresetCombo->setCommitCallback(onChangeWWPresetName);
mSkyPresetCombo = getChild<LLComboBox>("WLPresetsCombo");
mSkyPresetCombo = getChild<LLComboBox>("WLSkyPresetsCombo");
mSkyPresetCombo->setCommitCallback(onChangeWLPresetName);
// mDayCyclePresetCombo = getChild<LLComboBox>("DCPresetsCombo");