From 7ff09d05f2023ce8eb26acc46da22f8d86743de5 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Mon, 7 Oct 2019 12:41:00 +0300 Subject: [PATCH 1/2] SL-12024 Remove 'Estate warning' message and show just region name instead --- indra/newview/llfloaterland.cpp | 1 + indra/newview/llfloaterregioninfo.cpp | 23 ++---- indra/newview/llfloaterregioninfo.h | 2 - indra/newview/llpanelenvironment.cpp | 4 +- indra/newview/llpanelenvironment.h | 1 + indra/newview/llviewermessage.cpp | 3 +- .../xui/en/panel_region_environment.xml | 70 ++++++++----------- 7 files changed, 42 insertions(+), 62 deletions(-) diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 02c81adf2c..7b0c91da80 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -3329,6 +3329,7 @@ BOOL LLPanelLandEnvironment::postBuild() getChild(BTN_USEDEFAULT)->setLabelArg("[USEDEFAULT]", getString(STR_LABEL_USEREGION)); getChild(CHK_ALLOWOVERRIDE)->setVisible(FALSE); + getChild(PNL_REGION_MSG)->setVisible(FALSE); getChild(PNL_ENVIRONMENT_ALTITUDES)->setVisible(TRUE); return TRUE; 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); diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index 61aa0778ef..75d0c3ea5c 100644 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -107,8 +107,6 @@ public: void enableTopButtons(); void disableTopButtons(); - static void updateEstateName(const std::string& estate_name); - private: LLFloaterRegionInfo(const LLSD& seed); diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp index c4fa4244b1..2ad7a23278 100644 --- a/indra/newview/llpanelenvironment.cpp +++ b/indra/newview/llpanelenvironment.cpp @@ -84,6 +84,7 @@ const std::string LLPanelEnvironmentInfo::PNL_ENVIRONMENT_ALTITUDES("pnl_environ const std::string LLPanelEnvironmentInfo::PNL_BUTTONS("pnl_environment_buttons"); const std::string LLPanelEnvironmentInfo::PNL_DISABLED("pnl_environment_disabled"); const std::string LLPanelEnvironmentInfo::TXT_DISABLED("txt_environment_disabled"); +const std::string LLPanelEnvironmentInfo::PNL_REGION_MSG("pnl_environment_region_msg"); const std::string LLPanelEnvironmentInfo::SDT_DROP_TARGET("sdt_drop_target"); const std::string LLPanelEnvironmentInfo::STR_LABEL_USEDEFAULT("str_label_use_default"); @@ -483,7 +484,7 @@ bool LLPanelEnvironmentInfo::setControlsEnabled(bool enabled) getChild(PNL_BUTTONS)->setVisible(false); getChild(PNL_DISABLED)->setVisible(true); getChild(PNL_ENVIRONMENT_ALTITUDES)->setVisible(false); - + getChild(PNL_REGION_MSG)->setVisible(false); updateEditFloater(mCurrentEnvironment, false); return false; @@ -491,6 +492,7 @@ bool LLPanelEnvironmentInfo::setControlsEnabled(bool enabled) getChild(PNL_SETTINGS)->setVisible(true); getChild(PNL_BUTTONS)->setVisible(true); getChild(PNL_DISABLED)->setVisible(false); + getChild(PNL_REGION_MSG)->setVisible(isRegion()); getChild(PNL_ENVIRONMENT_ALTITUDES)->setVisible(LLEnvironment::instance().isExtendedEnvironmentEnabled()); getChild(BTN_RST_ALTITUDES)->setVisible(isRegion()); diff --git a/indra/newview/llpanelenvironment.h b/indra/newview/llpanelenvironment.h index 50ec1165be..38e3f09e34 100644 --- a/indra/newview/llpanelenvironment.h +++ b/indra/newview/llpanelenvironment.h @@ -80,6 +80,7 @@ protected: static const std::string PNL_ENVIRONMENT_ALTITUDES; static const std::string PNL_BUTTONS; static const std::string PNL_DISABLED; + static const std::string PNL_REGION_MSG; static const std::string TXT_DISABLED; static const std::string SDT_DROP_TARGET; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 296289de09..a0935628d7 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -6714,8 +6714,9 @@ void process_covenant_reply(LLMessageSystem* msg, void**) msg->getString("Data", "EstateName", estate_name); msg->getUUID("Data", "EstateOwnerID", estate_owner_id); + LLPanelEstateCovenant::updateEstateName(estate_name); LLPanelLandCovenant::updateEstateName(estate_name); - LLFloaterRegionInfo::updateEstateName(estate_name); + LLPanelEstateInfo::updateEstateName(estate_name); LLFloaterBuyLand::updateEstateName(estate_name); std::string owner_name = diff --git a/indra/newview/skins/default/xui/en/panel_region_environment.xml b/indra/newview/skins/default/xui/en/panel_region_environment.xml index bc0d59bcc7..edf1e1efd4 100644 --- a/indra/newview/skins/default/xui/en/panel_region_environment.xml +++ b/indra/newview/skins/default/xui/en/panel_region_environment.xml @@ -19,53 +19,42 @@ The parcel must be at least 128 square meters to support an environment. (empty) (region environment) - - Changes to settings on this tab will affect all regions in the estate. - - - Estate: - - - (unknown) - + + + + Region: + + + unknown + + Date: Tue, 15 Oct 2019 18:07:55 +0300 Subject: [PATCH 2/2] SL-11907 Fixed assigning permissions to environment when using "Save As" --- indra/newview/llfloatereditextdaycycle.cpp | 9 +++++---- indra/newview/llfloatereditextdaycycle.h | 2 +- indra/newview/llfloaterfixedenvironment.cpp | 8 +++++--- indra/newview/llfloaterfixedenvironment.h | 2 +- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp index cb2f5dbb1d..c92eed42cd 100644 --- a/indra/newview/llfloatereditextdaycycle.cpp +++ b/indra/newview/llfloatereditextdaycycle.cpp @@ -1428,7 +1428,7 @@ LLFloaterEditExtDayCycle::connection_t LLFloaterEditExtDayCycle::setEditCommitSi return mCommitSignal.connect(cb); } -void LLFloaterEditExtDayCycle::loadInventoryItem(const LLUUID &inventoryId) +void LLFloaterEditExtDayCycle::loadInventoryItem(const LLUUID &inventoryId, bool can_trans) { if (inventoryId.isNull()) { @@ -1471,7 +1471,7 @@ void LLFloaterEditExtDayCycle::loadInventoryItem(const LLUUID &inventoryId) mCanSave = true; mCanCopy = mInventoryItem->getPermissions().allowCopyBy(gAgent.getID()); mCanMod = mInventoryItem->getPermissions().allowModifyBy(gAgent.getID()); - mCanTrans = mInventoryItem->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()); + mCanTrans = can_trans && mInventoryItem->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()); mExpectingAssetId = mInventoryItem->getAssetUUID(); LLSettingsVOBase::getSettingsAsset(mInventoryItem->getAssetUUID(), @@ -1799,7 +1799,7 @@ void LLFloaterEditExtDayCycle::onInventoryCreated(LLUUID asset_id, LLUUID invent void LLFloaterEditExtDayCycle::onInventoryCreated(LLUUID asset_id, LLUUID inventory_id) { - + bool can_trans = true; if (mInventoryItem) { LLPermissions perms = mInventoryItem->getPermissions(); @@ -1808,6 +1808,7 @@ void LLFloaterEditExtDayCycle::onInventoryCreated(LLUUID asset_id, LLUUID invent if (created_item) { + can_trans = perms.allowOperationBy(PERM_TRANSFER, gAgent.getID()); created_item->setPermissions(perms); created_item->updateServer(false); } @@ -1815,7 +1816,7 @@ void LLFloaterEditExtDayCycle::onInventoryCreated(LLUUID asset_id, LLUUID invent clearDirtyFlag(); setFocus(TRUE); // Call back the focus... - loadInventoryItem(inventory_id); + loadInventoryItem(inventory_id, can_trans); } void LLFloaterEditExtDayCycle::onInventoryUpdated(LLUUID asset_id, LLUUID inventory_id, LLSD results) diff --git a/indra/newview/llfloatereditextdaycycle.h b/indra/newview/llfloatereditextdaycycle.h index 83ce69cff3..b6e9fdb14f 100644 --- a/indra/newview/llfloatereditextdaycycle.h +++ b/indra/newview/llfloatereditextdaycycle.h @@ -148,7 +148,7 @@ private: void removeCurrentSliderFrame(); void removeSliderFrame(F32 frame); - void loadInventoryItem(const LLUUID &inventoryId); + void loadInventoryItem(const LLUUID &inventoryId, bool can_trans = true); void onAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status); void doImportFromDisk(); diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index f564dce629..38b1f5066d 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -250,7 +250,7 @@ LLFloaterSettingsPicker * LLFloaterFixedEnvironment::getSettingsPicker() return picker; } -void LLFloaterFixedEnvironment::loadInventoryItem(const LLUUID &inventoryId) +void LLFloaterFixedEnvironment::loadInventoryItem(const LLUUID &inventoryId, bool can_trans) { if (inventoryId.isNull()) { @@ -290,7 +290,7 @@ void LLFloaterFixedEnvironment::loadInventoryItem(const LLUUID &inventoryId) mCanCopy = mInventoryItem->getPermissions().allowCopyBy(gAgent.getID()); mCanMod = mInventoryItem->getPermissions().allowModifyBy(gAgent.getID()); - mCanTrans = mInventoryItem->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()); + mCanTrans = can_trans && mInventoryItem->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()); LLSettingsVOBase::getSettingsAsset(mInventoryItem->getAssetUUID(), [this](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { onAssetLoaded(asset_id, settings, status); }); @@ -653,6 +653,7 @@ void LLFloaterFixedEnvironment::onInventoryCreated(LLUUID asset_id, LLUUID inven void LLFloaterFixedEnvironment::onInventoryCreated(LLUUID asset_id, LLUUID inventory_id) { + bool can_trans = true; if (mInventoryItem) { LLPermissions perms = mInventoryItem->getPermissions(); @@ -661,13 +662,14 @@ void LLFloaterFixedEnvironment::onInventoryCreated(LLUUID asset_id, LLUUID inven if (created_item) { + can_trans = perms.allowOperationBy(PERM_TRANSFER, gAgent.getID()); created_item->setPermissions(perms); created_item->updateServer(false); } } clearDirtyFlag(); setFocus(TRUE); // Call back the focus... - loadInventoryItem(inventory_id); + loadInventoryItem(inventory_id, can_trans); } void LLFloaterFixedEnvironment::onInventoryUpdated(LLUUID asset_id, LLUUID inventory_id, LLSD results) diff --git a/indra/newview/llfloaterfixedenvironment.h b/indra/newview/llfloaterfixedenvironment.h index 84feaa1a20..513996c4a3 100644 --- a/indra/newview/llfloaterfixedenvironment.h +++ b/indra/newview/llfloaterfixedenvironment.h @@ -76,7 +76,7 @@ protected: LLFloaterSettingsPicker *getSettingsPicker(); - void loadInventoryItem(const LLUUID &inventoryId); + void loadInventoryItem(const LLUUID &inventoryId, bool can_trans = true); void checkAndConfirmSettingsLoss(on_confirm_fn cb);