diff options
author | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2024-06-27 18:57:02 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-27 18:57:02 +0300 |
commit | ac0f56668b42bbd01396633bbfd6dbda7ea434a5 (patch) | |
tree | dbb724773d49b1397e192e38770543fff4cf85f2 /indra/newview/llinventorygallerymenu.cpp | |
parent | fcffbad09007185becf53f2a259701c7e07444f5 (diff) | |
parent | 6ee6d19f600bb7fee99f96e8476e2c57088dad17 (diff) |
Merge pull request #1840 from secondlife/inventory_favorites
viewer#1300
viewer#1301
viewer#1424
viewer#1425
viewer#1619
viewer#1005
Diffstat (limited to 'indra/newview/llinventorygallerymenu.cpp')
-rw-r--r-- | indra/newview/llinventorygallerymenu.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/indra/newview/llinventorygallerymenu.cpp b/indra/newview/llinventorygallerymenu.cpp index 77bdb4d1f5..13436819a5 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) @@ -519,6 +533,18 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men items.push_back(std::string("New Outfit")); } + if (!is_trash && !is_in_trash && gInventory.getRootFolderID() != selected_id) + { + if (get_is_favorite(obj)) + { + items.push_back(std::string("Remove from Favorites")); + } + else + { + items.push_back(std::string("Add to Favorites")); + } + } + items.push_back(std::string("Subfolder Separator")); if (!is_system_folder && !isRootFolder()) { @@ -564,6 +590,17 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men if(is_agent_inventory) { items.push_back(std::string("Cut")); + if (!is_in_trash) + { + if (get_is_favorite(obj)) + { + items.push_back(std::string("Remove from Favorites")); + } + else + { + items.push_back(std::string("Add to Favorites")); + } + } if (!is_link || !is_cof || !get_is_item_worn(selected_id)) { items.push_back(std::string("Delete")); @@ -703,6 +740,15 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men disabled_items.push_back(std::string("upload_options")); disabled_items.push_back(std::string("upload_def")); } + + if (get_is_favorite(obj)) + { + 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); |