Skip to content
Snippets Groups Projects
Commit 5dfc5d02 authored by Mike Antipov's avatar Mike Antipov
Browse files

Work on task EXT-6722 (Create modified inventory view for "my outfits" tab in...

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
parent 07b46372
No related branches found
No related tags found
No related merge requests found
...@@ -168,26 +168,21 @@ void LLOutfitsList::refreshList(const LLUUID& category_id) ...@@ -168,26 +168,21 @@ void LLOutfitsList::refreshList(const LLUUID& category_id)
std::string name = cat->getName(); std::string name = cat->getName();
// *TODO: create accordion tabs and lists from XML. static LLXMLNodePtr accordionXmlNode = getAccordionTabXMLNode();
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);
mAccordion->addCollapsibleCtrl(tab); accordionXmlNode->setAttributeString("name", name);
accordionXmlNode->setAttributeString("title", name);
LLFlatListView::Params list_params; LLAccordionCtrlTab* tab = LLUICtrlFactory::defaultBuilder<LLAccordionCtrlTab>(accordionXmlNode, NULL, NULL);
LLWearableItemsList* list = LLUICtrlFactory::create<LLWearableItemsList>(list_params);
tab->addChild(list, 0); // *TODO: LLUICtrlFactory::defaultBuilder does not use "display_children" from xml. Should be investigated.
tab->setDisplayChildren(false); tab->setDisplayChildren(false);
mAccordion->addCollapsibleCtrl(tab);
// Map the new tab with outfit category UUID. // Map the new tab with outfit category UUID.
mOutfitsMap.insert(LLOutfitsList::outfits_map_value_t(cat_id, tab)); mOutfitsMap.insert(LLOutfitsList::outfits_map_value_t(cat_id, tab));
// Start observing the new outfit category. // 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)); mCategoriesObserver->addCategory(cat_id, boost::bind(&LLWearableItemsList::updateList, list, cat_id));
// Fetch the new outfit contents. // Fetch the new outfit contents.
...@@ -262,4 +257,21 @@ void LLOutfitsList::setFilterSubString(const std::string& string) ...@@ -262,4 +257,21 @@ void LLOutfitsList::setFilterSubString(const std::string& string)
mFilterSubString = 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 // EOF
...@@ -59,6 +59,14 @@ class LLOutfitsList : public LLPanel, public LLInventoryObserver ...@@ -59,6 +59,14 @@ class LLOutfitsList : public LLPanel, public LLInventoryObserver
void setFilterSubString(const std::string& string); void setFilterSubString(const std::string& string);
private: private:
/**
* Reads xml with accordion tab and Flat list from xml file.
*
* @return LLPointer to XMLNode with accordion tab and flat list.
*/
LLXMLNodePtr getAccordionTabXMLNode();
LLInventoryCategoriesObserver* mCategoriesObserver; LLInventoryCategoriesObserver* mCategoriesObserver;
LLAccordionCtrl* mAccordion; LLAccordionCtrl* mAccordion;
......
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<!-- *NOTE: mantipov: this xml is intended to be used inside panel_outfits_list.xml for each outfit folder-->
<!-- All accordion tabs in the My Appearance/My Outfits panel will be created from this one at runtume-->
<accordion_tab
display_children="false"
follows="all"
height="40"
layout="topleft"
name="Mockup Tab"
title="Mockup Tab"
width="0">
<wearable_items_list
allow_select="true"
follows="all"
keep_one_selected="true"
name="wearable_items_list"
/>
</accordion_tab>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment