diff options
author | Merov Linden <merov@lindenlab.com> | 2014-07-30 20:51:18 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2014-07-30 20:51:18 -0700 |
commit | d37c294bd38bf4cae251c33f863e4e6e66ef44db (patch) | |
tree | b8111a69d83c4a1013ed396dd5d27c6a468b9a25 /indra/llui/llfolderviewitem.cpp | |
parent | c182a8b79737a67794c032a6b60b038c9b905f57 (diff) |
DD-75 : Prevent dropping on filtered tabs root. Adding an allow_drop option to inventory tab and folder view folders so that case can be taken into account.
Diffstat (limited to 'indra/llui/llfolderviewitem.cpp')
-rw-r--r-- | indra/llui/llfolderviewitem.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 42116251fb..942dd76af9 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -104,7 +104,8 @@ LLFolderViewItem::Params::Params() item_height("item_height"), item_top_pad("item_top_pad"), creation_date(), - allow_wear("allow_wear", true), + allow_wear("allow_wear", true), + allow_drop("allow_drop", true), font_color("font_color"), font_highlight_color("font_highlight_color"), left_pad("left_pad", 0), @@ -138,6 +139,7 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) mViewModelItem(p.listener), mIsMouseOverTitle(false), mAllowWear(p.allow_wear), + mAllowDrop(p.allow_drop), mFontColor(p.font_color), mFontHighlightColor(p.font_highlight_color), mLeftPad(p.left_pad), @@ -1782,9 +1784,16 @@ BOOL LLFolderViewFolder::handleDragAndDropToThisFolder(MASK mask, EAcceptance* accept, std::string& tooltip_msg) { + if (!mAllowDrop) + { + *accept = ACCEPT_NO; + tooltip_msg = LLTrans::getString("TooltipOutboxCannotDropOnRoot"); + return TRUE; + } + BOOL accepted = getViewModelItem()->dragOrDrop(mask,drop,cargo_type,cargo_data, tooltip_msg); - - if (accepted) + + if (accepted) { mDragAndDropTarget = TRUE; *accept = ACCEPT_YES_MULTI; |