summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorygallerymenu.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-04-23 23:28:58 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-04-27 00:39:49 +0300
commit384d694aba523218490ec48c22d97b63acbffd6f (patch)
tree927ba7855b75ff603bfa312da4365ce102963457 /indra/newview/llinventorygallerymenu.cpp
parenta0b0f207779d1c8c3354af0a41d05dc6b188a033 (diff)
viewer#1300 Inventory favorites context menu
Diffstat (limited to 'indra/newview/llinventorygallerymenu.cpp')
-rw-r--r--indra/newview/llinventorygallerymenu.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/indra/newview/llinventorygallerymenu.cpp b/indra/newview/llinventorygallerymenu.cpp
index 5f4b816b99..6e5d8802a4 100644
--- a/indra/newview/llinventorygallerymenu.cpp
+++ b/indra/newview/llinventorygallerymenu.cpp
@@ -186,6 +186,20 @@ void LLInventoryGalleryContextMenu::doToSelected(const LLSD& userdata)
{
ungroup_folder_items(mUUIDs.front());
}
+ else if ("add_to_favorites" == action)
+ {
+ for (const LLUUID& id : mUUIDs)
+ {
+ set_favorite(id, true);
+ }
+ }
+ else if ("remove_from_favorites" == action)
+ {
+ for (const LLUUID& id : mUUIDs)
+ {
+ set_favorite(id, false);
+ }
+ }
else if ("take_off" == action || "detach" == action)
{
for (LLUUID& selected_id : mUUIDs)
@@ -707,6 +721,15 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men
disabled_items.push_back(std::string("New Folder"));
disabled_items.push_back(std::string("upload_def"));
}
+
+ if (obj->getIsFavorite())
+ {
+ items.push_back(std::string("Remove from Favorites"));
+ }
+ else if (is_agent_inventory)
+ {
+ items.push_back(std::string("Add to Favorites"));
+ }
}
hide_context_entries(*menu, items, disabled_items);