diff options
Diffstat (limited to 'linden/indra/newview/llinventoryactions.cpp')
-rw-r--r-- | linden/indra/newview/llinventoryactions.cpp | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/linden/indra/newview/llinventoryactions.cpp b/linden/indra/newview/llinventoryactions.cpp index 083ec7c..d7af8d1 100644 --- a/linden/indra/newview/llinventoryactions.cpp +++ b/linden/indra/newview/llinventoryactions.cpp | |||
@@ -86,6 +86,9 @@ | |||
86 | #include "lluictrlfactory.h" | 86 | #include "lluictrlfactory.h" |
87 | #include "llselectmgr.h" | 87 | #include "llselectmgr.h" |
88 | 88 | ||
89 | // Defined in llinventorybridge.cpp | ||
90 | void wear_attachments_on_avatar(const std::set<LLUUID>& item_ids, BOOL remove); | ||
91 | |||
89 | const std::string NEW_LSL_NAME = "New Script"; // *TODO:Translate? (probably not) | 92 | const std::string NEW_LSL_NAME = "New Script"; // *TODO:Translate? (probably not) |
90 | const std::string NEW_NOTECARD_NAME = "New Note"; // *TODO:Translate? (probably not) | 93 | const std::string NEW_NOTECARD_NAME = "New Note"; // *TODO:Translate? (probably not) |
91 | const std::string NEW_GESTURE_NAME = "New Gesture"; // *TODO:Translate? (probably not) | 94 | const std::string NEW_GESTURE_NAME = "New Gesture"; // *TODO:Translate? (probably not) |
@@ -116,6 +119,12 @@ bool doToSelected(LLFolderView* folder, std::string action) | |||
116 | std::set<LLUUID> selected_items; | 119 | std::set<LLUUID> selected_items; |
117 | folder->getSelectionList(selected_items); | 120 | folder->getSelectionList(selected_items); |
118 | 121 | ||
122 | if ( ("attach" == action) && (selected_items.size() > 1) ) | ||
123 | { | ||
124 | wear_attachments_on_avatar(selected_items, FALSE); | ||
125 | return true; | ||
126 | } | ||
127 | |||
119 | LLMultiPreview* multi_previewp = NULL; | 128 | LLMultiPreview* multi_previewp = NULL; |
120 | LLMultiProperties* multi_propertiesp = NULL; | 129 | LLMultiProperties* multi_propertiesp = NULL; |
121 | 130 | ||
@@ -467,6 +476,56 @@ class LLDoCreateFloater : public inventory_listener_t | |||
467 | } | 476 | } |
468 | }; | 477 | }; |
469 | 478 | ||
479 | //Handles the search type buttons | ||
480 | class SetSearchType : public inventory_listener_t | ||
481 | { | ||
482 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
483 | { | ||
484 | std::string search_type = userdata.asString(); | ||
485 | if(search_type == "name") | ||
486 | { | ||
487 | gSavedSettings.setU32("InventorySearchType", 0); | ||
488 | |||
489 | mPtr->getControl("Inventory.SearchByName")->setValue(TRUE); | ||
490 | mPtr->getControl("Inventory.SearchByCreator")->setValue(FALSE); | ||
491 | mPtr->getControl("Inventory.SearchByDesc")->setValue(FALSE); | ||
492 | mPtr->getControl("Inventory.SearchByAll")->setValue(FALSE); | ||
493 | } | ||
494 | else if(search_type == "creator") | ||
495 | { | ||
496 | gSavedSettings.setU32("InventorySearchType", 1); | ||
497 | |||
498 | mPtr->getControl("Inventory.SearchByName")->setValue(FALSE); | ||
499 | mPtr->getControl("Inventory.SearchByCreator")->setValue(TRUE); | ||
500 | mPtr->getControl("Inventory.SearchByDesc")->setValue(FALSE); | ||
501 | mPtr->getControl("Inventory.SearchByAll")->setValue(FALSE); | ||
502 | } | ||
503 | else if(search_type == "desc") | ||
504 | { | ||
505 | gSavedSettings.setU32("InventorySearchType", 2); | ||
506 | |||
507 | mPtr->getControl("Inventory.SearchByName")->setValue(FALSE); | ||
508 | mPtr->getControl("Inventory.SearchByCreator")->setValue(FALSE); | ||
509 | mPtr->getControl("Inventory.SearchByDesc")->setValue(TRUE); | ||
510 | mPtr->getControl("Inventory.SearchByAll")->setValue(FALSE); | ||
511 | } | ||
512 | else if(search_type == "all") | ||
513 | { | ||
514 | gSavedSettings.setU32("InventorySearchType", 3); | ||
515 | |||
516 | mPtr->getControl("Inventory.SearchByName")->setValue(FALSE); | ||
517 | mPtr->getControl("Inventory.SearchByCreator")->setValue(FALSE); | ||
518 | mPtr->getControl("Inventory.SearchByDesc")->setValue(FALSE); | ||
519 | mPtr->getControl("Inventory.SearchByAll")->setValue(TRUE); | ||
520 | } | ||
521 | |||
522 | //Clear search when switching modes. | ||
523 | mPtr->getActivePanel()->setFilterSubString(LLStringUtil::null); | ||
524 | mPtr->getActivePanel()->setFilterTypes(LLInventoryType::NIT_ALL); | ||
525 | return true; | ||
526 | } | ||
527 | }; | ||
528 | |||
470 | class LLSetSortBy : public inventory_listener_t | 529 | class LLSetSortBy : public inventory_listener_t |
471 | { | 530 | { |
472 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 531 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
@@ -714,6 +773,8 @@ void init_inventory_actions(LLInventoryView *floater) | |||
714 | (new LLShowFilters())->registerListener(floater, "Inventory.ShowFilters"); | 773 | (new LLShowFilters())->registerListener(floater, "Inventory.ShowFilters"); |
715 | (new LLResetFilter())->registerListener(floater, "Inventory.ResetFilter"); | 774 | (new LLResetFilter())->registerListener(floater, "Inventory.ResetFilter"); |
716 | (new LLSetSortBy())->registerListener(floater, "Inventory.SetSortBy"); | 775 | (new LLSetSortBy())->registerListener(floater, "Inventory.SetSortBy"); |
776 | |||
777 | (new SetSearchType())->registerListener(floater, "Inventory.SetSearchBy"); | ||
717 | } | 778 | } |
718 | 779 | ||
719 | void init_inventory_panel_actions(LLInventoryPanel *panel) | 780 | void init_inventory_panel_actions(LLInventoryPanel *panel) |