From 466914e122f201e62d8e969dcc684791e06333d3 Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Fri, 11 Aug 2023 17:18:06 -0700 Subject: SL-20024: Double-check object inventory is not pending when save button pressed --- indra/newview/llmaterialeditor.cpp | 4 ++++ indra/newview/llpanelface.cpp | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index 41df58914b..92042ad49f 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -1836,6 +1836,10 @@ bool can_use_objects_material(LLSelectedTEGetMatData& func, const std::vectorgetSelection()->getFirstObject()); return false; } + if (selected_object->isInventoryPending()) + { + return false; + } for (PermissionBit op : ops) { if (op == PERM_MODIFY && selected_object->isPermanentEnforced()) diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 21651899db..8f09136ccf 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -1897,11 +1897,10 @@ void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material, pbr_ctrl->setImageAssetID(pbr_id); } - const bool inventory_pending = objectp->isInventoryPending(); getChildView("pbr_from_inventory")->setEnabled(settable); - getChildView("edit_selected_pbr")->setEnabled(editable && !inventory_pending && !has_faces_without_pbr); - getChildView("save_selected_pbr")->setEnabled(saveable && !inventory_pending && identical_pbr); - if (inventory_pending) + getChildView("edit_selected_pbr")->setEnabled(editable && !has_faces_without_pbr); + getChildView("save_selected_pbr")->setEnabled(saveable && identical_pbr); + if (objectp->isInventoryPending()) { // Reuse the same listener when possible if (!mInventoryListener || !mInventoryListener->isListeningFor(objectp)) -- cgit v1.2.3 From f4d25ca795aed6ab4ad5d024d981ed7ed75710d4 Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Mon, 14 Aug 2023 17:13:38 -0700 Subject: SL-20024: Remove misleading permissions comment left over from previous implementation --- indra/llinventory/llpermissions.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/indra/llinventory/llpermissions.h b/indra/llinventory/llpermissions.h index 32fae844fb..27252f7b97 100644 --- a/indra/llinventory/llpermissions.h +++ b/indra/llinventory/llpermissions.h @@ -251,9 +251,7 @@ public: BOOL setNextOwnerBits(const LLUUID& agent, const LLUUID& group, BOOL set, PermissionMask bits); // This is currently only used in the Viewer to handle calling cards - // where the creator is actually used to store the target. - // It is also used for saving a GLTF material on a prim. - // Use with care. + // where the creator is actually used to store the target. Use with care. void setCreator(const LLUUID& creator) { mCreator = creator; } // -- cgit v1.2.3 From 465632214aad5e9979d12247149aa716a23d6899 Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Mon, 14 Aug 2023 17:18:52 -0700 Subject: SL-20024: Fix inventory not marked dirty for drag and drop if copy permission bit is unset --- indra/newview/lltooldraganddrop.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 23a6634154..afcdb26f1a 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -1012,8 +1012,12 @@ BOOL LLToolDragAndDrop::handleDropMaterialProtections(LLViewerObject* hit_obj, { hit_obj->updateInventory(new_item, TASK_INVENTORY_ITEM_KEY, true); } - // TODO: Check to see if adding the item was successful; if not, then - // we should return false here. + // Force the object to update and refetch its inventory so it has this asset. + hit_obj->dirtyInventory(); + hit_obj->requestInventory(); + // TODO: Check to see if adding the item was successful; if not, then + // we should return false here. This will requre a separate listener + // since without listener, we have no way to receive update } else if (!item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID())) -- cgit v1.2.3