MAINT-56 FIXED collapse_all_folders() and expand_all_folders() functions are added, which are called by menu items in gear menu.

meow-7.2.2
maxim_productengine 2012-08-22 11:42:44 +03:00
parent 4b44be799a
commit f93b94daa9
3 changed files with 54 additions and 0 deletions

View File

@ -117,6 +117,8 @@ public:
registrar.add("Gear.Rename", boost::bind(&LLOutfitListGearMenu::onRename, this));
registrar.add("Gear.Delete", boost::bind(&LLOutfitsList::removeSelected, mOutfitList));
registrar.add("Gear.Create", boost::bind(&LLOutfitListGearMenu::onCreate, this, _2));
registrar.add("Gear.Collapse", boost::bind(&LLOutfitsList::collapse_all_folders, mOutfitList));
registrar.add("Gear.Expand", boost::bind(&LLOutfitsList::expand_all_folders, mOutfitList));
registrar.add("Gear.WearAdd", boost::bind(&LLOutfitListGearMenu::onAdd, this));
@ -743,6 +745,34 @@ void LLOutfitsList::getSelectedItemsUUIDs(uuid_vec_t& selected_uuids) const
}
}
void LLOutfitsList::collapse_all_folders()
{
for (outfits_map_t::iterator iter = mOutfitsMap.begin();
iter != mOutfitsMap.end();
++iter)
{
LLAccordionCtrlTab* tab = iter->second;
if(tab && tab->isExpanded())
{
tab->changeOpenClose(true);
}
}
}
void LLOutfitsList::expand_all_folders()
{
for (outfits_map_t::iterator iter = mOutfitsMap.begin();
iter != mOutfitsMap.end();
++iter)
{
LLAccordionCtrlTab* tab = iter->second;
if(tab && !tab->isExpanded())
{
tab->changeOpenClose(false);
}
}
}
boost::signals2::connection LLOutfitsList::setSelectionChangeCallback(selection_change_callback_t cb)
{
return mSelectionChangeSignal.connect(cb);

View File

@ -108,6 +108,16 @@ public:
*/
bool hasItemSelected();
/**
Collapses all outfit accordions.
*/
void collapse_all_folders();
/**
Expands all outfit accordions.
*/
void expand_all_folders();
private:
void onOutfitsRemovalConfirmation(const LLSD& notification, const LLSD& response);

View File

@ -194,6 +194,20 @@
<!-- copied from menu_inventory_add.xml -->
<menu_item_separator name="sepatator2" />
<menu_item_call
label="Expand all folders"
layout="topleft"
name="expand">
<on_click
function="Gear.Expand" />
</menu_item_call>
<menu_item_call
label="Collapse all folders"
layout="topleft"
name="collapse">
<on_click
function="Gear.Collapse" />
</menu_item_call>
<menu_item_call
label="Rename Outfit"
layout="topleft"