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 From 107b9bcb70e785c2d12515e38b8b296eea7ab8d8 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 20 May 2015 10:56:09 -0400 Subject: MAINT-5232: Introduce SUBSYSTEM_CLEANUP() macro and use it for existing LLSomeClass::cleanupClass() calls. This logs the fact of making the call, as well as making it. --- indra/llui/llui.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index aabc7ed2e4..cc186f4997 100755 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -60,6 +60,7 @@ #include "llflyoutbutton.h" #include "llsearcheditor.h" #include "lltoolbar.h" +#include "llcleanup.h" // for XUIParse #include "llquaternion.h" @@ -208,7 +209,7 @@ void LLUI::initClass(const settings_map_t& settings, void LLUI::cleanupClass() { - LLRender2D::cleanupClass(); + SUBSYSTEM_CLEANUP(LLRender2D); } void LLUI::setPopupFuncs(const add_popup_t& add_popup, const remove_popup_t& remove_popup, const clear_popups_t& clear_popups) -- cgit v1.2.3 From 430263746424bd0a7c6647d25d9d1db5eca2e8c0 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 23 May 2015 12:41:47 -0400 Subject: MAINT-5232: Make gMessageSystem an LLPounceable. This will permit other subsystems to use gMessageSystem.callWhenReady() to (e.g.) register callbacks as soon as gMessageSystem is fully initialized. --- indra/llui/tests/llurlentry_stub.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/tests/llurlentry_stub.cpp b/indra/llui/tests/llurlentry_stub.cpp index 5d3f9ac327..d28f601009 100755 --- a/indra/llui/tests/llurlentry_stub.cpp +++ b/indra/llui/tests/llurlentry_stub.cpp @@ -31,6 +31,7 @@ #include "llcachename.h" #include "lluuid.h" #include "message.h" +#include "llpounceable.h" #include @@ -167,7 +168,7 @@ char const* const _PREHASH_AgentID = (char *)"AgentID"; LLHost LLHost::invalid(INVALID_PORT,INVALID_HOST_IP_ADDRESS); -LLMessageSystem* gMessageSystem = NULL; +LLPounceable gMessageSystem; // // Stub implementation for LLMessageSystem -- cgit v1.2.3 From 9f962c03bf9080d67a8ea10aa53289c841fea781 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 27 May 2015 16:41:10 -0400 Subject: MAINT-5232: Extract LLInitClass, LLDestroyClass from llui/llui.h to a new llcommon/llinitdestroyclass.h. This mechanism is so general -- but has so many related moving parts -- that (a) it deserves to be in a header file all its own, instead of conflated with llui.h, and (b) it should be in llcommon where anyone can use it. It has no dependencies whatsoever on llui or anything viewer-specific. In this very changeset we changed one #include "llui.h" whose comment admits that it was only dragged in for LLDestroyClass. --- indra/llui/llspellcheck.h | 1 + indra/llui/llui.h | 89 ----------------------------------------------- 2 files changed, 1 insertion(+), 89 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llspellcheck.h b/indra/llui/llspellcheck.h index 4ab80195ea..5ecc9aa110 100755 --- a/indra/llui/llspellcheck.h +++ b/indra/llui/llspellcheck.h @@ -29,6 +29,7 @@ #include "llsingleton.h" #include "llui.h" +#include "llinitdestroyclass.h" #include class Hunspell; diff --git a/indra/llui/llui.h b/indra/llui/llui.h index c727f75c4f..d7151dbee9 100755 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -344,95 +344,6 @@ private: // Moved LLLocalClipRect to lllocalcliprect.h -class LLCallbackRegistry -{ -public: - typedef boost::signals2::signal callback_signal_t; - - void registerCallback(const callback_signal_t::slot_type& slot) - { - mCallbacks.connect(slot); - } - - void fireCallbacks() - { - mCallbacks(); - } - -private: - callback_signal_t mCallbacks; -}; - -class LLInitClassList : - public LLCallbackRegistry, - public LLSingleton -{ - friend class LLSingleton; -private: - LLInitClassList() {} -}; - -class LLDestroyClassList : - public LLCallbackRegistry, - public LLSingleton -{ - friend class LLSingleton; -private: - LLDestroyClassList() {} -}; - -template -class LLRegisterWith -{ -public: - LLRegisterWith(boost::function func) - { - T::instance().registerCallback(func); - } - - // this avoids a MSVC bug where non-referenced static members are "optimized" away - // even if their constructors have side effects - S32 reference() - { - S32 dummy; - dummy = 0; - return dummy; - } -}; - -template -class LLInitClass -{ -public: - LLInitClass() { sRegister.reference(); } - - static LLRegisterWith sRegister; -private: - - static void initClass() - { - LL_ERRS() << "No static initClass() method defined for " << typeid(T).name() << LL_ENDL; - } -}; - -template -class LLDestroyClass -{ -public: - LLDestroyClass() { sRegister.reference(); } - - static LLRegisterWith sRegister; -private: - - static void destroyClass() - { - LL_ERRS() << "No static destroyClass() method defined for " << typeid(T).name() << LL_ENDL; - } -}; - -template LLRegisterWith LLInitClass::sRegister(&T::initClass); -template LLRegisterWith LLDestroyClass::sRegister(&T::destroyClass); - // useful parameter blocks struct TimeIntervalParam : public LLInitParam::ChoiceBlock { -- cgit v1.2.3