summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llenvironment.cpp4
-rw-r--r--indra/newview/llfloaterregioninfo.cpp129
-rw-r--r--indra/newview/llpanelenvironment.cpp16
-rw-r--r--indra/newview/llpanelenvironment.h16
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml12
5 files changed, 108 insertions, 69 deletions
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp
index 98fe593aeb..f33e5b864a 100644
--- a/indra/newview/llenvironment.cpp
+++ b/indra/newview/llenvironment.cpp
@@ -59,6 +59,7 @@
#include "llatmosphere.h"
#include "llagent.h"
#include "roles_constants.h"
+#include "llestateinfomodel.h"
//=========================================================================
namespace
@@ -395,6 +396,9 @@ bool LLEnvironment::canAgentUpdateParcelEnvironment(LLParcel *parcel) const
if (gAgent.isGodlike())
return true;
+ if (!LLEstateInfoModel::instance().getAllowEnvironmentOverride())
+ return false;
+
return LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_OPTIONS);
}
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index cbb99f1854..1935984df9 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -179,7 +179,7 @@ void unpack_request_params(
class LLPanelRegionEnvironment : public LLPanelEnvironmentInfo
{
public:
- LLPanelRegionEnvironment();
+ LLPanelRegionEnvironment();
virtual void refresh() override;
@@ -193,10 +193,19 @@ public:
virtual BOOL postBuild() override;
protected:
+ static const U32 DIRTY_FLAG_OVERRIDE;
+
virtual void doApply() override;
- virtual void doEditCommited(LLSettingsDay::ptr_t &newday);
- BOOL sendUpdate();
+
+// virtual void doEditCommited(LLSettingsDay::ptr_t &newday);
+// BOOL sendUpdate();
+ bool doUpdateEstate(const LLSD& notification, const LLSD& response);
+
+ void onChkAllowOverride(bool value);
+
+private:
+ bool mAllowOverride;
};
@@ -3369,8 +3378,11 @@ void LLPanelRegionExperiences::itemChanged( U32 event_type, const LLUUID& id )
}
//=========================================================================
+const U32 LLPanelRegionEnvironment::DIRTY_FLAG_OVERRIDE(0x01 << 3);
+
LLPanelRegionEnvironment::LLPanelRegionEnvironment():
- LLPanelEnvironmentInfo()
+ LLPanelEnvironmentInfo(),
+ mAllowOverride(false)
{
LLEstateInfoModel& estate_info = LLEstateInfoModel::instance();
estate_info.setCommitCallback(boost::bind(&LLPanelRegionEnvironment::refreshFromEstate, this));
@@ -3386,6 +3398,7 @@ BOOL LLPanelRegionEnvironment::postBuild()
getChild<LLUICtrl>(RDO_USEDEFAULT)->setLabelArg("[USEDEFAULT]", getString(STR_LABEL_USEDEFAULT));
getChild<LLUICtrl>(CHK_ALLOWOVERRIDE)->setVisible(TRUE);
+ getChild<LLUICtrl>(CHK_ALLOWOVERRIDE)->setCommitCallback([this](LLUICtrl *, const LLSD &value){ onChkAllowOverride(value.asBoolean()); });
return TRUE;
}
@@ -3400,11 +3413,13 @@ void LLPanelRegionEnvironment::refresh()
refreshFromEstate();
LLPanelEnvironmentInfo::refresh();
+
+ getChild<LLUICtrl>(CHK_ALLOWOVERRIDE)->setValue(mAllowOverride);
}
bool LLPanelRegionEnvironment::refreshFromRegion(LLViewerRegion* region)
{
- refresh();
+ refreshFromSource();
return true;
}
@@ -3412,57 +3427,65 @@ void LLPanelRegionEnvironment::refreshFromEstate()
{
const LLEstateInfoModel& estate_info = LLEstateInfoModel::instance();
- getChild<LLUICtrl>(CHK_ALLOWOVERRIDE)->setValue(estate_info.getAllowEnvironmentOverride());
-
+ mAllowOverride = estate_info.getAllowEnvironmentOverride();
}
void LLPanelRegionEnvironment::doApply()
{
LLPanelEnvironmentInfo::doApply();
-// if (mRegionSettingsRadioGroup->getSelectedIndex() == 0)
-// {
-// LLEnvironment::instance().resetRegion();
-// }
-// else
-// {
-// LLSettingsDay::Seconds daylength;
-// F32Hours dayoffset_h;
-//
-// daylength = F32Hours(mDayLengthSlider->getValueF32());
-// dayoffset_h = F32Hours(mDayOffsetSlider->getValueF32());
-//
-// if (dayoffset_h.value() < 0)
-// {
-// dayoffset_h = F32Hours(24.0f) + dayoffset_h;
-// }
-//
-// LLSettingsDay::Seconds dayoffset_s = dayoffset_h;
-//
-// LLEnvironment::instance().updateRegion(mEditingDayCycle, daylength.value(), dayoffset_s.value());
-// }
-}
-
-void LLPanelRegionEnvironment::doEditCommited(LLSettingsDay::ptr_t &newday)
-{
-// mEditingDayCycle = newday;
-}
-
-BOOL LLPanelRegionEnvironment::sendUpdate()
-{
-// LL_INFOS() << "LLPanelEsateInfo::sendUpdate()" << LL_ENDL;
-//
-// LLNotification::Params params("ChangeLindenEstate");
-// params.functor.function(boost::bind(&LLPanelEstateInfo::callbackChangeLindenEstate, this, _1, _2));
-//
-// if (isLindenEstate())
-// {
-// // trying to change reserved estate, warn
-// LLNotifications::instance().add(params);
-// }
-// else
-// {
-// // for normal estates, just make the change
-// LLNotifications::instance().forceResponse(params, 0);
-// }
- return TRUE;
+
+ if (getIsDirtyFlag(DIRTY_FLAG_OVERRIDE))
+ {
+ LLNotification::Params params("ChangeLindenEstate");
+ //params.functor.function(boost::bind(&LLPanelEstateInfo::doUpdateEstate, this, _1, _2));
+ params.functor.function([this](const LLSD& notification, const LLSD& response) { doUpdateEstate(notification, response); });
+
+ if (LLPanelEstateInfo::isLindenEstate())
+ {
+ // trying to change reserved estate, warn
+ LLNotifications::instance().add(params);
+ }
+ else
+ {
+ // for normal estates, just make the change
+ LLNotifications::instance().forceResponse(params, 0);
+ }
+
+ }
+}
+
+bool LLPanelRegionEnvironment::doUpdateEstate(const LLSD& notification, const LLSD& response)
+{
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+
+ switch (option)
+ {
+ case 0:
+ {
+ LLEstateInfoModel& estate_info = LLEstateInfoModel::instance();
+
+ // update model
+ estate_info.setAllowEnvironmentOverride(mAllowOverride);
+ // send the update to sim
+ estate_info.sendEstateInfo();
+ clearDirtyFlag(DIRTY_FLAG_OVERRIDE);
+ }
+ break;
+
+ case 1:
+ default:
+ break;
+ }
+ return false;
+}
+
+void LLPanelRegionEnvironment::onChkAllowOverride(bool value)
+{
+ if (!value)
+ {
+ LLNotificationsUtil::add("EstateParcelEnvironmentOverride");
+ }
+
+ setDirtyFlag(DIRTY_FLAG_OVERRIDE);
+ mAllowOverride = value;
}
diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp
index d323e5f43b..7d11f7c6e2 100644
--- a/indra/newview/llpanelenvironment.cpp
+++ b/indra/newview/llpanelenvironment.cpp
@@ -69,11 +69,11 @@ const std::string LLPanelEnvironmentInfo::STR_LABEL_USEDEFAULT("str_label_use_de
const std::string LLPanelEnvironmentInfo::STR_LABEL_USEREGION("str_label_use_region");
const std::string LLPanelEnvironmentInfo::STR_LABEL_UNKNOWNINV("str_unknow_inventory");
-const S32 LLPanelEnvironmentInfo::DIRTY_FLAG_DAYCYCLE(0x01 << 0);
-const S32 LLPanelEnvironmentInfo::DIRTY_FLAG_DAYLENGTH(0x01 << 1);
-const S32 LLPanelEnvironmentInfo::DIRTY_FLAG_DAYOFFSET(0x01 << 2);
+const U32 LLPanelEnvironmentInfo::DIRTY_FLAG_DAYCYCLE(0x01 << 0);
+const U32 LLPanelEnvironmentInfo::DIRTY_FLAG_DAYLENGTH(0x01 << 1);
+const U32 LLPanelEnvironmentInfo::DIRTY_FLAG_DAYOFFSET(0x01 << 2);
-const S32 LLPanelEnvironmentInfo::DIRTY_FLAG_MASK(
+const U32 LLPanelEnvironmentInfo::DIRTY_FLAG_MASK(
LLPanelEnvironmentInfo::DIRTY_FLAG_DAYCYCLE |
LLPanelEnvironmentInfo::DIRTY_FLAG_DAYLENGTH |
LLPanelEnvironmentInfo::DIRTY_FLAG_DAYOFFSET );
@@ -253,7 +253,7 @@ void LLPanelEnvironmentInfo::setApplyProgress(bool started)
// }
}
-void LLPanelEnvironmentInfo::setDirtyFlag(S32 flag)
+void LLPanelEnvironmentInfo::setDirtyFlag(U32 flag)
{
bool can_edit = canEdit();
mDirtyFlag |= flag;
@@ -261,7 +261,7 @@ void LLPanelEnvironmentInfo::setDirtyFlag(S32 flag)
getChildView(BTN_CANCEL)->setEnabled((mDirtyFlag != 0) && can_edit);
}
-void LLPanelEnvironmentInfo::clearDirtyFlag(S32 flag)
+void LLPanelEnvironmentInfo::clearDirtyFlag(U32 flag)
{
bool can_edit = canEdit();
mDirtyFlag &= ~flag;
@@ -294,7 +294,7 @@ void LLPanelEnvironmentInfo::onSldDayOffsetChanged(F32 value)
if (dayoffset.value() < 0.0f)
dayoffset += F32Hours(24.0);
- mCurrentEnvironment->mDayLength = dayoffset;
+ mCurrentEnvironment->mDayOffset = dayoffset;
setDirtyFlag(DIRTY_FLAG_DAYOFFSET);
}
@@ -353,8 +353,8 @@ void LLPanelEnvironmentInfo::doApply()
[this](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) {handleEnvironmentReceived(parcel_id, envifo); });
}
+ setControlsEnabled(false);
}
- setControlsEnabled(false);
}
void LLPanelEnvironmentInfo::onPickerCommited(LLUUID asset_id)
diff --git a/indra/newview/llpanelenvironment.h b/indra/newview/llpanelenvironment.h
index 66224f8ba7..9a7ce289f0 100644
--- a/indra/newview/llpanelenvironment.h
+++ b/indra/newview/llpanelenvironment.h
@@ -80,19 +80,19 @@ protected:
static const std::string STR_LABEL_USEREGION;
static const std::string STR_LABEL_UNKNOWNINV;
- static const S32 DIRTY_FLAG_DAYCYCLE;
- static const S32 DIRTY_FLAG_DAYLENGTH;
- static const S32 DIRTY_FLAG_DAYOFFSET;
+ static const U32 DIRTY_FLAG_DAYCYCLE;
+ static const U32 DIRTY_FLAG_DAYLENGTH;
+ static const U32 DIRTY_FLAG_DAYOFFSET;
- static const S32 DIRTY_FLAG_MASK;
+ static const U32 DIRTY_FLAG_MASK;
void setControlsEnabled(bool enabled);
void setApplyProgress(bool started);
- void setDirtyFlag(S32 flag);
- void clearDirtyFlag(S32 flag);
+ void setDirtyFlag(U32 flag);
+ void clearDirtyFlag(U32 flag);
bool getIsDirty() const { return (mDirtyFlag != 0); }
- bool getIsDirtyFlag(S32 flag) const { return ((mDirtyFlag & flag) != 0); }
- S32 getDirtyFlag() const { return mDirtyFlag; }
+ bool getIsDirtyFlag(U32 flag) const { return ((mDirtyFlag & flag) != 0); }
+ U32 getDirtyFlag() const { return mDirtyFlag; }
void onSwitchDefaultSelection();
void onSldDayLengthChanged(F32 value);
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 9d406a14e1..f011fe0aaa 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -4799,6 +4799,18 @@ Unchecking this option may remove restrictions that parcel owners have added to
<notification
icon="alertmodal.tga"
+ name="EstateParcelEnvironmentOverride"
+ type="alertmodal">
+Unchecking this option may remove any custom environments that parcel owners have added to their parcels. Please discuss with your parcel owners as needed.
+ <tag>confirm</tag>
+ <usetemplate
+ name="okbutton"
+ yestext="OK"/>
+ </notification>
+
+
+ <notification
+ icon="alertmodal.tga"
name="RegionEntryAccessBlocked"
type="alertmodal">
<tag>fail</tag>