diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2009-12-09 13:46:05 -0800 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2009-12-09 13:46:05 -0800 |
commit | 2554a88ec17998c092368e814254c6ad3928d920 (patch) | |
tree | 39d3e0d9abd21f36dee6d96cc02d2cb5dda3867b /indra/newview/llpaneloutfitsinventory.cpp | |
parent | 2af183c51d8911a7242b838394863e2606ed3fe7 (diff) | |
parent | 6260ce6a9210192963a77e5b1f44b0d2c2c86591 (diff) |
merge!
Diffstat (limited to 'indra/newview/llpaneloutfitsinventory.cpp')
-rw-r--r-- | indra/newview/llpaneloutfitsinventory.cpp | 67 |
1 files changed, 64 insertions, 3 deletions
diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 6aba8c0ebb..4511bca23a 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -136,6 +136,24 @@ void LLPanelOutfitsInventory::onWear() } } +void LLPanelOutfitsInventory::onAdd() +{ + LLFolderViewEventListener* listenerp = getCorrectListenerForAction(); + if (listenerp) + { + listenerp->performAction(NULL, NULL,"addtooutfit"); + } +} + +void LLPanelOutfitsInventory::onRemove() +{ + LLFolderViewEventListener* listenerp = getCorrectListenerForAction(); + if (listenerp) + { + listenerp->performAction(NULL, NULL,"removefromoutfit"); + } +} + void LLPanelOutfitsInventory::onEdit() { } @@ -224,8 +242,10 @@ void LLPanelOutfitsInventory::initListCommandsHandlers() , _7 // EAcceptance* accept )); - mCommitCallbackRegistrar.add("panel_outfits_inventory_gear_default.Custom.Action", boost::bind(&LLPanelOutfitsInventory::onCustomAction, this, _2)); - mEnableCallbackRegistrar.add("panel_outfits_inventory_gear_default.Enable", boost::bind(&LLPanelOutfitsInventory::isActionEnabled, this, _2)); + mCommitCallbackRegistrar.add("panel_outfits_inventory_gear_default.Custom.Action", + boost::bind(&LLPanelOutfitsInventory::onCustomAction, this, _2)); + mEnableCallbackRegistrar.add("panel_outfits_inventory_gear_default.Enable", + boost::bind(&LLPanelOutfitsInventory::isActionEnabled, this, _2)); mMenuGearDefault = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("panel_outfits_inventory_gear_default.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); } @@ -290,6 +310,22 @@ void LLPanelOutfitsInventory::onCustomAction(const LLSD& userdata) { onWear(); } + if (command_name == "add") + { + onAdd(); + } + if (command_name == "remove") + { + onRemove(); + } + if (command_name == "rename") + { + onClipboardAction("rename"); + } + if (command_name == "remove_link") + { + onClipboardAction("delete"); + } if (command_name == "delete") { onClipboardAction("delete"); @@ -320,8 +356,33 @@ BOOL LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata) } return FALSE; } + if (command_name == "remove_link") + { + BOOL can_delete = FALSE; + LLFolderView *folder = getActivePanel()->getRootFolder(); + if (folder) + { + can_delete = TRUE; + std::set<LLUUID> selection_set; + folder->getSelectionList(selection_set); + for (std::set<LLUUID>::iterator iter = selection_set.begin(); + iter != selection_set.end(); + ++iter) + { + const LLUUID &item_id = (*iter); + LLViewerInventoryItem *item = gInventory.getItem(item_id); + if (!item || !item->getIsLinkType()) + return FALSE; + } + return can_delete; + } + return FALSE; + } if (command_name == "edit" || - command_name == "wear") + command_name == "wear" || + command_name == "add" || + command_name == "remove" + ) { return (getCorrectListenerForAction() != NULL); } |