From 598cd8a30fe31b2af5e9bd23db72101afae45870 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Mon, 10 Sep 2018 17:31:31 +0300 Subject: MAINT-9066 EEP should not be able to delete all Keyframes from Ground Level or Water --- indra/newview/llfloatereditextdaycycle.cpp | 14 +++++++++++++- indra/newview/llfloatereditextdaycycle.h | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp index f1dbb32016..2295e4f10b 100644 --- a/indra/newview/llfloatereditextdaycycle.cpp +++ b/indra/newview/llfloatereditextdaycycle.cpp @@ -842,7 +842,7 @@ void LLFloaterEditExtDayCycle::updateButtons() //mAddFrameButton->setEnabled(can_add); //mDeleteFrameButton->setEnabled(!can_add); mAddFrameButton->setEnabled(true && mCanMod); - mDeleteFrameButton->setEnabled(true && mCanMod); + mDeleteFrameButton->setEnabled(isRemovingFrameAllowed() && mCanMod); } void LLFloaterEditExtDayCycle::updateSlider() @@ -1198,6 +1198,18 @@ void LLFloaterEditExtDayCycle::doApplyCommit() } } +bool LLFloaterEditExtDayCycle::isRemovingFrameAllowed() +{ + if (mCurrentTrack <= LLSettingsDay::TRACK_GROUND_LEVEL) + { + return (mSliderKeyMap.size() > 1); + } + else + { + return (mSliderKeyMap.size() > 0); + } +} + void LLFloaterEditExtDayCycle::onInventoryCreated(LLUUID asset_id, LLUUID inventory_id, LLSD results) { LL_INFOS("ENVDAYEDIT") << "Inventory item " << inventory_id << " has been created with asset " << asset_id << " results are:" << results << LL_ENDL; diff --git a/indra/newview/llfloatereditextdaycycle.h b/indra/newview/llfloatereditextdaycycle.h index c64ed3ff5a..d808dc60c5 100644 --- a/indra/newview/llfloatereditextdaycycle.h +++ b/indra/newview/llfloatereditextdaycycle.h @@ -166,6 +166,8 @@ private: void setDirtyFlag() { mIsDirty = true; } virtual void clearDirtyFlag(); + bool isRemovingFrameAllowed(); + LLSettingsDay::ptr_t mEditDay; // edited copy LLSettingsDay::Seconds mDayLength; U32 mCurrentTrack; -- cgit v1.2.3 From 2fd4ce55af8c68b8ae5eea72566cdb6d87d3a842 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 10 Sep 2018 11:22:36 -0700 Subject: 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. --- indra/newview/llpanelenvironment.cpp | 27 +++++++++++++++++++++++++++ indra/newview/llpanelenvironment.h | 1 + 2 files changed, 28 insertions(+) (limited to 'indra/newview') 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(RDG_ENVIRONMENT_SELECT)->getSelectedIndex(); @@ -272,6 +298,7 @@ void LLPanelEnvironmentInfo::setControlsEnabled(bool enabled) getChild(PNL_BUTTONS)->setVisible(!is_unavailable); getChild(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; -- cgit v1.2.3 From 6246c8077e5ee81321cff52250d3b99eab81cd57 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 10 Sep 2018 14:49:14 -0700 Subject: MAINT-9118: Allow the environment panel to indicated that the environment may be modified. --- indra/newview/llfloatereditextdaycycle.cpp | 6 ++++++ indra/newview/llfloatereditextdaycycle.h | 1 + indra/newview/llpanelenvironment.cpp | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp index 2295e4f10b..166d53fc74 100644 --- a/indra/newview/llfloatereditextdaycycle.cpp +++ b/indra/newview/llfloatereditextdaycycle.cpp @@ -114,6 +114,7 @@ namespace { const std::string LLFloaterEditExtDayCycle::KEY_INVENTORY_ID("inventory_id"); const std::string LLFloaterEditExtDayCycle::KEY_EDIT_CONTEXT("edit_context"); const std::string LLFloaterEditExtDayCycle::KEY_DAY_LENGTH("day_length"); +const std::string LLFloaterEditExtDayCycle::KEY_CANMOD("canmod"); const std::string LLFloaterEditExtDayCycle::VALUE_CONTEXT_INVENTORY("inventory"); const std::string LLFloaterEditExtDayCycle::VALUE_CONTEXT_PARCEL("parcel"); @@ -234,6 +235,11 @@ void LLFloaterEditExtDayCycle::onOpen(const LLSD& key) mEditContext = CONTEXT_REGION; } + if (key.has(KEY_CANMOD)) + { + mCanMod = key[KEY_CANMOD].asBoolean(); + } + if (mEditContext == CONTEXT_UNKNOWN) { LL_WARNS("ENVDAYEDIT") << "Unknown editing context!" << LL_ENDL; diff --git a/indra/newview/llfloatereditextdaycycle.h b/indra/newview/llfloatereditextdaycycle.h index d808dc60c5..76f7d705a2 100644 --- a/indra/newview/llfloatereditextdaycycle.h +++ b/indra/newview/llfloatereditextdaycycle.h @@ -57,6 +57,7 @@ public: static const std::string KEY_INVENTORY_ID; static const std::string KEY_EDIT_CONTEXT; static const std::string KEY_DAY_LENGTH; + static const std::string KEY_CANMOD; static const std::string VALUE_CONTEXT_INVENTORY; static const std::string VALUE_CONTEXT_PARCEL; diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp index e1676fbb13..3edfd4156c 100644 --- a/indra/newview/llpanelenvironment.cpp +++ b/indra/newview/llpanelenvironment.cpp @@ -384,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) -- cgit v1.2.3