diff options
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llpaneloutfitsinventory.cpp | 67 | ||||
-rw-r--r-- | indra/newview/llpaneloutfitsinventory.h | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_inventory.xml | 51 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_outfits_inventory_gear_default.xml | 54 |
5 files changed, 140 insertions, 36 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 4c28d5e2df..28b982d386 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2455,6 +2455,8 @@ void LLFolderBridge::folderOptionsMenu() mItems.push_back(std::string("Wear As Ensemble")); } mItems.push_back(std::string("Remove From Outfit")); + if (is_sidepanel) + mItems.push_back(std::string("Outfit Separator")); } hide_context_entries(*mMenu, mItems, disabled_items); 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); } diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h index aa0ab4efbc..afeaef485d 100644 --- a/indra/newview/llpaneloutfitsinventory.h +++ b/indra/newview/llpaneloutfitsinventory.h @@ -55,6 +55,8 @@ public: void onSearchEdit(const std::string& string); void onWear(); + void onAdd(); + void onRemove(); void onEdit(); void onNew(); diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index b65a49eaed..a36bfb8ec1 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -340,6 +340,33 @@ parameter="open" /> </menu_item_call> <menu_item_call + label="Replace Current Outfit" + layout="topleft" + name="Replace Outfit"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="replaceoutfit" /> + </menu_item_call> + <menu_item_call + label="Add To Current Outfit" + layout="topleft" + name="Add To Outfit"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="addtooutfit" /> + </menu_item_call> + <menu_item_call + label="Remove From Current Outfit" + layout="topleft" + name="Remove From Outfit"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="removefromoutfit" /> + </menu_item_call> + <menu_item_separator + layout="topleft" + name="Outfit Separator" /> + <menu_item_call label="Purge Item" layout="topleft" name="Purge Item"> @@ -433,30 +460,6 @@ </menu_item_call> <menu_item_separator layout="topleft" /> - <menu_item_call - label="Remove From Outfit" - layout="topleft" - name="Remove From Outfit"> - <menu_item_call.on_click - function="Inventory.DoToSelected" - parameter="removefromoutfit" /> - </menu_item_call> - <menu_item_call - label="Add To Outfit" - layout="topleft" - name="Add To Outfit"> - <menu_item_call.on_click - function="Inventory.DoToSelected" - parameter="addtooutfit" /> - </menu_item_call> - <menu_item_call - label="Replace Outfit" - layout="topleft" - name="Replace Outfit"> - <menu_item_call.on_click - function="Inventory.DoToSelected" - parameter="replaceoutfit" /> - </menu_item_call> <menu_item_separator layout="topleft" /> <menu_item_call diff --git a/indra/newview/skins/default/xui/en/panel_outfits_inventory_gear_default.xml b/indra/newview/skins/default/xui/en/panel_outfits_inventory_gear_default.xml index c8c79f8761..7b88fca7c3 100644 --- a/indra/newview/skins/default/xui/en/panel_outfits_inventory_gear_default.xml +++ b/indra/newview/skins/default/xui/en/panel_outfits_inventory_gear_default.xml @@ -7,29 +7,65 @@ name="menu_gear_default" visible="false"> <menu_item_call - label="New Outfit" + label="Replace Current Outfit" layout="topleft" - name="new"> + name="wear"> <on_click function="panel_outfits_inventory_gear_default.Custom.Action" - parameter="new" /> + parameter="wear" /> <on_enable function="panel_outfits_inventory_gear_default.Enable" - parameter="new" /> + parameter="wear" /> </menu_item_call> <menu_item_call - label="Wear Outfit" + label="Add To Current Outfit" layout="topleft" - name="wear"> + name="add"> <on_click function="panel_outfits_inventory_gear_default.Custom.Action" - parameter="wear" /> + parameter="add" /> <on_enable function="panel_outfits_inventory_gear_default.Enable" - parameter="wear" /> + parameter="add" /> + </menu_item_call> + <menu_item_call + label="Remove From Current Outfit" + layout="topleft" + name="remove"> + <on_click + function="panel_outfits_inventory_gear_default.Custom.Action" + parameter="remove" /> + <on_enable + function="panel_outfits_inventory_gear_default.Enable" + parameter="remove" /> + </menu_item_call> + <menu_item_separator + layout="topleft" + name="Outfits Gear Separator" /> + <menu_item_call + label="Rename" + layout="topleft" + name="rename"> + <on_click + function="panel_outfits_inventory_gear_default.Custom.Action" + parameter="rename" /> + <on_enable + function="panel_outfits_inventory_gear_default.Enable" + parameter="rename" /> + </menu_item_call> + <menu_item_call + label="Remove" + layout="topleft" + name="remove_link"> + <on_click + function="panel_outfits_inventory_gear_default.Custom.Action" + parameter="remove_link" /> + <on_enable + function="panel_outfits_inventory_gear_default.Enable" + parameter="remove_link" /> </menu_item_call> <menu_item_call - label="Delete Outfit" + label="Delete" layout="topleft" name="delete"> <on_click |