diff options
Diffstat (limited to 'linden/indra/newview/llinventoryactions.cpp')
-rw-r--r-- | linden/indra/newview/llinventoryactions.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/linden/indra/newview/llinventoryactions.cpp b/linden/indra/newview/llinventoryactions.cpp index 0bf3ab2..2ee7307 100644 --- a/linden/indra/newview/llinventoryactions.cpp +++ b/linden/indra/newview/llinventoryactions.cpp | |||
@@ -464,6 +464,40 @@ class LLDoCreateFloater : public inventory_listener_t | |||
464 | } | 464 | } |
465 | }; | 465 | }; |
466 | 466 | ||
467 | //Handles the search type buttons | ||
468 | class SetSearchType : public inventory_listener_t | ||
469 | { | ||
470 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
471 | { | ||
472 | std::string search_type = userdata.asString(); | ||
473 | if(search_type == "name") | ||
474 | { | ||
475 | gSavedSettings.setU32("InventorySearchType", 0); | ||
476 | |||
477 | mPtr->getControl("Inventory.SearchByName")->setValue(TRUE); | ||
478 | mPtr->getControl("Inventory.SearchByCreator")->setValue(FALSE); | ||
479 | mPtr->getControl("Inventory.SearchByAll")->setValue(FALSE); | ||
480 | } | ||
481 | else if(search_type == "creator") | ||
482 | { | ||
483 | gSavedSettings.setU32("InventorySearchType", 1); | ||
484 | |||
485 | mPtr->getControl("Inventory.SearchByName")->setValue(FALSE); | ||
486 | mPtr->getControl("Inventory.SearchByCreator")->setValue(TRUE); | ||
487 | mPtr->getControl("Inventory.SearchByAll")->setValue(FALSE); | ||
488 | } | ||
489 | else if(search_type == "all") | ||
490 | { | ||
491 | gSavedSettings.setU32("InventorySearchType", 4); | ||
492 | |||
493 | mPtr->getControl("Inventory.SearchByName")->setValue(FALSE); | ||
494 | mPtr->getControl("Inventory.SearchByCreator")->setValue(FALSE); | ||
495 | mPtr->getControl("Inventory.SearchByAll")->setValue(TRUE); | ||
496 | } | ||
497 | return true; | ||
498 | } | ||
499 | }; | ||
500 | |||
467 | class LLSetSortBy : public inventory_listener_t | 501 | class LLSetSortBy : public inventory_listener_t |
468 | { | 502 | { |
469 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 503 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
@@ -711,6 +745,8 @@ void init_inventory_actions(LLInventoryView *floater) | |||
711 | (new LLShowFilters())->registerListener(floater, "Inventory.ShowFilters"); | 745 | (new LLShowFilters())->registerListener(floater, "Inventory.ShowFilters"); |
712 | (new LLResetFilter())->registerListener(floater, "Inventory.ResetFilter"); | 746 | (new LLResetFilter())->registerListener(floater, "Inventory.ResetFilter"); |
713 | (new LLSetSortBy())->registerListener(floater, "Inventory.SetSortBy"); | 747 | (new LLSetSortBy())->registerListener(floater, "Inventory.SetSortBy"); |
748 | |||
749 | (new SetSearchType())->registerListener(floater, "Inventory.SetSearchBy"); | ||
714 | } | 750 | } |
715 | 751 | ||
716 | void init_inventory_panel_actions(LLInventoryPanel *panel) | 752 | void init_inventory_panel_actions(LLInventoryPanel *panel) |