summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2018-09-11 14:04:43 -0700
committerRider Linden <rider@lindenlab.com>2018-09-11 14:04:43 -0700
commita0b9c262185c00d15fb54d06ab2fdb1c6d6b95d9 (patch)
tree1d2653c569cf1a7142f6602254fd068be1f2745b
parentfe28c3e886aa8a9d5c5b9bc582b532f1235bd76c (diff)
SL-9620: Double check that commit actually passes back a day cycle from the editor.
Also hide the altitude setting interface for the moment.
-rw-r--r--indra/newview/llfloatereditextdaycycle.cpp38
-rw-r--r--indra/newview/llfloatereditextdaycycle.h8
-rw-r--r--indra/newview/llpanelenvironment.cpp10
3 files changed, 36 insertions, 20 deletions
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index 4cab1160c0..ad797c686a 100644
--- a/indra/newview/llfloatereditextdaycycle.cpp
+++ b/indra/newview/llfloatereditextdaycycle.cpp
@@ -484,24 +484,31 @@ BOOL LLFloaterEditExtDayCycle::handleKeyUp(KEY key, MASK mask, BOOL called_from_
void LLFloaterEditExtDayCycle::onButtonApply(LLUICtrl *ctrl, const LLSD &data)
{
std::string ctrl_action = ctrl->getName();
+ LLSettingsDay::ptr_t dayclone = mEditDay->buildClone(); // create a compressed copy
+
+ if (!dayclone)
+ {
+ LL_WARNS("ENVDAYEDIT") << "Unable to clone daycylce from editor." << LL_ENDL;
+ return;
+ }
if (ctrl_action == ACTION_SAVE)
{
- doApplyUpdateInventory();
+ doApplyUpdateInventory(dayclone);
}
else if (ctrl_action == ACTION_SAVEAS)
{
- doApplyCreateNewInventory();
+ doApplyCreateNewInventory(dayclone);
}
else if ((ctrl_action == ACTION_APPLY_LOCAL) ||
(ctrl_action == ACTION_APPLY_PARCEL) ||
(ctrl_action == ACTION_APPLY_REGION))
{
- doApplyEnvironment(ctrl_action);
+ doApplyEnvironment(ctrl_action, dayclone);
}
else if (ctrl_action == ACTION_COMMIT)
{
- doApplyCommit();
+ doApplyCommit(dayclone);
}
else
{
@@ -1186,31 +1193,30 @@ void LLFloaterEditExtDayCycle::reblendSettings()
mWaterBlender->setPosition(position);
}
-void LLFloaterEditExtDayCycle::doApplyCreateNewInventory()
+void LLFloaterEditExtDayCycle::doApplyCreateNewInventory(const LLSettingsDay::ptr_t &day)
{
// This method knows what sort of settings object to create.
LLUUID parent_id = mInventoryItem ? mInventoryItem->getParentUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS);
- // buildClone creates compressed copy
- LLSettingsVOBase::createInventoryItem(mEditDay->buildClone(), parent_id,
+ LLSettingsVOBase::createInventoryItem(day, parent_id,
[this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); });
}
-void LLFloaterEditExtDayCycle::doApplyUpdateInventory()
+void LLFloaterEditExtDayCycle::doApplyUpdateInventory(const LLSettingsDay::ptr_t &day)
{
if (mInventoryId.isNull())
- LLSettingsVOBase::createInventoryItem(mEditDay->buildClone(), gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS),
+ LLSettingsVOBase::createInventoryItem(day, gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS),
[this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); });
else
- LLSettingsVOBase::updateInventoryItem(mEditDay->buildClone(), mInventoryId,
+ LLSettingsVOBase::updateInventoryItem(day, mInventoryId,
[this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryUpdated(asset_id, inventory_id, results); });
}
-void LLFloaterEditExtDayCycle::doApplyEnvironment(const std::string &where)
+void LLFloaterEditExtDayCycle::doApplyEnvironment(const std::string &where, const LLSettingsDay::ptr_t &day)
{
if (where == ACTION_APPLY_LOCAL)
{
- LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, mEditDay->buildClone());
+ LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, day);
}
else if (where == ACTION_APPLY_PARCEL)
{
@@ -1229,11 +1235,11 @@ void LLFloaterEditExtDayCycle::doApplyEnvironment(const std::string &where)
return;
}
- LLEnvironment::instance().updateParcel(parcel->getLocalID(), mEditDay->buildClone(), -1, -1);
+ LLEnvironment::instance().updateParcel(parcel->getLocalID(), day, -1, -1);
}
else if (where == ACTION_APPLY_REGION)
{
- LLEnvironment::instance().updateRegion(mEditDay->buildClone(), -1, -1);
+ LLEnvironment::instance().updateRegion(day, -1, -1);
}
else
{
@@ -1243,11 +1249,11 @@ void LLFloaterEditExtDayCycle::doApplyEnvironment(const std::string &where)
}
-void LLFloaterEditExtDayCycle::doApplyCommit()
+void LLFloaterEditExtDayCycle::doApplyCommit(LLSettingsDay::ptr_t day)
{
if (!mCommitSignal.empty())
{
- mCommitSignal(mEditDay->buildClone());
+ mCommitSignal(day);
closeFloater();
}
diff --git a/indra/newview/llfloatereditextdaycycle.h b/indra/newview/llfloatereditextdaycycle.h
index 76f7d705a2..f03a69c200 100644
--- a/indra/newview/llfloatereditextdaycycle.h
+++ b/indra/newview/llfloatereditextdaycycle.h
@@ -136,10 +136,10 @@ private:
void onAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status);
void doImportFromDisk();
- void doApplyCreateNewInventory();
- void doApplyUpdateInventory();
- void doApplyEnvironment(const std::string &where);
- void doApplyCommit();
+ void doApplyCreateNewInventory(const LLSettingsDay::ptr_t &day);
+ void doApplyUpdateInventory(const LLSettingsDay::ptr_t &day);
+ void doApplyEnvironment(const std::string &where, const LLSettingsDay::ptr_t &day);
+ void doApplyCommit(LLSettingsDay::ptr_t day);
void onInventoryCreated(LLUUID asset_id, LLUUID inventory_id, LLSD results);
void onInventoryUpdated(LLUUID asset_id, LLUUID inventory_id, LLSD results);
diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp
index 825a38e8b2..d3325796fb 100644
--- a/indra/newview/llpanelenvironment.cpp
+++ b/indra/newview/llpanelenvironment.cpp
@@ -205,6 +205,10 @@ void LLPanelEnvironmentInfo::refresh()
udpateApparentTimeOfDay();
+#if 1
+ // hiding the controls until Rider can get the simulator code to adjust altitudes done.
+ getChild<LLUICtrl>(PNL_ENVIRONMENT_ALTITUDES)->setVisible(FALSE);
+#else
LLEnvironment::altitude_list_t altitudes = LLEnvironment::instance().getRegionAltitudes();
if (altitudes.size() > 0)
{
@@ -216,6 +220,7 @@ void LLPanelEnvironmentInfo::refresh()
mAltitudes[alt_sliders[idx]] = AltitudeData(idx+1, idx, altitudes[idx+1]);
}
}
+#endif
}
@@ -610,6 +615,11 @@ void LLPanelEnvironmentInfo::onPickerCommited(LLUUID asset_id)
void LLPanelEnvironmentInfo::onEditCommited(LLSettingsDay::ptr_t newday)
{
+ if (!newday)
+ {
+ LL_WARNS("ENVPANEL") << "Editor committed an empty day. Do nothing." << LL_ENDL;
+ return;
+ }
size_t newhash(newday->getHash());
size_t oldhash((mCurrentEnvironment->mDayCycle) ? mCurrentEnvironment->mDayCycle->getHash() : 0);