summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorybridge.cpp
diff options
context:
space:
mode:
authorGlenn Glazer <coyot@lindenlab.com>2017-05-23 07:59:15 -0700
committerGlenn Glazer <coyot@lindenlab.com>2017-05-23 07:59:15 -0700
commit3fda9bea31327f166dd1067f7e5c9ce251b40289 (patch)
treed7bbf85ac5d6b15ed7d5db8b8b67a1cccbaca4f9 /indra/newview/llinventorybridge.cpp
parent4bf1f1d618d61f0cc2ec0dd22cea7d1c5b909b8f (diff)
parentcf5865c6e2b27918b526431ccc4309bfc702534e (diff)
pull from gate
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r--indra/newview/llinventorybridge.cpp35
1 files changed, 34 insertions, 1 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 555c19baac..1b32fc9dfe 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -391,6 +391,7 @@ void LLInvFVBridge::removeBatch(std::vector<LLFolderViewModelItem*>& batch)
}
}
removeBatchNoCheck(batch);
+ model->checkTrashOverflow();
}
void LLInvFVBridge::removeBatchNoCheck(std::vector<LLFolderViewModelItem*>& batch)
@@ -851,6 +852,7 @@ void LLInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
getClipboardEntries(true, items, disabled_items, flags);
}
+ addLinkReplaceMenuOption(items, disabled_items);
hide_context_entries(menu, items, disabled_items);
}
@@ -1051,6 +1053,20 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags,
items.push_back(std::string("Marketplace Listings Separator"));
}
+void LLInvFVBridge::addLinkReplaceMenuOption(menuentry_vec_t& items, menuentry_vec_t& disabled_items)
+{
+ const LLInventoryObject* obj = getInventoryObject();
+
+ if (isAgentInventory() && obj && obj->getType() != LLAssetType::AT_CATEGORY && obj->getType() != LLAssetType::AT_LINK_FOLDER)
+ {
+ items.push_back(std::string("Replace Links"));
+
+ if (mRoot->getSelectedCount() != 1)
+ {
+ disabled_items.push_back(std::string("Replace Links"));
+ }
+ }
+}
// *TODO: remove this
BOOL LLInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const
@@ -3855,6 +3871,13 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items
}
if(trash_id == mUUID)
{
+ bool is_recent_panel = false;
+ LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE);
+ if (active_panel && (active_panel->getName() == "Recent Items"))
+ {
+ is_recent_panel = true;
+ }
+
// This is the trash.
items.push_back(std::string("Empty Trash"));
@@ -3862,7 +3885,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items
LLInventoryModel::item_array_t* item_array;
gInventory.getDirectDescendentsOf(mUUID, cat_array, item_array);
// Enable Empty menu item only when there is something to act upon.
- if (0 == cat_array->size() && 0 == item_array->size())
+ if ((0 == cat_array->size() && 0 == item_array->size()) || is_recent_panel)
{
disabled_items.push_back(std::string("Empty Trash"));
}
@@ -5179,6 +5202,7 @@ void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
disabled_items.push_back(std::string("Save As"));
}
}
+ addLinkReplaceMenuOption(items, disabled_items);
hide_context_entries(menu, items, disabled_items);
}
@@ -5251,6 +5275,7 @@ void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
items.push_back(std::string("Sound Play"));
}
+ addLinkReplaceMenuOption(items, disabled_items);
hide_context_entries(menu, items, disabled_items);
}
@@ -5339,6 +5364,7 @@ void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
disabled_items.push_back(std::string("About Landmark"));
}
+ addLinkReplaceMenuOption(items, disabled_items);
hide_context_entries(menu, items, disabled_items);
}
@@ -5641,6 +5667,7 @@ void LLCallingCardBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
disabled_items.push_back(std::string("Conference Chat"));
}
}
+ addLinkReplaceMenuOption(items, disabled_items);
hide_context_entries(menu, items, disabled_items);
}
@@ -5910,6 +5937,7 @@ void LLGestureBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
items.push_back(std::string("Activate"));
}
}
+ addLinkReplaceMenuOption(items, disabled_items);
hide_context_entries(menu, items, disabled_items);
}
@@ -5967,6 +5995,7 @@ void LLAnimationBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
items.push_back(std::string("Animation Audition"));
}
+ addLinkReplaceMenuOption(items, disabled_items);
hide_context_entries(menu, items, disabled_items);
}
@@ -6283,6 +6312,7 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
}
}
}
+ addLinkReplaceMenuOption(items, disabled_items);
hide_context_entries(menu, items, disabled_items);
}
@@ -6511,6 +6541,7 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
}
}
}
+ addLinkReplaceMenuOption(items, disabled_items);
hide_context_entries(menu, items, disabled_items);
}
@@ -6682,6 +6713,7 @@ void LLLinkItemBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
items.push_back(std::string("Properties"));
addDeleteContextMenuOptions(items, disabled_items);
}
+ addLinkReplaceMenuOption(items, disabled_items);
hide_context_entries(menu, items, disabled_items);
}
@@ -6733,6 +6765,7 @@ void LLMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
getClipboardEntries(true, items, disabled_items, flags);
}
+ addLinkReplaceMenuOption(items, disabled_items);
hide_context_entries(menu, items, disabled_items);
}