From 2ce7556e53544e50a4d4d28705976655cafa6992 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Wed, 21 Apr 2010 15:44:24 +0300 Subject: Implemented by SL EXT-6722(normal task) - Create modified inventory view for "my outfits" tab in top-level appearance sidebar (tier 1) llui: - Setting container panel for accordion tab control to dynamically add tabs to accordions. - Added method to dynamically remove accordion tabs. - Added LLIconCtrl image setter. newview: - Class LLOutfitsList - a list of agents's outfits from "My Outfits" inventory category which represents each outfit by an accordion tab with a list of items inside it. - Class LLWearableItemsList - a list of wearable items used in each accordion tab of "My Outfits" tab. - Class LLInventoryItemsList - a base class for LLWearableItemsList that represents inventory items by panels in LLFlatListView. - Class LLPanelInventoryItem - inventory item representation for a flat list. Item icon is set according to item type. - Class LLInventoryCategoriesObserver - an observer used in LLOutfitsList for monitoring changes to "My Outfits" inventory category and updating outfits accordion tabs and list of items for each outfit. Known issues: - Only first outfit tab is displayed in "My Outfits" until this tab is expanded. - Bottom bar buttons and filter field not functioning for "My Outfits" tab since LLOutfitsList still doesn't support selection, filtering and sorting. - "My Outfits" and "Wearing" tabs of "Appearance" side panel might need a common interface to use LLOutfitsList and LLinventoryPanel as tabs in LLPanelOutfitsInventory or "Wearing" tab should be replaces with LLOutfitsList class object i.e. a flat list. On review - https://codereview.productengine.com/secondlife/r/285/ --HG-- branch : product-engine --- indra/newview/llinventoryitemslist.h | 88 ++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 indra/newview/llinventoryitemslist.h (limited to 'indra/newview/llinventoryitemslist.h') diff --git a/indra/newview/llinventoryitemslist.h b/indra/newview/llinventoryitemslist.h new file mode 100644 index 0000000000..bba739dbbf --- /dev/null +++ b/indra/newview/llinventoryitemslist.h @@ -0,0 +1,88 @@ +/** + * @file llinventoryitemslist.h + * @brief A list of inventory items represented by LLFlatListView. + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLINVENTORYITEMSLIST_H +#define LL_LLINVENTORYITEMSLIST_H + +#include "llpanel.h" + +#include "llassettype.h" + +#include "llinventorytype.h" + +// newview +#include "llflatlistview.h" +#include "llinventorymodel.h" + +class LLIconCtrl; +class LLTextBox; + +class LLPanelInventoryItem : public LLPanel +{ +public: + LLPanelInventoryItem(LLAssetType::EType asset_type, + LLInventoryType::EType inventory_type, + U32 wearable_type, + const std::string &item_name, + const std::string &hl); + virtual ~LLPanelInventoryItem(); + + /*virtual*/ BOOL postBuild(); + /*virtual*/ void setValue(const LLSD& value); + + void updateItem(); + + void onMouseEnter(S32 x, S32 y, MASK mask); + void onMouseLeave(S32 x, S32 y, MASK mask); + +private: + LLIconCtrl* mIcon; + LLTextBox* mTitle; + + LLUIImagePtr mItemIcon; + std::string mItemName; + std::string mHighlightedText; +}; + + +class LLInventoryItemsList : public LLFlatListView +{ +public: + virtual ~LLInventoryItemsList(); + + void refreshList(const LLInventoryModel::item_array_t item_array); + +protected: + friend class LLUICtrlFactory; + LLInventoryItemsList(const LLFlatListView::Params& p); +}; + +#endif //LL_LLINVENTORYITEMSLIST_H -- cgit v1.2.3 From b15e2beabfc2987ba8d17b74014074ba313b5db7 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Thu, 22 Apr 2010 15:48:48 +0300 Subject: Implemented EXT-6724(normal task) - Implement flat list view of filtered inventory for "add wearables" panel of outfit editor 1. Modified LLInventoryItemsList - implemented delayed item construction. Items are added during draw, not more than 50 items will be added in single draw. This lets us reduce system overload during multiple panel construction. 2. Implemented LLFilteredWearableListManager to populate inventory flat list with data. This class filters entire inventory according to specified filter and populates specified inventory list with data. 3. Created LLCommonUtil::computeDifference() to avoid code copy-pasting(will use it in all appropriate places in next review request) Reviewed by Mike Antipov - https://codereview.productengine.com/secondlife/r/301/ --HG-- branch : product-engine --- indra/newview/llinventoryitemslist.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'indra/newview/llinventoryitemslist.h') diff --git a/indra/newview/llinventoryitemslist.h b/indra/newview/llinventoryitemslist.h index bba739dbbf..0ca4146867 100644 --- a/indra/newview/llinventoryitemslist.h +++ b/indra/newview/llinventoryitemslist.h @@ -80,9 +80,43 @@ public: void refreshList(const LLInventoryModel::item_array_t item_array); + /** + * Let list know items need to be refreshed in next draw() + */ + void setNeedsRefresh(bool needs_refresh){ mNeedsRefresh = needs_refresh; } + + bool getNeedsRefresh(){ return mNeedsRefresh; } + + /*virtual*/ void draw(); + protected: friend class LLUICtrlFactory; LLInventoryItemsList(const LLFlatListView::Params& p); + + uuid_vec_t& getIDs() { return mIDs; } + + /** + * Refreshes list items, adds new items and removes deleted items. + * Called from draw() until all new items are added, , + * maximum 50 items can be added during single call. + */ + void refresh(); + + /** + * Compute difference between new items and current items, fills 'vadded' with added items, + * 'vremoved' with removed items. See LLCommonUtils::computeDifference + */ + void computeDifference(const uuid_vec_t& vnew, uuid_vec_t& vadded, uuid_vec_t& vremoved); + + /** + * Add an item to the list + */ + void addNewItem(LLViewerInventoryItem* item); + +private: + uuid_vec_t mIDs; // IDs of items that were added in refreshList(). + // Will be used in refresh() to determine added and removed ids + bool mNeedsRefresh; }; #endif //LL_LLINVENTORYITEMSLIST_H -- cgit v1.2.3 From fbfc85176670f3f948e6e2f00c8d8e37c96d5299 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Mon, 26 Apr 2010 18:56:28 +0300 Subject: (EXT-6722) Create modified inventory view for "my outfits" tab in top-level appearance sidebar (tier 1) llui: - Setting container panel for accordion tab control to dynamically add tabs to accordions. - Added method to dynamically remove accordion tabs. - Added LLIconCtrl image setter. newview: - Class LLOutfitsList - a list of agents's outfits from "My Outfits" inventory category which represents each outfit by an accordion tab with a list of items inside it. - Class LLWearableItemsList - a list of wearable items used in each accordion tab of "My Outfits" tab. - Class LLInventoryItemsList - a base class for LLWearableItemsList that represents inventory items by panels in LLFlatListView. - Class LLPanelInventoryItem - inventory item representation for a flat list. Item icon is set according to item type. - Class LLInventoryCategoriesObserver - an observer used in LLOutfitsList for monitoring changes to "My Outfits" inventory category and updating outfits accordion tabs and list of items for each outfit. Reviewed by Mike Antipov https://codereview.productengine.com/secondlife/r/285/ --HG-- branch : product-engine --- indra/newview/llinventoryitemslist.h | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) (limited to 'indra/newview/llinventoryitemslist.h') diff --git a/indra/newview/llinventoryitemslist.h b/indra/newview/llinventoryitemslist.h index 0ca4146867..b496f4b9e9 100644 --- a/indra/newview/llinventoryitemslist.h +++ b/indra/newview/llinventoryitemslist.h @@ -2,6 +2,10 @@ * @file llinventoryitemslist.h * @brief A list of inventory items represented by LLFlatListView. * + * Class LLInventoryItemsList implements a flat list of inventory items. + * Class LLPanelInventoryListItem displays inventory item as an element + * of LLInventoryItemsList. + * * $LicenseInfo:firstyear=2010&license=viewergpl$ * * Copyright (c) 2010, Linden Research, Inc. @@ -32,28 +36,23 @@ #ifndef LL_LLINVENTORYITEMSLIST_H #define LL_LLINVENTORYITEMSLIST_H -#include "llpanel.h" - -#include "llassettype.h" +#include "lldarray.h" -#include "llinventorytype.h" +#include "llpanel.h" // newview #include "llflatlistview.h" -#include "llinventorymodel.h" class LLIconCtrl; class LLTextBox; +class LLViewerInventoryItem; -class LLPanelInventoryItem : public LLPanel +class LLPanelInventoryListItem : public LLPanel { public: - LLPanelInventoryItem(LLAssetType::EType asset_type, - LLInventoryType::EType inventory_type, - U32 wearable_type, - const std::string &item_name, - const std::string &hl); - virtual ~LLPanelInventoryItem(); + static LLPanelInventoryListItem* createItemPanel(const LLViewerInventoryItem* item); + + virtual ~LLPanelInventoryListItem(); /*virtual*/ BOOL postBuild(); /*virtual*/ void setValue(const LLSD& value); @@ -63,6 +62,9 @@ public: void onMouseEnter(S32 x, S32 y, MASK mask); void onMouseLeave(S32 x, S32 y, MASK mask); +protected: + LLPanelInventoryListItem(const LLViewerInventoryItem* item); + private: LLIconCtrl* mIcon; LLTextBox* mTitle; @@ -72,13 +74,17 @@ private: std::string mHighlightedText; }; - class LLInventoryItemsList : public LLFlatListView { public: + struct Params : public LLInitParam::Block + { + Params(); + }; + virtual ~LLInventoryItemsList(); - void refreshList(const LLInventoryModel::item_array_t item_array); + void refreshList(const LLDynamicArray > item_array); /** * Let list know items need to be refreshed in next draw() @@ -91,7 +97,7 @@ public: protected: friend class LLUICtrlFactory; - LLInventoryItemsList(const LLFlatListView::Params& p); + LLInventoryItemsList(const LLInventoryItemsList::Params& p); uuid_vec_t& getIDs() { return mIDs; } -- cgit v1.2.3