EXT-3954 : "Wear" button shouldn't be enabled in "Wearing" tab

EXT-3952 : "Make Outfit" button shouldn't be enabled in "Wearing" tab
EXT-3955 : "Add to Current Outfit" gear menu option confusing, remove it
EXT-3961 : Switch order of "Wearing" and "My Outfits" tabs

Most of these are very minor xui/button-state changes.
Also added a new onOpen method to llpaneloutfitsinventory so that it can update its state (notably, which tab is active) when the sidepanel is opened.
meow-7.2.2
Loren Shih 2010-01-06 12:33:28 -05:00
parent af61dd45b3
commit cdb158e9e0
4 changed files with 35 additions and 21 deletions

View File

@ -84,6 +84,14 @@ BOOL LLPanelOutfitsInventory::postBuild()
return TRUE;
}
// virtual
void LLPanelOutfitsInventory::onOpen(const LLSD& key)
{
// Make sure we know which tab is selected, update the filter,
// and update verbs.
onTabChange();
}
void LLPanelOutfitsInventory::updateVerbs()
{
if (mParent)
@ -94,6 +102,7 @@ void LLPanelOutfitsInventory::updateVerbs()
if (mListCommands)
{
mListCommands->childSetVisible("look_edit_btn",sShowDebugEditor);
updateListCommands();
}
}
@ -176,7 +185,6 @@ void LLPanelOutfitsInventory::onNew()
void LLPanelOutfitsInventory::onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action)
{
updateListCommands();
updateVerbs();
if (getRootFolder()->needsAutoRename() && items.size())
{
@ -264,9 +272,11 @@ void LLPanelOutfitsInventory::updateListCommands()
{
bool trash_enabled = isActionEnabled("delete");
bool wear_enabled = isActionEnabled("wear");
bool make_outfit_enabled = isActionEnabled("make_outfit");
mListCommands->childSetEnabled("trash_btn", trash_enabled);
mListCommands->childSetEnabled("wear_btn", wear_enabled);
mListCommands->childSetEnabled("make_outfit_btn", make_outfit_enabled);
}
void LLPanelOutfitsInventory::onGearButtonClick()
@ -323,6 +333,7 @@ void LLPanelOutfitsInventory::onCustomAction(const LLSD& userdata)
{
onWearButtonClick();
}
// Note: This option has been removed from the gear menu.
if (command_name == "add")
{
onAdd();
@ -391,6 +402,16 @@ BOOL LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata)
}
return FALSE;
}
if (command_name == "wear" ||
command_name == "make_outfit")
{
const BOOL is_my_outfits = (mActivePanel->getName() == "outfitslist_accordionpanel");
if (!is_my_outfits)
{
return FALSE;
}
}
if (command_name == "edit" ||
command_name == "wear" ||
command_name == "add" ||
@ -425,17 +446,17 @@ bool LLPanelOutfitsInventory::handleDragAndDropToTrash(BOOL drop, EDragAndDropTy
void LLPanelOutfitsInventory::initTabPanels()
{
mTabPanels.resize(2);
LLInventoryPanel *cof_panel = getChild<LLInventoryPanel>("cof_accordionpanel");
cof_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
mTabPanels[0] = cof_panel;
LLInventoryPanel *myoutfits_panel = getChild<LLInventoryPanel>("outfitslist_accordionpanel");
myoutfits_panel->setFilterTypes(1LL << LLFolderType::FT_OUTFIT, LLInventoryFilter::FILTERTYPE_CATEGORY);
myoutfits_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
mTabPanels[0] = myoutfits_panel;
mActivePanel = myoutfits_panel;
mTabPanels[1] = myoutfits_panel;
LLInventoryPanel *cof_panel = getChild<LLInventoryPanel>("cof_accordionpanel");
cof_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
mTabPanels[1] = cof_panel;
mActivePanel = mTabPanels[0];
for (tabpanels_vec_t::iterator iter = mTabPanels.begin();
iter != mTabPanels.end();
@ -479,9 +500,7 @@ void LLPanelOutfitsInventory::onTabChange()
return;
}
mActivePanel->setFilterSubString(mFilterSubString);
bool is_my_outfits = (mActivePanel->getName() == "outfitslist_accordionpanel");
mListCommands->childSetEnabled("make_outfit_btn", is_my_outfits);
updateVerbs();
}
LLInventoryPanel* LLPanelOutfitsInventory::getActivePanel()

View File

@ -53,6 +53,7 @@ public:
virtual ~LLPanelOutfitsInventory();
/*virtual*/ BOOL postBuild();
/*virtual*/ void onOpen(const LLSD& key);
void onSearchEdit(const std::string& string);
void onAdd();

View File

@ -166,6 +166,11 @@ void LLSidepanelAppearance::onOpen(const LLSD& key)
refreshCurrentOutfitName();
updateVerbs();
if (mPanelOutfitsInventory)
{
mPanelOutfitsInventory->onOpen(key);
}
if(key.size() == 0)
return;

View File

@ -17,17 +17,6 @@
function="panel_outfits_inventory_gear_default.Enable"
parameter="wear" />
</menu_item_call>
<menu_item_call
label="Add To Current Outfit"
layout="topleft"
name="add">
<on_click
function="panel_outfits_inventory_gear_default.Custom.Action"
parameter="add" />
<on_enable
function="panel_outfits_inventory_gear_default.Enable"
parameter="add" />
</menu_item_call>
<menu_item_call
label="Remove From Current Outfit"
layout="topleft"