From 6a02f5bbcec2b1a530ceeacb0dc564cfeb7cbc7f Mon Sep 17 00:00:00 2001 From: pavelkproductengine Date: Fri, 11 Dec 2015 19:58:08 +0200 Subject: Initial version of Visual Outfit Browser --- indra/newview/lloutfitslist.h | 204 +++++++++++++++++++++++++++++++++--------- 1 file changed, 163 insertions(+), 41 deletions(-) (limited to 'indra/newview/lloutfitslist.h') diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index 2e3fb3f488..f4b02991e5 100755 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -32,11 +32,14 @@ // newview #include "llinventorymodel.h" +#include "lllistcontextmenu.h" #include "llpanelappearancetab.h" +#include "lltoggleablemenu.h" +#include "llviewermenu.h" class LLAccordionCtrlTab; class LLInventoryCategoriesObserver; -class LLOutfitListGearMenu; +class LLOutfitListGearMenuBase; class LLWearableItemsList; class LLListContextMenu; @@ -57,6 +60,134 @@ public: /*virtual*/ bool compare(const LLAccordionCtrlTab* tab1, const LLAccordionCtrlTab* tab2) const; }; +class LLOutfitListBase : public LLPanelAppearanceTab +{ +public: + typedef boost::function selection_change_callback_t; + typedef boost::signals2::signal selection_change_signal_t; + + LLOutfitListBase(); + virtual ~LLOutfitListBase(); + + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& info); + + void refreshList(const LLUUID& category_id); + void computeDifference(const LLInventoryModel::cat_array_t& vcats, uuid_vec_t& vadded, uuid_vec_t& vremoved); + // highlights currently worn outfit in list and unhighlights previously worn + void highlightBaseOutfit(); + void ñhangeOutfitSelection(LLWearableItemsList* list, const LLUUID& category_id); + + + virtual void getCurrentCategories(uuid_vec_t& vcur) = 0; + virtual void updateAddedCategory(LLUUID cat_id) = 0; + virtual void updateRemovedCategory(LLUUID cat_id) = 0; + virtual void updateChangedCategoryName(LLViewerInventoryCategory *cat, std::string name) = 0; + virtual void sortOutfits(); + + void removeSelected(); + void setSelectedOutfitByUUID(const LLUUID& outfit_uuid); + const LLUUID& getSelectedOutfitUUID() const { return mSelectedOutfitUUID; } + boost::signals2::connection setSelectionChangeCallback(selection_change_callback_t cb); + void outfitRightClickCallBack(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id); + + virtual bool isActionEnabled(const LLSD& userdata); + virtual void performAction(std::string action); + virtual bool hasItemSelected() = 0; + virtual bool canWearSelected() = 0; + + void signalSelectionOutfitUUID(const LLUUID& category_id); + + void collapseAllFolders(); + virtual void onCollapseAllFolders() = 0; + + void expandAllFolders(); + virtual void onExpandAllFolders() = 0; + + virtual bool getHasExpandableFolders() = 0; + +protected: + virtual LLOutfitListGearMenuBase* createGearMenu() = 0; + virtual void onHighlightBaseOutfit(LLUUID base_id, LLUUID prev_id) = 0; + virtual void onSetSelectedOutfitByUUID(const LLUUID& outfit_uuid) = 0; + virtual void onOutfitRightClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id) = 0; + void onOutfitsRemovalConfirmation(const LLSD& notification, const LLSD& response); + virtual void onChangeOutfitSelection(LLWearableItemsList* list, const LLUUID& category_id) = 0; + + bool mIsInitialized; + LLInventoryCategoriesObserver* mCategoriesObserver; + LLUUID mSelectedOutfitUUID; + // id of currently highlited outfit + LLUUID mHighlightedOutfitUUID; + selection_change_signal_t mSelectionChangeSignal; + LLListContextMenu* mOutfitMenu; + LLOutfitListGearMenuBase* mGearMenu; +}; + +////////////////////////////////////////////////////////////////////////// + +class LLOutfitContextMenu : public LLListContextMenu +{ +public: + + LLOutfitContextMenu(LLOutfitListBase* outfit_list) + : LLListContextMenu(), + mOutfitList(outfit_list) + {} +protected: + /* virtual */ LLContextMenu* createMenu(); + + bool onEnable(LLSD::String param); + + bool onVisible(LLSD::String param); + + static void editOutfit(); + + static void renameOutfit(const LLUUID& outfit_cat_id); + +private: + LLOutfitListBase* mOutfitList; +}; + +class LLOutfitListGearMenuBase +{ +public: + LLOutfitListGearMenuBase(LLOutfitListBase* olist); + + void updateItemsVisibility(); + + LLToggleableMenu* getMenu(); + +protected: + virtual void onUpdateItemsVisibility(); + virtual void onUploadFoto(); + virtual void onLoadAssets(); + const LLUUID& getSelectedOutfitID(); + + LLOutfitListBase* mOutfitList; + LLToggleableMenu* mMenu; +private: + + LLViewerInventoryCategory* getSelectedOutfit(); + + void onWear(); + void onAdd(); + void onTakeOff(); + void onRename(); + void onCreate(const LLSD& data); + bool onEnable(LLSD::String param); + bool onVisible(LLSD::String param); +}; + +class LLOutfitListGearMenu : public LLOutfitListGearMenuBase +{ +public: + LLOutfitListGearMenu(LLOutfitListBase* olist); + +protected: + /*virtual*/ void onUpdateItemsVisibility(); +}; + /** * @class LLOutfitsList * @@ -66,11 +197,9 @@ public: * * Starts fetching necessary inventory content on first opening. */ -class LLOutfitsList : public LLPanelAppearanceTab +class LLOutfitsList : public LLOutfitListBase { public: - typedef boost::function selection_change_callback_t; - typedef boost::signals2::signal selection_change_signal_t; LLOutfitsList(); virtual ~LLOutfitsList(); @@ -79,74 +208,72 @@ public: /*virtual*/ void onOpen(const LLSD& info); - void refreshList(const LLUUID& category_id); - - // highlits currently worn outfit tab text and unhighlights previously worn - void highlightBaseOutfit(); - void performAction(std::string action); + //virtual void refreshList(const LLUUID& category_id); - void removeSelected(); + /*virtual*/ void updateAddedCategory(LLUUID cat_id); + /*virtual*/ void updateRemovedCategory(LLUUID cat_id); - void setSelectedOutfitByUUID(const LLUUID& outfit_uuid); + // highlits currently worn outfit tab text and unhighlights previously worn + /*virtual*/ void onHighlightBaseOutfit(LLUUID base_id, LLUUID prev_id); - /*virtual*/ void setFilterSubString(const std::string& string); + //void performAction(std::string action); - /*virtual*/ bool isActionEnabled(const LLSD& userdata); - const LLUUID& getSelectedOutfitUUID() const { return mSelectedOutfitUUID; } + /*virtual*/ void setFilterSubString(const std::string& string); /*virtual*/ void getSelectedItemsUUIDs(uuid_vec_t& selected_uuids) const; - boost::signals2::connection setSelectionChangeCallback(selection_change_callback_t cb); - - // Collects selected items from all selected lists and wears them(if possible- adds, else replaces) + // Collects selected items from all selected lists and wears them(if possible- adds, else replaces) void wearSelectedItems(); /** * Returns true if there is a selection inside currently selected outfit */ - bool hasItemSelected(); + /*virtual*/ bool hasItemSelected(); /** Collapses all outfit accordions. */ - void collapse_all_folders(); + /*virtual*/ void onCollapseAllFolders(); /** Expands all outfit accordions. */ - void expand_all_folders(); + void onExpandAllFolders(); + /*virtual*/ bool getHasExpandableFolders() { return TRUE; } -private: +protected: + LLOutfitListGearMenuBase* createGearMenu(); - void onOutfitsRemovalConfirmation(const LLSD& notification, const LLSD& response); +private: /** * Wrapper for LLCommonUtils::computeDifference. @see LLCommonUtils::computeDifference */ - void computeDifference(const LLInventoryModel::cat_array_t& vcats, uuid_vec_t& vadded, uuid_vec_t& vremoved); + //void computeDifference(const LLInventoryModel::cat_array_t& vcats, uuid_vec_t& vadded, uuid_vec_t& vremoved); + + void getCurrentCategories(uuid_vec_t& vcur); /** * Updates tab displaying outfit identified by category_id. */ - void updateOutfitTab(const LLUUID& category_id); + /*virtual*/ void updateChangedCategoryName(LLViewerInventoryCategory *cat, std::string name); + + /*virtual*/ void sortOutfits(); + + /*virtual*/ void onSetSelectedOutfitByUUID(const LLUUID& outfit_uuid); /** * Resets previous selection and stores newly selected list and outfit id. */ - void changeOutfitSelection(LLWearableItemsList* list, const LLUUID& category_id); + /*virtual*/ void onChangeOutfitSelection(LLWearableItemsList* list, const LLUUID& category_id); /** *Resets items selection inside outfit */ void resetItemSelection(LLWearableItemsList* list, const LLUUID& category_id); - /** - * Saves newly selected outfit ID. - */ - void setSelectedOutfitUUID(const LLUUID& category_id); - /** * Removes the outfit from selection. */ @@ -182,15 +309,16 @@ private: */ bool canWearSelected(); - void onAccordionTabRightClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id); void onWearableItemsListRightClick(LLUICtrl* ctrl, S32 x, S32 y); void onCOFChanged(); - void onSelectionChange(LLUICtrl* ctrl); + void onListSelectionChange(LLUICtrl* ctrl); + + /*virtual*/ void onOutfitRightClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id); static void onOutfitRename(const LLSD& notification, const LLSD& response); - LLInventoryCategoriesObserver* mCategoriesObserver; + //LLInventoryCategoriesObserver* mCategoriesObserver; LLAccordionCtrl* mAccordion; LLPanel* mListCommands; @@ -199,11 +327,6 @@ private: typedef wearables_lists_map_t::value_type wearables_lists_map_value_t; wearables_lists_map_t mSelectedListsMap; - LLUUID mSelectedOutfitUUID; - // id of currently highlited outfit - LLUUID mHighlightedOutfitUUID; - selection_change_signal_t mSelectionChangeSignal; - typedef std::map outfits_map_t; typedef outfits_map_t::value_type outfits_map_value_t; outfits_map_t mOutfitsMap; @@ -212,10 +335,9 @@ private: // Used to monitor COF changes for updating items worn state. See EXT-8636. uuid_vec_t mCOFLinkedItems; - LLOutfitListGearMenu* mGearMenu; - LLListContextMenu* mOutfitMenu; + //LLOutfitListGearMenu* mGearMenu; - bool mIsInitialized; + //bool mIsInitialized; /** * True if there is a selection inside currently selected outfit */ -- cgit v1.2.3 From 5b76576a5a4bde9ae21c080bd612e84d6130ac99 Mon Sep 17 00:00:00 2001 From: pavelkproductengine Date: Thu, 4 Feb 2016 18:56:04 +0200 Subject: MAINT-5194 Visual Outfit Browser Fixed Mac specific build issues --- indra/newview/lloutfitslist.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/lloutfitslist.h') diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index f4b02991e5..9495866d73 100755 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -76,7 +76,7 @@ public: void computeDifference(const LLInventoryModel::cat_array_t& vcats, uuid_vec_t& vadded, uuid_vec_t& vremoved); // highlights currently worn outfit in list and unhighlights previously worn void highlightBaseOutfit(); - void ñhangeOutfitSelection(LLWearableItemsList* list, const LLUUID& category_id); + void ChangeOutfitSelection(LLWearableItemsList* list, const LLUUID& category_id); virtual void getCurrentCategories(uuid_vec_t& vcur) = 0; @@ -153,7 +153,8 @@ class LLOutfitListGearMenuBase { public: LLOutfitListGearMenuBase(LLOutfitListBase* olist); - + virtual ~LLOutfitListGearMenuBase(); + void updateItemsVisibility(); LLToggleableMenu* getMenu(); @@ -183,6 +184,7 @@ class LLOutfitListGearMenu : public LLOutfitListGearMenuBase { public: LLOutfitListGearMenu(LLOutfitListBase* olist); + virtual ~LLOutfitListGearMenu(); protected: /*virtual*/ void onUpdateItemsVisibility(); -- cgit v1.2.3 From 7ca8e984be40e68c01d2b54092629d41b4df4e46 Mon Sep 17 00:00:00 2001 From: pavelkproductengine Date: Fri, 4 Mar 2016 19:41:01 +0200 Subject: MAINT-5194 Visual Outfit Browser 1) Made code clean-up 2) Removed constants in code via #define and introduced parametres which can ne set in XML instead 3) Made refactoring of some methods 4) Removed non-functional item "Load assets" from outfit gear-menu --- indra/newview/lloutfitslist.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/lloutfitslist.h') diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index 9495866d73..6db3efa70d 100755 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -96,6 +96,8 @@ public: virtual bool hasItemSelected() = 0; virtual bool canWearSelected() = 0; + virtual void deselectOutfit(const LLUUID& category_id); + void signalSelectionOutfitUUID(const LLUUID& category_id); void collapseAllFolders(); @@ -162,7 +164,6 @@ public: protected: virtual void onUpdateItemsVisibility(); virtual void onUploadFoto(); - virtual void onLoadAssets(); const LLUUID& getSelectedOutfitID(); LLOutfitListBase* mOutfitList; @@ -279,7 +280,7 @@ private: /** * Removes the outfit from selection. */ - void deselectOutfit(const LLUUID& category_id); + /*virtual*/ void deselectOutfit(const LLUUID& category_id); /** * Try restoring selection for a temporary hidden tab. -- cgit v1.2.3 From 808b8ed01849fc6e2cd5caba68843eebcadc5333 Mon Sep 17 00:00:00 2001 From: pavelkproductengine Date: Tue, 5 Apr 2016 17:44:53 +0300 Subject: MAINT-6228 Update Photo/Image Upload feature for Outfit Browser 1) Added "Select Photo" to outfit gear menu 2) Incorporated Texture Picker --- indra/newview/lloutfitslist.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/lloutfitslist.h') diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index 6db3efa70d..d7c549c417 100755 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -164,6 +164,8 @@ public: protected: virtual void onUpdateItemsVisibility(); virtual void onUploadFoto(); + virtual void onSelectPhoto(); + const LLUUID& getSelectedOutfitID(); LLOutfitListBase* mOutfitList; -- cgit v1.2.3 From 4125bebce7116e074aef664026b9ed33ffa9ca19 Mon Sep 17 00:00:00 2001 From: pavelkproductengine Date: Fri, 29 Apr 2016 20:28:11 +0300 Subject: MAINT-6226 Incorporate a customized Snapshot feature to Outfit Browser flow Initial version, further refactoring pending --- indra/newview/lloutfitslist.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/lloutfitslist.h') diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index d7c549c417..696a18a36a 100755 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -165,6 +165,7 @@ protected: virtual void onUpdateItemsVisibility(); virtual void onUploadFoto(); virtual void onSelectPhoto(); + virtual void onTakeSnapshot(); const LLUUID& getSelectedOutfitID(); -- cgit v1.2.3 From 3cbab4d820963565c23f72e0bb6efd519c97462d Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Mon, 6 Jun 2016 16:47:09 +0300 Subject: MAINT-6474 FIXED No easy way to remove an image from a VOB Folder --- indra/newview/lloutfitslist.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/lloutfitslist.h') diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index 696a18a36a..c4dd2cd075 100644 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -166,6 +166,7 @@ protected: virtual void onUploadFoto(); virtual void onSelectPhoto(); virtual void onTakeSnapshot(); + virtual void onRemovePhoto(); const LLUUID& getSelectedOutfitID(); -- cgit v1.2.3 From 554db00bdf20692f58c3eb42b83731011e9ad119 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 10 Jun 2016 18:04:16 +0300 Subject: MAINT-6475 Add menu item for changing sort priority --- indra/newview/lloutfitslist.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/lloutfitslist.h') diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index c4dd2cd075..81be8de94f 100644 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -167,6 +167,7 @@ protected: virtual void onSelectPhoto(); virtual void onTakeSnapshot(); virtual void onRemovePhoto(); + virtual void onChangeSortOrder(); const LLUUID& getSelectedOutfitID(); -- cgit v1.2.3