diff options
author | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-03-31 18:24:01 +0300 |
---|---|---|
committer | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-03-31 18:24:01 +0300 |
commit | 79fb8e2ec26dc2c5a42ef1ee48ebaaa39183c67b (patch) | |
tree | 2747ceb9c211f677be9a595ba91b75e71506c529 /indra/newview/llfloaterwindlight.cpp | |
parent | 5476999e9dfeca48009b43e4fcc0967be5540572 (diff) |
STORM-1126 WIP Windlight Estate Settings integration: pass 4
Changes:
* Fixed incorrect way to pass parameters to notifications.
* Fixed crashes in the Advanced Sky floater and the Region Terrain panel.
* Fixed initialization and multiple instantiation of the Day Cycle floater
(that might lead to incorrect behavior).
* Fixed and re-enabled committing env. settings changes to region.
* Fixed day cycle and sky settings being sent as empty arrays and therefore not passing validation on server.
It is now possible to change region environment settings.
* Added debug messages.
Diffstat (limited to 'indra/newview/llfloaterwindlight.cpp')
-rw-r--r-- | indra/newview/llfloaterwindlight.cpp | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/indra/newview/llfloaterwindlight.cpp b/indra/newview/llfloaterwindlight.cpp index 217c7bd7ec..4fb470fa45 100644 --- a/indra/newview/llfloaterwindlight.cpp +++ b/indra/newview/llfloaterwindlight.cpp @@ -37,6 +37,7 @@ #include "pipeline.h" #include "llsky.h" +#include "llfloaterreg.h" #include "llsliderctrl.h" #include "llmultislider.h" #include "llmultisliderctrl.h" @@ -75,6 +76,7 @@ LLFloaterWindLight::LLFloaterWindLight(const LLSD &key) : LLFloater(key) BOOL LLFloaterWindLight::postBuild() { + sWindLight = this; sOriginalTitle = getTitle(); // add the combo boxes @@ -211,21 +213,9 @@ void LLFloaterWindLight::initCallbacks(void) childSetCommitCallback("WLStarAlpha", onStarAlphaMoved, NULL); } -#if 0 -void LLFloaterWindLight::onClickHelp(void* data) -{ - const std::string xml_alert = *(std::string*)data; - LLNotifications::instance().add(xml_alert, LLSD(), LLSD()); -} - -void LLFloaterWindLight::initHelpBtn(const std::string& name, const std::string& xml_alert) -{ - childSetAction(name, onClickHelp, new std::string(xml_alert)); -} -#endif - bool LLFloaterWindLight::newPromptCallback(const LLSD& notification, const LLSD& response) { + llassert(sWindLight); std::string text = response["message"].asString(); LLWLParamKey newKey(text, LLEnvKey::SCOPE_LOCAL); S32 option = LLNotification::getSelectedOption(notification, response); @@ -420,17 +410,19 @@ void LLFloaterWindLight::syncMenu() } -#if 0 // static LLFloaterWindLight* LLFloaterWindLight::instance() { if (!sWindLight) { - sWindLight = new LLFloaterWindLight("WindLight floater"); + lldebugs << "Creating WL floater" << llendl; + sWindLight = LLFloaterReg::getTypedInstance<LLFloaterWindLight>("env_windlight"); + llassert(sWindLight); } return sWindLight; } +// static void LLFloaterWindLight::show(LLEnvKey::EScope scope) { LLFloaterWindLight* windLight = instance(); @@ -465,25 +457,20 @@ void LLFloaterWindLight::show(LLEnvKey::EScope scope) bool LLFloaterWindLight::isOpen() { - if (sWindLight != NULL) { - return true; - } - return false; + return LLFloater::isShown(sWindLight); } // virtual void LLFloaterWindLight::onClose(bool app_quitting) { - if (sWindLight) - { - sWindLight->setVisible(FALSE); - } + lldebugs << "Destroying WL floater" << llendl; + sWindLight = NULL; } -#endif // color control callbacks void LLFloaterWindLight::onColorControlRMoved(LLUICtrl* ctrl, void* userData) { + llassert(sWindLight); LLWLParamManager::getInstance()->mAnimator.deactivate(); LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); @@ -520,6 +507,7 @@ void LLFloaterWindLight::onColorControlRMoved(LLUICtrl* ctrl, void* userData) void LLFloaterWindLight::onColorControlGMoved(LLUICtrl* ctrl, void* userData) { + llassert(sWindLight); LLWLParamManager::getInstance()->mAnimator.deactivate(); LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); @@ -592,6 +580,7 @@ void LLFloaterWindLight::onColorControlBMoved(LLUICtrl* ctrl, void* userData) void LLFloaterWindLight::onColorControlIMoved(LLUICtrl* ctrl, void* userData) { + llassert(sWindLight); LLWLParamManager::getInstance()->mAnimator.deactivate(); LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); @@ -737,6 +726,7 @@ void LLFloaterWindLight::onBoolToggle(LLUICtrl* ctrl, void* userData) // time of day void LLFloaterWindLight::onSunMoved(LLUICtrl* ctrl, void* userData) { + llassert(sWindLight); LLWLParamManager::getInstance()->mAnimator.deactivate(); LLSliderCtrl* sunSldr = sWindLight->getChild<LLSliderCtrl>("WLSunAngle"); @@ -789,6 +779,7 @@ void LLFloaterWindLight::onNewPreset(void* userData) void LLFloaterWindLight::onSavePreset(void* userData) { + llassert(sWindLight); // get the name LLComboBox* comboBox = sWindLight->getChild<LLComboBox>( "WLPresetsCombo"); @@ -835,6 +826,7 @@ bool LLFloaterWindLight::saveAlertCallback(const LLSD& notification, const LLSD& void LLFloaterWindLight::onDeletePreset(void* userData) { + llassert(sWindLight); LLComboBox* combo_box = sWindLight->getChild<LLComboBox>( "WLPresetsCombo"); @@ -911,6 +903,7 @@ bool LLFloaterWindLight::deleteAlertCallback(const LLSD& notification, const LLS void LLFloaterWindLight::onChangePresetName(LLUICtrl* ctrl, void * userData) { + llassert(sWindLight); LLWLParamManager::getInstance()->mAnimator.deactivate(); LLComboBox * combo_box = static_cast<LLComboBox*>(ctrl); @@ -951,6 +944,7 @@ void LLFloaterWindLight::onCloudScrollYMoved(LLUICtrl* ctrl, void* userData) void LLFloaterWindLight::onCloudScrollXToggled(LLUICtrl* ctrl, void* userData) { + llassert(sWindLight); LLWLParamManager::getInstance()->mAnimator.deactivate(); LLCheckBoxCtrl* cbCtrl = static_cast<LLCheckBoxCtrl*>(ctrl); @@ -974,6 +968,7 @@ void LLFloaterWindLight::onCloudScrollXToggled(LLUICtrl* ctrl, void* userData) void LLFloaterWindLight::onCloudScrollYToggled(LLUICtrl* ctrl, void* userData) { + llassert(sWindLight); LLWLParamManager::getInstance()->mAnimator.deactivate(); LLCheckBoxCtrl* cbCtrl = static_cast<LLCheckBoxCtrl*>(ctrl); |