diff options
Diffstat (limited to 'indra/newview/llpanelenvironment.cpp')
-rw-r--r-- | indra/newview/llpanelenvironment.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp index 04153b8aa7..3e0bb43d71 100644 --- a/indra/newview/llpanelenvironment.cpp +++ b/indra/newview/llpanelenvironment.cpp @@ -148,10 +148,13 @@ LLPanelEnvironmentInfo::~LLPanelEnvironmentInfo() mChangeMonitor.disconnect(); if (mCommitConnection.connected()) mCommitConnection.disconnect(); + if (mUpdateConnection.connected()) + mUpdateConnection.disconnect(); } BOOL LLPanelEnvironmentInfo::postBuild() { + getChild<LLUICtrl>(BTN_USEDEFAULT)->setCommitCallback([this](LLUICtrl *, const LLSD &){ onBtnDefault(); }); getChild<LLUICtrl>(BTN_SELECTINV)->setCommitCallback([this](LLUICtrl *, const LLSD &){ onBtnSelect(); }); getChild<LLUICtrl>(BTN_EDIT)->setCommitCallback([this](LLUICtrl *, const LLSD &){ onBtnEdit(); }); @@ -166,6 +169,9 @@ BOOL LLPanelEnvironmentInfo::postBuild() mChangeMonitor = LLEnvironment::instance().setEnvironmentChanged([this](LLEnvironment::EnvSelection_t env, S32 version) { onEnvironmentChanged(env, version); }); + // if we ever allow LLEstateInfoModel to work for non-EMs, uncomment this line. + // mUpdateConnection = LLEstateInfoModel::instance().setUpdateCallback(boost::bind(&LLPanelEnvironmentInfo::refreshFromEstate, this)); + getChild<LLSettingsDropTarget>(SDT_DROP_TARGET)->setPanel(this); return TRUE; @@ -291,21 +297,13 @@ void LLPanelEnvironmentInfo::refresh() void LLPanelEnvironmentInfo::refreshFromEstate() { - /*TODO: Bug!! estate_info seems stale if regain floater has not been opened.*/ - const LLEstateInfoModel& estate_info = LLEstateInfoModel::instance(); + /*TODO: Unfortunately only estate manager may get information from the LLEstateInfoModel. + * The proletariat is not allowed to know what options are set for an estate. We should fix this.*/ - if (isRegion()) - { // this should always work... but estate_info gives back false when it shouldn't for parcels - bool oldAO = mAllowOverride; - mAllowOverride = estate_info.getAllowEnvironmentOverride(); - if (oldAO != mAllowOverride) - refresh(); - } - else - { - // Get rid of this when I solve the above. - mAllowOverride = true; - } + bool oldAO = mAllowOverride; + mAllowOverride = (!isRegion()) || LLEstateInfoModel::instance().getAllowEnvironmentOverride(); + if (oldAO != mAllowOverride) + refresh(); } std::string LLPanelEnvironmentInfo::getInventoryNameForAssetId(LLUUID asset_id) |