diff options
| author | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-06-07 17:46:56 +0300 | 
|---|---|---|
| committer | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-06-07 17:46:56 +0300 | 
| commit | 3ce8ea1dff578511344c453b281ddfc592a56c58 (patch) | |
| tree | 9d011e1ab2cf336d3c26a95c271a6bfc5d103614 | |
| parent | 7151a4e6b02f02155387fc595034a42aebd7ec9c (diff) | |
STORM-1255 WIP Moved stuff around for consistency between the header and the .cpp.
| -rw-r--r-- | indra/newview/llfloatereditsky.cpp | 86 | ||||
| -rw-r--r-- | indra/newview/llfloatereditsky.h | 4 | 
2 files changed, 45 insertions, 45 deletions
| diff --git a/indra/newview/llfloatereditsky.cpp b/indra/newview/llfloatereditsky.cpp index f78baf2ed5..da3f684ba2 100644 --- a/indra/newview/llfloatereditsky.cpp +++ b/indra/newview/llfloatereditsky.cpp @@ -45,8 +45,6 @@  static const F32 WL_SUN_AMBIENT_SLIDER_SCALE = 3.0f; -//================================================================================================= -  LLFloaterEditSky::LLFloaterEditSky(const LLSD &key)  :	LLFloater(key)  ,	mSkyPresetNameEditor(NULL) @@ -210,6 +208,8 @@ void LLFloaterEditSky::initCallbacks(void)  	getChild<LLUICtrl>("WLStarAlpha")->setCommitCallback(boost::bind(&LLFloaterEditSky::onStarAlphaMoved, this, _1));  } +//================================================================================================= +  void LLFloaterEditSky::syncControls()  {  	bool err; @@ -822,6 +822,47 @@ void LLFloaterEditSky::onSkyPresetSelected()  	mMakeDefaultCheckBox->setEnabled(key.scope == LLEnvKey::SCOPE_LOCAL);  } +bool LLFloaterEditSky::onSaveAnswer(const LLSD& notification, const LLSD& response) +{ +	S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + +	// If they choose save, do it.  Otherwise, don't do anything +	if (option == 0) +	{ +		onSaveConfirmed(); +	} + +	return false; +} + +void LLFloaterEditSky::onSaveConfirmed() +{ +	// Save current params to the selected preset. +	LLWLParamKey key(getSelectedSkyPreset()); + +	LL_DEBUGS("Windlight") << "Saving sky preset " << key.name << LL_ENDL; +	LLWLParamManager& wl_mgr = LLWLParamManager::instance(); +	if (wl_mgr.hasParamSet(key)) +	{ +		wl_mgr.setParamSet(key, wl_mgr.mCurParams); +	} +	else +	{ +		wl_mgr.addParamSet(key, wl_mgr.mCurParams); +	} + +	wl_mgr.savePreset(key); + +	// Change preference if requested. +	if (mMakeDefaultCheckBox->getValue()) +	{ +		LL_DEBUGS("Windlight") << key.name << " is now the new preferred sky preset" << llendl; +		LLEnvManagerNew::instance().setUseSkyPreset(key.name); +	} + +	closeFloater(); +} +  void LLFloaterEditSky::onBtnSave()  {  	LLWLParamKey selected_sky = getSelectedSkyPreset(); @@ -866,47 +907,6 @@ void LLFloaterEditSky::onBtnCancel()  	closeFloater();  } -bool LLFloaterEditSky::onSaveAnswer(const LLSD& notification, const LLSD& response) -{ -	S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - -	// If they choose save, do it.  Otherwise, don't do anything -	if (option == 0) -	{ -		onSaveConfirmed(); -	} - -	return false; -} - -void LLFloaterEditSky::onSaveConfirmed() -{ -	// Save current params to the selected preset. -	LLWLParamKey key(getSelectedSkyPreset()); - -	LL_DEBUGS("Windlight") << "Saving sky preset " << key.name << LL_ENDL; -	LLWLParamManager& wl_mgr = LLWLParamManager::instance(); -	if (wl_mgr.hasParamSet(key)) -	{ -		wl_mgr.setParamSet(key, wl_mgr.mCurParams); -	} -	else -	{ -		wl_mgr.addParamSet(key, wl_mgr.mCurParams); -	} - -	wl_mgr.savePreset(key); - -	// Change preference if requested. -	if (mMakeDefaultCheckBox->getValue()) -	{ -		LL_DEBUGS("Windlight") << key.name << " is now the new preferred sky preset" << llendl; -		LLEnvManagerNew::instance().setUseSkyPreset(key.name); -	} - -	closeFloater(); -} -  void LLFloaterEditSky::onSkyPresetListChange()  {  	LLWLParamKey key = getSelectedSkyPreset(); // preset being edited diff --git a/indra/newview/llfloatereditsky.h b/indra/newview/llfloatereditsky.h index 70a90fb5b3..89e7719270 100644 --- a/indra/newview/llfloatereditsky.h +++ b/indra/newview/llfloatereditsky.h @@ -55,6 +55,8 @@ private:  	//-- WL stuff begins ------------------------------------------------------ +	void syncControls(); /// sync up sliders with parameters +  	// general purpose callbacks for dealing with color controllers  	void onColorControlRMoved(LLUICtrl* ctrl, void* userdata);  	void onColorControlGMoved(LLUICtrl* ctrl, void* userdata); @@ -78,8 +80,6 @@ private:  	void onCloudScrollXToggled(LLUICtrl* ctrl);  	void onCloudScrollYToggled(LLUICtrl* ctrl); -	void syncControls(); /// sync up sliders with parameters -  	//-- WL stuff ends --------------------------------------------------------  	bool isNewPreset() const; | 
