summaryrefslogtreecommitdiff
path: root/indra/newview/lloutfitslist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lloutfitslist.cpp')
-rw-r--r--indra/newview/lloutfitslist.cpp38
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