diff options
| -rw-r--r-- | indra/newview/llfloatereditsky.cpp | 18 | ||||
| -rw-r--r-- | indra/newview/llfloatereditsky.h | 1 | 
2 files changed, 19 insertions, 0 deletions
| diff --git a/indra/newview/llfloatereditsky.cpp b/indra/newview/llfloatereditsky.cpp index a35b7cb003..538d6cfa39 100644 --- a/indra/newview/llfloatereditsky.cpp +++ b/indra/newview/llfloatereditsky.cpp @@ -39,6 +39,7 @@  // newview  #include "llagent.h" +#include "llregioninfomodel.h"  #include "llviewerregion.h"  #undef max @@ -121,6 +122,9 @@ void LLFloaterEditSky::initCallbacks(void)  	LLEnvManagerNew::instance().setRegionSettingsChangeCallback(boost::bind(&LLFloaterEditSky::onRegionSettingsChange, this));  	LLWLParamManager::instance().setPresetListChangeCallback(boost::bind(&LLFloaterEditSky::onSkyPresetListChange, this)); +	// Connect to region info updates. +	LLRegionInfoModel::instance().setUpdateCallback(boost::bind(&LLFloaterEditSky::onRegionInfoUpdate, this)); +  	//-------------------------------------------------------------------------  	LLWLParamManager& param_mgr = LLWLParamManager::instance(); @@ -949,3 +953,17 @@ void LLFloaterEditSky::onRegionSettingsChange()  		refreshSkyPresetsList();  	}  } + +void LLFloaterEditSky::onRegionInfoUpdate() +{ +	bool can_edit = true; + +	// If we've selected the region day cycle for editing. +	if (getSelectedSkyPreset().scope == LLEnvKey::SCOPE_REGION) +	{ +		// check whether we have the access +		can_edit = LLEnvManagerNew::canEditRegionSettings(); +	} + +	enableEditing(can_edit); +} diff --git a/indra/newview/llfloatereditsky.h b/indra/newview/llfloatereditsky.h index 85b4b250d5..0ad4217a43 100644 --- a/indra/newview/llfloatereditsky.h +++ b/indra/newview/llfloatereditsky.h @@ -99,6 +99,7 @@ private:  	void onSkyPresetListChange();  	void onRegionSettingsChange(); +	void onRegionInfoUpdate();  	LLLineEditor*	mSkyPresetNameEditor;  	LLComboBox*		mSkyPresetCombo; | 
