diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2021-11-16 00:54:53 +0200 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2021-11-16 00:54:53 +0200 |
commit | f9373a9b4ea6a1e22c69976303b5a15763bd994b (patch) | |
tree | 6982b8a537b201c216efc74566dea9210243292c /indra/newview/llpanelmaininventory.cpp | |
parent | 3614083377a9bc00da057acbd9caaaa95f7a4c2a (diff) | |
parent | 9957c28ddc5e5c129af2db662da7d69f1509af65 (diff) |
Merge branch 'master' into DRTVWR-527-maint
# Conflicts:
# autobuild.xml
# indra/newview/installers/windows/lang_pl.nsi
# indra/newview/llfloaterpreference.cpp
# indra/newview/llinventorymodel.cpp
Diffstat (limited to 'indra/newview/llpanelmaininventory.cpp')
-rw-r--r-- | indra/newview/llpanelmaininventory.cpp | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 8027e15b70..89256b40c4 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -62,15 +62,11 @@ const std::string FILTERS_FILENAME("filters.xml"); -static LLPanelInjector<LLPanelMainInventory> t_inventory("panel_main_inventory"); +const std::string ALL_ITEMS("All Items"); +const std::string RECENT_ITEMS("Recent Items"); +const std::string WORN_ITEMS("Worn Items"); -void on_file_loaded_for_save(BOOL success, - LLViewerFetchedTexture *src_vi, - LLImageRaw* src, - LLImageRaw* aux_src, - S32 discard_level, - BOOL final, - void* userdata); +static LLPanelInjector<LLPanelMainInventory> t_inventory("panel_main_inventory"); ///---------------------------------------------------------------------------- /// LLFloaterInventoryFinder @@ -149,7 +145,7 @@ BOOL LLPanelMainInventory::postBuild() //panel->getFilter().markDefault(); // Set up the default inv. panel/filter settings. - mActivePanel = getChild<LLInventoryPanel>("All Items"); + mActivePanel = getChild<LLInventoryPanel>(ALL_ITEMS); if (mActivePanel) { // "All Items" is the previous only view, so it gets the InventorySortOrder @@ -159,7 +155,7 @@ BOOL LLPanelMainInventory::postBuild() mActivePanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mActivePanel, _1, _2)); mResortActivePanel = true; } - LLInventoryPanel* recent_items_panel = getChild<LLInventoryPanel>("Recent Items"); + LLInventoryPanel* recent_items_panel = getChild<LLInventoryPanel>(RECENT_ITEMS); if (recent_items_panel) { // assign default values until we will be sure that we have setting to restore @@ -173,7 +169,7 @@ BOOL LLPanelMainInventory::postBuild() recent_items_panel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, recent_items_panel, _1, _2)); } - mWornItemsPanel = getChild<LLInventoryPanel>("Worn Items"); + mWornItemsPanel = getChild<LLInventoryPanel>(WORN_ITEMS); if (mWornItemsPanel) { U32 filter_types = 0x0; @@ -270,7 +266,7 @@ LLPanelMainInventory::~LLPanelMainInventory( void ) // 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"); + LLInventoryPanel* all_items_panel = getChild<LLInventoryPanel>(ALL_ITEMS); if (all_items_panel) { LLSD filterState; @@ -284,7 +280,7 @@ LLPanelMainInventory::~LLPanelMainInventory( void ) } } - LLInventoryPanel* panel = findChild<LLInventoryPanel>("Recent Items"); + LLInventoryPanel* panel = findChild<LLInventoryPanel>(RECENT_ITEMS); if (panel) { LLSD filterState; @@ -315,7 +311,7 @@ LLPanelMainInventory::~LLPanelMainInventory( void ) LLInventoryPanel* LLPanelMainInventory::getAllItemsPanel() { - return getChild<LLInventoryPanel>("All Items"); + return getChild<LLInventoryPanel>(ALL_ITEMS); } void LLPanelMainInventory::selectAllItemsPanel() @@ -323,6 +319,11 @@ void LLPanelMainInventory::selectAllItemsPanel() mFilterTabs->selectFirstTab(); } +bool LLPanelMainInventory::isRecentItemsPanelSelected() +{ + return (RECENT_ITEMS == getActivePanel()->getName()); +} + void LLPanelMainInventory::startSearch() { // this forces focus to line editor portion of search editor @@ -438,7 +439,7 @@ void LLPanelMainInventory::setSortBy(const LLSD& userdata) } getActivePanel()->setSortOrder(sort_order_mask); - if ("Recent Items" == getActivePanel()->getName()) + if (isRecentItemsPanelSelected()) { gSavedSettings.setU32("RecentItemsSortOrder", sort_order_mask); } @@ -800,8 +801,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); + getChild<LLInventoryPanel>(ALL_ITEMS)->setSelectCallback(cb); + getChild<LLInventoryPanel>(RECENT_ITEMS)->setSelectCallback(cb); } void LLPanelMainInventory::onSelectionChange(LLInventoryPanel *panel, const std::deque<LLFolderViewItem*>& items, BOOL user_action) @@ -1199,11 +1200,11 @@ void LLPanelMainInventory::onAddButtonClick() { // Gray out the "New Folder" option when the Recent tab is active as new folders will not be displayed // unless "Always show folders" is checked in the filter options. - bool recent_active = ("Recent Items" == mActivePanel->getName()); + LLMenuGL* menu = (LLMenuGL*)mMenuAddHandle.get(); if (menu) { - menu->getChild<LLMenuItemGL>("New Folder")->setEnabled(!recent_active); + menu->getChild<LLMenuItemGL>("New Folder")->setEnabled(!isRecentItemsPanelSelected()); setUploadCostIfNeeded(); |