summaryrefslogtreecommitdiff
path: root/indra/newview/llpaneloutfitsinventory.cpp
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2009-12-09 13:24:21 -0800
committerJames Cook <james@lindenlab.com>2009-12-09 13:24:21 -0800
commit6260ce6a9210192963a77e5b1f44b0d2c2c86591 (patch)
tree949f5d4e19149ecea3d4dd05f72e1a480aaf8c38 /indra/newview/llpaneloutfitsinventory.cpp
parent7193e97b982d69de75ee6bb5769f5e53ccfb517d (diff)
parent883ef71722a27fdb1c09abfa4a4421569d416cd2 (diff)
Merge
Diffstat (limited to 'indra/newview/llpaneloutfitsinventory.cpp')
-rw-r--r--indra/newview/llpaneloutfitsinventory.cpp67
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);
}