summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelmaininventory.cpp
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2020-08-31 21:27:37 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2020-09-23 11:32:14 +0300
commitbc07bc526cd9492e488380edcc5a6db102fad2d9 (patch)
tree4da32216f4032deded60bc757a6233dd7a8d5f9e /indra/newview/llpanelmaininventory.cpp
parentf8fb2dab5b93588fb3e7f4c1912fd253375e0ced (diff)
SL-13852 Add visibility options to inventory search results
Diffstat (limited to 'indra/newview/llpanelmaininventory.cpp')
-rw-r--r--indra/newview/llpanelmaininventory.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 89682d9576..f845e9b056 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -115,6 +115,7 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p)
mSavedFolderState(NULL),
mFilterText(""),
mMenuGearDefault(NULL),
+ mMenuVisibility(NULL),
mMenuAddHandle(),
mNeedUploadCost(true)
{
@@ -238,6 +239,7 @@ BOOL LLPanelMainInventory::postBuild()
}
mGearMenuButton = getChild<LLMenuButton>("options_gear_btn");
+ mVisibilityMenuButton = getChild<LLMenuButton>("options_visibility_btn");
initListCommandsHandlers();
@@ -1174,6 +1176,9 @@ void LLPanelMainInventory::initListCommandsHandlers()
LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_inventory_add.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
mMenuAddHandle = menu->getHandle();
+ mMenuVisibility = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_inventory_search_visibility.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
+ mVisibilityMenuButton->setMenu(mMenuVisibility);
+
// Update the trash button when selected item(s) get worn or taken off.
LLOutfitObserver::instance().addCOFChangedCallback(boost::bind(&LLPanelMainInventory::updateListCommands, this));
}
@@ -1363,6 +1368,21 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata)
}
LLFloaterReg::showInstance("linkreplace", params);
}
+
+ if (command_name == "toggle_search_trash")
+ {
+ mActivePanel->getFilter().toggleSearchVisibilityTrash();
+ }
+
+ if (command_name == "toggle_search_library")
+ {
+ mActivePanel->getFilter().toggleSearchVisibilityLibrary();
+ }
+
+ if (command_name == "include_links")
+ {
+ mActivePanel->getFilter().toggleSearchVisibilityLinks();
+ }
}
void LLPanelMainInventory::onVisibilityChange( BOOL new_visibility )
@@ -1508,6 +1528,21 @@ BOOL LLPanelMainInventory::isActionChecked(const LLSD& userdata)
return sort_order_mask & LLInventoryFilter::SO_SYSTEM_FOLDERS_TO_TOP;
}
+ if (command_name == "toggle_search_trash")
+ {
+ return (mActivePanel->getFilter().getSearchVisibilityTypes() & LLInventoryFilter::VISIBILITY_TRASH) != 0;
+ }
+
+ if (command_name == "toggle_search_library")
+ {
+ return (mActivePanel->getFilter().getSearchVisibilityTypes() & LLInventoryFilter::VISIBILITY_LIBRARY) != 0;
+ }
+
+ if (command_name == "include_links")
+ {
+ return (mActivePanel->getFilter().getSearchVisibilityTypes() & LLInventoryFilter::VISIBILITY_LINKS) != 0;
+ }
+
return FALSE;
}