summaryrefslogtreecommitdiff
path: root/indra/newview/llpaneloutfitsinventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpaneloutfitsinventory.cpp')
-rw-r--r--indra/newview/llpaneloutfitsinventory.cpp27
1 files changed, 23 insertions, 4 deletions
diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp
index 8b451c156c..0e1e94129b 100644
--- a/indra/newview/llpaneloutfitsinventory.cpp
+++ b/indra/newview/llpaneloutfitsinventory.cpp
@@ -555,11 +555,25 @@ void LLPanelOutfitsInventory::onTrashButtonClick()
void LLPanelOutfitsInventory::onClipboardAction(const LLSD& userdata)
{
std::string command_name = userdata.asString();
- // TODO: add handling "My Outfits" tab.
if (isCOFPanelActive())
{
getActivePanel()->getRootFolder()->doToSelected(getActivePanel()->getModel(),command_name);
}
+ else // "My Outfits" tab active
+ {
+ if (command_name == "delete")
+ {
+ const LLUUID& selected_outfit_id = mMyOutfitsPanel->getSelectedOutfitUUID();
+ if (selected_outfit_id.notNull())
+ {
+ remove_category(&gInventory, selected_outfit_id);
+ }
+ }
+ else
+ {
+ llwarns << "Unrecognized action" << llendl;
+ }
+ }
updateListCommands();
updateVerbs();
}
@@ -614,7 +628,6 @@ BOOL LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata)
{
BOOL can_delete = FALSE;
- // TODO: add handling "My Outfits" tab.
if (isCOFPanelActive())
{
LLFolderView* root = getActivePanel()->getRootFolder();
@@ -630,10 +643,15 @@ BOOL LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata)
LLFolderViewItem *item = root->getItemByID(item_id);
can_delete &= item->getListener()->isItemRemovable();
}
- return can_delete;
}
}
- return FALSE;
+ else // "My Outfits" tab active
+ {
+ const LLUUID& selected_outfit = mMyOutfitsPanel->getSelectedOutfitUUID();
+ can_delete = LLAppearanceMgr::instance().getCanRemoveOutfit(selected_outfit);
+ }
+
+ return can_delete;
}
if (command_name == "remove_link")
{
@@ -730,6 +748,7 @@ void LLPanelOutfitsInventory::initTabPanels()
mCurrentOutfitPanel->setSelectCallback(boost::bind(&LLPanelOutfitsInventory::onTabSelectionChange, this, mCurrentOutfitPanel, _1, _2));
mMyOutfitsPanel = getChild<LLOutfitsList>(OUTFITS_TAB_NAME);
+ mMyOutfitsPanel->addSelectionChangeCallback(boost::bind(&LLPanelOutfitsInventory::updateVerbs, this));
mAppearanceTabs = getChild<LLTabContainer>("appearance_tabs");
mAppearanceTabs->setCommitCallback(boost::bind(&LLPanelOutfitsInventory::onTabChange, this));