Add Paste As Copy to inventory menu...
The opposite of Paste As Link, this will make copies of everything in the paste buffer, allowing the user to copy bunches of items or links and simply paste them to make new copies. Also appears when not needed... unsure how to go about removing, maybe comment out in release?
This commit is contained in:
@@ -77,7 +77,7 @@ public:
|
||||
virtual BOOL copyToClipboard() const = 0;
|
||||
virtual void cutToClipboard() = 0;
|
||||
virtual BOOL isClipboardPasteable() const = 0;
|
||||
virtual void pasteFromClipboard() = 0;
|
||||
virtual void pasteFromClipboard(bool only_copies = false) = 0;
|
||||
virtual void pasteLinkFromClipboard() = 0;
|
||||
virtual void buildContextMenu(LLMenuGL& menu, U32 flags) = 0;
|
||||
virtual BOOL isUpToDate() const = 0;
|
||||
|
||||
@@ -816,10 +816,14 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
|
||||
if (!isCOFFolder() && !isInboxFolder() && !isOutboxFolder())
|
||||
{
|
||||
items.push_back(std::string("Paste"));
|
||||
// Paste as copy if we have links.
|
||||
if (InventoryLinksEnabled() && !LLInventoryClipboard::instance().isCutMode())
|
||||
items.push_back(std::string("Paste As Copy"));
|
||||
}
|
||||
if (!isClipboardPasteable() || ((flags & FIRST_SELECTED_ITEM) == 0))
|
||||
{
|
||||
disabled_items.push_back(std::string("Paste"));
|
||||
disabled_items.push_back(std::string("Paste As Copy"));
|
||||
}
|
||||
|
||||
if(InventoryLinksEnabled())
|
||||
@@ -1483,6 +1487,18 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action)
|
||||
folder_view_itemp->getListener()->pasteFromClipboard();
|
||||
return;
|
||||
}
|
||||
else if ("paste_copies" == action)
|
||||
{
|
||||
// Single item only
|
||||
LLInventoryItem* itemp = model->getItem(mUUID);
|
||||
if (!itemp) return;
|
||||
|
||||
LLFolderViewItem* folder_view_itemp = mRoot->getItemByID(itemp->getParentUUID());
|
||||
if (!folder_view_itemp) return;
|
||||
|
||||
folder_view_itemp->getListener()->pasteFromClipboard(true);
|
||||
return;
|
||||
}
|
||||
else if ("paste_link" == action)
|
||||
{
|
||||
// Single item only
|
||||
@@ -2854,6 +2870,11 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action)
|
||||
pasteFromClipboard();
|
||||
return;
|
||||
}
|
||||
else if ("paste_copies" == action)
|
||||
{
|
||||
pasteFromClipboard(true);
|
||||
return;
|
||||
}
|
||||
else if ("paste_link" == action)
|
||||
{
|
||||
pasteLinkFromClipboard();
|
||||
@@ -3092,7 +3113,7 @@ bool LLFolderBridge::removeItemResponse(const LLSD& notification, const LLSD& re
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void LLFolderBridge::pasteFromClipboard()
|
||||
void LLFolderBridge::pasteFromClipboard(bool only_copies)
|
||||
{
|
||||
LLInventoryModel* model = getInventoryModel();
|
||||
if(model && isClipboardPasteable())
|
||||
@@ -3165,7 +3186,7 @@ void LLFolderBridge::pasteFromClipboard()
|
||||
dropToOutfit(item, move_is_into_current_outfit);
|
||||
}
|
||||
}
|
||||
else if(LLInventoryClipboard::instance().isCutMode())
|
||||
else if (!only_copies && LLInventoryClipboard::instance().isCutMode())
|
||||
{
|
||||
// Do a move to "paste" a "cut"
|
||||
// move_inventory_item() is not enough, as we have to update inventory locally too
|
||||
@@ -3190,6 +3211,11 @@ void LLFolderBridge::pasteFromClipboard()
|
||||
}
|
||||
else
|
||||
{
|
||||
if (only_copies)
|
||||
{
|
||||
item = model->getLinkedItem(item_id);
|
||||
obj = model->getObject(item->getUUID());
|
||||
}
|
||||
// Do a "copy" to "paste" a regular copy clipboard
|
||||
if (LLAssetType::AT_CATEGORY == obj->getType())
|
||||
{
|
||||
@@ -3201,7 +3227,7 @@ void LLFolderBridge::pasteFromClipboard()
|
||||
}
|
||||
}
|
||||
// [SL:KB] - Patch: Inventory-Links | Checked: 2010-04-12 (Catznip-2.2.0a) | Added: Catznip-2.0.0a
|
||||
else if (LLAssetType::lookupIsLinkType(item->getActualType()))
|
||||
else if (!only_copies && LLAssetType::lookupIsLinkType(item->getActualType()))
|
||||
{
|
||||
link_inventory_item(
|
||||
gAgent.getID(),
|
||||
|
||||
@@ -109,7 +109,7 @@ public:
|
||||
virtual void cutToClipboard();
|
||||
virtual BOOL isClipboardPasteable() const;
|
||||
virtual BOOL isClipboardPasteableAsLink() const;
|
||||
virtual void pasteFromClipboard() {}
|
||||
virtual void pasteFromClipboard(bool only_copies = false) {}
|
||||
virtual void pasteLinkFromClipboard() {}
|
||||
void getClipboardEntries(bool show_asset_id, menuentry_vec_t &items,
|
||||
menuentry_vec_t &disabled_items, U32 flags);
|
||||
@@ -261,7 +261,7 @@ public:
|
||||
BOOL removeSystemFolder();
|
||||
bool removeItemResponse(const LLSD& notification, const LLSD& response);
|
||||
|
||||
virtual void pasteFromClipboard();
|
||||
virtual void pasteFromClipboard(bool only_copies = false);
|
||||
virtual void pasteLinkFromClipboard();
|
||||
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
|
||||
virtual BOOL hasChildren() const;
|
||||
|
||||
@@ -131,7 +131,7 @@ public:
|
||||
virtual BOOL copyToClipboard() const;
|
||||
virtual void cutToClipboard();
|
||||
virtual BOOL isClipboardPasteable() const;
|
||||
virtual void pasteFromClipboard();
|
||||
virtual void pasteFromClipboard(bool only_copies = false);
|
||||
virtual void pasteLinkFromClipboard();
|
||||
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
|
||||
virtual void performAction(LLInventoryModel* model, std::string action);
|
||||
@@ -604,7 +604,7 @@ BOOL LLTaskInvFVBridge::isClipboardPasteable() const
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void LLTaskInvFVBridge::pasteFromClipboard()
|
||||
void LLTaskInvFVBridge::pasteFromClipboard(bool only_copies)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -198,6 +198,10 @@
|
||||
name="Paste" width="128">
|
||||
<on_click filter="" function="Inventory.DoToSelected" userdata="paste" />
|
||||
</menu_item_call>
|
||||
<menu_item_call bottom_delta="-18" height="18" label="Paste As Copy" left="0" mouse_opaque="true"
|
||||
name="Paste As Copy" width="128">
|
||||
<on_click filter="" function="Inventory.DoToSelected" userdata="paste_copies" />
|
||||
</menu_item_call>
|
||||
<menu_item_call bottom_delta="-18" height="18" label="Paste As Link" left="0" mouse_opaque="true"
|
||||
name="Paste As Link" width="128">
|
||||
<on_click filter="" function="Inventory.DoToSelected" userdata="paste_link" />
|
||||
|
||||
Reference in New Issue
Block a user