summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelmaininventory.cpp
diff options
context:
space:
mode:
authorBrad Linden <brad@lindenlab.com>2024-08-09 17:57:23 -0700
committerBrad Linden <brad@lindenlab.com>2024-08-09 17:57:23 -0700
commita7fde9d79c517bfc6165756c1bc3eb16fa4d935c (patch)
treef0608f7f72f23a447778f8bce6f210eb221ebdf1 /indra/newview/llpanelmaininventory.cpp
parentac330f63fd7ac655bbd06ce5d4ed65430aa2f42a (diff)
parentc106221726c48a4231b7854bff224ae422c0517f (diff)
Merge remote-tracking branch release/2024.06-atlasaurus into 'develop'
Diffstat (limited to 'indra/newview/llpanelmaininventory.cpp')
-rw-r--r--indra/newview/llpanelmaininventory.cpp65
1 files changed, 32 insertions, 33 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index ba52da0760..fd7085c452 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -154,28 +154,30 @@ bool LLPanelMainInventory::postBuild()
//panel->getFilter().markDefault();
// Set up the default inv. panel/filter settings.
- mActivePanel = getChild<LLInventoryPanel>(ALL_ITEMS);
- if (mActivePanel)
+ mAllItemsPanel = getChild<LLInventoryPanel>(ALL_ITEMS);
+ if (mAllItemsPanel)
{
// "All Items" is the previous only view, so it gets the InventorySortOrder
- mActivePanel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::DEFAULT_SORT_ORDER));
- mActivePanel->getFilter().markDefault();
- mActivePanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState);
- mActivePanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mActivePanel, _1, _2));
+ mAllItemsPanel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::DEFAULT_SORT_ORDER));
+ mAllItemsPanel->getFilter().markDefault();
+ mAllItemsPanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState);
+ mAllItemsPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mAllItemsPanel, _1, _2));
mResortActivePanel = true;
}
- LLInventoryPanel* recent_items_panel = getChild<LLInventoryPanel>(RECENT_ITEMS);
- if (recent_items_panel)
+ mActivePanel = mAllItemsPanel;
+
+ mRecentPanel = getChild<LLInventoryPanel>(RECENT_ITEMS);
+ if (mRecentPanel)
{
// assign default values until we will be sure that we have setting to restore
- recent_items_panel->setSinceLogoff(true);
- recent_items_panel->setSortOrder(LLInventoryFilter::SO_DATE);
- recent_items_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
- LLInventoryFilter& recent_filter = recent_items_panel->getFilter();
+ mRecentPanel->setSinceLogoff(true);
+ mRecentPanel->setSortOrder(LLInventoryFilter::SO_DATE);
+ mRecentPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
+ LLInventoryFilter& recent_filter = mRecentPanel->getFilter();
recent_filter.setFilterObjectTypes(recent_filter.getFilterObjectTypes() & ~(0x1 << LLInventoryType::IT_CATEGORY));
recent_filter.setEmptyLookupMessage("InventoryNoMatchingRecentItems");
recent_filter.markDefault();
- recent_items_panel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, recent_items_panel, _1, _2));
+ mRecentPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mRecentPanel, _1, _2));
}
mWornItemsPanel = getChild<LLInventoryPanel>(WORN_ITEMS);
@@ -211,17 +213,17 @@ bool LLPanelMainInventory::postBuild()
// Load the persistent "Recent Items" settings.
// Note that the "All Items" settings do not persist.
- if(recent_items_panel)
+ if(mRecentPanel)
{
- if(savedFilterState.has(recent_items_panel->getFilter().getName()))
+ if(savedFilterState.has(mRecentPanel->getFilter().getName()))
{
LLSD recent_items = savedFilterState.get(
- recent_items_panel->getFilter().getName());
+ mRecentPanel->getFilter().getName());
LLInventoryFilter::Params p;
LLParamSDParser parser;
parser.readSD(recent_items, p);
- recent_items_panel->getFilter().fromParams(p);
- recent_items_panel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::RECENTITEMS_SORT_ORDER));
+ mRecentPanel->getFilter().fromParams(p);
+ mRecentPanel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::RECENTITEMS_SORT_ORDER));
}
}
if(mActivePanel)
@@ -362,7 +364,7 @@ LLPanelMainInventory::~LLPanelMainInventory( void )
LLInventoryPanel* LLPanelMainInventory::getAllItemsPanel()
{
- return getChild<LLInventoryPanel>(ALL_ITEMS);
+ return mAllItemsPanel;
}
void LLPanelMainInventory::selectAllItemsPanel()
@@ -372,7 +374,7 @@ void LLPanelMainInventory::selectAllItemsPanel()
bool LLPanelMainInventory::isRecentItemsPanelSelected()
{
- return (RECENT_ITEMS == getActivePanel()->getName());
+ return (mRecentPanel == getActivePanel());
}
void LLPanelMainInventory::startSearch()
@@ -1077,8 +1079,8 @@ void LLPanelMainInventory::toggleFindOptions()
void LLPanelMainInventory::setSelectCallback(const LLFolderView::signal_t::slot_type& cb)
{
- getChild<LLInventoryPanel>(ALL_ITEMS)->setSelectCallback(cb);
- getChild<LLInventoryPanel>(RECENT_ITEMS)->setSelectCallback(cb);
+ mAllItemsPanel->setSelectCallback(cb);
+ mRecentPanel->setSelectCallback(cb);
}
void LLPanelMainInventory::onSelectionChange(LLInventoryPanel *panel, const std::deque<LLFolderViewItem*>& items, bool user_action)
@@ -1177,7 +1179,7 @@ void LLFloaterInventoryFinder::updateElementsFromFilter()
return;
// Get data needed for filter display
- U32 filter_types = mFilter->getFilterObjectTypes();
+ U32 filter_types = (U32)mFilter->getFilterObjectTypes();
LLInventoryFilter::EFolderShow show_folders = mFilter->getShowFolderState();
U32 hours = mFilter->getHoursAgo();
U32 date_search_direction = mFilter->getDateSearchDirection();
@@ -1482,10 +1484,10 @@ void LLFloaterInventoryFinder::selectNoTypes(void* user_data)
void LLPanelMainInventory::initListCommandsHandlers()
{
childSetAction("add_btn", boost::bind(&LLPanelMainInventory::onAddButtonClick, this));
- childSetAction("view_mode_btn", boost::bind(&LLPanelMainInventory::onViewModeClick, this));
- childSetAction("up_btn", boost::bind(&LLPanelMainInventory::onUpFolderClicked, this));
- childSetAction("back_btn", boost::bind(&LLPanelMainInventory::onBackFolderClicked, this));
- childSetAction("forward_btn", boost::bind(&LLPanelMainInventory::onForwardFolderClicked, this));
+ mViewModeBtn->setCommitCallback(boost::bind(&LLPanelMainInventory::onViewModeClick, this));
+ mUpBtn->setCommitCallback(boost::bind(&LLPanelMainInventory::onUpFolderClicked, this));
+ mBackBtn->setCommitCallback(boost::bind(&LLPanelMainInventory::onBackFolderClicked, this));
+ mForwardBtn->setCommitCallback(boost::bind(&LLPanelMainInventory::onForwardFolderClicked, this));
mCommitCallbackRegistrar.add("Inventory.GearDefault.Custom.Action", boost::bind(&LLPanelMainInventory::onCustomAction, this, _2));
mEnableCallbackRegistrar.add("Inventory.GearDefault.Check", boost::bind(&LLPanelMainInventory::isActionChecked, this, _2));
@@ -1550,12 +1552,9 @@ void LLPanelMainInventory::initSingleFolderRoot(const LLUUID& start_folder_id)
void LLPanelMainInventory::initInventoryViews()
{
- LLInventoryPanel* all_item = getChild<LLInventoryPanel>(ALL_ITEMS);
- all_item->initializeViewBuilding();
- LLInventoryPanel* recent_item = getChild<LLInventoryPanel>(RECENT_ITEMS);
- recent_item->initializeViewBuilding();
- LLInventoryPanel* worn_item = getChild<LLInventoryPanel>(WORN_ITEMS);
- worn_item->initializeViewBuilding();
+ mAllItemsPanel->initializeViewBuilding();
+ mRecentPanel->initializeViewBuilding();
+ mWornItemsPanel->initializeViewBuilding();
}
void LLPanelMainInventory::toggleViewMode()