summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelmaininventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelmaininventory.cpp')
-rw-r--r--indra/newview/llpanelmaininventory.cpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index fbc1b80857..e9c9c451a2 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)
{
@@ -219,6 +220,17 @@ BOOL LLPanelMainInventory::postBuild()
recent_items_panel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::RECENTITEMS_SORT_ORDER));
}
}
+ if(mActivePanel)
+ {
+ if(savedFilterState.has(mActivePanel->getFilter().getName()))
+ {
+ LLSD items = savedFilterState.get(mActivePanel->getFilter().getName());
+ LLInventoryFilter::Params p;
+ LLParamSDParser parser;
+ parser.readSD(items, p);
+ mActivePanel->getFilter().setSearchVisibilityTypes(p);
+ }
+ }
}
@@ -229,6 +241,7 @@ BOOL LLPanelMainInventory::postBuild()
}
mGearMenuButton = getChild<LLMenuButton>("options_gear_btn");
+ mVisibilityMenuButton = getChild<LLMenuButton>("options_visibility_btn");
initListCommandsHandlers();
@@ -254,6 +267,9 @@ BOOL LLPanelMainInventory::postBuild()
LLPanelMainInventory::~LLPanelMainInventory( void )
{
// Save the filters state.
+ // Some params types cannot be saved this way
+ // for example, LLParamSDParser doesn't know about U64,
+ // so some FilterOps params should be revised.
LLSD filterRoot;
LLInventoryPanel* all_items_panel = getChild<LLInventoryPanel>("All Items");
if (all_items_panel)
@@ -1165,6 +1181,10 @@ 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);
+ mVisibilityMenuButton->setMenuPosition(LLMenuButton::MP_BOTTOM_LEFT);
+
// Update the trash button when selected item(s) get worn or taken off.
LLOutfitObserver::instance().addCOFChangedCallback(boost::bind(&LLPanelMainInventory::updateListCommands, this));
}
@@ -1354,6 +1374,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 )
@@ -1499,6 +1534,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;
}