From d44e5b7d9cd22e372ce19aa1d4f62904d13ed97e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 6 Mar 2015 15:57:11 -0500 Subject: SL-103 WIP - comment re: possible future work --- indra/llui/llfolderview.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 474b545f00..3ec92cb6e7 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -1809,7 +1809,9 @@ void LLFolderView::updateMenuOptions(LLMenuGL* menu) } // Successively filter out invalid options - + // FIXME this item-by-item approach does not allow options to be enabled/disabled based on the selection as a whole - for example, + // if avatar has room for one more wearable, and the selection includes two wearables, add should be disabled. + // llwearableitemslist.cpp has a more holistic approach here. 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(); -- cgit v1.2.3 From 64511ce28f4c3740fe7f87d680722105f83f82c0 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 6 Mar 2015 16:05:47 -0500 Subject: SL-103 WIP - comment --- indra/llui/llfolderview.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 3ec92cb6e7..26cb90505d 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -1808,10 +1808,15 @@ void LLFolderView::updateMenuOptions(LLMenuGL* menu) (*menu_itor)->setEnabled(TRUE); } + + // FIXME this item-by-item approach does not allow options to be + // enabled/disabled based on the selection as a whole - for + // example, if avatar has room for one more wearable, and the + // selection includes two wearables, add should be disabled. + // canAddWearables() in llwearableitemslist.cpp has a more + // holistic approach to this. + // Successively filter out invalid options - // FIXME this item-by-item approach does not allow options to be enabled/disabled based on the selection as a whole - for example, - // if avatar has room for one more wearable, and the selection includes two wearables, add should be disabled. - // llwearableitemslist.cpp has a more holistic approach here. 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(); -- cgit v1.2.3 From fb072c91485a484e3d0740113ee753b58c439900 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 13 Mar 2015 16:38:23 -0400 Subject: MAINT-4980 WIP - add context menu filtering based on the selection group --- indra/llui/llfolderview.cpp | 16 +++++++++++++++- indra/llui/llfolderview.h | 8 +++++++- indra/llui/llfolderviewitem.h | 7 +++++++ 3 files changed, 29 insertions(+), 2 deletions(-) mode change 100644 => 100755 indra/llui/llfolderviewitem.h (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 26cb90505d..7f0d486981 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -171,7 +171,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; @@ -1828,6 +1829,19 @@ void LLFolderView::updateMenuOptions(LLMenuGL* menu) flags = multi_select_flag; } + if (getFolderViewGroupedItemModel()) + { + getFolderViewGroupedItemModel()->groupFilterContextMenu(mSelectedItems,*menu); + } +#if 0 + selected_items_t::iterator item_itor = mSelectedItems.begin(); + if (item_itor != mSelectedItems.end()) + { + LLFolderViewItem* selected_item = (*item_itor); + selected_item->getViewModelItem()->groupFilterContextMenu(mSelectedItems,*menu); + } +#endif + 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 view_model; + Optional grouped_item_model; Mandatory options_menu; @@ -100,7 +102,7 @@ public: }; friend class LLFolderViewScrollContainer; - typedef std::deque 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& 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 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 old mode 100644 new mode 100755 index 0cd20a0f2d..5ad5731cad --- a/indra/llui/llfolderviewitem.h +++ b/indra/llui/llfolderviewitem.h @@ -454,5 +454,12 @@ public: template void sortItems(const SORT_FUNC& func) { mItems.sort(func); } }; +typedef std::deque folder_view_item_deque; + +class LLFolderViewGroupedItemModel: public LLRefCount +{ +public: + virtual void groupFilterContextMenu(folder_view_item_deque& selected_items, LLMenuGL& menu) = 0; +}; #endif // LLFOLDERVIEWITEM_H -- cgit v1.2.3 From dd7f0e2954a80e39eba50b7a06e167a50a248632 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 13 Mar 2015 16:55:19 -0400 Subject: MAINT-4980 WIP - moved canAddWearables() to LLAppearanceMgr --- indra/llui/llfolderview.cpp | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 7f0d486981..0fb163c73a 100755 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -1809,14 +1809,6 @@ void LLFolderView::updateMenuOptions(LLMenuGL* menu) (*menu_itor)->setEnabled(TRUE); } - - // FIXME this item-by-item approach does not allow options to be - // enabled/disabled based on the selection as a whole - for - // example, if avatar has room for one more wearable, and the - // selection includes two wearables, add should be disabled. - // canAddWearables() in llwearableitemslist.cpp has a more - // holistic approach to this. - // 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; @@ -1829,19 +1821,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); } -#if 0 - selected_items_t::iterator item_itor = mSelectedItems.begin(); - if (item_itor != mSelectedItems.end()) - { - LLFolderViewItem* selected_item = (*item_itor); - selected_item->getViewModelItem()->groupFilterContextMenu(mSelectedItems,*menu); - } -#endif - + addNoOptions(menu); } -- cgit v1.2.3