summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-07-30 20:51:18 -0700
committerMerov Linden <merov@lindenlab.com>2014-07-30 20:51:18 -0700
commitd37c294bd38bf4cae251c33f863e4e6e66ef44db (patch)
treeb8111a69d83c4a1013ed396dd5d27c6a468b9a25 /indra/llui
parentc182a8b79737a67794c032a6b60b038c9b905f57 (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')
-rw-r--r--indra/llui/llfolderviewitem.cpp15
-rw-r--r--indra/llui/llfolderviewitem.h2
2 files changed, 14 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;
diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h
index 12fba4f9b1..ffeaf0d1b7 100644
--- a/indra/llui/llfolderviewitem.h
+++ b/indra/llui/llfolderviewitem.h
@@ -60,6 +60,7 @@ public:
Optional<time_t> creation_date;
Optional<bool> allow_wear;
+ Optional<bool> allow_drop;
Optional<LLUIColor> font_color;
Optional<LLUIColor> font_highlight_color;
@@ -118,6 +119,7 @@ protected:
mDragAndDropTarget,
mIsMouseOverTitle,
mAllowWear,
+ mAllowDrop,
mSelectPending;
LLUIColor mFontColor;