summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorandreykproductengine <akleshchev@productengine.com>2015-06-05 16:30:04 +0300
committerandreykproductengine <akleshchev@productengine.com>2015-06-05 16:30:04 +0300
commitb59770199afae70f8fa14b3f050d5f5d4818cb07 (patch)
tree112f4fe9a08eb1700062201482246fe429dfc35c /indra/llui
parent77b4f1d51c6e9d2b7d6711bfa38912ba4682c320 (diff)
parentf3c58f765c0168f25bb13c4427e34b4bdad2f671 (diff)
Merge from viewer-release
Diffstat (limited to 'indra/llui')
-rwxr-xr-xindra/llui/llfolderview.cpp12
-rwxr-xr-xindra/llui/llfolderview.h8
-rwxr-xr-x[-rw-r--r--]indra/llui/llfolderviewitem.h7
3 files changed, 24 insertions, 3 deletions
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index f60129e601..4c05d001a0 100755
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -170,7 +170,8 @@ LLFolderView::LLFolderView(const Params& p)
mDraggingOverItem(NULL),
mStatusTextBox(NULL),
mShowItemLinkOverlays(p.show_item_link_overlays),
- mViewModel(p.view_model)
+ mViewModel(p.view_model),
+ mGroupedItemModel(p.grouped_item_model)
{
claimMem(mViewModel);
LLPanel* panel = p.parent_panel;
@@ -1810,7 +1811,6 @@ void LLFolderView::updateMenuOptions(LLMenuGL* menu)
}
// Successively filter out invalid options
-
U32 multi_select_flag = (mSelectedItems.size() > 1 ? ITEM_IN_MULTI_SELECTION : 0x0);
U32 flags = multi_select_flag | FIRST_SELECTED_ITEM;
for (selected_items_t::iterator item_itor = mSelectedItems.begin();
@@ -1822,6 +1822,14 @@ void LLFolderView::updateMenuOptions(LLMenuGL* menu)
flags = multi_select_flag;
}
+ // This adds a check for restrictions based on the entire
+ // selection set - for example, any one wearable may not push you
+ // over the limit, but all wearables together still might.
+ if (getFolderViewGroupedItemModel())
+ {
+ getFolderViewGroupedItemModel()->groupFilterContextMenu(mSelectedItems,*menu);
+ }
+
addNoOptions(menu);
}
diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h
index 08e0a6220a..114dd7bd2f 100755
--- a/indra/llui/llfolderview.h
+++ b/indra/llui/llfolderview.h
@@ -45,6 +45,7 @@
#include "llscrollcontainer.h"
class LLFolderViewModelInterface;
+class LLFolderViewGroupedItemModel;
class LLFolderViewFolder;
class LLFolderViewItem;
class LLFolderViewFilter;
@@ -93,6 +94,7 @@ public:
use_ellipses,
show_item_link_overlays;
Mandatory<LLFolderViewModelInterface*> view_model;
+ Optional<LLFolderViewGroupedItemModel*> grouped_item_model;
Mandatory<std::string> options_menu;
@@ -100,7 +102,7 @@ public:
};
friend class LLFolderViewScrollContainer;
- typedef std::deque<LLFolderViewItem*> selected_items_t;
+ typedef folder_view_item_deque selected_items_t;
LLFolderView(const Params&);
virtual ~LLFolderView( void );
@@ -113,6 +115,9 @@ public:
LLFolderViewModelInterface* getFolderViewModel() { return mViewModel; }
const LLFolderViewModelInterface* getFolderViewModel() const { return mViewModel; }
+ LLFolderViewGroupedItemModel* getFolderViewGroupedItemModel() { return mGroupedItemModel; }
+ const LLFolderViewGroupedItemModel* getFolderViewGroupedItemModel() const { return mGroupedItemModel; }
+
typedef boost::signals2::signal<void (const std::deque<LLFolderViewItem*>& items, BOOL user_action)> signal_t;
void setSelectCallback(const signal_t::slot_type& cb) { mSelectSignal.connect(cb); }
void setReshapeCallback(const signal_t::slot_type& cb) { mReshapeSignal.connect(cb); }
@@ -300,6 +305,7 @@ protected:
LLHandle<LLPanel> mParentPanel;
LLFolderViewModelInterface* mViewModel;
+ LLFolderViewGroupedItemModel* mGroupedItemModel;
/**
* Is used to determine if we need to cut text In LLFolderViewItem to avoid horizontal scroll.
diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h
index 0cd20a0f2d..5ad5731cad 100644..100755
--- a/indra/llui/llfolderviewitem.h
+++ b/indra/llui/llfolderviewitem.h
@@ -454,5 +454,12 @@ public:
template<typename SORT_FUNC> void sortItems(const SORT_FUNC& func) { mItems.sort(func); }
};
+typedef std::deque<LLFolderViewItem*> folder_view_item_deque;
+
+class LLFolderViewGroupedItemModel: public LLRefCount
+{
+public:
+ virtual void groupFilterContextMenu(folder_view_item_deque& selected_items, LLMenuGL& menu) = 0;
+};
#endif // LLFOLDERVIEWITEM_H