diff options
author | Merov Linden <merov@lindenlab.com> | 2012-02-07 17:13:24 -0800 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2012-02-07 17:13:24 -0800 |
commit | c744603af9b53c6bc73fefbd56de68cf2778ed70 (patch) | |
tree | 353cea8bbf89f69bd644b6d0b3fd2fa4c66acf8b /indra/newview/llinventorybridge.cpp | |
parent | 9761375ac244af36635899c73e99efc46b68b589 (diff) |
EXP-1873 : Implement cut in the inventory contextual menu. Works without deleting the items but simply dimming them and moving them. Doesn't work for folders yet.
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 14f1bb9d41..7ba914eaf6 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -210,7 +210,7 @@ BOOL LLInvFVBridge::isLink() const */ void LLInvFVBridge::cutToClipboard() { - if(isItemMovable()) + if (isItemMovable() && isItemRemovable()) { LLClipboard::getInstance()->cut(mUUID); } @@ -602,6 +602,12 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, disabled_items.push_back(std::string("Copy")); } + items.push_back(std::string("Cut")); + if (!isItemMovable() || !isItemRemovable()) + { + disabled_items.push_back(std::string("Cut")); + } + if (canListOnMarketplace()) { items.push_back(std::string("Marketplace Separator")); @@ -1281,6 +1287,11 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action) gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(buffer)); return; } + else if ("cut" == action) + { + cutToClipboard(); + return; + } else if ("copy" == action) { copyToClipboard(); @@ -2608,6 +2619,11 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) modifyOutfit(TRUE); return; } + else if ("cut" == action) + { + cutToClipboard(); + return; + } else if ("copy" == action) { copyToClipboard(); @@ -2867,6 +2883,8 @@ void LLFolderBridge::pasteFromClipboard() } } } + // Change mode to paste for next paste + LLClipboard::getInstance()->setCutMode(false); } } @@ -2920,6 +2938,8 @@ void LLFolderBridge::pasteLinkFromClipboard() LLPointer<LLInventoryCallback>(NULL)); } } + // Change mode to paste for next paste + LLClipboard::getInstance()->setCutMode(false); } } |