summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2018-09-10 11:22:36 -0700
committerRider Linden <rider@lindenlab.com>2018-09-10 11:22:36 -0700
commit2fd4ce55af8c68b8ae5eea72566cdb6d87d3a842 (patch)
tree6a178fe6d6c9cb4300e59f776da816ad08a5d6a3 /indra
parent598cd8a30fe31b2af5e9bd23db72101afae45870 (diff)
MAINT-9115: When selecting no parcel or a parcel without a day cycle, close the day cycle editor if it is not dirty, if dirty just disable commit.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llpanelenvironment.cpp27
-rw-r--r--indra/newview/llpanelenvironment.h1
2 files changed, 28 insertions, 0 deletions
diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp
index 51b2fa380f..e1676fbb13 100644
--- a/indra/newview/llpanelenvironment.cpp
+++ b/indra/newview/llpanelenvironment.cpp
@@ -141,6 +141,7 @@ void LLPanelEnvironmentInfo::refresh()
return;
setControlsEnabled(canEdit());
+
if (!mCurrentEnvironment)
{
return;
@@ -240,6 +241,7 @@ LLFloaterEditExtDayCycle * LLPanelEnvironmentInfo::getEditFloater(bool create)
if (!editor)
return nullptr;
+ mEditFloater = editor->getHandle();
}
if (editor && !mCommitConnection.connected())
@@ -248,6 +250,30 @@ LLFloaterEditExtDayCycle * LLPanelEnvironmentInfo::getEditFloater(bool create)
return editor;
}
+
+void LLPanelEnvironmentInfo::updateEditFloater(const LLEnvironment::EnvironmentInfo::ptr_t &nextenv)
+{
+ LLFloaterEditExtDayCycle *dayeditor(getEditFloater(false));
+
+ if (!dayeditor)
+ return;
+
+ if (!nextenv || !nextenv->mDayCycle)
+ {
+ if (mCommitConnection.connected())
+ mCommitConnection.disconnect();
+
+ if (dayeditor->isDirty())
+ dayeditor->refresh();
+ else
+ dayeditor->closeFloater();
+ }
+ else
+ {
+ /*TODO: Swap in new day to edit?*/
+ }
+}
+
void LLPanelEnvironmentInfo::setControlsEnabled(bool enabled)
{
S32 rdo_selection = getChild<LLRadioGroup>(RDG_ENVIRONMENT_SELECT)->getSelectedIndex();
@@ -272,6 +298,7 @@ void LLPanelEnvironmentInfo::setControlsEnabled(bool enabled)
getChild<LLUICtrl>(PNL_BUTTONS)->setVisible(!is_unavailable);
getChild<LLUICtrl>(PNL_DISABLED)->setVisible(is_unavailable);
+ updateEditFloater(mCurrentEnvironment);
}
void LLPanelEnvironmentInfo::setApplyProgress(bool started)
diff --git a/indra/newview/llpanelenvironment.h b/indra/newview/llpanelenvironment.h
index b867a7b61d..a8a1f018cf 100644
--- a/indra/newview/llpanelenvironment.h
+++ b/indra/newview/llpanelenvironment.h
@@ -121,6 +121,7 @@ protected:
LLFloaterSettingsPicker * getSettingsPicker();
LLFloaterEditExtDayCycle * getEditFloater(bool create = true);
+ void updateEditFloater(const LLEnvironment::EnvironmentInfo::ptr_t &nextenv);
LLEnvironment::EnvironmentInfo::ptr_t mCurrentEnvironment;
S32 mCurrentParcelId;