summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rwxr-xr-xindra/llui/llfolderview.cpp1
-rw-r--r--indra/llui/llfolderviewitem.cpp21
-rw-r--r--indra/llui/llfolderviewitem.h6
-rwxr-xr-xindra/llui/llfolderviewmodel.h4
4 files changed, 23 insertions, 9 deletions
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index cca26f335a..244957fc5a 100755
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -947,7 +947,6 @@ void LLFolderView::cut()
if (listener)
{
listener->cutToClipboard();
- listener->removeItem();
}
}
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index 83254c2840..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_open("allow_open", 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),
@@ -137,7 +138,8 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p)
mRoot(p.root),
mViewModelItem(p.listener),
mIsMouseOverTitle(false),
- mAllowOpen(p.allow_open),
+ mAllowWear(p.allow_wear),
+ mAllowDrop(p.allow_drop),
mFontColor(p.font_color),
mFontHighlightColor(p.font_highlight_color),
mLeftPad(p.left_pad),
@@ -454,7 +456,7 @@ void LLFolderViewItem::buildContextMenu(LLMenuGL& menu, U32 flags)
void LLFolderViewItem::openItem( void )
{
- if (mAllowOpen)
+ if (mAllowWear || !getViewModelItem()->isItemWearable())
{
getViewModelItem()->openItem();
}
@@ -1477,12 +1479,14 @@ void LLFolderViewFolder::destroyView()
while (!mItems.empty())
{
LLFolderViewItem *itemp = mItems.back();
+ mItems.pop_back();
itemp->destroyView(); // LLFolderViewItem::destroyView() removes entry from mItems
}
while (!mFolders.empty())
{
LLFolderViewFolder *folderp = mFolders.back();
+ mFolders.pop_back();
folderp->destroyView(); // LLFolderVievFolder::destroyView() removes entry from mFolders
}
@@ -1780,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 a9b0201236..ffeaf0d1b7 100644
--- a/indra/llui/llfolderviewitem.h
+++ b/indra/llui/llfolderviewitem.h
@@ -59,7 +59,8 @@ public:
item_top_pad;
Optional<time_t> creation_date;
- Optional<bool> allow_open;
+ Optional<bool> allow_wear;
+ Optional<bool> allow_drop;
Optional<LLUIColor> font_color;
Optional<LLUIColor> font_highlight_color;
@@ -117,7 +118,8 @@ protected:
mIsCurSelection,
mDragAndDropTarget,
mIsMouseOverTitle,
- mAllowOpen,
+ mAllowWear,
+ mAllowDrop,
mSelectPending;
LLUIColor mFontColor;
diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h
index 8d98363c5f..99c7c4013c 100755
--- a/indra/llui/llfolderviewmodel.h
+++ b/indra/llui/llfolderviewmodel.h
@@ -156,6 +156,8 @@ public:
virtual void openItem( void ) = 0;
virtual void closeItem( void ) = 0;
virtual void selectItem(void) = 0;
+
+ virtual BOOL isItemWearable() const { return FALSE; }
virtual BOOL isItemRenameable() const = 0;
virtual BOOL renameItem(const std::string& new_name) = 0;
@@ -169,7 +171,7 @@ public:
virtual BOOL isItemCopyable() const = 0;
virtual BOOL copyToClipboard() const = 0;
- virtual BOOL cutToClipboard() const = 0;
+ virtual BOOL cutToClipboard() = 0;
virtual BOOL isClipboardPasteable() const = 0;
virtual void pasteFromClipboard() = 0;