MAINT-6397 cut items should not go to trash
parent
757414afb8
commit
7d54c62016
|
|
@ -191,6 +191,7 @@ Ansariel Hiller
|
|||
MAINT-5756
|
||||
MAINT-4677
|
||||
MAINT-6300
|
||||
MAINT-6397
|
||||
Aralara Rajal
|
||||
Arare Chantilly
|
||||
CHUIBUG-191
|
||||
|
|
|
|||
|
|
@ -127,6 +127,8 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p)
|
|||
mIsSelected( FALSE ),
|
||||
mIsCurSelection( FALSE ),
|
||||
mSelectPending(FALSE),
|
||||
mIsItemCut(false),
|
||||
mCutGeneration(0),
|
||||
mLabelStyle( LLFontGL::NORMAL ),
|
||||
mHasVisibleChildren(FALSE),
|
||||
mIsFolderComplete(true),
|
||||
|
|
@ -694,6 +696,19 @@ void LLFolderViewItem::drawOpenFolderArrow(const Params& default_params, const L
|
|||
return mIsCurSelection;
|
||||
}
|
||||
|
||||
/*virtual*/ bool LLFolderViewItem::isFadeItem()
|
||||
{
|
||||
LLClipboard& clipboard = LLClipboard::instance();
|
||||
if (mCutGeneration != clipboard.getGeneration())
|
||||
{
|
||||
mCutGeneration = clipboard.getGeneration();
|
||||
mIsItemCut = clipboard.isCutMode()
|
||||
&& ((getParentFolder() && getParentFolder()->isFadeItem())
|
||||
|| getViewModelItem()->isCutToClipboard());
|
||||
}
|
||||
return mIsItemCut;
|
||||
}
|
||||
|
||||
void LLFolderViewItem::drawHighlight(const BOOL showContent, const BOOL hasKeyboardFocus, const LLUIColor &selectColor, const LLUIColor &flashColor,
|
||||
const LLUIColor &focusOutlineColor, const LLUIColor &mouseOverColor)
|
||||
{
|
||||
|
|
@ -875,6 +890,12 @@ 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;
|
||||
}
|
||||
drawLabel(font, text_left, y, color, right_x);
|
||||
|
||||
//--------------------------------------------------------------------------------//
|
||||
|
|
@ -882,7 +903,7 @@ void LLFolderViewItem::draw()
|
|||
//
|
||||
if (!mLabelSuffix.empty())
|
||||
{
|
||||
font->renderUTF8( mLabelSuffix, 0, right_x, y, sSuffixColor,
|
||||
font->renderUTF8( mLabelSuffix, 0, right_x, y, isFadeItem() ? color : sSuffixColor,
|
||||
LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW,
|
||||
S32_MAX, S32_MAX, &right_x, FALSE );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,8 +121,11 @@ protected:
|
|||
mIsMouseOverTitle,
|
||||
mAllowWear,
|
||||
mAllowDrop,
|
||||
mSelectPending;
|
||||
|
||||
mSelectPending,
|
||||
mIsItemCut;
|
||||
|
||||
S32 mCutGeneration;
|
||||
|
||||
LLUIColor mFontColor;
|
||||
LLUIColor mFontHighlightColor;
|
||||
|
||||
|
|
@ -145,6 +148,7 @@ protected:
|
|||
virtual void addFolder(LLFolderViewFolder*) { }
|
||||
virtual bool isHighlightAllowed();
|
||||
virtual bool isHighlightActive();
|
||||
virtual bool isFadeItem();
|
||||
virtual bool isFlashing() { return false; }
|
||||
virtual void setFlashState(bool) { }
|
||||
|
||||
|
|
|
|||
|
|
@ -173,6 +173,7 @@ public:
|
|||
virtual BOOL isItemCopyable() const = 0;
|
||||
virtual BOOL copyToClipboard() const = 0;
|
||||
virtual BOOL cutToClipboard() = 0;
|
||||
virtual bool isCutToClipboard() { return false; };
|
||||
|
||||
virtual BOOL isClipboardPasteable() const = 0;
|
||||
virtual void pasteFromClipboard() = 0;
|
||||
|
|
|
|||
|
|
@ -286,6 +286,16 @@ BOOL LLInvFVBridge::cutToClipboard()
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
// virtual
|
||||
bool LLInvFVBridge::isCutToClipboard()
|
||||
{
|
||||
if (LLClipboard::instance().isCutMode())
|
||||
{
|
||||
return LLClipboard::instance().isOnClipboard(mUUID);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Callback for cutToClipboard if DAMA required...
|
||||
BOOL LLInvFVBridge::callback_cutToClipboard(const LLSD& notification, const LLSD& response)
|
||||
{
|
||||
|
|
@ -307,9 +317,7 @@ BOOL LLInvFVBridge::perform_cutToClipboard()
|
|||
if (obj && isItemMovable() && isItemRemovable())
|
||||
{
|
||||
LLClipboard::instance().setCutMode(true);
|
||||
BOOL added_to_clipboard = LLClipboard::instance().addToClipboard(mUUID);
|
||||
removeObject(&gInventory, mUUID); // Always perform the remove even if the object couldn't make it to the clipboard
|
||||
return added_to_clipboard;
|
||||
return LLClipboard::instance().addToClipboard(mUUID);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,6 +116,7 @@ public:
|
|||
virtual BOOL isItemCopyable() const { return FALSE; }
|
||||
virtual BOOL copyToClipboard() const;
|
||||
virtual BOOL cutToClipboard();
|
||||
virtual bool isCutToClipboard();
|
||||
virtual BOOL isClipboardPasteable() const;
|
||||
virtual BOOL isClipboardPasteableAsLink() const;
|
||||
virtual void pasteFromClipboard() {}
|
||||
|
|
|
|||
|
|
@ -84,21 +84,18 @@ LLInventoryFilter::LLInventoryFilter(const Params& p)
|
|||
bool LLInventoryFilter::check(const LLFolderViewModelItem* item)
|
||||
{
|
||||
const LLFolderViewModelItemInventory* listener = dynamic_cast<const LLFolderViewModelItemInventory*>(item);
|
||||
// Clipboard cut items are *always* filtered so we need this value upfront
|
||||
const BOOL passed_clipboard = (listener ? checkAgainstClipboard(listener->getUUID()) : TRUE);
|
||||
|
||||
// If it's a folder and we're showing all folders, return automatically.
|
||||
const BOOL is_folder = listener->getInventoryType() == LLInventoryType::IT_CATEGORY;
|
||||
if (is_folder && (mFilterOps.mShowFolderState == LLInventoryFilter::SHOW_ALL_FOLDERS))
|
||||
{
|
||||
return passed_clipboard;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool passed = (mFilterSubString.size() ? listener->getSearchableName().find(mFilterSubString) != std::string::npos : true);
|
||||
passed = passed && checkAgainstFilterType(listener);
|
||||
passed = passed && checkAgainstPermissions(listener);
|
||||
passed = passed && checkAgainstFilterLinks(listener);
|
||||
passed = passed && passed_clipboard;
|
||||
|
||||
return passed;
|
||||
}
|
||||
|
|
@ -108,9 +105,8 @@ bool LLInventoryFilter::check(const LLInventoryItem* item)
|
|||
const bool passed_string = (mFilterSubString.size() ? item->getName().find(mFilterSubString) != std::string::npos : true);
|
||||
const bool passed_filtertype = checkAgainstFilterType(item);
|
||||
const bool passed_permissions = checkAgainstPermissions(item);
|
||||
const bool passed_clipboard = checkAgainstClipboard(item->getUUID());
|
||||
|
||||
return passed_filtertype && passed_permissions && passed_clipboard && passed_string;
|
||||
return passed_filtertype && passed_permissions && passed_string;
|
||||
}
|
||||
|
||||
bool LLInventoryFilter::checkFolder(const LLFolderViewModelItem* item) const
|
||||
|
|
@ -129,13 +125,10 @@ bool LLInventoryFilter::checkFolder(const LLFolderViewModelItem* item) const
|
|||
|
||||
bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const
|
||||
{
|
||||
// Always check against the clipboard
|
||||
const BOOL passed_clipboard = checkAgainstClipboard(folder_id);
|
||||
|
||||
// we're showing all folders, overriding filter
|
||||
if (mFilterOps.mShowFolderState == LLInventoryFilter::SHOW_ALL_FOLDERS)
|
||||
{
|
||||
return passed_clipboard;
|
||||
return true;
|
||||
}
|
||||
|
||||
// when applying a filter, matching folders get their contents downloaded first
|
||||
|
|
@ -201,7 +194,7 @@ bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const
|
|||
LLViewerInventoryItem* item = gInventory.getItem(folder_id);
|
||||
if (item && item->getActualType() == LLAssetType::AT_LINK_FOLDER)
|
||||
{
|
||||
return passed_clipboard;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mFilterOps.mFilterTypes & FILTERTYPE_CATEGORY)
|
||||
|
|
@ -216,7 +209,7 @@ bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const
|
|||
return false;
|
||||
}
|
||||
|
||||
return passed_clipboard;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInventory* listener) const
|
||||
|
|
|
|||
Loading…
Reference in New Issue