diff options
author | Rider Linden <rider@lindenlab.com> | 2018-09-19 15:31:23 -0700 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2018-09-19 15:31:23 -0700 |
commit | cae08e0096f75827851a8c9447e163ddb0132f2d (patch) | |
tree | 512d05c8082a654569d9602a42e4f0874b39bac2 /indra/newview/llpanelenvironment.cpp | |
parent | 1ef89151bda78b39f44071cfdbb28f1f0450b436 (diff) |
SL-9661: Trigger an event when the settings on a parcel or region are changed. Environment panel montiors this event and updates itself when it occurs.
Diffstat (limited to 'indra/newview/llpanelenvironment.cpp')
-rw-r--r-- | indra/newview/llpanelenvironment.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp index bc06bde138..1beba9db0c 100644 --- a/indra/newview/llpanelenvironment.cpp +++ b/indra/newview/llpanelenvironment.cpp @@ -125,6 +125,12 @@ LLPanelEnvironmentInfo::LLPanelEnvironmentInfo(): { } +LLPanelEnvironmentInfo::~LLPanelEnvironmentInfo() +{ + if (mChangeMonitor.connected()) + mChangeMonitor.disconnect(); +} + BOOL LLPanelEnvironmentInfo::postBuild() { getChild<LLUICtrl>(RDG_ENVIRONMENT_SELECT)->setCommitCallback([this](LLUICtrl *, const LLSD &){ onSwitchDefaultSelection(); }); @@ -138,6 +144,8 @@ BOOL LLPanelEnvironmentInfo::postBuild() getChild<LLMultiSliderCtrl>(SLD_ALTITUDES)->setCommitCallback([this](LLUICtrl *cntrl, const LLSD &value) { onAltSliderCallback(cntrl, value); }); + mChangeMonitor = LLEnvironment::instance().setEnvironmentChanged([this](LLEnvironment::EnvSelection_t env) { onEnvironmentChanged(env); }); + return TRUE; } @@ -151,7 +159,9 @@ void LLPanelEnvironmentInfo::onOpen(const LLSD& key) void LLPanelEnvironmentInfo::onVisibilityChange(BOOL new_visibility) { if (new_visibility) + { gIdleCallbacks.addFunction(onIdlePlay, this); + } else { LLFloaterSettingsPicker *picker = getSettingsPicker(false); @@ -164,6 +174,7 @@ void LLPanelEnvironmentInfo::onVisibilityChange(BOOL new_visibility) LLFloaterEditExtDayCycle *dayeditor = getEditFloater(); if (mCommitConnection.connected()) mCommitConnection.disconnect(); + if (dayeditor) { if (dayeditor->isDirty()) @@ -674,6 +685,17 @@ void LLPanelEnvironmentInfo::onEditCommitted(LLSettingsDay::ptr_t newday) } } +void LLPanelEnvironmentInfo::onEnvironmentChanged(LLEnvironment::EnvSelection_t env) +{ + if ((isRegion() && (env == LLEnvironment::ENV_REGION)) || + ((env == LLEnvironment::ENV_PARCEL) && (getParcelId() == LLViewerParcelMgr::instance().getAgentParcelId()))) + { + mCurrentEnvironment.reset(); + refreshFromSource(); + } +} + + void LLPanelEnvironmentInfo::onPickerAssetDownloaded(LLSettingsBase::ptr_t settings) { LLSettingsVODay::buildFromOtherSetting(settings, [this](LLSettingsDay::ptr_t pday) |