diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 48a8b8beb0ad83a1946e05193182bab3cce8018f..c75c897a175833d6d755efc9c67d4d3597fa61c2 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -5,6 +5,7 @@ * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. + * Copyright (C) 2010-2015, Kitty Barnett * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -902,7 +903,11 @@ BOOL LLFolderView::canCopy() const for (selected_items_t::const_iterator selected_it = mSelectedItems.begin(); selected_it != mSelectedItems.end(); ++selected_it) { const LLFolderViewItem* item = *selected_it; - if (!item->getViewModelItem()->isItemCopyable()) +// [SL:KB] - Patch: Inventory-Actions | Checked: 2013-09-19 (Catznip-3.6) + const LLFolderViewFolder* folder = dynamic_cast<const LLFolderViewFolder*>(item); + if ( (!item->getViewModelItem()->isItemCopyable()) && ((folder) || (!item->getViewModelItem()->isItemLinkable())) ) +// [/SL:KB] +// if (!item->getViewModelItem()->isItemCopyable()) { return FALSE; } @@ -944,7 +949,10 @@ BOOL LLFolderView::canCut() const const LLFolderViewItem* item = *selected_it; const LLFolderViewModelItem* listener = item->getViewModelItem(); - if (!listener || !listener->isItemRemovable()) +// if (!listener || !listener->isItemRemovable()) +// [SL:KB] - Patch: Inventory-Actions | Checked: 2015-07-15 (Catznip-3.8) + if (!listener || !listener->isItemMovable()) +// [/SL:KB] { return FALSE; } diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 5c9c15f0b8e6f78cfdcfd606e96d2cc00471aeec..c4d462f57c880953373a14ffe9e06426182b8052 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -5,6 +5,7 @@ * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. +* Copyright (C) 2010-2017, Kitty Barnett * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -897,18 +898,30 @@ void LLFolderViewItem::draw() // Draw open icon // const S32 icon_x = mIndentation + mArrowSize + mTextPad; +// [SL:KB] - Patch: Inventory-Actions | Checked: 2012-06-30 (Catznip-3.3) + const F32 label_alpha = (isFadeItem()) ? 0.6f : 1.0f; +// [/SL:KB] if (!mIconOpen.isNull() && (llabs(mControlLabelRotation) > 80)) // For open folders { - mIconOpen->draw(icon_x, getRect().getHeight() - mIconOpen->getHeight() - TOP_PAD + 1); +// [SL:KB] - Patch: Inventory-Actions | Checked: 2012-06-30 (Catznip-3.3) + mIconOpen->draw(icon_x, getRect().getHeight() - mIconOpen->getHeight() - TOP_PAD + 1, UI_VERTEX_COLOR % label_alpha); +// [/SL:KB] +// mIconOpen->draw(icon_x, getRect().getHeight() - mIconOpen->getHeight() - TOP_PAD + 1); } else if (mIcon) { - mIcon->draw(icon_x, getRect().getHeight() - mIcon->getHeight() - TOP_PAD + 1); +// [SL:KB] - Patch: Inventory-Actions | Checked: 2012-06-30 (Catznip-3.3) + mIcon->draw(icon_x, getRect().getHeight() - mIcon->getHeight() - TOP_PAD + 1, UI_VERTEX_COLOR % label_alpha); +// [/SL:KB] +// mIcon->draw(icon_x, getRect().getHeight() - mIcon->getHeight() - TOP_PAD + 1); } if (mIconOverlay && getRoot()->showItemLinkOverlays()) { - mIconOverlay->draw(icon_x, getRect().getHeight() - mIcon->getHeight() - TOP_PAD + 1); +// [SL:KB] - Patch: Inventory-Actions | Checked: 2012-06-30 (Catznip-3.3) + mIconOverlay->draw(icon_x, getRect().getHeight() - mIcon->getHeight() - TOP_PAD + 1, UI_VERTEX_COLOR % label_alpha); +// [/SL:KB] +// mIconOverlay->draw(icon_x, getRect().getHeight() - mIcon->getHeight() - TOP_PAD + 1); } //--------------------------------------------------------------------------------// @@ -938,12 +951,15 @@ void LLFolderViewItem::draw() } LLColor4 color = (mIsSelected && filled) ? mFontHighlightColor : mFontColor; - - if (isFadeItem()) - { - // Fade out item color to indicate it's being cut - color.mV[VALPHA] *= 0.5f; - } +// [SL:KB] - Patch: Inventory-Actions | Checked: 2012-06-30 (Catznip-3.3) + color.setAlpha(label_alpha); +// [/SL:KB] + +// if (isFadeItem()) +// { +// // Fade out item color to indicate it's being cut +// color.mV[VALPHA] *= 0.5f; +// } drawLabel(font, text_left, y, color, right_x); //--------------------------------------------------------------------------------// diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index 4484d3209a0db771551216b8a90413058bdd7a3f..923faf3331387011198087aa517e5aaeea8f3d16 100644 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -4,6 +4,7 @@ * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. + * Copyright (C) 2010-2017, Kitty Barnett * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -175,6 +176,9 @@ class LLFolderViewModelItem : public LLRefCount, public LLTrace::MemTrackable<LL virtual void removeBatch(std::vector<LLFolderViewModelItem*>& batch) = 0; virtual BOOL isItemCopyable() const = 0; + // [SL:KB] - Patch: Inventory-Actions | Checked: 2013-09-19 (Catznip-3.6) + virtual bool isItemLinkable() const = 0; + // [/SL:KB] virtual BOOL copyToClipboard() const = 0; virtual BOOL cutToClipboard() = 0; virtual bool isCutToClipboard() { return false; }; diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h index 239d12876f9557f300684f21a5a4fc7d093ecfc2..0efc6907945c8d77b15000fd8ca9736b399a78b7 100644 --- a/indra/newview/llconversationmodel.h +++ b/indra/newview/llconversationmodel.h @@ -88,6 +88,9 @@ class LLConversationItem : public LLFolderViewModelItemCommon virtual void removeBatch(std::vector<LLFolderViewModelItem*>& batch) { } virtual void move( LLFolderViewModelItem* parent_listener ) { } virtual BOOL isItemCopyable() const { return FALSE; } +// [SL:KB] - Patch: Inventory-Actions | Checked: 2013-09-19 (Catznip-3.6) + /*virtual*/ bool isItemLinkable() const { return false; } +// [/SL:KB] virtual BOOL copyToClipboard() const { return FALSE; } virtual BOOL cutToClipboard() { return FALSE; } virtual BOOL isClipboardPasteable() const { return FALSE; } diff --git a/indra/newview/llfolderviewmodelinventory.cpp b/indra/newview/llfolderviewmodelinventory.cpp index 19ed515ef5fa9973f2157861d25d82e3305b9e02..f825ba4be4fd1770625b36bb5d89d9a9635c4641 100644 --- a/indra/newview/llfolderviewmodelinventory.cpp +++ b/indra/newview/llfolderviewmodelinventory.cpp @@ -5,6 +5,7 @@ * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. + * Copyright (C) 2010-2017, Kitty Barnett * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -235,7 +236,10 @@ bool LLFolderViewModelItemInventory::filter( LLFolderViewFilter& filter) } */ - bool is_folder = (getInventoryType() == LLInventoryType::IT_CATEGORY); +// bool is_folder = (getInventoryType() == LLInventoryType::IT_CATEGORY); +// [SL:KB] - Patch: Inventory-Links | Checked: 2013-09-19 (Catznip-3.6) + bool is_folder = (getInventoryType() == LLInventoryType::IT_CATEGORY) && (!isLink()); +// [/SL:KB] const bool passed_filter_folder = is_folder ? filter.checkFolder(this) : true; setPassedFolderFilter(passed_filter_folder, filter_generation); diff --git a/indra/newview/llfolderviewmodelinventory.h b/indra/newview/llfolderviewmodelinventory.h index 51b98339c42623ff3565dc5ec684c40e3d5a7599..4eff87b584f8068777b44b3b90d10696f886d418 100644 --- a/indra/newview/llfolderviewmodelinventory.h +++ b/indra/newview/llfolderviewmodelinventory.h @@ -53,6 +53,7 @@ class LLFolderViewModelItemInventory virtual LLWearableType::EType getWearableType() const = 0; virtual LLSettingsType::type_e getSettingsType() const = 0; virtual EInventorySortGroup getSortGroup() const = 0; + virtual BOOL isLink() const = 0; virtual LLInventoryObject* getInventoryObject() const = 0; virtual void requestSort(); virtual void setPassedFilter(bool filtered, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 3795b27dd22f1e83733c70396db3b52d216577c3..7e8ebc2dd3907bc0211eebb16625d5d9ecd3b446 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -5,6 +5,7 @@ * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. + * Copyright (C) 2010-2020, Kitty Barnett * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -312,7 +313,10 @@ BOOL LLInvFVBridge::isItemRemovable() const // Can be moved to another folder BOOL LLInvFVBridge::isItemMovable() const { - return TRUE; +// [SL:KB] - Patch: Inventory-Actions | Checked: 2012-08-18 (Catznip-3.3) + return get_is_item_movable(getInventoryModel(), mUUID); +// [/SL:KB] +// return TRUE; } BOOL LLInvFVBridge::isLink() const @@ -332,7 +336,10 @@ BOOL LLInvFVBridge::isLibraryItem() const BOOL LLInvFVBridge::cutToClipboard() { const LLInventoryObject* obj = gInventory.getObject(mUUID); - if (obj && isItemMovable() && isItemRemovable()) +// if (obj && isItemMovable() && isItemRemovable()) +// [SL:KB] - Patch: Inventory-Actions | Checked: 2012-08-18 (Catznip-3.3) + if ( (obj) && (isItemMovable()) ) +// [/SL:KB] { const LLUUID &marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); const BOOL cut_from_marketplacelistings = gInventory.isObjectDescendentOf(mUUID, marketplacelistings_id); @@ -378,7 +385,10 @@ BOOL LLInvFVBridge::callback_cutToClipboard(const LLSD& notification, const LLSD BOOL LLInvFVBridge::perform_cutToClipboard() { const LLInventoryObject* obj = gInventory.getObject(mUUID); - if (obj && isItemMovable() && isItemRemovable()) +// if (obj && isItemMovable() && isItemRemovable()) +// [SL:KB] - Patch: Inventory-Actions | Checked: 2012-08-18 (Catznip-3.3) + if ( (obj) && (isItemMovable()) ) +// [/SL:KB] { LLClipboard::instance().setCutMode(true); return LLClipboard::instance().addToClipboard(mUUID); @@ -389,7 +399,10 @@ BOOL LLInvFVBridge::perform_cutToClipboard() BOOL LLInvFVBridge::copyToClipboard() const { const LLInventoryObject* obj = gInventory.getObject(mUUID); - if (obj && isItemCopyable()) +// if (obj && isItemCopyable()) +// [SL:KB] - Patch: Inventory-Actions | Checked: 2013-09-19 (Catznip-3.6) + if ( (obj) && ( (isItemCopyable()) || (isItemLinkable()) ) ) +// [/SL:KB] { return LLClipboard::instance().addToClipboard(mUUID); } @@ -792,12 +805,12 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, if (obj) { - items.push_back(std::string("Copy Separator")); - items.push_back(std::string("Copy")); - if (!isItemCopyable()) - { - disabled_items.push_back(std::string("Copy")); - } +// items.push_back(std::string("Copy Separator")); +// items.push_back(std::string("Copy")); +// if (!isItemCopyable()) +// { +// disabled_items.push_back(std::string("Copy")); +// } if (obj->getIsLinkType()) { @@ -809,7 +822,11 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, } else { - if (LLAssetType::lookupCanLink(obj->getType())) +// if (LLAssetType::lookupCanLink(obj->getType())) +// [SL:KB] - Patch: Inventory-Actions | Checked: 2012-08-15 (Catznip-3.3) + // Don't show 'Find Links' for folders + if ( (LLAssetType::AT_CATEGORY != obj->getType()) && (LLAssetType::lookupCanLink(obj->getType())) ) +// [/SL:KB] { items.push_back(std::string("Find Links")); } @@ -842,11 +859,11 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, } } - items.push_back(std::string("Cut")); - if (!isItemMovable() || !isItemRemovable()) - { - disabled_items.push_back(std::string("Cut")); - } +// items.push_back(std::string("Cut")); +// if (!isItemMovable() || !isItemRemovable()) +// { +// disabled_items.push_back(std::string("Cut")); +// } if (canListOnMarketplace() && !isMarketplaceListingsFolder() && !isInboxFolder()) { @@ -864,6 +881,22 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, } } } + +// [SL:KB] - Patch: Inventory-Actions | Checked: 2010-04-12 (Catznip-2.0) + items.push_back(std::string("Copy Separator")); + + items.push_back(std::string("Copy")); + if ( (!isItemCopyable()) && (!isItemLinkable()) ) + { + disabled_items.push_back(std::string("Copy")); + } + + items.push_back(std::string("Cut")); + if ( (!isItemMovable()) || (isLibraryItem()) ) + { + disabled_items.push_back(std::string("Cut")); + } +// [/SL:KB] } // Don't allow items to be pasted directly into the COF or the inbox @@ -913,11 +946,18 @@ void LLInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else { - items.push_back(std::string("Share")); - if (!canShare()) +// [SL:KB] - Patch: Inventory-Links | Checked: 2013-09-17 (Catznip-3.6) + if (!isLink()) { - disabled_items.push_back(std::string("Share")); +// [/SL:KB] + items.push_back(std::string("Share")); + if (!canShare()) + { + disabled_items.push_back(std::string("Share")); + } +// [SL:KB] - Patch: Inventory-Links | Checked: 2013-09-17 (Catznip-3.6) } +// [/SL:KB] addOpenRightClickMenuOption(items); items.push_back(std::string("Properties")); @@ -2070,7 +2110,10 @@ BOOL LLItemBridge::removeItem() // we can't do this check because we may have items in a folder somewhere that is // not yet in memory, so we don't want false negatives. (If disabled, then we // know we only have links in the Outfits folder which we explicitly fetch.) - if (!gSavedSettings.getBOOL("InventoryLinking")) +// [SL:KB] - Patch: Inventory-Links | Checked: 2010-06-01 (Catznip-2.0) + // Users move folders around and reuse links that way... if we know something has links then it's just bad not to warn them :| +// [/SL:KB] +// if (!gSavedSettings.getBOOL("InventoryLinking")) { if (!item->getIsLinkType()) { @@ -2118,19 +2161,39 @@ BOOL LLItemBridge::isItemCopyable() const LLViewerInventoryItem* item = getItem(); if (item) { - // Can't copy worn objects. - // Worn objects are tied to their inworld conterparts - // Copy of modified worn object will return object with obsolete asset and inventory - if(get_is_item_worn(mUUID)) +// // Can't copy worn objects. +// // Worn objects are tied to their inworld conterparts +// // Copy of modified worn object will return object with obsolete asset and inventory +// if(get_is_item_worn(mUUID)) +// return FALSE; +// } + +// [SL:KB] - Patch: Inventory-Links | Checked: 2010-04-12 (Catznip-2.0) + // We'll allow copying a link if: + // - its target is available + // - it doesn't point to another link [see LLViewerInventoryItem::getLinkedItem() which returns NULL in that case] + if (item->getIsLinkType()) { - return FALSE; + return (NULL != item->getLinkedItem()); } +// [/SL:KB] - return item->getPermissions().allowCopyBy(gAgent.getID()) || gSavedSettings.getBOOL("InventoryLinking"); +// [SL:KB] - Patch: Inventory-Links | Checked: 2010-04-12 (Catznip-2.0) + return (item->getPermissions().allowCopyBy(gAgent.getID())); +// [/SL:KB] +// return item->getPermissions().allowCopyBy(gAgent.getID()) || gSavedSettings.getBOOL("InventoryLinking"); } return FALSE; } +// [SL:KB] - Patch: Inventory-Links | Checked: 2013-09-19 (Catznip-3.6) +bool LLItemBridge::isItemLinkable() const +{ + LLViewerInventoryItem* item = getItem(); + return (item) && (LLAssetType::lookupCanLink(item->getType())); +} +// [/SL:KB] + LLViewerInventoryItem* LLItemBridge::getItem() const { LLViewerInventoryItem* item = NULL; @@ -2161,15 +2224,18 @@ LLHandle<LLFolderBridge> LLFolderBridge::sSelf; // Can be moved to another folder BOOL LLFolderBridge::isItemMovable() const { - LLInventoryObject* obj = getInventoryObject(); - if(obj) - { - // If it's a protected type folder, we can't move it - if (LLFolderType::lookupIsProtectedType(((LLInventoryCategory*)obj)->getPreferredType())) - return FALSE; - return TRUE; - } - return FALSE; +// [SL:KB] - Patch: Inventory-Actions | Checked: 2012-08-18 (Catznip-3.3) + return get_is_category_movable(getInventoryModel(), mUUID); +// [/SL:KB] +// LLInventoryObject* obj = getInventoryObject(); +// if(obj) +// { +// // If it's a protected type folder, we can't move it +// if (LLFolderType::lookupIsProtectedType(((LLInventoryCategory*)obj)->getPreferredType())) +// return FALSE; +// return TRUE; +// } +// return FALSE; } void LLFolderBridge::selectItem() @@ -2362,6 +2428,14 @@ BOOL LLFolderBridge::isItemCopyable() const return TRUE; } +// [SL:KB] - Patch: Inventory-Links | Checked: 2013-09-19 (Catznip-3.6) +bool LLFolderBridge::isItemLinkable() const +{ + LLFolderType::EType ftType = getPreferredType(); + return (LLFolderType::FT_NONE == ftType) || (LLFolderType::FT_OUTFIT == ftType); +} +// [/SL:KB] + BOOL LLFolderBridge::isClipboardPasteable() const { if ( ! LLInvFVBridge::isClipboardPasteable() ) @@ -5545,11 +5619,18 @@ void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else { - items.push_back(std::string("Share")); - if (!canShare()) +// [SL:KB] - Patch: Inventory-Links | Checked: 2013-09-17 (Catznip-3.6) + if (!isLink()) { - disabled_items.push_back(std::string("Share")); +// [/SL:KB] + items.push_back(std::string("Share")); + if (!canShare()) + { + disabled_items.push_back(std::string("Share")); + } +// [SL:KB] - Patch: Inventory-Links | Checked: 2013-09-17 (Catznip-3.6) } +// [/SL:KB] addOpenRightClickMenuOption(items); items.push_back(std::string("Properties")); @@ -5647,11 +5728,18 @@ void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else { - items.push_back(std::string("Share")); - if (!canShare()) +// [SL:KB] - Patch: Inventory-Links | Checked: 2013-09-17 (Catznip-3.6) + if (!isLink()) { - disabled_items.push_back(std::string("Share")); +// [/SL:KB] + items.push_back(std::string("Share")); + if (!canShare()) + { + disabled_items.push_back(std::string("Share")); + } +// [SL:KB] - Patch: Inventory-Links | Checked: 2013-09-17 (Catznip-3.6) } +// [/SL:KB] items.push_back(std::string("Sound Open")); items.push_back(std::string("Properties")); @@ -5725,11 +5813,19 @@ void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else { - items.push_back(std::string("Share")); - if (!canShare()) +// [SL:KB] - Patch: Inventory-Links | Checked: 2013-09-17 (Catznip-3.6) + if (!isLink()) { - disabled_items.push_back(std::string("Share")); +// [/SL:KB] + items.push_back(std::string("Share")); + if (!canShare()) + { + disabled_items.push_back(std::string("Share")); + } +// [SL:KB] - Patch: Inventory-Links | Checked: 2013-09-17 (Catznip-3.6) } +// [/SL:KB] + items.push_back(std::string("Landmark Open")); items.push_back(std::string("Properties")); @@ -6024,11 +6120,18 @@ void LLCallingCardBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else { - items.push_back(std::string("Share")); - if (!canShare()) +// [SL:KB] - Patch: Inventory-Links | Checked: 2013-09-17 (Catznip-3.6) + if (!isLink()) { - disabled_items.push_back(std::string("Share")); +// [/SL:KB] + items.push_back(std::string("Share")); + if (!canShare()) + { + disabled_items.push_back(std::string("Share")); + } +// [SL:KB] - Patch: Inventory-Links | Checked: 2013-09-17 (Catznip-3.6) } +// [/SL:KB] if ((flags & FIRST_SELECTED_ITEM) == 0) { disabled_items.push_back(std::string("Open")); @@ -6327,11 +6430,18 @@ void LLGestureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else { - items.push_back(std::string("Share")); - if (!canShare()) +// [SL:KB] - Patch: Inventory-Links | Checked: 2013-09-17 (Catznip-3.6) + if (!isLink()) { - disabled_items.push_back(std::string("Share")); +// [/SL:KB] + items.push_back(std::string("Share")); + if (!canShare()) + { + disabled_items.push_back(std::string("Share")); + } +// [SL:KB] - Patch: Inventory-Links | Checked: 2013-09-17 (Catznip-3.6) } +// [/SL:KB] addOpenRightClickMenuOption(items); items.push_back(std::string("Properties")); @@ -6390,11 +6500,18 @@ void LLAnimationBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else { - items.push_back(std::string("Share")); - if (!canShare()) +// [SL:KB] - Patch: Inventory-Links | Checked: 2013-09-17 (Catznip-3.6) + if (!isLink()) { - disabled_items.push_back(std::string("Share")); +// [/SL:KB] + items.push_back(std::string("Share")); + if (!canShare()) + { + disabled_items.push_back(std::string("Share")); + } +// [SL:KB] - Patch: Inventory-Links | Checked: 2013-09-17 (Catznip-3.6) } +// [/SL:KB] items.push_back(std::string("Animation Open")); items.push_back(std::string("Properties")); @@ -6687,11 +6804,18 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else { - items.push_back(std::string("Share")); - if (!canShare()) +// [SL:KB] - Patch: Inventory-Links | Checked: 2013-09-17 (Catznip-3.6) + if (!isLink()) { - disabled_items.push_back(std::string("Share")); +// [/SL:KB] + items.push_back(std::string("Share")); + if (!canShare()) + { + disabled_items.push_back(std::string("Share")); + } +// [SL:KB] - Patch: Inventory-Links | Checked: 2013-09-17 (Catznip-3.6) } +// [/SL:KB] items.push_back(std::string("Properties")); @@ -6948,11 +7072,18 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { can_open = FALSE; } - items.push_back(std::string("Share")); - if (!canShare()) +// [SL:KB] - Patch: Inventory-Links | Checked: 2013-09-17 (Catznip-3.6) + if (!isLink()) { - disabled_items.push_back(std::string("Share")); +// [/SL:KB] + items.push_back(std::string("Share")); + if (!canShare()) + { + disabled_items.push_back(std::string("Share")); + } +// [SL:KB] - Patch: Inventory-Links | Checked: 2013-09-17 (Catznip-3.6) } +// [/SL:KB] if (can_open) { @@ -6976,7 +7107,10 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) disabled_items.push_back(std::string("Wearable Edit")); } // Don't allow items to be worn if their baseobj is in the trash. - if (isLinkedObjectInTrash() || isLinkedObjectMissing() || isCOFFolder()) +// if (isLinkedObjectInTrash() || isLinkedObjectMissing() || isCOFFolder()) +// [SL:KB] - Patch: Inventory-Actions | Checked: 2012-08-15 (Catznip-3.3) + if (isLinkedObjectInTrash() || isLinkedObjectMissing()) +// [/SL:KB] { disabled_items.push_back(std::string("Wearable And Object Wear")); disabled_items.push_back(std::string("Wearable Add")); diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 3d785a388fa7f487634e4e75655f84205ac15ca4..de1181aae02af988c67fa528976c084d94a21b9e 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -120,6 +120,9 @@ class LLInvFVBridge : public LLFolderViewModelItemInventory virtual void removeBatch(std::vector<LLFolderViewModelItem*>& batch); virtual void move(LLFolderViewModelItem* new_parent_bridge) {} virtual BOOL isItemCopyable() const { return FALSE; } +// [SL:KB] - Patch: Inventory-Links | Checked: 2013-09-19 (Catznip-3.6) + virtual bool isItemLinkable() const { return FALSE; } +// [/SL:KB] virtual BOOL copyToClipboard() const; virtual BOOL cutToClipboard(); virtual bool isCutToClipboard(); @@ -246,6 +249,9 @@ class LLItemBridge : public LLInvFVBridge virtual BOOL renameItem(const std::string& new_name); virtual BOOL removeItem(); virtual BOOL isItemCopyable() const; +// [SL:KB] - Patch: Inventory-Links | Checked: 2013-09-19 (Catznip-3.6) + /*virtual*/ bool isItemLinkable() const; +// [/SL:KB] virtual bool hasChildren() const { return FALSE; } virtual BOOL isUpToDate() const { return TRUE; } virtual LLUIImagePtr getIconOverlay() const; @@ -319,6 +325,9 @@ class LLFolderBridge : public LLInvFVBridge virtual BOOL isItemMovable() const ; virtual BOOL isUpToDate() const; virtual BOOL isItemCopyable() const; +// [SL:KB] - Patch: Inventory-Links | Checked: 2013-09-19 (Catznip-3.6) + /*virtual*/ bool isItemLinkable() const; +// [/SL:KB] virtual BOOL isClipboardPasteable() const; virtual BOOL isClipboardPasteableAsLink() const; diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 8baba6e6d5dc6184cfe238b7ec92836a394f5026..6a1e5973d23feeef37bf7879a28da8512dfc97d4 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -6,6 +6,7 @@ * $LicenseInfo:firstyear=2005&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. +* Copyright (C) 2010-2017, Kitty Barnett * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -96,7 +97,10 @@ bool LLInventoryFilter::check(const LLFolderViewModelItem* item) const LLFolderViewModelItemInventory* listener = dynamic_cast<const LLFolderViewModelItemInventory*>(item); // If it's a folder and we're showing all folders, return automatically. - const BOOL is_folder = listener->getInventoryType() == LLInventoryType::IT_CATEGORY; +// const BOOL is_folder = listener->getInventoryType() == LLInventoryType::IT_CATEGORY; +// [SL:KB] - Patch: Inventory-Links | Checked: Catznip-3.6 + const BOOL is_folder = (listener->getInventoryType() == LLInventoryType::IT_CATEGORY) && (!listener->isLink()); +// [/SL:KB] if (is_folder && (mFilterOps.mShowFolderState == LLInventoryFilter::SHOW_ALL_FOLDERS)) { return true; diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 9f226c536cad9212d90d11b4b22ff8e31cc7fc17..07bf1d37db20d21a8500d0eada291450389f8dc5 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -631,6 +631,36 @@ BOOL get_can_item_be_worn(const LLUUID& id) return FALSE; } +// [SL:KB] - Patch: Inventory-Actions | Checked: 2012-08-18 (Catznip-3.3) +BOOL get_is_item_movable(const LLInventoryModel* model, const LLUUID& id) +{ + // Can't move an item that's in COF (don't block the library as it's a special case where move operations convert to copy instead) + if ( (model) && (!model->isObjectDescendentOf(id, LLAppearanceMgr::instance().getCOF())) ) + { + return TRUE; + } + return FALSE; +} + +BOOL get_is_category_movable(const LLInventoryModel* model, const LLUUID& id) +{ + // NOTE: This function doesn't check the folder's children. + // See LLFolderBridge for a function that does consider the children. + + // Don't block the library since it's a special case where move operations will be converted to copy instead + if (model) + { + // Can't move protected category types + const LLInventoryCategory* category = model->getCategory(id); + if ( (category) && (!LLFolderType::lookupIsProtectedType(category->getPreferredType())) ) + { + return TRUE; + } + } + return FALSE; +} +// [/SL:KB] + BOOL get_is_item_removable(const LLInventoryModel* model, const LLUUID& id) { if (!model) diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index d6f74d367708a5ca8eca0371462bc0a1abfce876..d12530a2fb09352e874aef6628159089684ca811 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -6,6 +6,7 @@ * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. + * Copyright (C) 2010-2020, Kitty Barnett * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -51,6 +52,12 @@ BOOL get_is_item_worn(const LLUUID& id); // Could this item be worn (correct type + not already being worn) BOOL get_can_item_be_worn(const LLUUID& id); +// [SL:KB] - Patch: Inventory-Actions | Checked: 2012-08-18 (Catznip-3.3) +BOOL get_is_item_movable(const LLInventoryModel* model, const LLUUID& id); + +BOOL get_is_category_movable(const LLInventoryModel* model, const LLUUID& id); +// [/SL:KB] + BOOL get_is_item_removable(const LLInventoryModel* model, const LLUUID& id); // Performs the appropiate edit action (if one exists) for this item diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index aeed2b9b01ccc5fda0ca50b20c4268dd4cff9994..f8c25e25dd83ee6053574fc171f6ca6dbb25bb86 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -137,6 +137,10 @@ class LLTaskInvFVBridge : public LLFolderViewModelItemInventory virtual void removeBatch(std::vector<LLFolderViewModelItem*>& batch); virtual void move(LLFolderViewModelItem* parent_listener); virtual BOOL isItemCopyable() const; +// [SL:KB] - Patch: Inventory-Actions | Checked: 2013-09-19 (Catznip-3.6) + /*virtual*/ bool isItemLinkable() const; + /*virtual*/ BOOL isLink() const; +// [/SL:KB] virtual BOOL copyToClipboard() const; virtual BOOL cutToClipboard(); virtual BOOL isClipboardPasteable() const; @@ -501,6 +505,18 @@ BOOL LLTaskInvFVBridge::isItemCopyable() const GP_OBJECT_MANIPULATE); } +// [SL:KB] - Patch: Inventory-Actions | Checked: 2013-09-19 (Catznip-3.6) +bool LLTaskInvFVBridge::isItemLinkable() const +{ + return false; +} + +BOOL LLTaskInvFVBridge::isLink() const +{ + return FALSE; +} +// [/SL:KB] + BOOL LLTaskInvFVBridge::copyToClipboard() const { return FALSE;