summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelenvironment.cpp
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2018-09-10 23:22:42 +0100
committerGraham Linden <graham@lindenlab.com>2018-09-10 23:22:42 +0100
commit48ec44c2faac816615a4709b0e71e2a0a88e9885 (patch)
tree2964a04a7fa075890a28bcfd64ea7bb30772cdea /indra/newview/llpanelenvironment.cpp
parent555dfdc6ef0dab37bc4eaf6ae0b00a857f0609da (diff)
parent6246c8077e5ee81321cff52250d3b99eab81cd57 (diff)
Merge
Diffstat (limited to 'indra/newview/llpanelenvironment.cpp')
-rw-r--r--indra/newview/llpanelenvironment.cpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp
index 51b2fa380f..3edfd4156c 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)
@@ -357,7 +384,8 @@ void LLPanelEnvironmentInfo::onBtnEdit()
LLFloaterEditExtDayCycle *dayeditor = getEditFloater();
LLSD params(LLSDMap(LLFloaterEditExtDayCycle::KEY_EDIT_CONTEXT, (mCurrentParcelId == INVALID_PARCEL_ID) ? LLFloaterEditExtDayCycle::VALUE_CONTEXT_REGION : LLFloaterEditExtDayCycle::VALUE_CONTEXT_REGION)
- (LLFloaterEditExtDayCycle::KEY_DAY_LENGTH, mCurrentEnvironment ? (S32)(mCurrentEnvironment->mDayLength.value()) : FOURHOURS));
+ (LLFloaterEditExtDayCycle::KEY_DAY_LENGTH, mCurrentEnvironment ? (S32)(mCurrentEnvironment->mDayLength.value()) : FOURHOURS)
+ (LLFloaterEditExtDayCycle::KEY_CANMOD, LLSD::Boolean(true)));
dayeditor->openFloater(params);
if (mCurrentEnvironment->mDayCycle)