From ff0244c3120757f7074fd5162f370ad8f6646ed2 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sat, 8 Nov 2008 22:10:34 -0600 Subject: Quick Filter works, but is a bit rough. It doesn't refresh its display when you change tabs, and the Show Filters window doesn't refresh either. --- ChangeLog.txt | 6 +++ linden/indra/newview/llinventoryview.cpp | 77 +++++++++++++++++++++++++++++++- 2 files changed, 82 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index c3f90bd..f4a217d 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,6 +1,12 @@ 2008-11-08 Jacek Antonelli * linden/indra/newview/llinventoryview.cpp: + Quick Filter works, but is a bit rough. + It doesn't refresh its display when you change tabs, + and the Show Filters window doesn't refresh either. + + + * linden/indra/newview/llinventoryview.cpp: Added commit callback for Quick Filter. * linden/indra/newview/llinventoryview.h: Ditto. diff --git a/linden/indra/newview/llinventoryview.cpp b/linden/indra/newview/llinventoryview.cpp index edc1ca7..e0061ba 100644 --- a/linden/indra/newview/llinventoryview.cpp +++ b/linden/indra/newview/llinventoryview.cpp @@ -991,9 +991,84 @@ void LLInventoryView::onSearchEdit(const std::string& search_string, void* user_ //static void LLInventoryView::onQuickFilterCommit(LLUICtrl* ctrl, void* user_data) { + LLComboBox* quickfilter = (LLComboBox*)ctrl; - llinfos << "Quick Filter: " << quickfilter->getSimple() << llendl; + + LLInventoryView* view = (LLInventoryView*)(quickfilter->getParent()); + if (!view->mActivePanel) + { + return; + } + + + std::string item_type = quickfilter->getSimple(); + U32 filter_type; + + if ("Animations" == item_type) + { + filter_type = 0x1 << LLInventoryType::IT_ANIMATION; + } + + else if ("Calling Cards" == item_type) + { + filter_type = 0x1 << LLInventoryType::IT_CALLINGCARD; + } + + else if ("Clothing" == item_type) + { + filter_type = 0x1 << LLInventoryType::IT_WEARABLE; + } + + else if ("Gestures" == item_type) + { + filter_type = 0x1 << LLInventoryType::IT_GESTURE; + } + + else if ("Landmarks" == item_type) + { + filter_type = 0x1 << LLInventoryType::IT_LANDMARK; + } + + else if ("Notecards" == item_type) + { + filter_type = 0x1 << LLInventoryType::IT_NOTECARD; + } + + else if ("Objects" == item_type) + { + filter_type = 0x1 << LLInventoryType::IT_OBJECT; + } + + else if ("Scripts" == item_type) + { + filter_type = 0x1 << LLInventoryType::IT_LSL; + } + + else if ("Sounds" == item_type) + { + filter_type = 0x1 << LLInventoryType::IT_SOUND; + } + + else if ("Textures" == item_type) + { + filter_type = 0x1 << LLInventoryType::IT_TEXTURE; + } + + else if ("Snapshots" == item_type) + { + filter_type = 0x1 << LLInventoryType::IT_SNAPSHOT; + } + + else + { + // Show all types + filter_type = 0xffffffff; + } + + view->mActivePanel->setFilterTypes( filter_type ); + + llinfos << "Quick Filter: " << item_type << llendl; } -- cgit v1.1