From b37eb2642f6e6e4d1e32a49c7ab31f70321cd979 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 10 Nov 2017 16:17:25 -0800 Subject: Remove delete preset dialog, Initial settings for selection level (Region/Parcel/Local) --- indra/newview/llfloaterregioninfo.cpp | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index af68a2aae1..4f0603fe59 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -53,7 +53,6 @@ #include "llcheckboxctrl.h" #include "llcombobox.h" #include "lldaycyclemanager.h" -#include "llenvmanager.h" #include "llestateinfomodel.h" #include "llfilepicker.h" #include "llfloatergodtools.h" // for send_sim_wide_deletes() @@ -99,6 +98,8 @@ #include "llpanelexperiences.h" #include "llcorehttputil.h" +#include "llenvmanager.h" + const S32 TERRAIN_TEXTURE_COUNT = 4; const S32 CORNER_COUNT = 4; @@ -3115,7 +3116,7 @@ BOOL LLPanelEnvironmentInfo::postBuild() mDayCyclePresetCombo = getChild("dayc_settings_preset_combo"); mDayCyclePresetCombo->setCommitCallback(boost::bind(&LLPanelEnvironmentInfo::onSelectDayCycle, this)); - childSetCommitCallback("apply_btn", boost::bind(&LLPanelEnvironmentInfo::onBtnApply, this), NULL); + childSetCommitCallback("apply_btn", boost::bind(&LLPanelEnvironmentInfo::onBtnApply, this), NULL); getChild("apply_btn")->setRightMouseDownCallback(boost::bind(&LLEnvManagerNew::dumpUserPrefs, LLEnvManagerNew::getInstance())); childSetCommitCallback("cancel_btn", boost::bind(&LLPanelEnvironmentInfo::onBtnCancel, this), NULL); getChild("cancel_btn")->setRightMouseDownCallback(boost::bind(&LLEnvManagerNew::dumpPresets, LLEnvManagerNew::getInstance())); @@ -3191,9 +3192,9 @@ void LLPanelEnvironmentInfo::setControlsEnabled(bool enabled) mRegionSettingsRadioGroup->setEnabled(enabled); mDayCycleSettingsRadioGroup->setEnabled(enabled); - mWaterPresetCombo->setEnabled(enabled); - mSkyPresetCombo->setEnabled(enabled); - mDayCyclePresetCombo->setEnabled(enabled); + mWaterPresetCombo->setEnabled(false); + mSkyPresetCombo->setEnabled(false); + mDayCyclePresetCombo->setEnabled(false); getChildView("apply_btn")->setEnabled(enabled); getChildView("cancel_btn")->setEnabled(enabled); @@ -3234,6 +3235,7 @@ void LLPanelEnvironmentInfo::setDirty(bool dirty) void LLPanelEnvironmentInfo::sendRegionSunUpdate() { +#if 0 LLRegionInfoModel& region_info = LLRegionInfoModel::instance(); // If the region is being switched to fixed sky, @@ -3258,6 +3260,7 @@ void LLPanelEnvironmentInfo::sendRegionSunUpdate() LL_DEBUGS("Windlight Sync") << "Sun hour: " << region_info.mSunHour << LL_ENDL; region_info.sendRegionTerrain(LLFloaterRegionInfo::getLastInvoice()); +#endif } void LLPanelEnvironmentInfo::fixEstateSun() @@ -3276,6 +3279,7 @@ void LLPanelEnvironmentInfo::fixEstateSun() void LLPanelEnvironmentInfo::populateWaterPresetsList() { +#if 0 mWaterPresetCombo->removeall(); // If the region already has water params, add them to the list. @@ -3308,10 +3312,12 @@ void LLPanelEnvironmentInfo::populateWaterPresetsList() } // There's no way to select current preset because its name is not stored on server. +#endif } void LLPanelEnvironmentInfo::populateSkyPresetsList() { +#if 0 mSkyPresetCombo->removeall(); LLWLParamManager::preset_name_list_t region_presets; @@ -3356,10 +3362,12 @@ void LLPanelEnvironmentInfo::populateSkyPresetsList() std::string preset_name = sky_map.beginMap()->first; mSkyPresetCombo->selectByValue(LLWLParamKey(preset_name, LLEnvKey::SCOPE_REGION).toStringVal()); } +#endif } void LLPanelEnvironmentInfo::populateDayCyclesList() { +#if 0 mDayCyclePresetCombo->removeall(); // If the region already has env. settings, add its day cycle to the list. @@ -3394,10 +3402,12 @@ void LLPanelEnvironmentInfo::populateDayCyclesList() } // Current day cycle is already selected. +#endif } bool LLPanelEnvironmentInfo::getSelectedWaterParams(LLSD& water_params) { +#if 0 LLWLParamKey water_key(mWaterPresetCombo->getSelectedValue()); if (water_key.scope == LLEnvKey::SCOPE_REGION) @@ -3417,10 +3427,13 @@ bool LLPanelEnvironmentInfo::getSelectedWaterParams(LLSD& water_params) } return true; +#endif + return false; } bool LLPanelEnvironmentInfo::getSelectedSkyParams(LLSD& sky_params, std::string& preset_name) { +#if 0 std::string preset_key(mSkyPresetCombo->getValue().asString()); LLWLParamKey preset(preset_key); @@ -3435,10 +3448,13 @@ bool LLPanelEnvironmentInfo::getSelectedSkyParams(LLSD& sky_params, std::string& sky_params = param_set.getAll(); preset_name = preset.name; return true; +#endif + return false; } bool LLPanelEnvironmentInfo::getSelectedDayCycleParams(LLSD& day_cycle, LLSD& sky_map, short& scope) { +#if 0 std::string preset_key(mDayCyclePresetCombo->getValue().asString()); LLWLParamKey dc(preset_key); LL_DEBUGS("Windlight") << "Use day cycle: " << dc.toLLSD() << LL_ENDL; @@ -3468,6 +3484,8 @@ bool LLPanelEnvironmentInfo::getSelectedDayCycleParams(LLSD& day_cycle, LLSD& sk scope = dc.scope; return true; +#endif + return false; } void LLPanelEnvironmentInfo::onSwitchRegionSettings() { @@ -3615,6 +3633,7 @@ void LLPanelEnvironmentInfo::onBtnApply() } } +#if 0 // Send settings apply request. LLEnvironmentSettings new_region_settings; new_region_settings.saveParams(day_cycle, sky_map, water_params, 0.0f); @@ -3627,6 +3646,7 @@ void LLPanelEnvironmentInfo::onBtnApply() // When the settings get applied, we'll also send the region sun position update. // To determine the sun angle we're going to need the new settings. mNewRegionSettings = new_region_settings; +#endif // Start spinning the progress indicator. setApplyProgress(true); @@ -3637,6 +3657,8 @@ void LLPanelEnvironmentInfo::onBtnCancel() // Reload last saved region settings. refresh(); +#if 0 + LLEnvironment::instance().applyChosenEnvironment(); // Apply them. LLEnvManagerNew& env_mgr = LLEnvManagerNew::instance(); const LLEnvironmentSettings& cur_settings = env_mgr.getRegionSettings(); @@ -3644,6 +3666,7 @@ void LLPanelEnvironmentInfo::onBtnCancel() const LLSD& region_water = cur_settings.getWaterParams(); env_mgr.useWaterParams(region_water); env_mgr.useDayCycleParams(region_day_cycle, LLEnvKey::SCOPE_REGION); +#endif } void LLPanelEnvironmentInfo::onRegionSettingschange() -- cgit v1.2.3 From b227c86b450134f17ec0624655e1e4c5cb5ba89d Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 13 Nov 2017 14:40:54 -0800 Subject: Remove the old wl environment code. --- indra/newview/llfloaterregioninfo.cpp | 38 +++++++++++++++++------------------ 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 4f0603fe59..e0a56b9412 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -52,7 +52,6 @@ #include "llbutton.h" #include "llcheckboxctrl.h" #include "llcombobox.h" -#include "lldaycyclemanager.h" #include "llestateinfomodel.h" #include "llfilepicker.h" #include "llfloatergodtools.h" // for send_sim_wide_deletes() @@ -86,7 +85,6 @@ #include "llviewertexteditor.h" #include "llviewerwindow.h" #include "llvlcomposition.h" -#include "llwaterparammanager.h" #include "lltrans.h" #include "llagentui.h" #include "llmeshrepository.h" @@ -98,8 +96,6 @@ #include "llpanelexperiences.h" #include "llcorehttputil.h" -#include "llenvmanager.h" - const S32 TERRAIN_TEXTURE_COUNT = 4; const S32 CORNER_COUNT = 4; @@ -338,13 +334,13 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) { return; } - +#if 0 // We need to re-request environment setting here, // otherwise after we apply (send) updated region settings we won't get them back, // so our environment won't be updated. // This is also the way to know about externally changed region environment. LLEnvManagerNew::instance().requestRegionSettings(); - +#endif LLTabContainer* tab = floater->getChild("region_panels"); LLViewerRegion* region = gAgent.getRegion(); @@ -3117,16 +3113,16 @@ BOOL LLPanelEnvironmentInfo::postBuild() mDayCyclePresetCombo->setCommitCallback(boost::bind(&LLPanelEnvironmentInfo::onSelectDayCycle, this)); childSetCommitCallback("apply_btn", boost::bind(&LLPanelEnvironmentInfo::onBtnApply, this), NULL); - getChild("apply_btn")->setRightMouseDownCallback(boost::bind(&LLEnvManagerNew::dumpUserPrefs, LLEnvManagerNew::getInstance())); +// getChild("apply_btn")->setRightMouseDownCallback(boost::bind(&LLEnvManagerNew::dumpUserPrefs, LLEnvManagerNew::getInstance())); childSetCommitCallback("cancel_btn", boost::bind(&LLPanelEnvironmentInfo::onBtnCancel, this), NULL); - getChild("cancel_btn")->setRightMouseDownCallback(boost::bind(&LLEnvManagerNew::dumpPresets, LLEnvManagerNew::getInstance())); +// getChild("cancel_btn")->setRightMouseDownCallback(boost::bind(&LLEnvManagerNew::dumpPresets, LLEnvManagerNew::getInstance())); - LLEnvManagerNew::instance().setRegionSettingsChangeCallback(boost::bind(&LLPanelEnvironmentInfo::onRegionSettingschange, this)); - LLEnvManagerNew::instance().setRegionSettingsAppliedCallback(boost::bind(&LLPanelEnvironmentInfo::onRegionSettingsApplied, this, _1)); +// LLEnvManagerNew::instance().setRegionSettingsChangeCallback(boost::bind(&LLPanelEnvironmentInfo::onRegionSettingschange, this)); +// LLEnvManagerNew::instance().setRegionSettingsAppliedCallback(boost::bind(&LLPanelEnvironmentInfo::onRegionSettingsApplied, this, _1)); - LLDayCycleManager::instance().setModifyCallback(boost::bind(&LLPanelEnvironmentInfo::populateDayCyclesList, this)); - LLWLParamManager::instance().setPresetListChangeCallback(boost::bind(&LLPanelEnvironmentInfo::populateSkyPresetsList, this)); - LLWaterParamManager::instance().setPresetListChangeCallback(boost::bind(&LLPanelEnvironmentInfo::populateWaterPresetsList, this)); +// LLDayCycleManager::instance().setModifyCallback(boost::bind(&LLPanelEnvironmentInfo::populateDayCyclesList, this)); +// LLWLParamManager::instance().setPresetListChangeCallback(boost::bind(&LLPanelEnvironmentInfo::populateSkyPresetsList, this)); +// LLWaterParamManager::instance().setPresetListChangeCallback(boost::bind(&LLPanelEnvironmentInfo::populateWaterPresetsList, this)); return TRUE; } @@ -3145,7 +3141,7 @@ void LLPanelEnvironmentInfo::onVisibilityChange(BOOL new_visibility) // display user's preferred environment. if (!new_visibility) { - LLEnvManagerNew::instance().usePrefs(); +// LLEnvManagerNew::instance().usePrefs(); } } @@ -3165,6 +3161,7 @@ bool LLPanelEnvironmentInfo::refreshFromRegion(LLViewerRegion* region) void LLPanelEnvironmentInfo::refresh() { +#if 0 if(gDisconnected) { return; @@ -3185,6 +3182,7 @@ void LLPanelEnvironmentInfo::refresh() setControlsEnabled(mEnableEditing); setDirty(false); +#endif } void LLPanelEnvironmentInfo::setControlsEnabled(bool enabled) @@ -3494,7 +3492,7 @@ void LLPanelEnvironmentInfo::onSwitchRegionSettings() if (use_defaults) { - LLEnvManagerNew::instance().useDefaults(); +// LLEnvManagerNew::instance().useDefaults(); } else { @@ -3530,7 +3528,7 @@ void LLPanelEnvironmentInfo::onSelectWaterPreset() if (getSelectedWaterParams(water_params)) { - LLEnvManagerNew::instance().useWaterParams(water_params); +// LLEnvManagerNew::instance().useWaterParams(water_params); } setDirty(true); @@ -3543,7 +3541,7 @@ void LLPanelEnvironmentInfo::onSelectSkyPreset() if (getSelectedSkyParams(params, dummy)) { - LLEnvManagerNew::instance().useSkyParams(params); +// LLEnvManagerNew::instance().useSkyParams(params); } setDirty(true); @@ -3557,7 +3555,7 @@ void LLPanelEnvironmentInfo::onSelectDayCycle() if (getSelectedDayCycleParams(day_cycle, sky_map, scope)) { - LLEnvManagerNew::instance().useDayCycleParams(day_cycle, (LLEnvKey::EScope) scope); +// LLEnvManagerNew::instance().useDayCycleParams(day_cycle, (LLEnvKey::EScope) scope); } setDirty(true); @@ -3583,6 +3581,7 @@ void LLPanelEnvironmentInfo::onBtnApply() { LL_DEBUGS("Windlight") << "Use fixed sky" << LL_ENDL; +#if 0 // Get selected sky params. LLSD params; std::string preset_name; @@ -3603,6 +3602,7 @@ void LLPanelEnvironmentInfo::onBtnApply() param_set.setAll(params); refs[LLWLParamKey(preset_name, LLEnvKey::SCOPE_LOCAL)] = param_set; // scope doesn't matter here sky_map = LLWLParamManager::createSkyMap(refs); +#endif } else // use day cycle { @@ -3703,7 +3703,7 @@ void LLPanelEnvironmentInfo::onRegionSettingsApplied(bool ok) // "Unable to update environment settings because the last update your viewer saw was not the same // as the last update sent from the simulator. Try sending your update again, and if this // does not work, try leaving and returning to the region." - LLEnvManagerNew::instance().requestRegionSettings(); +// LLEnvManagerNew::instance().requestRegionSettings(); } } -- cgit v1.2.3 From a0c228d84240a80437b63e0a2cd1cee24e8004a0 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 16 Jan 2018 11:03:26 -0800 Subject: MAINT-8052: Report if the returned environment is the default. --- indra/newview/llfloaterregioninfo.cpp | 678 +++------------------------------- 1 file changed, 48 insertions(+), 630 deletions(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index e0a56b9412..5ce682fe8c 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -189,7 +189,8 @@ LLUUID LLFloaterRegionInfo::sRequestInvoice; LLFloaterRegionInfo::LLFloaterRegionInfo(const LLSD& seed) - : LLFloater(seed) + : LLFloater(seed), + mEnvironmentPanel(NULL) {} BOOL LLFloaterRegionInfo::postBuild() @@ -220,10 +221,9 @@ BOOL LLFloaterRegionInfo::postBuild() panel->buildFromFile("panel_region_terrain.xml"); mTab->addTabPanel(panel); - panel = new LLPanelEnvironmentInfo; - mInfoPanels.push_back(panel); - panel->buildFromFile("panel_region_environment.xml"); - mTab->addTabPanel(panel); + mEnvironmentPanel = new LLPanelRegionEnvironment; + mEnvironmentPanel->buildFromFile("panel_region_environment.xml"); + mTab->addTabPanel(mEnvironmentPanel); panel = new LLPanelRegionDebugInfo; mInfoPanels.push_back(panel); @@ -242,7 +242,7 @@ BOOL LLFloaterRegionInfo::postBuild() panel->buildFromFile("panel_region_experiences.xml"); mTab->addTabPanel(panel); } - + gMessageSystem->setHandlerFunc( "EstateOwnerMessage", &processEstateOwnerRequest); @@ -540,6 +540,7 @@ void LLFloaterRegionInfo::refreshFromRegion(LLViewerRegion* region) std::mem_fun(&LLPanelRegionInfo::refreshFromRegion), #endif region)); + mEnvironmentPanel->refreshFromRegion(region); } // public @@ -550,6 +551,7 @@ void LLFloaterRegionInfo::refresh() { (*iter)->refresh(); } + mEnvironmentPanel->refresh(); } void LLFloaterRegionInfo::enableTopButtons() @@ -3083,630 +3085,6 @@ bool LLDispatchSetEstateExperience::operator()( } - -LLPanelEnvironmentInfo::LLPanelEnvironmentInfo() -: mEnableEditing(false), - mRegionSettingsRadioGroup(NULL), - mDayCycleSettingsRadioGroup(NULL), - mWaterPresetCombo(NULL), - mSkyPresetCombo(NULL), - mDayCyclePresetCombo(NULL) -{ -} - -// virtual -BOOL LLPanelEnvironmentInfo::postBuild() -{ - mRegionSettingsRadioGroup = getChild("region_settings_radio_group"); - mRegionSettingsRadioGroup->setCommitCallback(boost::bind(&LLPanelEnvironmentInfo::onSwitchRegionSettings, this)); - - mDayCycleSettingsRadioGroup = getChild("sky_dayc_settings_radio_group"); - mDayCycleSettingsRadioGroup->setCommitCallback(boost::bind(&LLPanelEnvironmentInfo::onSwitchDayCycle, this)); - - mWaterPresetCombo = getChild("water_settings_preset_combo"); - mWaterPresetCombo->setCommitCallback(boost::bind(&LLPanelEnvironmentInfo::onSelectWaterPreset, this)); - - mSkyPresetCombo = getChild("sky_settings_preset_combo"); - mSkyPresetCombo->setCommitCallback(boost::bind(&LLPanelEnvironmentInfo::onSelectSkyPreset, this)); - - mDayCyclePresetCombo = getChild("dayc_settings_preset_combo"); - mDayCyclePresetCombo->setCommitCallback(boost::bind(&LLPanelEnvironmentInfo::onSelectDayCycle, this)); - - childSetCommitCallback("apply_btn", boost::bind(&LLPanelEnvironmentInfo::onBtnApply, this), NULL); -// getChild("apply_btn")->setRightMouseDownCallback(boost::bind(&LLEnvManagerNew::dumpUserPrefs, LLEnvManagerNew::getInstance())); - childSetCommitCallback("cancel_btn", boost::bind(&LLPanelEnvironmentInfo::onBtnCancel, this), NULL); -// getChild("cancel_btn")->setRightMouseDownCallback(boost::bind(&LLEnvManagerNew::dumpPresets, LLEnvManagerNew::getInstance())); - -// LLEnvManagerNew::instance().setRegionSettingsChangeCallback(boost::bind(&LLPanelEnvironmentInfo::onRegionSettingschange, this)); -// LLEnvManagerNew::instance().setRegionSettingsAppliedCallback(boost::bind(&LLPanelEnvironmentInfo::onRegionSettingsApplied, this, _1)); - -// LLDayCycleManager::instance().setModifyCallback(boost::bind(&LLPanelEnvironmentInfo::populateDayCyclesList, this)); -// LLWLParamManager::instance().setPresetListChangeCallback(boost::bind(&LLPanelEnvironmentInfo::populateSkyPresetsList, this)); -// LLWaterParamManager::instance().setPresetListChangeCallback(boost::bind(&LLPanelEnvironmentInfo::populateWaterPresetsList, this)); - - return TRUE; -} - -// virtual -void LLPanelEnvironmentInfo::onOpen(const LLSD& key) -{ - LL_DEBUGS("Windlight") << "Panel opened, refreshing" << LL_ENDL; - refresh(); -} - -// virtual -void LLPanelEnvironmentInfo::onVisibilityChange(BOOL new_visibility) -{ - // If hiding (user switched to another tab or closed the floater), - // display user's preferred environment. - if (!new_visibility) - { -// LLEnvManagerNew::instance().usePrefs(); - } -} - -// virtual -bool LLPanelEnvironmentInfo::refreshFromRegion(LLViewerRegion* region) -{ - LL_DEBUGS("Windlight") << "Region updated, enabling/disabling controls" << LL_ENDL; - BOOL owner_or_god = gAgent.isGodlike() || (region && (region->getOwner() == gAgent.getID())); - BOOL owner_or_god_or_manager = owner_or_god || (region && region->isEstateManager()); - - // Don't refresh from region settings to avoid flicker after applying new region settings. - mEnableEditing = owner_or_god_or_manager; - setControlsEnabled(mEnableEditing); - - return LLPanelRegionInfo::refreshFromRegion(region); -} - -void LLPanelEnvironmentInfo::refresh() -{ -#if 0 - if(gDisconnected) - { - return; - } - - populateWaterPresetsList(); - populateSkyPresetsList(); - populateDayCyclesList(); - - // Init radio groups. - const LLEnvironmentSettings& settings = LLEnvManagerNew::instance().getRegionSettings(); - const LLSD& dc = settings.getWLDayCycle(); - LLSD::Real first_frame_time = dc.size() > 0 ? dc[0][0].asReal() : 0.0f; - const bool use_fixed_sky = dc.size() == 1 && first_frame_time < 0; - mRegionSettingsRadioGroup->setSelectedIndex(settings.getSkyMap().size() == 0 ? 0 : 1); - mDayCycleSettingsRadioGroup->setSelectedIndex(use_fixed_sky ? 0 : 1); - - setControlsEnabled(mEnableEditing); - - setDirty(false); -#endif -} - -void LLPanelEnvironmentInfo::setControlsEnabled(bool enabled) -{ - mRegionSettingsRadioGroup->setEnabled(enabled); - mDayCycleSettingsRadioGroup->setEnabled(enabled); - - mWaterPresetCombo->setEnabled(false); - mSkyPresetCombo->setEnabled(false); - mDayCyclePresetCombo->setEnabled(false); - - getChildView("apply_btn")->setEnabled(enabled); - getChildView("cancel_btn")->setEnabled(enabled); - - if (enabled) - { - // Enable/disable some controls based on currently selected radio buttons. - bool use_defaults = mRegionSettingsRadioGroup->getSelectedIndex() == 0; - getChild("user_environment_settings")->setEnabled(!use_defaults); - - bool is_fixed_sky = mDayCycleSettingsRadioGroup->getSelectedIndex() == 0; - mSkyPresetCombo->setEnabled(is_fixed_sky); - mDayCyclePresetCombo->setEnabled(!is_fixed_sky); - } -} - -void LLPanelEnvironmentInfo::setApplyProgress(bool started) -{ - LLLoadingIndicator* indicator = getChild("progress_indicator"); - - indicator->setVisible(started); - - if (started) - { - indicator->start(); - } - else - { - indicator->stop(); - } -} - -void LLPanelEnvironmentInfo::setDirty(bool dirty) -{ - getChildView("apply_btn")->setEnabled(dirty); - getChildView("cancel_btn")->setEnabled(dirty); -} - -void LLPanelEnvironmentInfo::sendRegionSunUpdate() -{ -#if 0 - LLRegionInfoModel& region_info = LLRegionInfoModel::instance(); - - // If the region is being switched to fixed sky, - // change the region's sun hour according to the (fixed) sun position. - // This is needed for llGetSunDirection() LSL function to work properly (STORM-1330). - const LLSD& sky_map = mNewRegionSettings.getSkyMap(); - bool region_use_fixed_sky = sky_map.size() == 1; - if (region_use_fixed_sky) - { - LLWLParamSet param_set; - llassert(sky_map.isMap()); - param_set.setAll(sky_map.beginMap()->second); - F32 sun_angle = param_set.getSunAngle(); - - LL_DEBUGS("Windlight Sync") << "Old sun hour: " << region_info.mSunHour << LL_ENDL; - // convert value range from 0..2pi to 6..30 - region_info.mSunHour = fmodf((sun_angle / F_TWO_PI) * 24.f, 24.f) + 6.f; - } - - region_info.setUseFixedSun(region_use_fixed_sky); - region_info.mUseEstateSun = !region_use_fixed_sky; - LL_DEBUGS("Windlight Sync") << "Sun hour: " << region_info.mSunHour << LL_ENDL; - - region_info.sendRegionTerrain(LLFloaterRegionInfo::getLastInvoice()); -#endif -} - -void LLPanelEnvironmentInfo::fixEstateSun() -{ - // We don't support fixed sun estates anymore and need to fix - // such estates for region day cycle to take effect. - // *NOTE: Assuming that current estate settings have arrived already. - LLEstateInfoModel& estate_info = LLEstateInfoModel::instance(); - if (estate_info.getUseFixedSun()) - { - LL_INFOS() << "Switching estate to global sun" << LL_ENDL; - estate_info.setUseFixedSun(false); - estate_info.sendEstateInfo(); - } -} - -void LLPanelEnvironmentInfo::populateWaterPresetsList() -{ -#if 0 - mWaterPresetCombo->removeall(); - - // If the region already has water params, add them to the list. - const LLEnvironmentSettings& region_settings = LLEnvManagerNew::instance().getRegionSettings(); - if (region_settings.getWaterParams().size() != 0) - { - const std::string& region_name = gAgent.getRegion()->getName(); - mWaterPresetCombo->add(region_name, LLWLParamKey(region_name, LLEnvKey::SCOPE_REGION).toLLSD()); - mWaterPresetCombo->addSeparator(); - } - - std::list user_presets, system_presets; - LLWaterParamManager::instance().getPresetNames(user_presets, system_presets); - - // Add local user presets first. - for (std::list::const_iterator it = user_presets.begin(); it != user_presets.end(); ++it) - { - mWaterPresetCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toLLSD()); - } - - if (user_presets.size() > 0) - { - mWaterPresetCombo->addSeparator(); - } - - // Add local system presets. - for (std::list::const_iterator it = system_presets.begin(); it != system_presets.end(); ++it) - { - mWaterPresetCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toLLSD()); - } - - // There's no way to select current preset because its name is not stored on server. -#endif -} - -void LLPanelEnvironmentInfo::populateSkyPresetsList() -{ -#if 0 - mSkyPresetCombo->removeall(); - - LLWLParamManager::preset_name_list_t region_presets; - LLWLParamManager::preset_name_list_t user_presets, sys_presets; - LLWLParamManager::instance().getPresetNames(region_presets, user_presets, sys_presets); - - // Add region presets. - std::string region_name = gAgent.getRegion() ? gAgent.getRegion()->getName() : LLTrans::getString("Unknown"); - for (LLWLParamManager::preset_name_list_t::const_iterator it = region_presets.begin(); it != region_presets.end(); ++it) - { - std::string preset_name = *it; - std::string item_title = preset_name + " (" + region_name + ")"; - mSkyPresetCombo->add(item_title, LLWLParamKey(preset_name, LLEnvKey::SCOPE_REGION).toStringVal()); - } - - if (!region_presets.empty()) - { - mSkyPresetCombo->addSeparator(); - } - - // Add user presets. - for (LLWLParamManager::preset_name_list_t::const_iterator it = user_presets.begin(); it != user_presets.end(); ++it) - { - mSkyPresetCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toStringVal()); - } - - if (!user_presets.empty()) - { - mSkyPresetCombo->addSeparator(); - } - - // Add system presets. - for (LLWLParamManager::preset_name_list_t::const_iterator it = sys_presets.begin(); it != sys_presets.end(); ++it) - { - mSkyPresetCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toStringVal()); - } - - // Select current preset. - LLSD sky_map = LLEnvManagerNew::instance().getRegionSettings().getSkyMap(); - if (sky_map.size() == 1) // if the region is set to fixed sky - { - std::string preset_name = sky_map.beginMap()->first; - mSkyPresetCombo->selectByValue(LLWLParamKey(preset_name, LLEnvKey::SCOPE_REGION).toStringVal()); - } -#endif -} - -void LLPanelEnvironmentInfo::populateDayCyclesList() -{ -#if 0 - mDayCyclePresetCombo->removeall(); - - // If the region already has env. settings, add its day cycle to the list. - const LLSD& cur_region_dc = LLEnvManagerNew::instance().getRegionSettings().getWLDayCycle(); - if (cur_region_dc.size() != 0) - { - LLViewerRegion* region = gAgent.getRegion(); - llassert(region != NULL); - - LLWLParamKey key(region->getName(), LLEnvKey::SCOPE_REGION); - mDayCyclePresetCombo->add(region->getName(), key.toStringVal()); - mDayCyclePresetCombo->addSeparator(); - } - - // Add local user day cycles. - LLDayCycleManager::preset_name_list_t user_days, sys_days; - LLDayCycleManager::instance().getPresetNames(user_days, sys_days); - for (LLDayCycleManager::preset_name_list_t::const_iterator it = user_days.begin(); it != user_days.end(); ++it) - { - mDayCyclePresetCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toStringVal()); - } - - if (user_days.size() > 0) - { - mDayCyclePresetCombo->addSeparator(); - } - - // Add local system day cycles. - for (LLDayCycleManager::preset_name_list_t::const_iterator it = sys_days.begin(); it != sys_days.end(); ++it) - { - mDayCyclePresetCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toStringVal()); - } - - // Current day cycle is already selected. -#endif -} - -bool LLPanelEnvironmentInfo::getSelectedWaterParams(LLSD& water_params) -{ -#if 0 - LLWLParamKey water_key(mWaterPresetCombo->getSelectedValue()); - - if (water_key.scope == LLEnvKey::SCOPE_REGION) - { - water_params = LLEnvManagerNew::instance().getRegionSettings().getWaterParams(); - } - else - { - LLWaterParamSet param_set; - if (!LLWaterParamManager::instance().getParamSet(water_key.name, param_set)) - { - LL_WARNS() << "Error getting water preset: " << water_key.name << LL_ENDL; - return false; - } - - water_params = param_set.getAll(); - } - - return true; -#endif - return false; -} - -bool LLPanelEnvironmentInfo::getSelectedSkyParams(LLSD& sky_params, std::string& preset_name) -{ -#if 0 - std::string preset_key(mSkyPresetCombo->getValue().asString()); - LLWLParamKey preset(preset_key); - - // Get the preset sky params. - LLWLParamSet param_set; - if (!LLWLParamManager::instance().getParamSet(preset, param_set)) - { - LL_WARNS() << "Error getting sky params: " << preset.toLLSD() << LL_ENDL; - return false; - } - - sky_params = param_set.getAll(); - preset_name = preset.name; - return true; -#endif - return false; -} - -bool LLPanelEnvironmentInfo::getSelectedDayCycleParams(LLSD& day_cycle, LLSD& sky_map, short& scope) -{ -#if 0 - std::string preset_key(mDayCyclePresetCombo->getValue().asString()); - LLWLParamKey dc(preset_key); - LL_DEBUGS("Windlight") << "Use day cycle: " << dc.toLLSD() << LL_ENDL; - - if (dc.scope == LLEnvKey::SCOPE_REGION) // current region day cycle - { - const LLEnvironmentSettings& cur_region_settings = LLEnvManagerNew::instance().getRegionSettings(); - day_cycle = cur_region_settings.getWLDayCycle(); - sky_map = cur_region_settings.getSkyMap(); - } - else // a local day cycle - { - if (!LLDayCycleManager::instance().getPreset(dc.name, day_cycle)) - { - LL_WARNS() << "Error getting day cycle " << dc.name << LL_ENDL; - return false; - } - - // Create sky map from the day cycle. - { - LLWLDayCycle tmp_day; - tmp_day.loadDayCycle(day_cycle, dc.scope); - tmp_day.getSkyMap(sky_map); - } - } - - scope = dc.scope; - - return true; -#endif - return false; -} -void LLPanelEnvironmentInfo::onSwitchRegionSettings() -{ - bool use_defaults = mRegionSettingsRadioGroup->getSelectedIndex() == 0; - getChild("user_environment_settings")->setEnabled(!use_defaults); - - if (use_defaults) - { -// LLEnvManagerNew::instance().useDefaults(); - } - else - { - onSelectWaterPreset(); - onSwitchDayCycle(); - } - - setDirty(true); -} - -void LLPanelEnvironmentInfo::onSwitchDayCycle() -{ - bool is_fixed_sky = mDayCycleSettingsRadioGroup->getSelectedIndex() == 0; - - mSkyPresetCombo->setEnabled(is_fixed_sky); - mDayCyclePresetCombo->setEnabled(!is_fixed_sky); - - if (is_fixed_sky) - { - onSelectSkyPreset(); - } - else - { - onSelectDayCycle(); - } - - setDirty(true); -} - -void LLPanelEnvironmentInfo::onSelectWaterPreset() -{ - LLSD water_params; - - if (getSelectedWaterParams(water_params)) - { -// LLEnvManagerNew::instance().useWaterParams(water_params); - } - - setDirty(true); -} - -void LLPanelEnvironmentInfo::onSelectSkyPreset() -{ - LLSD params; - std::string dummy; - - if (getSelectedSkyParams(params, dummy)) - { -// LLEnvManagerNew::instance().useSkyParams(params); - } - - setDirty(true); -} - -void LLPanelEnvironmentInfo::onSelectDayCycle() -{ - LLSD day_cycle; - LLSD sky_map; // unused - short scope; - - if (getSelectedDayCycleParams(day_cycle, sky_map, scope)) - { -// LLEnvManagerNew::instance().useDayCycleParams(day_cycle, (LLEnvKey::EScope) scope); - } - - setDirty(true); -} - -void LLPanelEnvironmentInfo::onBtnApply() -{ - const bool use_defaults = mRegionSettingsRadioGroup->getSelectedIndex() == 0; - const bool use_fixed_sky = mDayCycleSettingsRadioGroup->getSelectedIndex() == 0; - - LLSD day_cycle; - LLSD sky_map; - LLSD water_params; - - if (use_defaults) - { - // settings will be empty - LL_DEBUGS("Windlight") << "Defaults" << LL_ENDL; - } - else // use custom region settings - { - if (use_fixed_sky) - { - LL_DEBUGS("Windlight") << "Use fixed sky" << LL_ENDL; - -#if 0 - // Get selected sky params. - LLSD params; - std::string preset_name; - if (!getSelectedSkyParams(params, preset_name)) - { - return; - } - - // Create a day cycle consisting of a single sky preset. - LLSD key(LLSD::emptyArray()); - key.append(-1.0f); // indicate that user preference is actually fixed sky, not a day cycle - key.append(preset_name); - day_cycle.append(key); - - // Create a sky map consisting of only the sky preset. - std::map refs; - LLWLParamSet param_set; - param_set.setAll(params); - refs[LLWLParamKey(preset_name, LLEnvKey::SCOPE_LOCAL)] = param_set; // scope doesn't matter here - sky_map = LLWLParamManager::createSkyMap(refs); -#endif - } - else // use day cycle - { - LL_DEBUGS("Windlight") << "Use day cycle" << LL_ENDL; - - short scope; // unused - if (!getSelectedDayCycleParams(day_cycle, sky_map, scope)) - { - return; - } - - // If it's a special single-preset day cycle meaning using a fixed sky, - // reset the frame time to a non-negative value, - // so that the region setting is displayed in the floater as - // a day cycle, not a preset. (STORM-1289) - if (day_cycle.size() == 1 && day_cycle[0][0].asReal() < 0.0f) - { - LL_DEBUGS("Windlight") << "Fixing negative time" << LL_ENDL; - day_cycle[0][0] = 0.0f; - } - } - - // Get water params. - if (!getSelectedWaterParams(water_params)) - { - // *TODO: show a notification? - return; - } - } - -#if 0 - // Send settings apply request. - LLEnvironmentSettings new_region_settings; - new_region_settings.saveParams(day_cycle, sky_map, water_params, 0.0f); - if (!LLEnvManagerNew::instance().sendRegionSettings(new_region_settings)) - { - LL_WARNS() << "Error applying region environment settings" << LL_ENDL; - return; - } - - // When the settings get applied, we'll also send the region sun position update. - // To determine the sun angle we're going to need the new settings. - mNewRegionSettings = new_region_settings; -#endif - - // Start spinning the progress indicator. - setApplyProgress(true); -} - -void LLPanelEnvironmentInfo::onBtnCancel() -{ - // Reload last saved region settings. - refresh(); - -#if 0 - LLEnvironment::instance().applyChosenEnvironment(); - // Apply them. - LLEnvManagerNew& env_mgr = LLEnvManagerNew::instance(); - const LLEnvironmentSettings& cur_settings = env_mgr.getRegionSettings(); - const LLSD& region_day_cycle = cur_settings.getWLDayCycle(); - const LLSD& region_water = cur_settings.getWaterParams(); - env_mgr.useWaterParams(region_water); - env_mgr.useDayCycleParams(region_day_cycle, LLEnvKey::SCOPE_REGION); -#endif -} - -void LLPanelEnvironmentInfo::onRegionSettingschange() -{ - LL_DEBUGS("Windlight") << "Region settings changed, refreshing" << LL_ENDL; - refresh(); - - // Stop applying progress indicator (it may be running if it's us who initiated settings update). - setApplyProgress(false); -} - -void LLPanelEnvironmentInfo::onRegionSettingsApplied(bool ok) -{ - // If applying new settings has failed, stop the indicator right away. - // Otherwise it will be stopped when we receive the updated settings from server. - if (ok) - { - // Set the region sun phase/flags according to the chosen new preferences. - // - // If we do this earlier we may get jerky transition from fixed sky to a day cycle (STORM-1481). - // That is caused by the simulator re-sending the region info, which in turn makes us - // re-request and display old region environment settings while the new ones haven't been applied yet. - sendRegionSunUpdate(); - - // Switch estate to not using fixed sun for the region day cycle to work properly (STORM-1506). - fixEstateSun(); - } - else - { - setApplyProgress(false); - - // We need to re-request environment setting here, - // otherwise our subsequent attempts to change region settings will fail with the following error: - // "Unable to update environment settings because the last update your viewer saw was not the same - // as the last update sent from the simulator. Try sending your update again, and if this - // does not work, try leaving and returning to the region." -// LLEnvManagerNew::instance().requestRegionSettings(); - } -} - BOOL LLPanelRegionExperiences::postBuild() { mAllowed = setupList("panel_allowed", ESTATE_EXPERIENCE_ALLOWED_ADD, ESTATE_EXPERIENCE_ALLOWED_REMOVE); @@ -3965,3 +3343,43 @@ void LLPanelRegionExperiences::itemChanged( U32 event_type, const LLUUID& id ) onChangeAnything(); } + +//========================================================================= +class LLPanelRegionEnvironment : public LLPanelEnvironmentInfo +{ +public: + LLPanelRegionEnvironment(); + + void refresh(); + + bool refreshFromRegion(LLViewerRegion* region); + +private: + LLViewerRegion * mLastRegion; +}; + +LLPanelRegionEnvironment::LLPanelRegionEnvironment(): + LLPanelEnvironmentInfo(), + mLastRegion(NULL) +{ +} + +void LLPanelRegionEnvironment::refresh() +{ + refreshFromRegion(mLastRegion); +} + +bool LLPanelRegionEnvironment::refreshFromRegion(LLViewerRegion* region) +{ + BOOL owner_or_god = gAgent.isGodlike() || (region && (region->getOwner() == gAgent.getID())); + BOOL owner_or_god_or_manager = owner_or_god || (region && region->isEstateManager()); + + mDayLengthSlider->setValue(region->getDayLength().value()); + mDayOffsetSlider->setValue(region->getDayOffset().value()); + + + + setControlsEnabled(owner_or_god_or_manager); + mLastRegion = region; + return true; +} -- cgit v1.2.3 From 1b8c2b5ebbe0d42f147730bc9b6528fa8c6796ce Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 23 Jan 2018 08:54:34 -0800 Subject: MAINT-8052: Initial support for new EEP cap --- indra/newview/llfloaterregioninfo.cpp | 84 ++++++++++++++++++++++++++++------- 1 file changed, 69 insertions(+), 15 deletions(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 5ce682fe8c..578c85470e 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -95,6 +95,7 @@ #include "llexperiencecache.h" #include "llpanelexperiences.h" #include "llcorehttputil.h" +#include "llenvironment.h" const S32 TERRAIN_TEXTURE_COUNT = 4; const S32 CORNER_COUNT = 4; @@ -175,6 +176,24 @@ void unpack_request_params( } */ +class LLPanelRegionEnvironment : public LLPanelEnvironmentInfo +{ +public: + LLPanelRegionEnvironment(); + + void refresh(); + + bool refreshFromRegion(LLViewerRegion* region); + + virtual BOOL postBuild(); + +protected: + virtual void doApply(); + +private: + LLViewerRegion * mLastRegion; +}; + bool estate_dispatch_initialized = false; @@ -3345,25 +3364,22 @@ void LLPanelRegionExperiences::itemChanged( U32 event_type, const LLUUID& id ) } //========================================================================= -class LLPanelRegionEnvironment : public LLPanelEnvironmentInfo -{ -public: - LLPanelRegionEnvironment(); - - void refresh(); - - bool refreshFromRegion(LLViewerRegion* region); - -private: - LLViewerRegion * mLastRegion; -}; - LLPanelRegionEnvironment::LLPanelRegionEnvironment(): LLPanelEnvironmentInfo(), mLastRegion(NULL) { } + +BOOL LLPanelRegionEnvironment::postBuild() +{ + if (!LLPanelEnvironmentInfo::postBuild()) + return FALSE; + + return TRUE; +} + + void LLPanelRegionEnvironment::refresh() { refreshFromRegion(mLastRegion); @@ -3374,12 +3390,50 @@ bool LLPanelRegionEnvironment::refreshFromRegion(LLViewerRegion* region) BOOL owner_or_god = gAgent.isGodlike() || (region && (region->getOwner() == gAgent.getID())); BOOL owner_or_god_or_manager = owner_or_god || (region && region->isEstateManager()); - mDayLengthSlider->setValue(region->getDayLength().value()); - mDayOffsetSlider->setValue(region->getDayOffset().value()); + F64Hours daylength; + F64Hours dayoffset; + daylength = region->getDayLength(); + dayoffset = region->getDayOffset(); + + if (dayoffset.value() > 12.0) + dayoffset = dayoffset - F32Hours(24.0f); + + mDayLengthSlider->setValue(daylength.value()); + mDayOffsetSlider->setValue(dayoffset.value()); + mRegionSettingsRadioGroup->setSelectedIndex(region->getIsDefaultDayCycle() ? 0 : 1); setControlsEnabled(owner_or_god_or_manager); mLastRegion = region; + + if (region->getRegionDayCycle()) + mEditingDayCycle = region->getRegionDayCycle()->buildClone(); + return true; } + +void LLPanelRegionEnvironment::doApply() +{ + if (mRegionSettingsRadioGroup->getSelectedIndex() == 0) + { + LLEnvironment::instance().resetRegion(); + } + else + { + S64Seconds 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; + } + + S64Seconds dayoffset_s = dayoffset_h; + + LLEnvironment::instance().updateRegion(mEditingDayCycle, daylength.value(), dayoffset_s.value()); + } +} -- cgit v1.2.3 From 536aeb54a6130f3d1e20405c8f6cbd29201de26d Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 23 Jan 2018 17:34:25 -0800 Subject: MAINT-8052: One more step towards parcel environments. --- indra/newview/llfloaterregioninfo.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 578c85470e..bf965afbe1 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -190,6 +190,8 @@ public: protected: virtual void doApply(); + virtual void doEditCommited(LLSettingsDay::ptr_t &newday); + private: LLViewerRegion * mLastRegion; }; @@ -3437,3 +3439,8 @@ void LLPanelRegionEnvironment::doApply() LLEnvironment::instance().updateRegion(mEditingDayCycle, daylength.value(), dayoffset_s.value()); } } + +void LLPanelRegionEnvironment::doEditCommited(LLSettingsDay::ptr_t &newday) +{ + mEditingDayCycle = newday; +} -- cgit v1.2.3 From 0bf50e2f8cfa5f3ccd6165ce935cf0fd9c174ced Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 30 Jan 2018 16:42:34 -0800 Subject: Cleanup on daycyle selection and stack. Move blenders into environment. (Transition bronken, instant only. Shaddows moved based on region, not parcel) --- indra/newview/llfloaterregioninfo.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index bf965afbe1..272ac8a1bb 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -3395,22 +3395,25 @@ bool LLPanelRegionEnvironment::refreshFromRegion(LLViewerRegion* region) F64Hours daylength; F64Hours dayoffset; - daylength = region->getDayLength(); - dayoffset = region->getDayOffset(); + daylength = LLEnvironment::instance().getEnvironmentDayLength(LLEnvironment::ENV_REGION); + dayoffset = LLEnvironment::instance().getEnvironmentDayOffset(LLEnvironment::ENV_REGION); if (dayoffset.value() > 12.0) - dayoffset = dayoffset - F32Hours(24.0f); + dayoffset = dayoffset - F64Hours(24.0f); mDayLengthSlider->setValue(daylength.value()); mDayOffsetSlider->setValue(dayoffset.value()); - mRegionSettingsRadioGroup->setSelectedIndex(region->getIsDefaultDayCycle() ? 0 : 1); + //mRegionSettingsRadioGroup->setSelectedIndex(region->getIsDefaultDayCycle() ? 0 : 1); + mRegionSettingsRadioGroup->setSelectedIndex(1); setControlsEnabled(owner_or_god_or_manager); mLastRegion = region; - if (region->getRegionDayCycle()) - mEditingDayCycle = region->getRegionDayCycle()->buildClone(); + LLSettingsDay::ptr_t pday = LLEnvironment::instance().getEnvironmentDay(LLEnvironment::ENV_REGION); + + if (pday) + mEditingDayCycle = pday->buildClone(); return true; } -- cgit v1.2.3 From 8cfdc07e790a557e881fadaa1b6258e5b16751f4 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 1 Jun 2018 23:32:30 +0100 Subject: Code cleanup and move to using typedefs of S64Seconds/F64Seconds for ease in sync w/ sim side which has not llunits types. --- indra/newview/llfloaterregioninfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 272ac8a1bb..6719e6ed3b 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -3426,7 +3426,7 @@ void LLPanelRegionEnvironment::doApply() } else { - S64Seconds daylength; + LLSettingsDay::Seconds daylength; F32Hours dayoffset_h; daylength = F32Hours(mDayLengthSlider->getValueF32()); @@ -3437,7 +3437,7 @@ void LLPanelRegionEnvironment::doApply() dayoffset_h = F32Hours(24.0f) + dayoffset_h; } - S64Seconds dayoffset_s = dayoffset_h; + LLSettingsDay::Seconds dayoffset_s = dayoffset_h; LLEnvironment::instance().updateRegion(mEditingDayCycle, daylength.value(), dayoffset_s.value()); } -- cgit v1.2.3 From cd5f7b2c03e87cc5d236eaa5b8c025530571376a Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 6 Aug 2018 15:37:09 -0700 Subject: MAINT-7703: Estate and region flags for parcel environmests (not written to DB yet) --- indra/newview/llfloaterregioninfo.cpp | 48 ++++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 6 deletions(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 6719e6ed3b..5112ff11bf 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -184,6 +184,7 @@ public: void refresh(); bool refreshFromRegion(LLViewerRegion* region); + void refreshFromEstate(); virtual BOOL postBuild(); @@ -191,6 +192,7 @@ protected: virtual void doApply(); virtual void doEditCommited(LLSettingsDay::ptr_t &newday); + BOOL sendUpdate(); private: LLViewerRegion * mLastRegion; @@ -2388,8 +2390,6 @@ bool LLPanelEstateInfo::callbackChangeLindenEstate(const LLSD& notification, con estate_info.setDenyAgeUnverified(getChild("limit_age_verified")->getValue().asBoolean()); estate_info.setAllowVoiceChat(getChild("voice_chat_check")->getValue().asBoolean()); estate_info.setAllowAccessOverride(getChild("parcel_access_override")->getValue().asBoolean()); - // JIGGLYPUFF - //estate_info.setAllowAccessOverride(getChild("")->getValue().asBoolean()); // send the update to sim estate_info.sendEstateInfo(); } @@ -3370,6 +3370,9 @@ LLPanelRegionEnvironment::LLPanelRegionEnvironment(): LLPanelEnvironmentInfo(), mLastRegion(NULL) { + LLEstateInfoModel& estate_info = LLEstateInfoModel::instance(); + estate_info.setCommitCallback(boost::bind(&LLPanelRegionEnvironment::refreshFromEstate, this)); + estate_info.setUpdateCallback(boost::bind(&LLPanelRegionEnvironment::refreshFromEstate, this)); } @@ -3385,6 +3388,7 @@ BOOL LLPanelRegionEnvironment::postBuild() void LLPanelRegionEnvironment::refresh() { refreshFromRegion(mLastRegion); + refreshFromEstate(); } bool LLPanelRegionEnvironment::refreshFromRegion(LLViewerRegion* region) @@ -3403,9 +3407,6 @@ bool LLPanelRegionEnvironment::refreshFromRegion(LLViewerRegion* region) mDayLengthSlider->setValue(daylength.value()); mDayOffsetSlider->setValue(dayoffset.value()); - - //mRegionSettingsRadioGroup->setSelectedIndex(region->getIsDefaultDayCycle() ? 0 : 1); - mRegionSettingsRadioGroup->setSelectedIndex(1); setControlsEnabled(owner_or_god_or_manager); mLastRegion = region; @@ -3413,11 +3414,26 @@ bool LLPanelRegionEnvironment::refreshFromRegion(LLViewerRegion* region) LLSettingsDay::ptr_t pday = LLEnvironment::instance().getEnvironmentDay(LLEnvironment::ENV_REGION); if (pday) - mEditingDayCycle = pday->buildClone(); + { + mRegionSettingsRadioGroup->setSelectedIndex((pday->getAssetId() == LLSettingsDay::GetDefaultAssetId()) ? 0 : 1); + mEditingDayCycle = std::static_pointer_cast(pday->buildDerivedClone()); + } + else + { + mRegionSettingsRadioGroup->setSelectedIndex(1); + } return true; } +void LLPanelRegionEnvironment::refreshFromEstate() +{ + const LLEstateInfoModel& estate_info = LLEstateInfoModel::instance(); + + getChild("allow_override_chk")->setValue(estate_info.getAllowEnvironmentOverride()); + +} + void LLPanelRegionEnvironment::doApply() { if (mRegionSettingsRadioGroup->getSelectedIndex() == 0) @@ -3447,3 +3463,23 @@ 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; +} -- cgit v1.2.3 From eadf0b910174274e7c83fe37e417f576a7350edb Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 15 Aug 2018 13:35:53 -0700 Subject: MAINT-8990, MAINT-9002: First pass rework on environment panels, region/parcel --- indra/newview/llfloaterregioninfo.cpp | 102 ++++++++++++++-------------------- 1 file changed, 42 insertions(+), 60 deletions(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 5112ff11bf..eb42ede8a8 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -181,12 +181,16 @@ class LLPanelRegionEnvironment : public LLPanelEnvironmentInfo public: LLPanelRegionEnvironment(); - void refresh(); + virtual void refresh() override; + + virtual bool isRegion() const override { return true; } + virtual LLParcel * getParcel() override { return nullptr; } + virtual bool canEdit() override { return LLEnvironment::instance().canAgentUpdateRegionEnvironment(); } bool refreshFromRegion(LLViewerRegion* region); void refreshFromEstate(); - virtual BOOL postBuild(); + virtual BOOL postBuild() override; protected: virtual void doApply(); @@ -194,8 +198,6 @@ protected: virtual void doEditCommited(LLSettingsDay::ptr_t &newday); BOOL sendUpdate(); -private: - LLViewerRegion * mLastRegion; }; @@ -246,6 +248,7 @@ BOOL LLFloaterRegionInfo::postBuild() mEnvironmentPanel = new LLPanelRegionEnvironment; mEnvironmentPanel->buildFromFile("panel_region_environment.xml"); +// mEnvironmentPanel->configureForRegion(); mTab->addTabPanel(mEnvironmentPanel); panel = new LLPanelRegionDebugInfo; @@ -3367,8 +3370,7 @@ void LLPanelRegionExperiences::itemChanged( U32 event_type, const LLUUID& id ) //========================================================================= LLPanelRegionEnvironment::LLPanelRegionEnvironment(): - LLPanelEnvironmentInfo(), - mLastRegion(NULL) + LLPanelEnvironmentInfo() { LLEstateInfoModel& estate_info = LLEstateInfoModel::instance(); estate_info.setCommitCallback(boost::bind(&LLPanelRegionEnvironment::refreshFromEstate, this)); @@ -3381,48 +3383,28 @@ BOOL LLPanelRegionEnvironment::postBuild() if (!LLPanelEnvironmentInfo::postBuild()) return FALSE; + getChild(RDO_USEDEFAULT)->setLabelArg("[USEDEFAULT]", getString(STR_LABEL_USEDEFAULT)); + getChild(CHK_ALLOWOVERRIDE)->setVisible(TRUE); + return TRUE; } void LLPanelRegionEnvironment::refresh() { - refreshFromRegion(mLastRegion); + if (!mCurrentEnvironment) + { + refreshFromSource(); + return; + } + refreshFromEstate(); + LLPanelEnvironmentInfo::refresh(); } bool LLPanelRegionEnvironment::refreshFromRegion(LLViewerRegion* region) { - BOOL owner_or_god = gAgent.isGodlike() || (region && (region->getOwner() == gAgent.getID())); - BOOL owner_or_god_or_manager = owner_or_god || (region && region->isEstateManager()); - - F64Hours daylength; - F64Hours dayoffset; - - daylength = LLEnvironment::instance().getEnvironmentDayLength(LLEnvironment::ENV_REGION); - dayoffset = LLEnvironment::instance().getEnvironmentDayOffset(LLEnvironment::ENV_REGION); - - if (dayoffset.value() > 12.0) - dayoffset = dayoffset - F64Hours(24.0f); - - mDayLengthSlider->setValue(daylength.value()); - mDayOffsetSlider->setValue(dayoffset.value()); - - setControlsEnabled(owner_or_god_or_manager); - mLastRegion = region; - - LLSettingsDay::ptr_t pday = LLEnvironment::instance().getEnvironmentDay(LLEnvironment::ENV_REGION); - - if (pday) - { - mRegionSettingsRadioGroup->setSelectedIndex((pday->getAssetId() == LLSettingsDay::GetDefaultAssetId()) ? 0 : 1); - mEditingDayCycle = std::static_pointer_cast(pday->buildDerivedClone()); - } - else - { - mRegionSettingsRadioGroup->setSelectedIndex(1); - } - + refresh(); return true; } @@ -3430,38 +3412,38 @@ void LLPanelRegionEnvironment::refreshFromEstate() { const LLEstateInfoModel& estate_info = LLEstateInfoModel::instance(); - getChild("allow_override_chk")->setValue(estate_info.getAllowEnvironmentOverride()); + getChild(CHK_ALLOWOVERRIDE)->setValue(estate_info.getAllowEnvironmentOverride()); } void LLPanelRegionEnvironment::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()); - } +// 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; +// mEditingDayCycle = newday; } BOOL LLPanelRegionEnvironment::sendUpdate() -- cgit v1.2.3 From 68158f0340729d9f7e5a4b3e64bfc154a105ab6c Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 16 Aug 2018 09:43:54 -0700 Subject: Pass call backs into parcel and region change methods. --- indra/newview/llfloaterregioninfo.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index eb42ede8a8..cbb99f1854 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -187,13 +187,13 @@ public: virtual LLParcel * getParcel() override { return nullptr; } virtual bool canEdit() override { return LLEnvironment::instance().canAgentUpdateRegionEnvironment(); } - bool refreshFromRegion(LLViewerRegion* region); - void refreshFromEstate(); + bool refreshFromRegion(LLViewerRegion* region); + void refreshFromEstate(); - virtual BOOL postBuild() override; + virtual BOOL postBuild() override; protected: - virtual void doApply(); + virtual void doApply() override; virtual void doEditCommited(LLSettingsDay::ptr_t &newday); BOOL sendUpdate(); @@ -3418,6 +3418,7 @@ void LLPanelRegionEnvironment::refreshFromEstate() void LLPanelRegionEnvironment::doApply() { + LLPanelEnvironmentInfo::doApply(); // if (mRegionSettingsRadioGroup->getSelectedIndex() == 0) // { // LLEnvironment::instance().resetRegion(); -- cgit v1.2.3 From 7f25bef9c4bd5bf277331040711f13eb69b9c6d1 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 16 Aug 2018 16:27:53 -0700 Subject: MAINT-7703: Estate level switch turns of parcel environments. --- indra/newview/llfloaterregioninfo.cpp | 129 ++++++++++++++++++++-------------- 1 file changed, 76 insertions(+), 53 deletions(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') 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(RDO_USEDEFAULT)->setLabelArg("[USEDEFAULT]", getString(STR_LABEL_USEDEFAULT)); getChild(CHK_ALLOWOVERRIDE)->setVisible(TRUE); + getChild(CHK_ALLOWOVERRIDE)->setCommitCallback([this](LLUICtrl *, const LLSD &value){ onChkAllowOverride(value.asBoolean()); }); return TRUE; } @@ -3400,11 +3413,13 @@ void LLPanelRegionEnvironment::refresh() refreshFromEstate(); LLPanelEnvironmentInfo::refresh(); + + getChild(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(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; } -- cgit v1.2.3 From 1716129fd23ff35e030808406af1a8f796dc4b01 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 17 Aug 2018 12:35:42 -0700 Subject: MAINT-8826, MAINT-8990, MAINT-9002, MAINT-7703: Rework for environment pannels in Region/Estate and Parcel. Enable/disable by permission. Edit the correct environment. Dirty flags for changes. Estate owner disallow switch. --- indra/newview/llfloaterregioninfo.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 1935984df9..11bbd2c6fa 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -198,8 +198,6 @@ protected: virtual void doApply() override; -// virtual void doEditCommited(LLSettingsDay::ptr_t &newday); -// BOOL sendUpdate(); bool doUpdateEstate(const LLSD& notification, const LLSD& response); void onChkAllowOverride(bool value); -- cgit v1.2.3 From 43c8f5959f8afaf2f67fbbf49e78965802859b55 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 10 Sep 2018 16:44:56 +0300 Subject: MAINT-9099 Adjustable region altitudes. --- indra/newview/llfloaterregioninfo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 11bbd2c6fa..d13190254f 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -3376,7 +3376,7 @@ void LLPanelRegionExperiences::itemChanged( U32 event_type, const LLUUID& id ) } //========================================================================= -const U32 LLPanelRegionEnvironment::DIRTY_FLAG_OVERRIDE(0x01 << 3); +const U32 LLPanelRegionEnvironment::DIRTY_FLAG_OVERRIDE(0x01 << 4); LLPanelRegionEnvironment::LLPanelRegionEnvironment(): LLPanelEnvironmentInfo(), @@ -3395,6 +3395,7 @@ BOOL LLPanelRegionEnvironment::postBuild() getChild(RDO_USEDEFAULT)->setLabelArg("[USEDEFAULT]", getString(STR_LABEL_USEDEFAULT)); getChild(CHK_ALLOWOVERRIDE)->setVisible(TRUE); + getChild(PNL_ENVIRONMENT_ALTITUDES)->setVisible(TRUE); getChild(CHK_ALLOWOVERRIDE)->setCommitCallback([this](LLUICtrl *, const LLSD &value){ onChkAllowOverride(value.asBoolean()); }); return TRUE; -- cgit v1.2.3 From 7c6ac0740dac946275ef3f904614688f4b73f850 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 14 Sep 2018 09:52:28 -0700 Subject: SL-1556: Correctly identify when the selected parcel is in another region and display a message about cross region environments. --- indra/newview/llfloaterregioninfo.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index d13190254f..6aa35b40b6 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -192,11 +192,14 @@ public: virtual BOOL postBuild() override; + virtual S32 getParcelId() override { return INVALID_PARCEL_ID; } + protected: static const U32 DIRTY_FLAG_OVERRIDE; virtual void doApply() override; + virtual void refreshFromSource() override; bool doUpdateEstate(const LLSD& notification, const LLSD& response); @@ -3418,6 +3421,19 @@ void LLPanelRegionEnvironment::refresh() bool LLPanelRegionEnvironment::refreshFromRegion(LLViewerRegion* region) { + if (!region) + { + setNoSelection(true); + setControlsEnabled(false); + } + setNoSelection(false); + + if (gAgent.getRegion()->getRegionID() != region->getRegionID()) + { + setCrossRegion(true); + } + setCrossRegion(false); + refreshFromSource(); return true; } @@ -3429,6 +3445,12 @@ void LLPanelRegionEnvironment::refreshFromEstate() mAllowOverride = estate_info.getAllowEnvironmentOverride(); } +void LLPanelRegionEnvironment::refreshFromSource() +{ + LLEnvironment::instance().requestRegion( + [this](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) {onEnvironmentReceived(parcel_id, envifo); }); +} + void LLPanelRegionEnvironment::doApply() { LLPanelEnvironmentInfo::doApply(); -- cgit v1.2.3 From 17fb7d0bf4cc4db1c3f30dbbbdee7610d168336c Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 17 Sep 2018 14:21:38 -0700 Subject: SL-9667, SL-9669: Do not attempt to request environment for non-eep parcels, use handle to panel passed to static for callbacks. --- indra/newview/llfloaterregioninfo.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 6aa35b40b6..96ca7c1ac4 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -3447,8 +3447,10 @@ void LLPanelRegionEnvironment::refreshFromEstate() void LLPanelRegionEnvironment::refreshFromSource() { + LLHandle that_h = getHandle(); + LLEnvironment::instance().requestRegion( - [this](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) {onEnvironmentReceived(parcel_id, envifo); }); + [that_h](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) { _onEnvironmentReceived(that_h, parcel_id, envifo); }); } void LLPanelRegionEnvironment::doApply() -- cgit v1.2.3 From ff8f5f52a49d7984909a1d2dcb89ad81a3cb7588 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 19 Sep 2018 17:48:41 +0300 Subject: SL-9679 EEP - disable panel elements until data update, null cycle crash fix --- indra/newview/llfloaterregioninfo.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 96ca7c1ac4..c8ed43871d 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -3451,6 +3451,8 @@ void LLPanelRegionEnvironment::refreshFromSource() LLEnvironment::instance().requestRegion( [that_h](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) { _onEnvironmentReceived(that_h, parcel_id, envifo); }); + + setControlsEnabled(false); } void LLPanelRegionEnvironment::doApply() -- cgit v1.2.3 From 6d1fa8cbf20ec00fba5dc9da8e502d3c9e1c6ab7 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Mon, 8 Oct 2018 17:06:57 +0300 Subject: SL-9817 FIXED [EEP] Switching by Region/Estate tabs reset Day Cycle settings --- indra/newview/llfloaterregioninfo.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index c8ed43871d..4fd23252fa 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -191,6 +191,7 @@ public: void refreshFromEstate(); virtual BOOL postBuild() override; + virtual void onOpen(const LLSD& key) override {}; virtual S32 getParcelId() override { return INVALID_PARCEL_ID; } -- cgit v1.2.3 From 77b278b7f5615a6ba93b47c2a0d8a2338dc27dc2 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 12 Nov 2018 16:41:40 +0200 Subject: SL-9620 Viewer crashes after clicking "Commit" button while editing Day Cycle preset --- indra/newview/llfloaterregioninfo.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 4fd23252fa..671f5aca9d 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -3450,6 +3450,7 @@ void LLPanelRegionEnvironment::refreshFromSource() { LLHandle that_h = getHandle(); + mCurEnvVersion = INVALID_PARCEL_ENVIRONMENT_VERSION; LLEnvironment::instance().requestRegion( [that_h](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) { _onEnvironmentReceived(that_h, parcel_id, envifo); }); -- cgit v1.2.3 From 76071d4fe8f2b88e33d0393fe00dc2ce88f71935 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 5 Dec 2018 22:13:49 +0200 Subject: SL-10091 EEP Filter out dupplicate refreshes and callbacks --- indra/newview/llfloaterregioninfo.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 671f5aca9d..d7d114ca41 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -300,8 +300,7 @@ void LLFloaterRegionInfo::onOpen(const LLSD& key) disableTabCtrls(); return; } - refreshFromRegion(gAgent.getRegion()); - requestRegionInfo(); + requestRegionInfo(); // will cause refreshFromRegion() requestMeshRezInfo(); } @@ -484,6 +483,8 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) panel->setCtrlsEnabled(allow_modify); + // Note: region info also causes LLRegionInfoModel::instance().update(msg); -> requestRegion(); -> changed message + // we need to know env version here and in update(msg) to know when to request and when not to, when to filter 'changed' floater->refreshFromRegion( gAgent.getRegion() ); } @@ -3410,7 +3411,10 @@ void LLPanelRegionEnvironment::refresh() { if (!mCurrentEnvironment) { - refreshFromSource(); + if (mCurEnvVersion <= INVALID_PARCEL_ENVIRONMENT_VERSION) + { + refreshFromSource(); // will immediately set mCurEnvVersion + } // else - already requesting return; } @@ -3426,15 +3430,17 @@ bool LLPanelRegionEnvironment::refreshFromRegion(LLViewerRegion* region) { setNoSelection(true); setControlsEnabled(false); + mCurEnvVersion = INVALID_PARCEL_ENVIRONMENT_VERSION; } setNoSelection(false); if (gAgent.getRegion()->getRegionID() != region->getRegionID()) { setCrossRegion(true); + mCurEnvVersion = INVALID_PARCEL_ENVIRONMENT_VERSION; } setCrossRegion(false); - + refreshFromSource(); return true; } @@ -3448,9 +3454,15 @@ void LLPanelRegionEnvironment::refreshFromEstate() void LLPanelRegionEnvironment::refreshFromSource() { + LL_DEBUGS("ENVIRONMENT") << "Requesting environment for region, known version " << mCurEnvVersion << LL_ENDL; LLHandle that_h = getHandle(); - mCurEnvVersion = INVALID_PARCEL_ENVIRONMENT_VERSION; + if (mCurEnvVersion < UNSET_PARCEL_ENVIRONMENT_VERSION) + { + // to mark as requesting + mCurEnvVersion = UNSET_PARCEL_ENVIRONMENT_VERSION; + } + LLEnvironment::instance().requestRegion( [that_h](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) { _onEnvironmentReceived(that_h, parcel_id, envifo); }); -- cgit v1.2.3 From d4fe87cca49162c978b4eacde880431977624874 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 7 Dec 2018 16:24:47 +0200 Subject: SL-10091 Prevent info floater from re-requesting data when not open --- indra/newview/llfloaterregioninfo.cpp | 44 ++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 13 deletions(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index d7d114ca41..fcaa7d2bf9 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -226,7 +226,8 @@ LLUUID LLFloaterRegionInfo::sRequestInvoice; LLFloaterRegionInfo::LLFloaterRegionInfo(const LLSD& seed) : LLFloater(seed), - mEnvironmentPanel(NULL) + mEnvironmentPanel(NULL), + mRegionChangedCallback() {} BOOL LLFloaterRegionInfo::postBuild() @@ -285,13 +286,18 @@ BOOL LLFloaterRegionInfo::postBuild() &processEstateOwnerRequest); // Request region info when agent region changes. - gAgent.addRegionChangedCallback(boost::bind(&LLFloaterRegionInfo::requestRegionInfo, this)); + mRegionChangedCallback = gAgent.addRegionChangedCallback(boost::bind(&LLFloaterRegionInfo::onRegionChanged, this)); return TRUE; } LLFloaterRegionInfo::~LLFloaterRegionInfo() -{} +{ + if (mRegionChangedCallback.connected()) + { + mRegionChangedCallback.disconnect(); + } +} void LLFloaterRegionInfo::onOpen(const LLSD& key) { @@ -304,15 +310,24 @@ void LLFloaterRegionInfo::onOpen(const LLSD& key) requestMeshRezInfo(); } -// static -void LLFloaterRegionInfo::requestRegionInfo() +void LLFloaterRegionInfo::onRegionChanged() { - LLTabContainer* tab = getChild("region_panels"); + if (getVisible()) //otherwise onOpen will do request + { + requestRegionInfo(); + } +} - tab->getChild("General")->setCtrlsEnabled(FALSE); - tab->getChild("Debug")->setCtrlsEnabled(FALSE); - tab->getChild("Terrain")->setCtrlsEnabled(FALSE); - tab->getChild("Estate")->setCtrlsEnabled(FALSE); +void LLFloaterRegionInfo::requestRegionInfo() +{ + LLTabContainer* tab = findChild("region_panels"); + if (tab) + { + tab->getChild("General")->setCtrlsEnabled(FALSE); + tab->getChild("Debug")->setCtrlsEnabled(FALSE); + tab->getChild("Terrain")->setCtrlsEnabled(FALSE); + tab->getChild("Estate")->setCtrlsEnabled(FALSE); + } // Must allow anyone to request the RegionInfo data // so non-owners/non-gods can see the values. @@ -483,9 +498,12 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) panel->setCtrlsEnabled(allow_modify); - // Note: region info also causes LLRegionInfoModel::instance().update(msg); -> requestRegion(); -> changed message - // we need to know env version here and in update(msg) to know when to request and when not to, when to filter 'changed' - floater->refreshFromRegion( gAgent.getRegion() ); + if (floater->getVisible()) + { + // Note: region info also causes LLRegionInfoModel::instance().update(msg); -> requestRegion(); -> changed message + // we need to know env version here and in update(msg) to know when to request and when not to, when to filter 'changed' + floater->refreshFromRegion(gAgent.getRegion()); + } // else will rerequest on onOpen either way } // static -- cgit v1.2.3 From 8227a0b270f6e7cc521adeb7b97ad2d5fb646973 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 21 Dec 2018 15:30:57 -0800 Subject: SL-10279: Rework the environment pannel. Still in progress. --- indra/newview/llfloaterregioninfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index fcaa7d2bf9..e52ba38080 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -3416,7 +3416,7 @@ BOOL LLPanelRegionEnvironment::postBuild() if (!LLPanelEnvironmentInfo::postBuild()) return FALSE; - getChild(RDO_USEDEFAULT)->setLabelArg("[USEDEFAULT]", getString(STR_LABEL_USEDEFAULT)); + getChild(BTN_USEDEFAULT)->setLabelArg("[USEDEFAULT]", getString(STR_LABEL_USEDEFAULT)); getChild(CHK_ALLOWOVERRIDE)->setVisible(TRUE); getChild(PNL_ENVIRONMENT_ALTITUDES)->setVisible(TRUE); -- cgit v1.2.3 From 5fe626afabd2857980e8011ceb6081f9e9f108c7 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 2 Jan 2019 15:13:47 -0800 Subject: SL-10279: Most functionality now present. Still needs some cleanup on the bump code. --- indra/newview/llfloaterregioninfo.cpp | 67 +++++++++++++---------------------- 1 file changed, 24 insertions(+), 43 deletions(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index e52ba38080..3e07c4abc7 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -188,7 +188,6 @@ public: virtual bool canEdit() override { return LLEnvironment::instance().canAgentUpdateRegionEnvironment(); } bool refreshFromRegion(LLViewerRegion* region); - void refreshFromEstate(); virtual BOOL postBuild() override; virtual void onOpen(const LLSD& key) override {}; @@ -198,16 +197,14 @@ public: protected: static const U32 DIRTY_FLAG_OVERRIDE; - virtual void doApply() override; - virtual void refreshFromSource() override; - bool doUpdateEstate(const LLSD& notification, const LLSD& response); + bool confirmUpdateEstateEnvironment(const LLSD& notification, const LLSD& response); void onChkAllowOverride(bool value); private: - bool mAllowOverride; + bool mAllowOverrideRestore; }; @@ -3403,7 +3400,7 @@ const U32 LLPanelRegionEnvironment::DIRTY_FLAG_OVERRIDE(0x01 << 4); LLPanelRegionEnvironment::LLPanelRegionEnvironment(): LLPanelEnvironmentInfo(), - mAllowOverride(false) + mAllowOverrideRestore(false) { LLEstateInfoModel& estate_info = LLEstateInfoModel::instance(); estate_info.setCommitCallback(boost::bind(&LLPanelRegionEnvironment::refreshFromEstate, this)); @@ -3436,7 +3433,6 @@ void LLPanelRegionEnvironment::refresh() return; } - refreshFromEstate(); LLPanelEnvironmentInfo::refresh(); getChild(CHK_ALLOWOVERRIDE)->setValue(mAllowOverride); @@ -3463,13 +3459,6 @@ bool LLPanelRegionEnvironment::refreshFromRegion(LLViewerRegion* region) return true; } -void LLPanelRegionEnvironment::refreshFromEstate() -{ - const LLEstateInfoModel& estate_info = LLEstateInfoModel::instance(); - - mAllowOverride = estate_info.getAllowEnvironmentOverride(); -} - void LLPanelRegionEnvironment::refreshFromSource() { LL_DEBUGS("ENVIRONMENT") << "Requesting environment for region, known version " << mCurEnvVersion << LL_ENDL; @@ -3487,31 +3476,7 @@ void LLPanelRegionEnvironment::refreshFromSource() setControlsEnabled(false); } -void LLPanelRegionEnvironment::doApply() -{ - LLPanelEnvironmentInfo::doApply(); - - 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) +bool LLPanelRegionEnvironment::confirmUpdateEstateEnvironment(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); @@ -3530,6 +3495,9 @@ bool LLPanelRegionEnvironment::doUpdateEstate(const LLSD& notification, const LL break; case 1: + mAllowOverride = mAllowOverrideRestore; + getChild(CHK_ALLOWOVERRIDE)->setValue(mAllowOverride); + break; default: break; } @@ -3538,11 +3506,24 @@ bool LLPanelRegionEnvironment::doUpdateEstate(const LLSD& notification, const LL void LLPanelRegionEnvironment::onChkAllowOverride(bool value) { - if (!value) + setDirtyFlag(DIRTY_FLAG_OVERRIDE); + mAllowOverrideRestore = mAllowOverride; + mAllowOverride = value; + + LLNotification::Params params("ChangeLindenEstate"); + params.functor.function([this](const LLSD& notification, const LLSD& response) { confirmUpdateEstateEnvironment(notification, response); }); + + std::string notification("EstateParcelEnvironmentOverride"); + if (LLPanelEstateInfo::isLindenEstate()) + notification = "ChangeLindenEstate"; + + if (!value || LLPanelEstateInfo::isLindenEstate()) + { // warn if turning off or a Linden Estate + LLNotifications::instance().add(params); + } + else { - LLNotificationsUtil::add("EstateParcelEnvironmentOverride"); + LLNotifications::instance().forceResponse(params, 0); } - setDirtyFlag(DIRTY_FLAG_OVERRIDE); - mAllowOverride = value; } -- cgit v1.2.3 From 0969632b11383e83a53bce3a10379945be7ad8c2 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 4 Jan 2019 12:32:23 -0800 Subject: Move some estate requests into the LLEstateInfoModel and out of the Region floater. Fix issue where user could potentially be looking at one set of estate options and update the estate they were standing in by mistake. --- indra/newview/llfloaterregioninfo.cpp | 641 ++++++++++------------------------ 1 file changed, 193 insertions(+), 448 deletions(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 3e07c4abc7..40e26ba3bd 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -106,43 +106,6 @@ const S32 CORNER_COUNT = 4; /// Local class declaration ///---------------------------------------------------------------------------- -class LLDispatchEstateUpdateInfo : public LLDispatchHandler -{ -public: - LLDispatchEstateUpdateInfo() {} - virtual ~LLDispatchEstateUpdateInfo() {} - virtual bool operator()( - const LLDispatcher* dispatcher, - const std::string& key, - const LLUUID& invoice, - const sparam_t& strings); -}; - -class LLDispatchSetEstateAccess : public LLDispatchHandler -{ -public: - LLDispatchSetEstateAccess() {} - virtual ~LLDispatchSetEstateAccess() {} - virtual bool operator()( - const LLDispatcher* dispatcher, - const std::string& key, - const LLUUID& invoice, - const sparam_t& strings); -}; - -class LLDispatchSetEstateExperience : public LLDispatchHandler -{ -public: - virtual bool operator()( - const LLDispatcher* dispatcher, - const std::string& key, - const LLUUID& invoice, - const sparam_t& strings); - - LLSD getIDs( sparam_t::const_iterator it, sparam_t::const_iterator end, S32 count ); -}; - - /* void unpack_request_params( LLMessageSystem* msg, @@ -180,6 +143,7 @@ class LLPanelRegionEnvironment : public LLPanelEnvironmentInfo { public: LLPanelRegionEnvironment(); + virtual ~LLPanelRegionEnvironment(); virtual void refresh() override; @@ -205,7 +169,7 @@ protected: private: bool mAllowOverrideRestore; - + connection_t mCommitConnect; }; @@ -217,10 +181,6 @@ bool estate_dispatch_initialized = false; /// LLFloaterRegionInfo ///---------------------------------------------------------------------------- -//S32 LLFloaterRegionInfo::sRequestSerial = 0; -LLUUID LLFloaterRegionInfo::sRequestInvoice; - - LLFloaterRegionInfo::LLFloaterRegionInfo(const LLSD& seed) : LLFloater(seed), mEnvironmentPanel(NULL), @@ -278,10 +238,6 @@ BOOL LLFloaterRegionInfo::postBuild() mTab->addTabPanel(panel); } - gMessageSystem->setHandlerFunc( - "EstateOwnerMessage", - &processEstateOwnerRequest); - // Request region info when agent region changes. mRegionChangedCallback = gAgent.addRegionChangedCallback(boost::bind(&LLFloaterRegionInfo::onRegionChanged, this)); @@ -337,42 +293,6 @@ void LLFloaterRegionInfo::requestRegionInfo() gAgent.sendReliableMessage(); } -// static -void LLFloaterRegionInfo::processEstateOwnerRequest(LLMessageSystem* msg,void**) -{ - static LLDispatcher dispatch; - LLFloaterRegionInfo* floater = LLFloaterReg::getTypedInstance("region_info"); - if(!floater) - { - return; - } - - if (!estate_dispatch_initialized) - { - LLPanelEstateInfo::initDispatch(dispatch); - } - - LLTabContainer* tab = floater->getChild("region_panels"); - LLPanelEstateInfo* panel = (LLPanelEstateInfo*)tab->getChild("Estate"); - - // unpack the message - std::string request; - LLUUID invoice; - LLDispatcher::sparam_t strings; - LLDispatcher::unpackMessage(msg, request, invoice, strings); - if(invoice != getLastInvoice()) - { - LL_WARNS() << "Mismatched Estate message: " << request << LL_ENDL; - return; - } - - //dispatch the message - dispatch.dispatch(request, invoice, strings); - - panel->updateControls(gAgent.getRegion()); -} - - // static void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) { @@ -687,43 +607,10 @@ void LLPanelRegionInfo::updateChild(LLUICtrl* child_ctr) // virtual bool LLPanelRegionInfo::refreshFromRegion(LLViewerRegion* region) { - if (region) mHost = region->getHost(); + LLEstateInfoModel::instance().setRegion(region); return true; } -void LLPanelRegionInfo::sendEstateOwnerMessage( - LLMessageSystem* msg, - const std::string& request, - const LLUUID& invoice, - const strings_t& strings) -{ - LL_INFOS() << "Sending estate request '" << request << "'" << LL_ENDL; - msg->newMessage("EstateOwnerMessage"); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null); //not used - msg->nextBlock("MethodData"); - msg->addString("Method", request); - msg->addUUID("Invoice", invoice); - if(strings.empty()) - { - msg->nextBlock("ParamList"); - msg->addString("Parameter", NULL); - } - else - { - strings_t::const_iterator it = strings.begin(); - strings_t::const_iterator end = strings.end(); - for(; it != end; ++it) - { - msg->nextBlock("ParamList"); - msg->addString("Parameter", *it); - } - } - msg->sendReliable(mHost); -} - void LLPanelRegionInfo::enableButton(const std::string& btn_name, BOOL enable) { LLView* button = findChildView(btn_name); @@ -857,8 +744,7 @@ void LLPanelRegionGeneralInfo::onKickCommit(const uuid_vec_t& ids) ids[0].toString(buffer); strings.push_back(strings_t::value_type(buffer)); - LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); - sendEstateOwnerMessage(gMessageSystem, "teleporthomeuser", invoice, strings); + LLEstateInfoModel::instance().sendEstateOwnerMessage("teleporthomeuser", strings); } } @@ -883,9 +769,8 @@ bool LLPanelRegionGeneralInfo::onKickAllCommit(const LLSD& notification, const L gAgent.getID().toString(buffer); strings.push_back(buffer); - LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); // historical message name - sendEstateOwnerMessage(gMessageSystem, "teleporthomeallusers", invoice, strings); + LLEstateInfoModel::instance().sendEstateOwnerMessage("teleporthomeallusers", strings); } return false; } @@ -924,8 +809,7 @@ bool LLPanelRegionGeneralInfo::onMessageCommit(const LLSD& notification, const L LLAgentUI::buildFullname(name); strings.push_back(strings_t::value_type(name)); strings.push_back(strings_t::value_type(text)); - LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); - sendEstateOwnerMessage(gMessageSystem, "simulatormessage", invoice, strings); + LLEstateInfoModel::instance().sendEstateOwnerMessage("simulatormessage", strings); return false; } @@ -1011,8 +895,7 @@ BOOL LLPanelRegionGeneralInfo::sendUpdate() buffer = llformat("%s", (getChild("allow_parcel_changes_check")->getValue().asBoolean() ? "Y" : "N")); strings.push_back(strings_t::value_type(buffer)); - LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); - sendEstateOwnerMessage(gMessageSystem, "setregioninfo", invoice, strings); + LLEstateInfoModel::instance().sendEstateOwnerMessage("setregioninfo", strings); } // if we changed access levels, tell user about it @@ -1084,8 +967,7 @@ BOOL LLPanelRegionDebugInfo::sendUpdate() buffer = llformat("%s", (getChild("disable_physics_check")->getValue().asBoolean() ? "Y" : "N")); strings.push_back(buffer); - LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); - sendEstateOwnerMessage(gMessageSystem, "setregiondebug", invoice, strings); + LLEstateInfoModel::instance().sendEstateOwnerMessage("setregiondebug", strings); return TRUE; } @@ -1155,9 +1037,7 @@ bool LLPanelRegionDebugInfo::callbackReturn(const LLSD& notification, const LLSD strings.push_back(llformat("%d", flags)); strings.push_back(target_avatar.asString()); - LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); - - sendEstateOwnerMessage(gMessageSystem, "estateobjectreturn", invoice, strings); + LLEstateInfoModel::instance().sendEstateOwnerMessage("estateobjectreturn", strings); } else { @@ -1175,7 +1055,6 @@ void LLPanelRegionDebugInfo::onClickTopColliders(void* data) LLPanelRegionDebugInfo* self = (LLPanelRegionDebugInfo*)data; strings_t strings; strings.push_back("1"); // one physics step - LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); LLFloaterTopObjects* instance = LLFloaterReg::getTypedInstance("top_objects"); if(!instance) return; LLFloaterReg::showInstance("top_objects"); @@ -1185,7 +1064,7 @@ void LLPanelRegionDebugInfo::onClickTopColliders(void* data) self->getChildView("top_colliders_btn")->setEnabled(false); self->getChildView("top_scripts_btn")->setEnabled(false); - self->sendEstateOwnerMessage(gMessageSystem, "colliders", invoice, strings); + LLEstateInfoModel::instance().sendEstateOwnerMessage("colliders", strings); } // static @@ -1194,7 +1073,6 @@ void LLPanelRegionDebugInfo::onClickTopScripts(void* data) LLPanelRegionDebugInfo* self = (LLPanelRegionDebugInfo*)data; strings_t strings; strings.push_back("6"); // top 5 scripts - LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); LLFloaterTopObjects* instance = LLFloaterReg::getTypedInstance("top_objects"); if(!instance) return; LLFloaterReg::showInstance("top_objects"); @@ -1204,7 +1082,7 @@ void LLPanelRegionDebugInfo::onClickTopScripts(void* data) self->getChildView("top_colliders_btn")->setEnabled(false); self->getChildView("top_scripts_btn")->setEnabled(false); - self->sendEstateOwnerMessage(gMessageSystem, "scripts", invoice, strings); + LLEstateInfoModel::instance().sendEstateOwnerMessage("scripts", strings); } // static @@ -1221,19 +1099,16 @@ bool LLPanelRegionDebugInfo::callbackRestart(const LLSD& notification, const LLS strings_t strings; strings.push_back("120"); - LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); - sendEstateOwnerMessage(gMessageSystem, "restart", invoice, strings); + LLEstateInfoModel::instance().sendEstateOwnerMessage("restart", strings); return false; } // static void LLPanelRegionDebugInfo::onClickCancelRestart(void* data) { - LLPanelRegionDebugInfo* self = (LLPanelRegionDebugInfo*)data; strings_t strings; strings.push_back("-1"); - LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); - self->sendEstateOwnerMessage(gMessageSystem, "restart", invoice, strings); + LLEstateInfoModel::instance().sendEstateOwnerMessage("restart", strings); } // static @@ -1398,7 +1273,6 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate() LL_INFOS() << "LLPanelRegionTerrainInfo::sendUpdate" << LL_ENDL; std::string buffer; strings_t strings; - LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); // update the model LLRegionInfoModel& region_info = LLRegionInfoModel::instance(); @@ -1407,7 +1281,7 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate() region_info.mTerrainLowerLimit = (F32) getChild("terrain_lower_spin")->getValue().asReal(); // and sync the region with it - region_info.sendRegionTerrain(invoice); + region_info.sendRegionTerrain(LLEstateInfoModel::instance().getLastInvoice()); // ======================================= // Assemble and send texturedetail message @@ -1435,7 +1309,6 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate() LLTextureCtrl* texture_ctrl; std::string id_str; - LLMessageSystem* msg = gMessageSystem; for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i) { @@ -1449,7 +1322,7 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate() strings.push_back(buffer); } } - sendEstateOwnerMessage(msg, "texturedetail", invoice, strings); + LLEstateInfoModel::instance().sendEstateOwnerMessage("texturedetail", strings); strings.clear(); // ======================================== @@ -1462,13 +1335,13 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate() std::string buffer3 = llformat("%d %f %f", i, (F32)getChild(buffer)->getValue().asReal(), (F32)getChild(buffer2)->getValue().asReal()); strings.push_back(buffer3); } - sendEstateOwnerMessage(msg, "textureheights", invoice, strings); + LLEstateInfoModel::instance().sendEstateOwnerMessage("textureheights", strings); strings.clear(); // ======================================== // Send texturecommit message - sendEstateOwnerMessage(msg, "texturecommit", invoice, strings); + LLEstateInfoModel::instance().sendEstateOwnerMessage("texturecommit", strings); return TRUE; } @@ -1508,12 +1381,10 @@ void LLPanelRegionTerrainInfo::onClickDownloadRaw(void* data) std::string filepath = picker.getFirstFile(); gXferManager->expectFileForRequest(filepath); - LLPanelRegionTerrainInfo* self = (LLPanelRegionTerrainInfo*)data; strings_t strings; strings.push_back("download filename"); strings.push_back(filepath); - LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); - self->sendEstateOwnerMessage(gMessageSystem, "terrain", invoice, strings); + LLEstateInfoModel::instance().sendEstateOwnerMessage("terrain", strings); } // static @@ -1528,12 +1399,10 @@ void LLPanelRegionTerrainInfo::onClickUploadRaw(void* data) std::string filepath = picker.getFirstFile(); gXferManager->expectFileForTransfer(filepath); - LLPanelRegionTerrainInfo* self = (LLPanelRegionTerrainInfo*)data; strings_t strings; strings.push_back("upload filename"); strings.push_back(filepath); - LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); - self->sendEstateOwnerMessage(gMessageSystem, "terrain", invoice, strings); + LLEstateInfoModel::instance().sendEstateOwnerMessage("terrain", strings); LLNotificationsUtil::add("RawUploadStarted"); } @@ -1551,8 +1420,7 @@ bool LLPanelRegionTerrainInfo::callbackBakeTerrain(const LLSD& notification, con strings_t strings; strings.push_back("bake"); - LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); - sendEstateOwnerMessage(gMessageSystem, "terrain", invoice, strings); + LLEstateInfoModel::instance().sendEstateOwnerMessage("terrain", strings); return false; } @@ -1566,33 +1434,11 @@ LLPanelEstateInfo::LLPanelEstateInfo() mEstateID(0) // invalid { LLEstateInfoModel& estate_info = LLEstateInfoModel::instance(); + estate_info.setCommitCallback(boost::bind(&LLPanelEstateInfo::refreshFromEstate, this)); estate_info.setUpdateCallback(boost::bind(&LLPanelEstateInfo::refreshFromEstate, this)); -} - -// static -void LLPanelEstateInfo::initDispatch(LLDispatcher& dispatch) -{ - std::string name; - -// name.assign("setowner"); -// static LLDispatchSetEstateOwner set_owner; -// dispatch.addHandler(name, &set_owner); - name.assign("estateupdateinfo"); - static LLDispatchEstateUpdateInfo estate_update_info; - dispatch.addHandler(name, &estate_update_info); - - name.assign("setaccess"); - static LLDispatchSetEstateAccess set_access; - dispatch.addHandler(name, &set_access); - - - name.assign("setexperience"); - static LLDispatchSetEstateExperience set_experience; - dispatch.addHandler(name, &set_experience); - - estate_dispatch_initialized = true; + estate_info.setUpdateAccessCallback(boost::bind(&LLPanelEstateInfo::refreshAccessFromEstate, this, _1)); } //--------------------------------------------------------------------------- @@ -1755,7 +1601,7 @@ bool LLPanelEstateInfo::kickUserConfirm(const LLSD& notification, const LLSD& re strings_t strings; strings.push_back(notification["payload"]["agent_id"].asString()); - sendEstateOwnerMessage(gMessageSystem, "kickestate", LLFloaterRegionInfo::getLastInvoice(), strings); + LLEstateInfoModel::instance().sendEstateOwnerMessage("kickestate", strings); break; } default: @@ -2152,7 +1998,7 @@ void LLPanelEstateInfo::sendEstateAccessDelta(U32 flags, const LLUUID& agent_or_ msg->nextBlock("MethodData"); msg->addString("Method", "estateaccessdelta"); - msg->addUUID("Invoice", LLFloaterRegionInfo::getLastInvoice()); + msg->addUUID("Invoice", LLEstateInfoModel::instance().getLastInvoice()); std::string buf; gAgent.getID().toString(buf); @@ -2255,16 +2101,13 @@ bool LLPanelEstateInfo::refreshFromRegion(LLViewerRegion* region) strings_t strings; //integers_t integers; //LLFloaterRegionInfo::incrementSerial(); - LLFloaterRegionInfo::nextInvoice(); - LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); //integers.push_back(LLFloaterRegionInfo::());::getPanelEstate(); LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); panel->clearAccessLists(); - - sendEstateOwnerMessage(gMessageSystem, "getinfo", invoice, strings); + LLEstateInfoModel::instance().setRegion(region); refresh(); @@ -2383,6 +2226,147 @@ void LLPanelEstateInfo::refreshFromEstate() refresh(); } + +void LLPanelEstateInfo::refreshAccessFromEstate(U32 flags) +{ + const LLEstateInfoModel& estate_info = LLEstateInfoModel::instance(); + + // grab the UUID's out of the string fields + if (flags & ESTATE_ACCESS_ALLOWED_AGENTS) + { + LLNameListCtrl *allowed_agent_name_list(getChild("allowed_avatar_name_list")); + + const uuid_set_t& allowed_agents(estate_info.getAllowedAgents()); + int totalAllowedAgents = allowed_agents.size(); + + if (allowed_agent_name_list) + { + totalAllowedAgents += allowed_agent_name_list->getItemCount(); + } + + LLStringUtil::format_map_t args; + args["[ALLOWEDAGENTS]"] = llformat("%d", totalAllowedAgents); + args["[MAXACCESS]"] = llformat("%d", ESTATE_MAX_ACCESS_IDS); + std::string msg = LLTrans::getString("RegionInfoAllowedResidents", args); + getChild("allow_resident_label")->setValue(LLSD(msg)); + + if (allowed_agent_name_list) + { + // Don't sort these as we add them, sort them when we are done. + allowed_agent_name_list->clearSortOrder(); + allowed_agent_name_list->deleteAllItems(); + + for (const LLUUID &id : allowed_agents) + { + allowed_agent_name_list->addNameItem(id); + } + allowed_agent_name_list->sortByName(TRUE); + } + } + + if (flags & ESTATE_ACCESS_ALLOWED_GROUPS) + { + LLNameListCtrl* allowed_group_name_list(getChild("allowed_group_name_list")); + const uuid_set_t &allowed_groups(estate_info.getAllowedGroups()); + + LLStringUtil::format_map_t args; + args["[ALLOWEDGROUPS]"] = llformat("%d", allowed_groups.size()); + args["[MAXACCESS]"] = llformat("%d", ESTATE_MAX_GROUP_IDS); + std::string msg = LLTrans::getString("RegionInfoAllowedGroups", args); + getChild("allow_group_label")->setValue(LLSD(msg)); + + if (allowed_group_name_list) + { + // Don't sort these as we add them, sort them when we are done. + allowed_group_name_list->clearSortOrder(); + allowed_group_name_list->deleteAllItems(); + + for (const LLUUID &id: allowed_groups) + { + allowed_group_name_list->addGroupNameItem(id); + } + allowed_group_name_list->sortByName(TRUE); + } + } + + if (flags & ESTATE_ACCESS_BANNED_AGENTS) + { + LLNameListCtrl* banned_agent_name_list(getChild("banned_avatar_name_list")); + const uuid_set_t &banned_agents(estate_info.getBannedAgents()); + int totalBannedAgents = banned_agents.size(); + + if (banned_agent_name_list) + { + totalBannedAgents += banned_agent_name_list->getItemCount(); + } + + + LLStringUtil::format_map_t args; + args["[BANNEDAGENTS]"] = llformat("%d", totalBannedAgents); + args["[MAXBANNED]"] = llformat("%d", ESTATE_MAX_ACCESS_IDS); + std::string msg = LLTrans::getString("RegionInfoBannedResidents", args); + getChild("ban_resident_label")->setValue(LLSD(msg)); + + if (banned_agent_name_list) + { + // Don't sort these as we add them, sort them when we are done. + banned_agent_name_list->clearSortOrder(); + + for (const LLUUID &id: banned_agents) + { + banned_agent_name_list->addNameItem(id); + } + banned_agent_name_list->sortByName(TRUE); + } + } + + if (flags & ESTATE_ACCESS_MANAGERS) + { + LLNameListCtrl* estate_manager_name_list(getChild("estate_manager_name_list")); + const uuid_set_t &estate_mgrs(estate_info.getEstateManagers()); + + LLStringUtil::format_map_t args; + args["[ESTATEMANAGERS]"] = llformat("%d", estate_mgrs.size()); + args["[MAXMANAGERS]"] = llformat("%d", ESTATE_MAX_MANAGERS); + std::string msg = LLTrans::getString("RegionInfoEstateManagers", args); + getChild("estate_manager_label")->setValue(LLSD(msg)); + + if (estate_manager_name_list) + { + // Don't sort these as we add them, sort them when we are done. + estate_manager_name_list->clearSortOrder(); + estate_manager_name_list->deleteAllItems(); // Clear existing entries + + // There should be only ESTATE_MAX_MANAGERS people in the list, but if the database gets more (SL-46107) don't + // truncate the list unless it's really big. Go ahead and show the extras so the user doesn't get confused, + // and they can still remove them. + for (const LLUUID &id : estate_mgrs) + { + estate_manager_name_list->addNameItem(id); + } + estate_manager_name_list->sortByName(TRUE); + } + } + + // Update the buttons which may change based on the list contents but also needs to account for general access features. + updateControls(gAgent.getRegion()); +} + + +namespace +{ + LLSD set_to_llsdarray(const uuid_set_t &values) + { + LLSD result(LLSD::emptyArray()); + + for (const LLUUID &id : values) + { + result.append(id); + } + return result; + } +} + BOOL LLPanelEstateInfo::sendUpdate() { LL_INFOS() << "LLPanelEsateInfo::sendUpdate()" << LL_ENDL; @@ -2515,8 +2499,8 @@ bool LLPanelEstateInfo::onMessageCommit(const LLSD& notification, const LLSD& re LLAgentUI::buildFullname(name); strings.push_back(strings_t::value_type(name)); strings.push_back(strings_t::value_type(text)); - LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); - sendEstateOwnerMessage(gMessageSystem, "instantmessage", invoice, strings); + + LLEstateInfoModel::instance().sendEstateOwnerMessage("instantmessage", strings); return false; } @@ -2801,7 +2785,7 @@ void LLPanelEstateCovenant::sendChangeCovenantID(const LLUUID &asset_id) msg->nextBlock("MethodData"); msg->addString("Method", "estatechangecovenantid"); - msg->addUUID("Invoice", LLFloaterRegionInfo::getLastInvoice()); + msg->addUUID("Invoice", LLEstateInfoModel::instance().getLastInvoice()); msg->nextBlock("ParamList"); msg->addString("Parameter", getCovenantID().asString()); @@ -2881,261 +2865,6 @@ void LLPanelEstateCovenant::setCovenantTextEditor(const std::string& text) mEditor->setText(text); } -// key = "estateupdateinfo" -// strings[0] = estate name -// strings[1] = str(owner_id) -// strings[2] = str(estate_id) -// strings[3] = str(estate_flags) -// strings[4] = str((S32)(sun_hour * 1024)) -// strings[5] = str(parent_estate_id) -// strings[6] = str(covenant_id) -// strings[7] = str(covenant_timestamp) -// strings[8] = str(send_to_agent_only) -// strings[9] = str(abuse_email_addr) -bool LLDispatchEstateUpdateInfo::operator()( - const LLDispatcher* dispatcher, - const std::string& key, - const LLUUID& invoice, - const sparam_t& strings) -{ - LL_DEBUGS() << "Received estate update" << LL_ENDL; - - // Update estate info model. - // This will call LLPanelEstateInfo::refreshFromEstate(). - // *TODO: Move estate message handling stuff to llestateinfomodel.cpp. - LLEstateInfoModel::instance().update(strings); - - return true; -} - - -// key = "setaccess" -// strings[0] = str(estate_id) -// strings[1] = str(packed_access_lists) -// strings[2] = str(num allowed agent ids) -// strings[3] = str(num allowed group ids) -// strings[4] = str(num banned agent ids) -// strings[5] = str(num estate manager agent ids) -// strings[6] = bin(uuid) -// strings[7] = bin(uuid) -// strings[8] = bin(uuid) -// ... -bool LLDispatchSetEstateAccess::operator()( - const LLDispatcher* dispatcher, - const std::string& key, - const LLUUID& invoice, - const sparam_t& strings) -{ - LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); - if (!panel) return true; - - S32 index = 1; // skip estate_id - U32 access_flags = strtoul(strings[index++].c_str(), NULL,10); - S32 num_allowed_agents = strtol(strings[index++].c_str(), NULL, 10); - S32 num_allowed_groups = strtol(strings[index++].c_str(), NULL, 10); - S32 num_banned_agents = strtol(strings[index++].c_str(), NULL, 10); - S32 num_estate_managers = strtol(strings[index++].c_str(), NULL, 10); - - // sanity ckecks - if (num_allowed_agents > 0 - && !(access_flags & ESTATE_ACCESS_ALLOWED_AGENTS)) - { - LL_WARNS() << "non-zero count for allowed agents, but no corresponding flag" << LL_ENDL; - } - if (num_allowed_groups > 0 - && !(access_flags & ESTATE_ACCESS_ALLOWED_GROUPS)) - { - LL_WARNS() << "non-zero count for allowed groups, but no corresponding flag" << LL_ENDL; - } - if (num_banned_agents > 0 - && !(access_flags & ESTATE_ACCESS_BANNED_AGENTS)) - { - LL_WARNS() << "non-zero count for banned agents, but no corresponding flag" << LL_ENDL; - } - if (num_estate_managers > 0 - && !(access_flags & ESTATE_ACCESS_MANAGERS)) - { - LL_WARNS() << "non-zero count for managers, but no corresponding flag" << LL_ENDL; - } - - // grab the UUID's out of the string fields - if (access_flags & ESTATE_ACCESS_ALLOWED_AGENTS) - { - LLNameListCtrl* allowed_agent_name_list; - allowed_agent_name_list = panel->getChild("allowed_avatar_name_list"); - - int totalAllowedAgents = num_allowed_agents; - - if (allowed_agent_name_list) - { - totalAllowedAgents += allowed_agent_name_list->getItemCount(); - } - - LLStringUtil::format_map_t args; - args["[ALLOWEDAGENTS]"] = llformat ("%d", totalAllowedAgents); - args["[MAXACCESS]"] = llformat ("%d", ESTATE_MAX_ACCESS_IDS); - std::string msg = LLTrans::getString("RegionInfoAllowedResidents", args); - panel->getChild("allow_resident_label")->setValue(LLSD(msg)); - - if (allowed_agent_name_list) - { - // Don't sort these as we add them, sort them when we are done. - allowed_agent_name_list->clearSortOrder(); - for (S32 i = 0; i < num_allowed_agents && i < ESTATE_MAX_ACCESS_IDS; i++) - { - LLUUID id; - memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */ - allowed_agent_name_list->addNameItem(id); - } - allowed_agent_name_list->sortByName(TRUE); - } - } - - if (access_flags & ESTATE_ACCESS_ALLOWED_GROUPS) - { - LLNameListCtrl* allowed_group_name_list; - allowed_group_name_list = panel->getChild("allowed_group_name_list"); - - LLStringUtil::format_map_t args; - args["[ALLOWEDGROUPS]"] = llformat ("%d", num_allowed_groups); - args["[MAXACCESS]"] = llformat ("%d", ESTATE_MAX_GROUP_IDS); - std::string msg = LLTrans::getString("RegionInfoAllowedGroups", args); - panel->getChild("allow_group_label")->setValue(LLSD(msg)); - - if (allowed_group_name_list) - { - // Don't sort these as we add them, sort them when we are done. - allowed_group_name_list->clearSortOrder(); - allowed_group_name_list->deleteAllItems(); - for (S32 i = 0; i < num_allowed_groups && i < ESTATE_MAX_GROUP_IDS; i++) - { - LLUUID id; - memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */ - allowed_group_name_list->addGroupNameItem(id); - } - allowed_group_name_list->sortByName(TRUE); - } - } - - if (access_flags & ESTATE_ACCESS_BANNED_AGENTS) - { - LLNameListCtrl* banned_agent_name_list; - banned_agent_name_list = panel->getChild("banned_avatar_name_list"); - - int totalBannedAgents = num_banned_agents; - - if (banned_agent_name_list) - { - totalBannedAgents += banned_agent_name_list->getItemCount(); - } - - - LLStringUtil::format_map_t args; - args["[BANNEDAGENTS]"] = llformat("%d", totalBannedAgents); - args["[MAXBANNED]"] = llformat("%d", ESTATE_MAX_ACCESS_IDS); - std::string msg = LLTrans::getString("RegionInfoBannedResidents", args); - panel->getChild("ban_resident_label")->setValue(LLSD(msg)); - - if (banned_agent_name_list) - { - // Don't sort these as we add them, sort them when we are done. - banned_agent_name_list->clearSortOrder(); - - for (S32 i = 0; i < num_banned_agents && i < ESTATE_MAX_ACCESS_IDS; i++) - { - LLUUID id; - memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */ - banned_agent_name_list->addNameItem(id); - } - banned_agent_name_list->sortByName(TRUE); - } - } - - if (access_flags & ESTATE_ACCESS_MANAGERS) - { - LLStringUtil::format_map_t args; - args["[ESTATEMANAGERS]"] = llformat("%d", num_estate_managers); - args["[MAXMANAGERS]"] = llformat("%d", ESTATE_MAX_MANAGERS); - std::string msg = LLTrans::getString("RegionInfoEstateManagers", args); - panel->getChild("estate_manager_label")->setValue(LLSD(msg)); - - LLNameListCtrl* estate_manager_name_list = - panel->getChild("estate_manager_name_list"); - if (estate_manager_name_list) - { - // Don't sort these as we add them, sort them when we are done. - estate_manager_name_list->clearSortOrder(); - - estate_manager_name_list->deleteAllItems(); // Clear existing entries - - // There should be only ESTATE_MAX_MANAGERS people in the list, but if the database gets more (SL-46107) don't - // truncate the list unless it's really big. Go ahead and show the extras so the user doesn't get confused, - // and they can still remove them. - for (S32 i = 0; i < num_estate_managers && i < (ESTATE_MAX_MANAGERS * 4); i++) - { - LLUUID id; - memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */ - estate_manager_name_list->addNameItem(id); - } - estate_manager_name_list->sortByName(TRUE); - } - } - - // Update the buttons which may change based on the list contents but also needs to account for general access features. - panel->updateControls(gAgent.getRegion()); - - return true; -} - -LLSD LLDispatchSetEstateExperience::getIDs( sparam_t::const_iterator it, sparam_t::const_iterator end, S32 count ) -{ - LLSD idList = LLSD::emptyArray(); - LLUUID id; - while(count--> 0) - { - memcpy(id.mData, (*(it++)).data(), UUID_BYTES); - idList.append(id); - } - return idList; -} - -// key = "setexperience" -// strings[0] = str(estate_id) -// strings[1] = str(send_to_agent_only) -// strings[2] = str(num blocked) -// strings[3] = str(num trusted) -// strings[4] = str(num allowed) -// strings[8] = bin(uuid) ... -// ... -bool LLDispatchSetEstateExperience::operator()( - const LLDispatcher* dispatcher, - const std::string& key, - const LLUUID& invoice, - const sparam_t& strings) -{ - LLPanelRegionExperiences* panel = LLFloaterRegionInfo::getPanelExperiences(); - if (!panel) return true; - - sparam_t::const_iterator it = strings.begin(); - ++it; // U32 estate_id = strtol((*it).c_str(), NULL, 10); - ++it; // U32 send_to_agent_only = strtoul((*(++it)).c_str(), NULL, 10); - - LLUUID id; - S32 num_blocked = strtol((*(it++)).c_str(), NULL, 10); - S32 num_trusted = strtol((*(it++)).c_str(), NULL, 10); - S32 num_allowed = strtol((*(it++)).c_str(), NULL, 10); - - LLSD ids = LLSD::emptyMap() - .with("blocked", getIDs(it, strings.end(), num_blocked)) - .with("trusted", getIDs(it + (num_blocked), strings.end(), num_trusted)) - .with("allowed", getIDs(it + (num_blocked+num_trusted), strings.end(), num_allowed)); - - panel->processResponse(ids); - - return true; -} - - BOOL LLPanelRegionExperiences::postBuild() { mAllowed = setupList("panel_allowed", ESTATE_EXPERIENCE_ALLOWED_ADD, ESTATE_EXPERIENCE_ALLOWED_REMOVE); @@ -3148,6 +2877,8 @@ BOOL LLPanelRegionExperiences::postBuild() getChild("allowed_text_help")->setText(getString("allowed_estate_text")); getChild("blocked_text_help")->setText(getString("blocked_estate_text")); + LLEstateInfoModel::instance().setUpdateExperienceCallback(boost::bind(&LLPanelRegionExperiences::refreshExperiencesFromEstate, this)); + return LLPanelRegionInfo::postBuild(); } @@ -3191,6 +2922,18 @@ void LLPanelRegionExperiences::processResponse( const LLSD& content ) } +void LLPanelRegionExperiences::refreshExperiencesFromEstate() +{ + const LLEstateInfoModel& estate_info = LLEstateInfoModel::instance(); + + LLSD ids = LLSDMap("blocked", set_to_llsdarray(estate_info.getBlockedExperiences())) + ("trusted", set_to_llsdarray(estate_info.getTrustedExperiences())) + ("allowed", set_to_llsdarray(estate_info.getAllowedExperiences())); + + processResponse(ids); +} + + // Used for both access add and remove operations, depending on the flag // passed in (ESTATE_EXPERIENCE_ALLOWED_ADD, ESTATE_EXPERIENCE_ALLOWED_REMOVE, etc.) // static @@ -3253,11 +2996,7 @@ void LLPanelRegionExperiences::sendEstateExperienceDelta(U32 flags, const LLUUID str[1] = llformat("%u", flags); experience_id.toString(str[2]); - LLPanelRegionExperiences* panel = LLFloaterRegionInfo::getPanelExperiences(); - if (panel) - { - panel->sendEstateOwnerMessage(gMessageSystem, "estateexperiencedelta", LLFloaterRegionInfo::getLastInvoice(), str); - } + LLEstateInfoModel::instance().sendEstateOwnerMessage("estateexperiencedelta", str); } @@ -3402,14 +3141,18 @@ LLPanelRegionEnvironment::LLPanelRegionEnvironment(): LLPanelEnvironmentInfo(), mAllowOverrideRestore(false) { - LLEstateInfoModel& estate_info = LLEstateInfoModel::instance(); - estate_info.setCommitCallback(boost::bind(&LLPanelRegionEnvironment::refreshFromEstate, this)); - estate_info.setUpdateCallback(boost::bind(&LLPanelRegionEnvironment::refreshFromEstate, this)); } +LLPanelRegionEnvironment::~LLPanelRegionEnvironment() +{ + if (mCommitConnect.connected()) + mCommitConnect.disconnect(); +} BOOL LLPanelRegionEnvironment::postBuild() { + LLEstateInfoModel& estate_info = LLEstateInfoModel::instance(); + if (!LLPanelEnvironmentInfo::postBuild()) return FALSE; @@ -3418,6 +3161,8 @@ BOOL LLPanelRegionEnvironment::postBuild() getChild(PNL_ENVIRONMENT_ALTITUDES)->setVisible(TRUE); getChild(CHK_ALLOWOVERRIDE)->setCommitCallback([this](LLUICtrl *, const LLSD &value){ onChkAllowOverride(value.asBoolean()); }); + + mCommitConnect = estate_info.setCommitCallback(boost::bind(&LLPanelRegionEnvironment::refreshFromEstate, this)); return TRUE; } -- cgit v1.2.3 From 1badfb0e96959725fbe2895994607a088f4a808b Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 7 Jan 2019 10:24:55 -0800 Subject: SL-9883: Hide controls and display message if parcel < 128m --- indra/newview/llfloaterregioninfo.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 40e26ba3bd..1e40be5868 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -150,6 +150,7 @@ public: virtual bool isRegion() const override { return true; } virtual LLParcel * getParcel() override { return nullptr; } virtual bool canEdit() override { return LLEnvironment::instance().canAgentUpdateRegionEnvironment(); } + virtual bool isLargeEnough() override { return true; } // regions are always large enough. bool refreshFromRegion(LLViewerRegion* region); -- cgit v1.2.3 From 82a8bcb24402978330ea184285fd498b9e50c0a0 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Wed, 16 Jan 2019 18:32:12 +0200 Subject: SL-10370 FIXED [EEP] 'Estate' tab is displayed with empty settings after opening 'Region/Estate' floater for the second time --- indra/newview/llfloaterregioninfo.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 1e40be5868..9f33feb901 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -260,6 +260,7 @@ void LLFloaterRegionInfo::onOpen(const LLSD& key) disableTabCtrls(); return; } + LLEstateInfoModel::instance().clearRegion(); requestRegionInfo(); // will cause refreshFromRegion() requestMeshRezInfo(); } -- cgit v1.2.3 From dfdeeb353ce20294ff87190fc95313a81581bd49 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 4 Apr 2019 11:47:28 -0700 Subject: SL-10849: Select the correct notification for unchecking the parcel owners may override button. --- indra/newview/llfloaterregioninfo.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 9f33feb901..a7887eb9b4 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -3257,13 +3257,14 @@ void LLPanelRegionEnvironment::onChkAllowOverride(bool value) mAllowOverrideRestore = mAllowOverride; mAllowOverride = value; - LLNotification::Params params("ChangeLindenEstate"); - params.functor.function([this](const LLSD& notification, const LLSD& response) { confirmUpdateEstateEnvironment(notification, response); }); std::string notification("EstateParcelEnvironmentOverride"); if (LLPanelEstateInfo::isLindenEstate()) notification = "ChangeLindenEstate"; + LLNotification::Params params(notification); + params.functor.function([this](const LLSD& notification, const LLSD& response) { confirmUpdateEstateEnvironment(notification, response); }); + if (!value || LLPanelEstateInfo::isLindenEstate()) { // warn if turning off or a Linden Estate LLNotifications::instance().add(params); -- cgit v1.2.3 From 1a9f9ae089111d9aa23dab97c02fb9fdb55f4865 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 18 Apr 2019 11:42:38 -0700 Subject: Fix merge error from 6.2.1 EAM merge. --- indra/newview/llfloaterregioninfo.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index bb76af9a3c..ab91c34b3d 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -350,6 +350,7 @@ void LLFloaterRegionInfo::requestRegionInfo() tab->getChild("Debug")->setCtrlsEnabled(FALSE); tab->getChild("Terrain")->setCtrlsEnabled(FALSE); tab->getChild("Estate")->setCtrlsEnabled(FALSE); + tab->getChild("Access")->setCtrlsEnabled(FALSE); } // Must allow anyone to request the RegionInfo data -- cgit v1.2.3 From bfc4b9fcf4bb3266e06c2f954854a430cca5075f Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 2 Aug 2019 20:23:06 +0300 Subject: SL-11668 Changes caused by Arrow Keys were not commited --- indra/newview/llfloaterregioninfo.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index ab91c34b3d..83215a7fec 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -3731,6 +3731,8 @@ BOOL LLPanelRegionEnvironment::postBuild() void LLPanelRegionEnvironment::refresh() { + commitDayLenOffsetChanges(false); // commit unsaved changes if any + if (!mCurrentEnvironment) { if (mCurEnvVersion <= INVALID_PARCEL_ENVIRONMENT_VERSION) -- cgit v1.2.3 From 7a7f68fb3c09c187f5b6fd333d0292a3fbfbc9df Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Fri, 27 Sep 2019 16:58:54 +0300 Subject: SL-12024 [EEP] UI should indicate that the Environment tab is an estate-wide setting. --- indra/newview/llfloaterregioninfo.cpp | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 83215a7fec..816ef68093 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -200,6 +200,8 @@ public: virtual S32 getParcelId() override { return INVALID_PARCEL_ID; } + static void updateEstateName(const std::string& name); + protected: static const U32 DIRTY_FLAG_OVERRIDE; @@ -572,6 +574,16 @@ LLPanelRegionGeneralInfo* LLFloaterRegionInfo::getPanelGeneral() return panel; } +// static +LLPanelRegionEnvironment* LLFloaterRegionInfo::getPanelEnvironment() +{ + LLFloaterRegionInfo* floater = LLFloaterReg::getTypedInstance("region_info"); + if (!floater) return NULL; + LLTabContainer* tab = floater->getChild("region_panels"); + LLPanelRegionEnvironment* panel = (LLPanelRegionEnvironment*)tab->getChild("panel_env_info"); + return panel; +} + // static LLPanelRegionTerrainInfo* LLFloaterRegionInfo::getPanelRegionTerrain() { @@ -597,6 +609,13 @@ LLPanelRegionExperiences* LLFloaterRegionInfo::getPanelExperiences() return (LLPanelRegionExperiences*)tab->getChild("Experiences"); } +void LLFloaterRegionInfo::updateEstateName(const std::string& estate_name) +{ + LLPanelEstateCovenant::updateEstateName(estate_name); + LLPanelEstateInfo::updateEstateName(estate_name); + LLPanelRegionEnvironment::updateEstateName(estate_name); +} + void LLFloaterRegionInfo::disableTabCtrls() { LLTabContainer* tab = getChild("region_panels"); @@ -3813,6 +3832,15 @@ bool LLPanelRegionEnvironment::confirmUpdateEstateEnvironment(const LLSD& notifi return false; } +void LLPanelRegionEnvironment::updateEstateName(const std::string& name) +{ + LLPanelRegionEnvironment* panelp = LLFloaterRegionInfo::getPanelEnvironment(); + if (panelp) + { + panelp->getChildRef("estate_name").setText(name); + } +} + void LLPanelRegionEnvironment::onChkAllowOverride(bool value) { setDirtyFlag(DIRTY_FLAG_OVERRIDE); @@ -3824,7 +3852,10 @@ void LLPanelRegionEnvironment::onChkAllowOverride(bool value) if (LLPanelEstateInfo::isLindenEstate()) notification = "ChangeLindenEstate"; - LLNotification::Params params(notification); + LLSD args; + args["ESTATENAME"] = LLEstateInfoModel::instance().getName(); + LLNotification::Params params(notification); + params.substitutions(args); params.functor.function([this](const LLSD& notification, const LLSD& response) { confirmUpdateEstateEnvironment(notification, response); }); if (!value || LLPanelEstateInfo::isLindenEstate()) -- cgit v1.2.3 From 7ff09d05f2023ce8eb26acc46da22f8d86743de5 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Mon, 7 Oct 2019 12:41:00 +0300 Subject: SL-12024 Remove 'Estate warning' message and show just region name instead --- indra/newview/llfloaterregioninfo.cpp | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'indra/newview/llfloaterregioninfo.cpp') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 816ef68093..8bcc5bbe7a 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -200,8 +200,6 @@ public: virtual S32 getParcelId() override { return INVALID_PARCEL_ID; } - static void updateEstateName(const std::string& name); - protected: static const U32 DIRTY_FLAG_OVERRIDE; @@ -609,13 +607,6 @@ LLPanelRegionExperiences* LLFloaterRegionInfo::getPanelExperiences() return (LLPanelRegionExperiences*)tab->getChild("Experiences"); } -void LLFloaterRegionInfo::updateEstateName(const std::string& estate_name) -{ - LLPanelEstateCovenant::updateEstateName(estate_name); - LLPanelEstateInfo::updateEstateName(estate_name); - LLPanelRegionEnvironment::updateEstateName(estate_name); -} - void LLFloaterRegionInfo::disableTabCtrls() { LLTabContainer* tab = getChild("region_panels"); @@ -3773,6 +3764,11 @@ bool LLPanelRegionEnvironment::refreshFromRegion(LLViewerRegion* region) setNoSelection(true); setControlsEnabled(false); mCurEnvVersion = INVALID_PARCEL_ENVIRONMENT_VERSION; + getChild("region_text")->setValue(LLSD("")); + } + else + { + getChild("region_text")->setValue(LLSD(region->getName())); } setNoSelection(false); @@ -3832,15 +3828,6 @@ bool LLPanelRegionEnvironment::confirmUpdateEstateEnvironment(const LLSD& notifi return false; } -void LLPanelRegionEnvironment::updateEstateName(const std::string& name) -{ - LLPanelRegionEnvironment* panelp = LLFloaterRegionInfo::getPanelEnvironment(); - if (panelp) - { - panelp->getChildRef("estate_name").setText(name); - } -} - void LLPanelRegionEnvironment::onChkAllowOverride(bool value) { setDirtyFlag(DIRTY_FLAG_OVERRIDE); -- cgit v1.2.3