diff options
Diffstat (limited to 'indra/newview/llpaneloutfitedit.cpp')
-rw-r--r-- | indra/newview/llpaneloutfitedit.cpp | 71 |
1 files changed, 22 insertions, 49 deletions
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index c09aff44da..8b9baef54a 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -283,8 +283,6 @@ LLPanelOutfitEdit::~LLPanelOutfitEdit() delete mCOFDragAndDropObserver; - delete mWearableListViewItemsComparator; - while (!mListViewItemTypes.empty()) { delete mListViewItemTypes.back(); mListViewItemTypes.pop_back(); @@ -388,24 +386,11 @@ 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_RANK_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; @@ -644,35 +629,24 @@ void LLPanelOutfitEdit::onShopButtonClicked() if (isAgentAvatarValid()) { // try to get wearable type from 'Add More' panel first (EXT-7639) - selection_info_t selection_info = getAddMorePanelSelectionType(); - - LLWearableType::EType type = selection_info.first; + LLWearableType::EType type = getAddMorePanelSelectionType(); - if (selection_info.second > 1) + if (type == LLWearableType::WT_NONE) { - // the second argument is not important in this case: generic market place will be opened - url = url_resolver.resolveURL(LLWearableType::WT_NONE, SEX_FEMALE); + type = getCOFWearablesSelectionType(); } - else - { - if (type == LLWearableType::WT_NONE) - { - type = getCOFWearablesSelectionType(); - } - ESex sex = gAgentAvatarp->getSex(); + ESex sex = gAgentAvatarp->getSex(); - // WT_INVALID comes for attachments - if (type != LLWearableType::WT_INVALID && type != LLWearableType::WT_NONE) - { - url = url_resolver.resolveURL(type, sex); - } + // WT_INVALID comes for attachments + if (type != LLWearableType::WT_INVALID && type != LLWearableType::WT_NONE) + { + url = url_resolver.resolveURL(type, sex); + } - if (url.empty()) - { - url = url_resolver.resolveURL( - mCOFWearables->getExpandedAccordionAssetType(), sex); - } + if (url.empty()) + { + url = url_resolver.resolveURL(mCOFWearables->getExpandedAccordionAssetType(), sex); } } else @@ -711,9 +685,9 @@ LLWearableType::EType LLPanelOutfitEdit::getCOFWearablesSelectionType() const return type; } -LLPanelOutfitEdit::selection_info_t LLPanelOutfitEdit::getAddMorePanelSelectionType() const +LLWearableType::EType LLPanelOutfitEdit::getAddMorePanelSelectionType() const { - selection_info_t result = std::make_pair(LLWearableType::WT_NONE, 0); + LLWearableType::EType type = LLWearableType::WT_NONE; if (mAddWearablesPanel != NULL && mAddWearablesPanel->getVisible()) { @@ -721,11 +695,9 @@ LLPanelOutfitEdit::selection_info_t LLPanelOutfitEdit::getAddMorePanelSelectionT { std::set<LLUUID> selected_uuids = mInventoryItemsPanel->getRootFolder()->getSelectionList(); - result.second = selected_uuids.size(); - - if (result.second == 1) + if (selected_uuids.size() == 1) { - result.first = getWearableTypeByItemUUID(*(selected_uuids.begin())); + type = getWearableTypeByItemUUID(*(selected_uuids.begin())); } } else if (mWearableItemsList != NULL && mWearableItemsList->getVisible()) @@ -733,16 +705,14 @@ LLPanelOutfitEdit::selection_info_t LLPanelOutfitEdit::getAddMorePanelSelectionT std::vector<LLUUID> selected_uuids; mWearableItemsList->getSelectedUUIDs(selected_uuids); - result.second = selected_uuids.size(); - - if (result.second == 1) + if (selected_uuids.size() == 1) { - result.first = getWearableTypeByItemUUID(selected_uuids.front()); + type = getWearableTypeByItemUUID(selected_uuids.front()); } } } - return result; + return type; } LLWearableType::EType LLPanelOutfitEdit::getWearableTypeByItemUUID(const LLUUID& item_uuid) const @@ -1129,6 +1099,9 @@ void LLPanelOutfitEdit::getSelectedItemsUUID(uuid_vec_t& uuid_list) void LLPanelOutfitEdit::onCOFChanged() { + //the panel is only updated when is visible to a user + if (!isInVisibleChain()) return; + update(); } |