diff options
author | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-06-07 17:41:26 +0300 |
---|---|---|
committer | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-06-07 17:41:26 +0300 |
commit | 7151a4e6b02f02155387fc595034a42aebd7ec9c (patch) | |
tree | 4e8727d56b795edc20d43a70f295ec47b3c937f5 /indra/newview/llfloatereditsky.cpp | |
parent | 497c0983bb013cb65b6faf10045ea7b62511cc55 (diff) |
STORM-1255 WIP Consistency pass on sky presets removal.
* Update all related floaters when a sky preset gets removed.
* Don't allow removing skies referenced by (local) day cycles.
* Other minor fixes.
Diffstat (limited to 'indra/newview/llfloatereditsky.cpp')
-rw-r--r-- | indra/newview/llfloatereditsky.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/indra/newview/llfloatereditsky.cpp b/indra/newview/llfloatereditsky.cpp index 96dfb7a8a9..f78baf2ed5 100644 --- a/indra/newview/llfloatereditsky.cpp +++ b/indra/newview/llfloatereditsky.cpp @@ -131,6 +131,8 @@ void LLFloaterEditSky::initCallbacks(void) mSaveButton->setCommitCallback(boost::bind(&LLFloaterEditSky::onBtnSave, this)); getChild<LLButton>("cancel")->setCommitCallback(boost::bind(&LLFloaterEditSky::onBtnCancel, this)); + LLWLParamManager::instance().setPresetListChangeCallback(boost::bind(&LLFloaterEditSky::onSkyPresetListChange, this)); + //------------------------------------------------------------------------- LLWLParamManager& param_mgr = LLWLParamManager::instance(); @@ -806,8 +808,8 @@ void LLFloaterEditSky::onSkyPresetSelected() if (!LLWLParamManager::instance().getParamSet(key, sky_params)) { - llwarns << "No sky preset named " << key.toString() << llendl; - llassert(false); + // Manually entered string? + LL_WARNS("Windlight") << "No sky preset named " << key.toString() << LL_ENDL; return; } @@ -904,3 +906,19 @@ void LLFloaterEditSky::onSaveConfirmed() closeFloater(); } + +void LLFloaterEditSky::onSkyPresetListChange() +{ + LLWLParamKey key = getSelectedSkyPreset(); // preset being edited + if (!LLWLParamManager::instance().hasParamSet(key)) + { + // Preset we've been editing doesn't exist anymore. Close the floater. + closeFloater(false); + } + else + { + // A new preset has been added. + // Refresh the presets list, though it may not make sense as the floater is about to be closed. + refreshSkyPresetsList(); + } +} |