diff options
author | Mike Antipov <mantipov@productengine.com> | 2010-04-23 17:44:33 +0300 |
---|---|---|
committer | Mike Antipov <mantipov@productengine.com> | 2010-04-23 17:44:33 +0300 |
commit | 5dfc5d020c0497619ae23da61a45f6671903d02c (patch) | |
tree | 879a2486c9418e30086eb7a0b71823ae7c1dceaf /indra/newview/lloutfitslist.cpp | |
parent | 07b463722e3e87aaea608981a1020f1b482781ba (diff) |
Work on task EXT-6722 (Create modified inventory view for "my outfits" tab in top-level appearance sidebar)
Code improvements:
* Moved Accordion tab + Flat list into separate xml.
* Implemented dynamic creation of the accordion tab via xml
Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/312/
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/lloutfitslist.cpp')
-rw-r--r-- | indra/newview/lloutfitslist.cpp | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index ad42d80467..cce4f94028 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -168,26 +168,21 @@ void LLOutfitsList::refreshList(const LLUUID& category_id) std::string name = cat->getName(); - // *TODO: create accordion tabs and lists from XML. - LLAccordionCtrlTab::Params params; - params.name(name); - params.title(name); - params.rect(LLRect(0, 0, 315, 20)); - params.display_children(false); - LLAccordionCtrlTab* tab = LLUICtrlFactory::create<LLAccordionCtrlTab>(params); + static LLXMLNodePtr accordionXmlNode = getAccordionTabXMLNode(); - mAccordion->addCollapsibleCtrl(tab); - - LLFlatListView::Params list_params; - LLWearableItemsList* list = LLUICtrlFactory::create<LLWearableItemsList>(list_params); + accordionXmlNode->setAttributeString("name", name); + accordionXmlNode->setAttributeString("title", name); + LLAccordionCtrlTab* tab = LLUICtrlFactory::defaultBuilder<LLAccordionCtrlTab>(accordionXmlNode, NULL, NULL); - tab->addChild(list, 0); - tab->setDisplayChildren(false); + // *TODO: LLUICtrlFactory::defaultBuilder does not use "display_children" from xml. Should be investigated. + tab->setDisplayChildren(false); + mAccordion->addCollapsibleCtrl(tab); // Map the new tab with outfit category UUID. mOutfitsMap.insert(LLOutfitsList::outfits_map_value_t(cat_id, tab)); // Start observing the new outfit category. + LLWearableItemsList* list = tab->getChild<LLWearableItemsList>("wearable_items_list"); mCategoriesObserver->addCategory(cat_id, boost::bind(&LLWearableItemsList::updateList, list, cat_id)); // Fetch the new outfit contents. @@ -262,4 +257,21 @@ void LLOutfitsList::setFilterSubString(const std::string& string) mFilterSubString = string; } + +////////////////////////////////////////////////////////////////////////// +// Private methods +////////////////////////////////////////////////////////////////////////// +LLXMLNodePtr LLOutfitsList::getAccordionTabXMLNode() +{ + LLXMLNodePtr xmlNode = NULL; + bool success = LLUICtrlFactory::getLayeredXMLNode("outfit_accordion_tab.xml", xmlNode); + if (!success) + { + llwarns << "Failed to read xml of Outfit's Accordion Tab from outfit_accordion_tab.xml" << llendl; + return NULL; + } + + return xmlNode; +} + // EOF |