diff options
author | Rider Linden <rider@lindenlab.com> | 2018-09-07 16:09:32 -0700 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2018-09-07 16:09:32 -0700 |
commit | 114e358aae80e9e3ca70de093d51e4700c46df37 (patch) | |
tree | c96972974d4f37ba87de5dca99399e596ca41f46 /indra/newview/llfloaterfixedenvironment.cpp | |
parent | e539236a75a163b1c6748617bd1e4d2b84aaa3d6 (diff) |
Work to make edit floaters respect no mod and no trans. Importing no-trans frame will cause day cycle to become no trans.
Diffstat (limited to 'indra/newview/llfloaterfixedenvironment.cpp')
-rw-r--r-- | indra/newview/llfloaterfixedenvironment.cpp | 60 |
1 files changed, 51 insertions, 9 deletions
diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 39e37034e7..47b07a8315 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -87,7 +87,9 @@ LLFloaterFixedEnvironment::LLFloaterFixedEnvironment(const LLSD &key) : mFlyoutControl(nullptr), mInventoryId(), mInventoryItem(nullptr), - mIsDirty(false) + mIsDirty(false), + mCanCopy(false), + mCanMod(false) { } @@ -168,12 +170,13 @@ void LLFloaterFixedEnvironment::refresh() bool is_inventory_avail = canUseInventory(); - mFlyoutControl->setMenuItemEnabled(ACTION_SAVE, is_inventory_avail); - mFlyoutControl->setMenuItemEnabled(ACTION_SAVEAS, is_inventory_avail); + mFlyoutControl->setMenuItemEnabled(ACTION_SAVE, is_inventory_avail && mCanMod && !mInventoryId.isNull()); + mFlyoutControl->setMenuItemEnabled(ACTION_SAVEAS, is_inventory_avail && mCanCopy); mFlyoutControl->setMenuItemEnabled(ACTION_APPLY_PARCEL, canApplyParcel()); mFlyoutControl->setMenuItemEnabled(ACTION_APPLY_REGION, canApplyRegion()); mTxtName->setValue(mSettings->getName()); + mTxtName->setEnabled(mCanMod); S32 count = mTab->getTabCount(); @@ -181,7 +184,10 @@ void LLFloaterFixedEnvironment::refresh() { LLSettingsEditPanel *panel = static_cast<LLSettingsEditPanel *>(mTab->getPanelByIndex(idx)); if (panel) + { panel->refresh(); + panel->setCanChangeSettings(mCanMod); + } } } @@ -221,6 +227,8 @@ void LLFloaterFixedEnvironment::loadInventoryItem(const LLUUID &inventoryId) { mInventoryItem = nullptr; mInventoryId.setNull(); + mCanMod = true; + mCanCopy = true; return; } @@ -250,9 +258,11 @@ void LLFloaterFixedEnvironment::loadInventoryItem(const LLUUID &inventoryId) return; } + mCanCopy = mInventoryItem->getPermissions().allowCopyBy(gAgent.getID()); + mCanMod = mInventoryItem->getPermissions().allowModifyBy(gAgent.getID()); LLSettingsVOBase::getSettingsAsset(mInventoryItem->getAssetUUID(), - [this](LLUUID asset_id, LLSettingsBase::ptr_t settins, S32 status, LLExtStat) { onAssetLoaded(asset_id, settins, status); }); + [this](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { onAssetLoaded(asset_id, settings, status); }); } @@ -265,7 +275,7 @@ void LLFloaterFixedEnvironment::checkAndConfirmSettingsLoss(LLFloaterFixedEnviro // create and show confirmation textbox LLNotificationsUtil::add("SettingsConfirmLoss", args, LLSD(), - [this, cb](const LLSD¬if, const LLSD&resp) + [cb](const LLSD¬if, const LLSD&resp) { S32 opt = LLNotificationsUtil::getSelectedOption(notif, resp); if (opt == 0) @@ -296,6 +306,9 @@ void LLFloaterFixedEnvironment::onAssetLoaded(LLUUID asset_id, LLSettingsBase::p } mSettings = settings; + if (mInventoryItem) + mSettings->setName(mInventoryItem->getName()); + updateEditEnvironment(); syncronizeTabs(); refresh(); @@ -359,12 +372,19 @@ void LLFloaterFixedEnvironment::doApplyCreateNewInventory() void LLFloaterFixedEnvironment::doApplyUpdateInventory() { + LL_WARNS("LAPRAS") << "Update inventory for " << mInventoryId << LL_ENDL; if (mInventoryId.isNull()) - LLSettingsVOBase::createInventoryItem(mSettings, gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS), - [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); + { + LL_WARNS("LAPRAS") << "Inventory ID is NULL. Creating New!!!" << LL_ENDL; + LLSettingsVOBase::createInventoryItem(mSettings, gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS), + [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); + } else - LLSettingsVOBase::updateInventoryItem(mSettings, mInventoryId, - [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryUpdated(asset_id, inventory_id, results); }); + { + LL_WARNS("LAPRAS") << "Updating inventory ID " << mInventoryId << LL_ENDL; + LLSettingsVOBase::updateInventoryItem(mSettings, mInventoryId, + [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryUpdated(asset_id, inventory_id, results); }); + } } void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) @@ -430,6 +450,18 @@ void LLFloaterFixedEnvironment::onInventoryCreated(LLUUID asset_id, LLUUID inven return; } + if (mInventoryItem) + { + LLPermissions perms = mInventoryItem->getPermissions(); + + LLInventoryItem *created_item = gInventory.getItem(mInventoryId); + + if (created_item) + { + created_item->setPermissions(perms); + created_item->updateServer(false); + } + } clearDirtyFlag(); setFocus(TRUE); // Call back the focus... loadInventoryItem(inventory_id); @@ -563,10 +595,13 @@ void LLFloaterFixedEnvironmentWater::doImportFromDisk() return; } + loadInventoryItem(LLUUID::null); + setDirtyFlag(); LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, legacywater); setEditSettings(legacywater); LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST, true); + } } @@ -641,6 +676,8 @@ void LLFloaterFixedEnvironmentSky::doImportFromDisk() return; } + loadInventoryItem(LLUUID::null); + clearDirtyFlag(); LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, legacysky); setEditSettings(legacysky); @@ -650,3 +687,8 @@ void LLFloaterFixedEnvironmentSky::doImportFromDisk() //========================================================================= +void LLSettingsEditPanel::setCanChangeSettings(bool enabled) +{ + setEnabled(enabled); + setAllChildrenEnabled(enabled); +} |