summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorcosmic-linden <111533034+cosmic-linden@users.noreply.github.com>2023-08-15 12:32:25 -0700
committerGitHub <noreply@github.com>2023-08-15 12:32:25 -0700
commitc527356f8a94df0dd280d683b26cf9e2938424b6 (patch)
tree1ff690377748d0ca9681230f941f9bf6ff4b8e78 /indra
parent50e2973cd2360dedd6baf1c0772d9d009e2628d4 (diff)
parent465632214aad5e9979d12247149aa716a23d6899 (diff)
Merge pull request #324 from secondlife/SL-20024
SL-20024: Double-check object inventory is not pending when save button pressed
Diffstat (limited to 'indra')
-rw-r--r--indra/llinventory/llpermissions.h4
-rw-r--r--indra/newview/llmaterialeditor.cpp4
-rw-r--r--indra/newview/llpanelface.cpp7
-rw-r--r--indra/newview/lltooldraganddrop.cpp8
4 files changed, 14 insertions, 9 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; }
//
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::vector<Pe
llassert(LLSelectMgr::getInstance()->getSelection()->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))
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()))