diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-08-12 12:51:00 +0100 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-08-12 12:51:00 +0100 |
commit | 6c79b8460027acf18bc40fb357a2b13ec86a1ccf (patch) | |
tree | 08ecdeea634abe75afed38e072d7e720c9ef2b3e /indra | |
parent | 11c498567443058b1516c25e1fcc197b4157c1ff (diff) | |
parent | 7a0b016c8c4b5c0e730ea6735205cfc84725737c (diff) |
merge from PE's viewer-release
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llpaneloutfitedit.cpp | 14 | ||||
-rw-r--r-- | indra/newview/llpaneloutfitedit.h | 2 | ||||
-rw-r--r-- | indra/newview/llwearableitemslist.cpp | 16 | ||||
-rw-r--r-- | indra/newview/llwearableitemslist.h | 20 |
4 files changed, 38 insertions, 14 deletions
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index d7a46f30b0..d76a5c586f 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -386,12 +386,26 @@ BOOL LLPanelOutfitEdit::postBuild() childSetAction(REVERT_BTN, boost::bind(&LLAppearanceMgr::wearBaseOutfit, LLAppearanceMgr::getInstance())); + /* + * By default AT_CLOTHING are sorted by (in in MY OUTFITS): + * - by type (types order determined in LLWearableType::EType) + * - each LLWearableType::EType by outer layer on top + * + * In Add More panel AT_CLOTHING should be sorted in a such way: + * - by type (types order determined in LLWearableType::EType) + * - each LLWearableType::EType by name (EXT-8205) + */ + mWearableListViewItemsComparator = new LLWearableItemTypeNameComparator(); + mWearableListViewItemsComparator->setOrder(LLAssetType::AT_CLOTHING, LLWearableItemTypeNameComparator::ORDER_RANG_1, false, true); + mWearablesListViewPanel = getChild<LLPanel>("filtered_wearables_panel"); mWearableItemsList = getChild<LLInventoryItemsList>("list_view"); mWearableItemsList->setCommitOnSelectionChange(true); mWearableItemsList->setCommitCallback(boost::bind(&LLPanelOutfitEdit::updatePlusButton, this)); mWearableItemsList->setDoubleClickCallback(boost::bind(&LLPanelOutfitEdit::onPlusBtnClicked, this)); + mWearableItemsList->setComparator(mWearableListViewItemsComparator); + mSaveComboBtn.reset(new LLSaveOutfitComboBtn(this)); return TRUE; } diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h index 5ce707e6eb..784c2bcad1 100644 --- a/indra/newview/llpaneloutfitedit.h +++ b/indra/newview/llpaneloutfitedit.h @@ -64,6 +64,7 @@ class LLMenuGL; class LLFindNonLinksByMask; class LLFindWearablesOfType; class LLSaveOutfitComboBtn; +class LLWearableItemTypeNameComparator; class LLPanelOutfitEdit : public LLPanel { @@ -222,6 +223,7 @@ private: LLFilteredWearableListManager* mWearableListManager; LLInventoryItemsList* mWearableItemsList; LLPanel* mWearablesListViewPanel; + LLWearableItemTypeNameComparator* mWearableListViewItemsComparator; LLCOFDragAndDropObserver* mCOFDragAndDropObserver; diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index fe8c09e329..5e23965f62 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -478,9 +478,9 @@ LLWearableItemTypeNameComparator::LLWearableItemTypeNameComparator() // 1. CLOTHING - sorted by name // 2. OBJECT - sorted by type // 3. BODYPART - sorted by name - mWearableOrder[LLAssetType::AT_CLOTHING] = LLWearableTypeOrder(ORDER_RANK_1, false, false); - mWearableOrder[LLAssetType::AT_OBJECT] = LLWearableTypeOrder(ORDER_RANK_2, true, true); - mWearableOrder[LLAssetType::AT_BODYPART] = LLWearableTypeOrder(ORDER_RANK_3, false, true); + mWearableOrder[LLAssetType::AT_CLOTHING] = LLWearableTypeOrder(ORDER_RANG_1, false, false); + mWearableOrder[LLAssetType::AT_OBJECT] = LLWearableTypeOrder(ORDER_RANG_2, true, true); + mWearableOrder[LLAssetType::AT_BODYPART] = LLWearableTypeOrder(ORDER_RANG_3, false, true); } void LLWearableItemTypeNameComparator::setOrder(LLAssetType::EType items_of_type, LLWearableItemTypeNameComparator::ETypeListOrder order_priority, bool sort_asset_items_by_name, bool sort_wearable_items_by_name) @@ -527,6 +527,8 @@ bool LLWearableItemTypeNameComparator::doCompare(const LLPanelInventoryListItemB const LLWearableType::EType item_wearable_type2 = wearable_item2->getWearableType(); if (item_wearable_type1 != item_wearable_type2) + // If items are of different LLWearableType::EType types they are compared + // by LLWearableType::EType. types order determined in LLWearableType::EType. { // If items are of different LLWearableType::EType types they are compared // by LLWearableType::EType. types order determined in LLWearableType::EType. @@ -549,10 +551,11 @@ LLWearableItemTypeNameComparator::ETypeListOrder LLWearableItemTypeNameComparato { wearable_type_order_map_t::const_iterator const_it = mWearableOrder.find(item_type); + if(const_it == mWearableOrder.end()) { llwarns<<"Absent information about order rang of items of "<<LLAssetType::getDesc(item_type)<<" type"<<llendl; - return ORDER_RANK_UNKNOWN; + return ORDER_RANG_UNKNOWN; } return const_it->second.mOrderPriority; @@ -562,25 +565,30 @@ bool LLWearableItemTypeNameComparator::sortAssetTypeByName(LLAssetType::EType it { wearable_type_order_map_t::const_iterator const_it = mWearableOrder.find(item_type); + if(const_it == mWearableOrder.end()) { llwarns<<"Absent information about sorting items of "<<LLAssetType::getDesc(item_type)<<" type"<<llendl; return true; } + return const_it->second.mSortAssetTypeByName; } + bool LLWearableItemTypeNameComparator::sortWearableTypeByName(LLAssetType::EType item_type) const { wearable_type_order_map_t::const_iterator const_it = mWearableOrder.find(item_type); + if(const_it == mWearableOrder.end()) { llwarns<<"Absent information about sorting items of "<<LLAssetType::getDesc(item_type)<<" type"<<llendl; return true; } + return const_it->second.mSortWearableTypeByName; } ////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h index f2f81968ee..237ba1af43 100644 --- a/indra/newview/llwearableitemslist.h +++ b/indra/newview/llwearableitemslist.h @@ -313,10 +313,10 @@ public: enum ETypeListOrder { - ORDER_RANK_1 = 1, - ORDER_RANK_2, - ORDER_RANK_3, - ORDER_RANK_UNKNOWN + ORDER_RANG_1 = 1, + ORDER_RANG_2, + ORDER_RANG_3, + ORDER_RANG_UNKNOWN }; void setOrder(LLAssetType::EType items_of_type, ETypeListOrder order_priority, bool sort_items_by_name, bool sort_wearable_items_by_name); @@ -325,15 +325,15 @@ protected: /** * All information about sort order is stored in mWearableOrder map * - * mWearableOrder : KYES VALUES + * mWearableOrder : KEYES VALUES * [LLAssetType] [struct LLWearableTypeOrder] * *--------------------------------------------------------------------------------------------- - * I. Determines order (ORDER_RANK) in which items of LLAssetType should be displayed in list. + * I. Determines order (ORDER_RANG) in which items of LLAssetType should be displayed in list. * For example by spec in MY OUTFITS the order is: - * 1. AT_CLOTHING (ORDER_RANK_1) - * 2. AT_OBJECT (ORDER_RANK_2) - * 3. AT_BODYPART (ORDER_RANK_3) + * 1. AT_CLOTHING (ORDER_RANG_1) + * 2. AT_OBJECT (ORDER_RANG_2) + * 3. AT_BODYPART (ORDER_RANG_3) * * II.Items of each type(LLAssetType) are sorted by name or type(LLWearableType) * For example by spec in MY OUTFITS the order within each items type(LLAssetType) is: @@ -346,7 +346,7 @@ protected: * * For each LLAssetType (KEYS in mWearableOrder) the information about: * - * I. ORDER_RANK (the flag is LLWearableTypeOrder::mOrderPriority) + * I. ORDER_RANG (the flag is LLWearableTypeOrder::mOrderPriority) * * II. whether items of this LLAssetType type should be ordered * by name or by LLWearableType::EType (the flag is LLWearableTypeOrder::mSortAssetTypeByName) |