aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llinventorybridge.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llinventorybridge.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/linden/indra/newview/llinventorybridge.cpp b/linden/indra/newview/llinventorybridge.cpp
index b1627b5..f71df2d 100644
--- a/linden/indra/newview/llinventorybridge.cpp
+++ b/linden/indra/newview/llinventorybridge.cpp
@@ -463,6 +463,12 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, std::vector<std::str
463 463
464 items.push_back(std::string("Copy Separator")); 464 items.push_back(std::string("Copy Separator"));
465 465
466 items.push_back(std::string("Cut"));
467 if (!isItemCopyable())
468 {
469 disabled_items.push_back(std::string("Cut"));
470 }
471
466 items.push_back(std::string("Copy")); 472 items.push_back(std::string("Copy"));
467 if (!isItemCopyable()) 473 if (!isItemCopyable())
468 { 474 {
@@ -813,6 +819,11 @@ void LLItemBridge::performAction(LLFolderView* folder, LLInventoryModel* model,
813 copyToClipboard(); 819 copyToClipboard();
814 return; 820 return;
815 } 821 }
822 else if ("cut" == action)
823 {
824 cutToClipboard();
825 return;
826 }
816 else if ("paste" == action) 827 else if ("paste" == action)
817 { 828 {
818 // Single item only 829 // Single item only
@@ -1086,6 +1097,15 @@ BOOL LLItemBridge::copyToClipboard() const
1086 } 1097 }
1087 return FALSE; 1098 return FALSE;
1088} 1099}
1100BOOL LLItemBridge::cutToClipboard() const
1101{
1102 if(isItemCopyable())
1103 {
1104 LLInventoryClipboard::instance().addCut(mUUID);
1105 return TRUE;
1106 }
1107 return FALSE;
1108}
1089 1109
1090LLViewerInventoryItem* LLItemBridge::getItem() const 1110LLViewerInventoryItem* LLItemBridge::getItem() const
1091{ 1111{
@@ -1890,6 +1910,35 @@ void LLFolderBridge::pasteFromClipboard()
1890 LLPointer<LLInventoryCallback>(NULL)); 1910 LLPointer<LLInventoryCallback>(NULL));
1891 } 1911 }
1892 } 1912 }
1913 //Do cuts as well
1914 LLInventoryClipboard::instance().retrieveCuts(objects);
1915 count = objects.count();
1916 parent_id = mUUID;
1917 for(S32 i = 0; i < count; i++)
1918 {
1919 item = model->getItem(objects.get(i));
1920 if (item)
1921 {
1922 copy_inventory_item(
1923 gAgent.getID(),
1924 item->getPermissions().getOwner(),
1925 item->getUUID(),
1926 parent_id,
1927 std::string(),
1928 LLPointer<LLInventoryCallback>(NULL));
1929 LLInventoryCategory* cat = model->getCategory(item->getUUID());
1930 if(cat)
1931 {
1932 model->purgeDescendentsOf(mUUID);
1933 }
1934 LLInventoryObject* obj = model->getObject(item->getUUID());
1935 if(!obj) return;
1936 obj->removeFromServer();
1937 LLPreview::hide(item->getUUID());
1938 model->deleteObject(item->getUUID());
1939 model->notifyObservers();
1940 }
1941 }
1893 } 1942 }
1894} 1943}
1895 1944