summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-04-06 19:51:08 +0300
committerMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-04-06 19:54:22 +0300
commitcc39c1e852b1b8ad0e6dc2bb7907b8116c716c1d (patch)
tree24c5cc73c59e1539997b8b784292efa3c6bbc751 /indra
parent0d12b5f637fb2bbf335a28c93dd6eaf416e71c95 (diff)
SL-19544 preparation for Combination view
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llinventoryfilter.cpp34
-rw-r--r--indra/newview/llinventoryfilter.h14
-rw-r--r--indra/newview/llinventorygallery.cpp6
-rw-r--r--indra/newview/llpanelmaininventory.cpp13
-rw-r--r--indra/newview/llpanelmaininventory.h1
-rw-r--r--indra/newview/skins/default/xui/en/menu_inventory_view_default.xml1
-rw-r--r--indra/newview/skins/default/xui/en/panel_main_inventory.xml11
7 files changed, 78 insertions, 2 deletions
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 5a300bad32..5c02b61522 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -63,6 +63,7 @@ LLInventoryFilter::FilterOps::FilterOps(const Params& p)
mFilterTypes(p.types),
mFilterUUID(p.uuid),
mFilterLinks(p.links),
+ mFilterThumbnails(p.thumbnails),
mSearchVisibility(p.search_visibility)
{
}
@@ -158,6 +159,8 @@ bool LLInventoryFilter::check(const LLFolderViewModelItem* item)
passed = passed && checkAgainstCreator(listener);
passed = passed && checkAgainstSearchVisibility(listener);
+ passed = passed && checkAgainstFilterThumbnails(listener->getUUID());
+
return passed;
}
@@ -567,6 +570,19 @@ bool LLInventoryFilter::checkAgainstFilterLinks(const LLFolderViewModelItemInven
return TRUE;
}
+bool LLInventoryFilter::checkAgainstFilterThumbnails(const LLUUID& object_id) const
+{
+ const LLInventoryObject *object = gInventory.getObject(object_id);
+ if (!object) return true;
+
+ const bool is_thumbnail = object->getThumbnailUUID().notNull();
+ if (is_thumbnail && (mFilterOps.mFilterThumbnails == FILTER_EXCLUDE_THUMBNAILS))
+ return false;
+ if (!is_thumbnail && (mFilterOps.mFilterThumbnails == FILTER_ONLY_THUMBNAILS))
+ return false;
+ return true;
+}
+
bool LLInventoryFilter::checkAgainstCreator(const LLFolderViewModelItemInventory* listener) const
{
if (!listener) return TRUE;
@@ -738,6 +754,19 @@ void LLInventoryFilter::setFilterSettingsTypes(U64 types)
mFilterOps.mFilterTypes |= FILTERTYPE_SETTINGS;
}
+void LLInventoryFilter::setFilterThumbnails(U64 filter_thumbnails)
+{
+ if (mFilterOps.mFilterThumbnails != filter_thumbnails)
+ {
+ if (mFilterOps.mFilterThumbnails == FILTER_EXCLUDE_THUMBNAILS ||
+ mFilterOps.mFilterThumbnails == FILTER_ONLY_THUMBNAILS)
+ setModified(FILTER_MORE_RESTRICTIVE);
+ else
+ setModified(FILTER_LESS_RESTRICTIVE);
+ }
+ mFilterOps.mFilterThumbnails = filter_thumbnails;
+}
+
void LLInventoryFilter::setFilterEmptySystemFolders()
{
mFilterOps.mFilterTypes |= FILTERTYPE_EMPTYFOLDERS;
@@ -1526,6 +1555,11 @@ U64 LLInventoryFilter::getSearchVisibilityTypes() const
return mFilterOps.mSearchVisibility;
}
+U64 LLInventoryFilter::getFilterThumbnails() const
+{
+ return mFilterOps.mFilterThumbnails;
+}
+
bool LLInventoryFilter::hasFilterString() const
{
return mFilterSubString.size() > 0;
diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h
index 267decfeb4..ada1d0f4b4 100644
--- a/indra/newview/llinventoryfilter.h
+++ b/indra/newview/llinventoryfilter.h
@@ -75,6 +75,13 @@ public:
FILTERLINK_ONLY_LINKS // only show links
};
+ enum EFilterThumbnail
+ {
+ FILTER_INCLUDE_THUMBNAILS,
+ FILTER_EXCLUDE_THUMBNAILS,
+ FILTER_ONLY_THUMBNAILS
+ };
+
enum ESortOrderType
{
SO_NAME = 0, // Sort inventory by name
@@ -140,12 +147,14 @@ public:
Optional<EFolderShow> show_folder_state;
Optional<PermissionMask> permissions;
Optional<EFilterCreatorType> creator_type;
+ Optional<EFilterThumbnail> thumbnails;
Params()
: types("filter_types", FILTERTYPE_OBJECT),
object_types("object_types", 0xffffFFFFffffFFFFULL),
wearable_types("wearable_types", 0xffffFFFFffffFFFFULL),
settings_types("settings_types", 0xffffFFFFffffFFFFULL),
+ thumbnails("thumbnails", FILTER_INCLUDE_THUMBNAILS),
category_types("category_types", 0xffffFFFFffffFFFFULL),
links("links", FILTERLINK_INCLUDE_LINKS),
search_visibility("search_visibility", 0xFFFFFFFF),
@@ -166,6 +175,7 @@ public:
U64 mFilterObjectTypes, // For _OBJECT
mFilterWearableTypes,
mFilterSettingsTypes, // for _SETTINGS
+ mFilterThumbnails,
mFilterLinks,
mFilterCategoryTypes; // For _CATEGORY
LLUUID mFilterUUID; // for UUID
@@ -208,6 +218,7 @@ public:
U64 getFilterWearableTypes() const;
U64 getFilterSettingsTypes() const;
U64 getSearchVisibilityTypes() const;
+ U64 getFilterThumbnails() const;
bool isFilterObjectTypesWith(LLInventoryType::EType t) const;
void setFilterObjectTypes(U64 types);
@@ -222,6 +233,7 @@ public:
void setFilterMarketplaceUnassociatedFolders();
void setFilterMarketplaceListingFolders(bool select_only_listing_folders);
void setFilterNoMarketplaceFolder();
+ void setFilterThumbnails(U64 filter_thumbnails);
void updateFilterTypes(U64 types, U64& current_types);
void setSearchType(ESearchType type);
ESearchType getSearchType() { return mSearchType; }
@@ -325,6 +337,8 @@ public:
LLInventoryFilter& operator =(const LLInventoryFilter& other);
+ bool checkAgainstFilterThumbnails(const LLUUID& object_id) const;
+
private:
bool areDateLimitsSet();
bool checkAgainstFilterType(const class LLFolderViewModelItemInventory* listener) const;
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp
index b964ecff05..c3e06fafc5 100644
--- a/indra/newview/llinventorygallery.cpp
+++ b/indra/newview/llinventorygallery.cpp
@@ -613,6 +613,12 @@ void LLInventoryGallery::applyFilter(LLInventoryGalleryItem* item, const std::st
return;
}
+ if(!mFilter->checkAgainstFilterThumbnails(item->getUUID()))
+ {
+ item->setHidden(true);
+ return;
+ }
+
if(!checkAgainstFilterType(item->getUUID()))
{
item->setHidden(true);
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 79b41f8e5f..7d7a92de81 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -1421,6 +1421,7 @@ void LLPanelMainInventory::toggleViewMode()
getChild<LLPanel>("default_inventory_panel")->setVisible(!mSingleFolderMode);
getChild<LLPanel>("single_folder_inventory")->setVisible(mSingleFolderMode && isListViewMode());
getChild<LLPanel>("gallery_view_inventory")->setVisible(mSingleFolderMode && isGalleryViewMode());
+ getChild<LLPanel>("combination_view_inventory")->setVisible(mSingleFolderMode && isCombinationViewMode());
getChild<LLLayoutPanel>("nav_buttons")->setVisible(mSingleFolderMode);
getChild<LLButton>("view_mode_btn")->setImageOverlay(mSingleFolderMode ? getString("default_mode_btn") : getString("single_folder_mode_btn"));
@@ -1823,6 +1824,10 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata)
{
setViewMode(MODE_GALLERY);
}
+ if (command_name == "combination_view")
+ {
+ setViewMode(MODE_COMBINATION);
+ }
}
void LLPanelMainInventory::onVisibilityChange( BOOL new_visibility )
@@ -2042,7 +2047,7 @@ BOOL LLPanelMainInventory::isActionChecked(const LLSD& userdata)
}
if (command_name == "combination_view")
{
- return false;
+ return isCombinationViewMode();
}
return FALSE;
@@ -2127,6 +2132,7 @@ void LLPanelMainInventory::setViewMode(EViewModeType mode)
getChild<LLPanel>("single_folder_inventory")->setVisible(mSingleFolderMode && isListViewMode());
getChild<LLPanel>("gallery_view_inventory")->setVisible(mSingleFolderMode && isGalleryViewMode());
+ getChild<LLPanel>("combination_view_inventory")->setVisible(mSingleFolderMode && isCombinationViewMode());
if(isListViewMode())
{
@@ -2166,6 +2172,11 @@ LLUUID LLPanelMainInventory::getCurrentSFVRoot()
{
return mInventoryGalleryPanel->getRootFolder();
}
+ if(isCombinationViewMode())
+ {
+ //todo: should get actual Combination view root
+ return mSingleFolderPanelInventory->getSingleFolderRoot();
+ }
return LLUUID::null;
}
diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h
index 1e171d5066..4a27bbca4e 100644
--- a/indra/newview/llpanelmaininventory.h
+++ b/indra/newview/llpanelmaininventory.h
@@ -125,6 +125,7 @@ public:
void setViewMode(EViewModeType mode);
bool isListViewMode() { return (mViewMode == MODE_LIST); }
bool isGalleryViewMode() { return (mViewMode == MODE_GALLERY); }
+ bool isCombinationViewMode() { return (mViewMode == MODE_COMBINATION); }
LLUUID getCurrentSFVRoot();
std::string getLocalizedRootName();
diff --git a/indra/newview/skins/default/xui/en/menu_inventory_view_default.xml b/indra/newview/skins/default/xui/en/menu_inventory_view_default.xml
index 28ec8f2bf1..c7f9822e41 100644
--- a/indra/newview/skins/default/xui/en/menu_inventory_view_default.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory_view_default.xml
@@ -89,7 +89,6 @@
<menu_item_check
label="Combination view"
layout="topleft"
- enabled="false"
name="combination_view">
<on_click
function="Inventory.GearDefault.Custom.Action"
diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
index d670161e00..dc8720b9d1 100644
--- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
@@ -328,4 +328,15 @@
follows="all"
layout="topleft" />
</panel>
+ <panel
+ follows="all"
+ halign="center"
+ height="372"
+ layout="topleft"
+ left="7"
+ name="combination_view_inventory"
+ top_delta="0"
+ visible="false"
+ width="312">
+ </panel>
</panel>