Inventory cut support!

Also fixes a bunch of comments, implementation based off of v-d.
Added isOnClipboard and setCutMode functions to LLInventoryClipboard, in part from v-d's LLClipboard.
LLInventoryFilter has a few rearrangements of code; only real change is now it has checkAgainstClipboard and uses it to filter out cut items.
There is a massive retabbed block in llinventorymodel.cpp, view without space changes. Implements removeObject.
Note: We are not afflicted by MAINT-1197: Fix inventory deselection/reselection when cutting items
This commit is contained in:
Lirusaito
2012-11-16 02:47:05 -05:00
parent 760ac98ab6
commit 7b2536eb0d
10 changed files with 230 additions and 64 deletions

View File

@@ -429,7 +429,7 @@ void LLFolderView::setOpenArrangeRecursively(BOOL openitem, ERecurseType recurse
static LLFastTimer::DeclareTimer FTM_ARRANGE("Arrange");
// This view grows and shinks to enclose all of its children items and folders.
// This view grows and shrinks to enclose all of its children items and folders.
S32 LLFolderView::arrange( S32* unused_width, S32* unused_height, S32 filter_generation )
{
if(!mScrollContainer)
@@ -1049,6 +1049,24 @@ bool isDescendantOfASelectedItem(LLFolderViewItem* item, const std::vector<LLFol
return false;
}
// static
void LLFolderView::removeCutItems()
{
// There's no item in "cut" mode on the clipboard -> exit
if (!LLInventoryClipboard::instance().isCutMode())
return;
// Get the list of clipboard item uuids and iterate through them
LLDynamicArray<LLUUID> objects;
LLInventoryClipboard::instance().retrieve(objects);
for (LLDynamicArray<LLUUID>::const_iterator iter = objects.begin();
iter != objects.end();
++iter)
{
gInventory.removeObject(*iter);
}
}
void LLFolderView::removeSelectedItems( void )
{
if(getVisible() && getEnabled())
@@ -1385,6 +1403,7 @@ void LLFolderView::cut()
listener->cutToClipboard();
}
}
LLFolderView::removeCutItems();
}
mSearchString.clear();
}
@@ -2015,7 +2034,7 @@ void LLFolderView::scrollToShowSelection()
}
}
// If the parent is scroll containter, scroll it to make the selection
// If the parent is scroll container, scroll it to make the selection
// is maximally visible.
void LLFolderView::scrollToShowItem(LLFolderViewItem* item, const LLRect& constraint_rect)
{
@@ -2165,7 +2184,7 @@ void LLFolderView::doIdle()
mNeedsAutoSelect = filter_modified_and_active &&
!(gFocusMgr.childHasKeyboardFocus(this) || gFocusMgr.getMouseCapture());
// filter to determine visiblity before arranging
// filter to determine visibility before arranging
filterFromRoot();
// automatically show matching items, and select first one