From 694c6e1d84d20413f97dabf7bbca6a3d6b5c59f9 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 27 Apr 2020 19:58:24 +0300 Subject: SL-13119 Optimize initialization of inventory views --- indra/newview/llinventorypanel.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorypanel.h') diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index b55eb2b828..adca8ad3e2 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -325,8 +325,15 @@ protected: static LLUIColor sLibraryColor; static LLUIColor sLinkColor; - virtual LLFolderViewItem* buildNewViews(const LLUUID& id); - LLFolderViewItem* buildNewViews(const LLUUID& id, LLInventoryObject const* objectp); + LLFolderViewItem* buildNewViews(const LLUUID& id); + LLFolderViewItem* buildNewViews(const LLUUID& id, + LLInventoryObject const* objectp); + LLFolderViewItem* buildNewViews(const LLUUID& id, + LLInventoryObject const* objectp, + LLFolderViewItem *target_view); + // if certain types are not allowed, no reason to create views + virtual bool typedViewsFilter(const LLUUID& id, LLInventoryObject const* objectp) { return true; } + virtual void itemChanged(const LLUUID& item_id, U32 mask, const LLInventoryObject* model_item); BOOL getIsHiddenFolderType(LLFolderType::EType folder_type) const; @@ -334,6 +341,14 @@ protected: virtual LLFolderViewFolder* createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop); virtual LLFolderViewItem* createFolderViewItem(LLInvFVBridge * bridge); private: + // buildViewsTree does not include some checks and is meant + // for recursive use, use buildNewViews() for first call + LLFolderViewItem* buildViewsTree(const LLUUID& id, + const LLUUID& parent_id, + LLInventoryObject const* objectp, + LLFolderViewItem *target_view, + LLFolderViewFolder *parent_folder_view); + bool mBuildDefaultHierarchy; // default inventory hierarchy should be created in postBuild() bool mViewsInitialized; // Views have been generated }; -- cgit v1.2.3 From e1504d8c562d11d538bcbafc6ffd22d56ff38491 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 5 May 2020 19:08:55 +0300 Subject: SL-13178 Improve initial opening time of the landmarks floater --- indra/newview/llinventorypanel.h | 59 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) (limited to 'indra/newview/llinventorypanel.h') diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index adca8ad3e2..cd504392e6 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -353,4 +353,63 @@ private: bool mViewsInitialized; // Views have been generated }; + +class LLInventoryFavoriteItemsPanel : public LLInventoryPanel +{ +public: + struct Params : public LLInitParam::Block + {}; + + void initFromParams(const Params& p); + bool isSelectionRemovable() { return false; } + void setSelectCallback(const boost::function& items, BOOL user_action)>& cb); + +protected: + LLInventoryFavoriteItemsPanel(const Params& params); + ~LLInventoryFavoriteItemsPanel() { mFolderChangedSignal.disconnect(); } + void updateFavoritesRootFolder(); + + boost::signals2::connection mFolderChangedSignal; + boost::function& items, BOOL user_action)> mSelectionCallback; + friend class LLUICtrlFactory; +}; + +/************************************************************************/ +/* Asset Pre-Filtered Inventory Panel related class */ +/* Exchanges filter's flexibility for speed of generation and */ +/* improved performance */ +/************************************************************************/ + +class LLAssetFilteredInventoryPanel : public LLInventoryPanel +{ +public: + struct Params + : public LLInitParam::Block + { + Mandatory filter_asset_type; + + Params() : filter_asset_type("filter_asset_type") {} + }; + + void initFromParams(const Params& p); +protected: + LLAssetFilteredInventoryPanel(const Params& p) : LLInventoryPanel(p) {} + friend class LLUICtrlFactory; +public: + ~LLAssetFilteredInventoryPanel() {} + + /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept, + std::string& tooltip_msg) override; + +protected: + /*virtual*/ LLFolderViewItem* buildNewViews(const LLUUID& id) override; + /*virtual*/ void itemChanged(const LLUUID& item_id, U32 mask, const LLInventoryObject* model_item) override; + +private: + LLAssetType::EType mAssetType; +}; + #endif // LL_LLINVENTORYPANEL_H -- cgit v1.2.3 From 40418c388cac19ee11deb901fe23166d63e91ba9 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 5 May 2020 21:08:23 +0300 Subject: Fixed conflict caused by SL-13178 --- indra/newview/llinventorypanel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorypanel.h') diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index cd504392e6..c202333f45 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -405,7 +405,7 @@ public: std::string& tooltip_msg) override; protected: - /*virtual*/ LLFolderViewItem* buildNewViews(const LLUUID& id) override; + /*virtual*/ bool typedViewsFilter(const LLUUID& id, LLInventoryObject const* objectp) override; /*virtual*/ void itemChanged(const LLUUID& item_id, U32 mask, const LLInventoryObject* model_item) override; private: -- cgit v1.2.3 From fa887f18e1a251fb29b93880cefda463ea2baec4 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Tue, 22 Sep 2020 23:31:22 +0300 Subject: follow-up build fix --- indra/newview/llinventorypanel.h | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llinventorypanel.h') diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 07a91b312c..c202333f45 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -405,7 +405,6 @@ public: std::string& tooltip_msg) override; protected: - /*virtual*/ LLFolderViewItem* buildNewViews(const LLUUID& id) override; /*virtual*/ bool typedViewsFilter(const LLUUID& id, LLInventoryObject const* objectp) override; /*virtual*/ void itemChanged(const LLUUID& item_id, U32 mask, const LLInventoryObject* model_item) override; -- cgit v1.2.3