diff options
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 35 |
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); } |