diff options
Diffstat (limited to 'linden/indra/newview/llinventoryactions.cpp')
-rw-r--r-- | linden/indra/newview/llinventoryactions.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/linden/indra/newview/llinventoryactions.cpp b/linden/indra/newview/llinventoryactions.cpp index 0bf3ab2..b598c83 100644 --- a/linden/indra/newview/llinventoryactions.cpp +++ b/linden/indra/newview/llinventoryactions.cpp | |||
@@ -85,6 +85,9 @@ | |||
85 | #include "lluictrlfactory.h" | 85 | #include "lluictrlfactory.h" |
86 | #include "llselectmgr.h" | 86 | #include "llselectmgr.h" |
87 | 87 | ||
88 | // Defined in llinventorybridge.cpp | ||
89 | void wear_attachments_on_avatar(const std::set<LLUUID>& item_ids, BOOL remove); | ||
90 | |||
88 | const std::string NEW_LSL_NAME = "New Script"; // *TODO:Translate? (probably not) | 91 | const std::string NEW_LSL_NAME = "New Script"; // *TODO:Translate? (probably not) |
89 | const std::string NEW_NOTECARD_NAME = "New Note"; // *TODO:Translate? (probably not) | 92 | const std::string NEW_NOTECARD_NAME = "New Note"; // *TODO:Translate? (probably not) |
90 | const std::string NEW_GESTURE_NAME = "New Gesture"; // *TODO:Translate? (probably not) | 93 | const std::string NEW_GESTURE_NAME = "New Gesture"; // *TODO:Translate? (probably not) |
@@ -115,6 +118,12 @@ bool doToSelected(LLFolderView* folder, std::string action) | |||
115 | std::set<LLUUID> selected_items; | 118 | std::set<LLUUID> selected_items; |
116 | folder->getSelectionList(selected_items); | 119 | folder->getSelectionList(selected_items); |
117 | 120 | ||
121 | if ( ("attach" == action) && (selected_items.size() > 1) ) | ||
122 | { | ||
123 | wear_attachments_on_avatar(selected_items, FALSE); | ||
124 | return true; | ||
125 | } | ||
126 | |||
118 | LLMultiPreview* multi_previewp = NULL; | 127 | LLMultiPreview* multi_previewp = NULL; |
119 | LLMultiProperties* multi_propertiesp = NULL; | 128 | LLMultiProperties* multi_propertiesp = NULL; |
120 | 129 | ||
@@ -464,6 +473,40 @@ class LLDoCreateFloater : public inventory_listener_t | |||
464 | } | 473 | } |
465 | }; | 474 | }; |
466 | 475 | ||
476 | //Handles the search type buttons | ||
477 | class SetSearchType : public inventory_listener_t | ||
478 | { | ||
479 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
480 | { | ||
481 | std::string search_type = userdata.asString(); | ||
482 | if(search_type == "name") | ||
483 | { | ||
484 | gSavedSettings.setU32("InventorySearchType", 0); | ||
485 | |||
486 | mPtr->getControl("Inventory.SearchByName")->setValue(TRUE); | ||
487 | mPtr->getControl("Inventory.SearchByCreator")->setValue(FALSE); | ||
488 | mPtr->getControl("Inventory.SearchByAll")->setValue(FALSE); | ||
489 | } | ||
490 | else if(search_type == "creator") | ||
491 | { | ||
492 | gSavedSettings.setU32("InventorySearchType", 1); | ||
493 | |||
494 | mPtr->getControl("Inventory.SearchByName")->setValue(FALSE); | ||
495 | mPtr->getControl("Inventory.SearchByCreator")->setValue(TRUE); | ||
496 | mPtr->getControl("Inventory.SearchByAll")->setValue(FALSE); | ||
497 | } | ||
498 | else if(search_type == "all") | ||
499 | { | ||
500 | gSavedSettings.setU32("InventorySearchType", 4); | ||
501 | |||
502 | mPtr->getControl("Inventory.SearchByName")->setValue(FALSE); | ||
503 | mPtr->getControl("Inventory.SearchByCreator")->setValue(FALSE); | ||
504 | mPtr->getControl("Inventory.SearchByAll")->setValue(TRUE); | ||
505 | } | ||
506 | return true; | ||
507 | } | ||
508 | }; | ||
509 | |||
467 | class LLSetSortBy : public inventory_listener_t | 510 | class LLSetSortBy : public inventory_listener_t |
468 | { | 511 | { |
469 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 512 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
@@ -711,6 +754,8 @@ void init_inventory_actions(LLInventoryView *floater) | |||
711 | (new LLShowFilters())->registerListener(floater, "Inventory.ShowFilters"); | 754 | (new LLShowFilters())->registerListener(floater, "Inventory.ShowFilters"); |
712 | (new LLResetFilter())->registerListener(floater, "Inventory.ResetFilter"); | 755 | (new LLResetFilter())->registerListener(floater, "Inventory.ResetFilter"); |
713 | (new LLSetSortBy())->registerListener(floater, "Inventory.SetSortBy"); | 756 | (new LLSetSortBy())->registerListener(floater, "Inventory.SetSortBy"); |
757 | |||
758 | (new SetSearchType())->registerListener(floater, "Inventory.SetSearchBy"); | ||
714 | } | 759 | } |
715 | 760 | ||
716 | void init_inventory_panel_actions(LLInventoryPanel *panel) | 761 | void init_inventory_panel_actions(LLInventoryPanel *panel) |